This is the mail archive of the gcc-patches@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: PIC_OFFSET_TABLE_SAVE_RTX in large stack frame


On Sat, 27 Jan 2001, John David Anglin wrote:

> > Don't give up so easy.  It _is_ possible to insert a move
> > at the beginning of the function.  See alpha_return_address:
> > 
> >       push_topmost_sequence ();
> >       emit_insn_after (init, get_insns ());
> >       pop_topmost_sequence ();
> 
> Here is a revised patch using the above approach.  Bootstrapped and
> checked under hpux 10.20 with no regressions.  I will post full test
> results later.  The PIC testing is rather limited however.

This trick doesn't seem to work for inline functions.

cat > inline.c <<EOF
extern int foo (void);
int a;

inline int f1 (int x)
{
  x += a;
  x += foo ();
  return x;
}

int f2 (int x)
{
  return x + f1 (x);
}
EOF
hppa-linux-gcc -O2 -S inline.c

gives me
f2:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=5
        .ENTRY
        stw %r2,-20(%r30)
        ldo 64(%r30),%r30
        stw %r19,-32(%r30)
        stw %r5,-64(%r30)
        copy %r26,%r5
        stw %r3,-56(%r30)
        ldw T'a(%r19),%r20
        stw %r4,-60(%r30)
        bl foo,%r2
        ldw 0(%r20),%r4
        ldw -84(%r30),%r2
        copy %r3,%r19
[snip]

and there's no "copy %r19,%r3" to be seen.

I'll see if I can nut this out, but if someone can give me some insight it
would be appreciated.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.


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