Painful problems with -fpic implementation on powerpc-sysv

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Sun Aug 23 07:45:00 GMT 1998


Am Sun, 23 Aug 1998 schrieb Geoff Keating:
>> Cc: egcs@cygnus.com, Franz.Sirl-kernel@lauterbach.com, law@cygnus.com
>> Date: Fri, 21 Aug 1998 11:27:39 -0400
>> From: David Edelsohn <dje@watson.ibm.com>
>> X-UIDL: 9c6f676aff83562f25614b7bea1441f5
>> 
>> >>>>> Geoff Keating writes:
>> 
>> Geoff> Yes.  My patch (attached to that e-mail message) `fixes' the problem
>> Geoff> in a really ugly way by forcing egcs to use the stack, not the GOT.
>> 
>> Geoff> That is what my patch does: it forces reload to try some other
>> Geoff> alternative.  My patch has to add an extra hook to force this; H.J
>> Geoff> suggested `CONST_DOUBLE_OK_FOR_LETTER_P' but that seems to be
>> Geoff> something else (the name is good, but it isn't called when the letter
>> Geoff> is 'm' or 'o' :-).  I don't dare to change the meaning of something
>> Geoff> like that because it would surely break other ports.
>> 
>> 	I wouldn't have thought that changes to reload.c itself were
>> necessary to accomplish that.  The PowerPC port already materializes FP
>> constants in GPRs and moves them through the stack. 
>...
>> 	There are just so many hooks already in place to tell the backend
>> that it needs an additional stack slot at a late stage, that I am
>> surprised the changes to reload.c are necessary.
>
>That's why it's really ugly :-).
>
>The problem is not that reload can't load the value using GPRs; it
>can, my patch relies on it (well, there was a small bug that had to be
>fixed).  It's just that reload _won't_, because it is less efficient.
>
>Reload sees that its choices are either:
>
>- load immediate value in GPRs, store value to memory, load FPR back
>  from memory;  or
>- load FPR directly from memory.
>
>Naturally, it chooses the second.
>
>
>I have discovered another case when reload can generate new symbol_ref
>references.  Consider the attached test case, compiled with '-O -fpic'.

Hmm, is this one different from the one included in the testsuite
(gcc.dg/980523-1.c), which is not fixed by your patch? I can confirm that
egcs-1.1 bootstraps and tests fine with your patch, gcc.dg/980526-1.c is fixed.

Franz.

PS: 
did you finish your thesis?



More information about the Gcc mailing list