This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Painful problems with -fpic implementation on powerpc-sysv
- To: geoffk at ozemail dot com dot au (Geoff Keating)
- Subject: Re: Painful problems with -fpic implementation on powerpc-sysv
- From: hjl at lucon dot org (H.J. Lu)
- Date: Thu, 20 Aug 1998 09:57:25 -0700 (PDT)
- Cc: egcs at cygnus dot com, Franz dot Sirl-kernel at lauterbach dot com
> The underlying problem for both of these is the same.
>
> The powerpc -fpic implementation works by allocating a pseudo to hold
> the GOT pointer, when required, (in the routine rs6000_got_register).
> In rs6000_finalise_pic, the pseudo is initialised. The result is used
> in the movsi_got_internal insn.
>
> There are two problems with this:
>
> 1. rs6000_finalise_pic is run before reload. But sometimes reload can
> create a new memory reference (see, for instance, test4.c). So
> rs6000_finalise_pic does not know where all the memory references
> are, or even if there are any at all.
>
> 2. Worse, rs6000_finalise_pic is actually run before scheduling, and
> so the scheduler can get the dependencies wrong if new memory
> references appear later. For instance, in test3.c after local
> register allocation, there is:
>
That sounds similar to the x86 -fPIC/-fomit-frame-pointer bug we fixed
earlier. What we did was to make sure the PIC register is used when in
doubt:
Sun Jul 26 01:11:12 1998 H.J. Lu (hjl@gnu.org)
* i386.h (CONST_DOUBLE_OK_FOR_LETTER_P): Return 0 when eliminating
the frame pointer and compiling PIC code and reload has not completed.
Can you do something like that for PPC?
H.J.