This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

reload, regcost problems [Was: Re: Math problems on PPC with gcc-2.96 20000928]


> From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
> Date: Sat, 30 Sep 2000 15:55:05 +0200

> The pow problems go away if  sysdeps/ieee754/dbl-64/e_pow.c is compiled with 
> -O1, haven't found the miscompiled routine for tan yet. Is anyone else seeing 
> this? I'll try to find the bug(s) in gcc, but I'm a bit unfamiliar with math 
> in gcc, so it may take a while.

Yes, I've been seeing this for some time, according to my logs it
happened between 2000-09-05T00:05:00Z and 2000-09-20T05:05:02Z.

I looked at it and found two problems:

1. The cost calculation was broken.  Certain variables are being
   allocated to integer registers when they should be allocated to FP
   registers.  I'm pretty sure this was caused by all the recent cost
   changes.

2. This makes reload do much more work than normal, and exposes a bug
   in the register inheritance code; it reloads an insn like

(set (reg:DF r3) (plus:DF (reg:DF r5) (reg:DF r5)))

   to

(set (reg:DF f7) (plus:DF (reg:DF f7) (reg:DF f7)))

   but then it decides that a few insns later, when it sees

(set (reg:DF f5) (mult:DF (reg:DF f6) (reg:DF r5)))

   that it can just re-use (reg:DF f7), inheriting the input reload
   from the first insn.  Of course this is bogus because f7 has been
   clobbered by the output of the first insn.

> Another problem showed up during test-float, but this was caused by an 
> oversight while making glibc aliasing safe, fixed by the attached patch.
> 
> Franz.
> 
> 	* sysdeps/ieee754/flt-32/s_frexpf.c: Make it aliasing safe.

This is OK, please commit it (you do have commit access, right?).

-- 
- Geoffrey Keating <geoffk@cygnus.com>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]