This is the mail archive of the
mailing list for the GCC project.
A patch for -fpic and -fomit-frame-pointer on x86
- To: egcs-patches at cygnus dot com
- Subject: A patch for -fpic and -fomit-frame-pointer on x86
- From: hjl at lucon dot org (H.J. Lu)
- Date: Mon, 13 Jul 1998 11:19:23 -0700 (PDT)
> In message <m0ytuCX-000266C@ocean.lucon.org>you write:
> > > If so, the bug is clearly in INITIAL_ELIMINATION_OFFSET.
> > >
> > Well, it is hard for the first INITIAL_ELIMINATION_OFFSET to tell if
> > PIC will be ever used. It depends on values of FP constants, CPU and
> > optimization.
> As I mentioned in an earlier message, depending on those things is
> not safe.
> Make it always include space for the PIC register on the stack and
> make the prologue always reserve the space.
I took a look at your suggestion. It may have a major impact on
shared library on x86. It means every function in shared library
has to save/restore the PIC register even if the PIC register is
not used at all. On Intel, push/pop may be faster than sub/add.
That means we cannot optimize the function return in shared library
since ix86_can_use_return_insn_p may have to always return 0 for PIC.
I think the following patch may be more appropriate given what we
can do. Basically it says it is not safe to assume we can have fp
constatnt as operand with PIC.
H.J. Lu (email@example.com)
Sun Jul 12 21:08:23 1998 H.J. Lu (firstname.lastname@example.org)
* config/i386/i386.c (standard_80387_constant_p): Return 0
RCS file: /home/work/cvs/gnu/egcs/gcc/config/i386/i386.c,v
retrieving revision 188.8.131.52
diff -u -p -r184.108.40.206 i386.c
--- i386.c 1998/07/07 15:09:58 220.127.116.11
+++ i386.c 1998/07/13 18:05:46
@@ -1556,6 +1556,9 @@ standard_80387_constant_p (x)
int is0, is1;
+ if (flag_pic)
+ return 0;
if (setjmp (handler))