This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

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


On Sat, 30 Sep 2000, Geoff Keating wrote:
> > 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.

Any solution to this? And you are already sure reload is the culprit? I 
didn't get as far as you, but for me it seemed the -fpic was confusing the 
scheduler, see my other bug report "-fpic confuses scheduler" with the 
testcase.

Franz.

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