A serious -fpic and -fomit-frame-pointer bug in egcs 1.0.3/1.1

Jeffrey A Law law@cygnus.com
Mon Jul 6 04:53:00 GMT 1998


  In message <m0ym0dL-00026AC@ocean.lucon.org>you write:
  > Hi,
  > 
  > There is a serious -fpic and -fomit-frame-pointer bug in egcs 1.0.3/1.1
  > on x86. Basically, they are not compatible with each other.
  > 
  > The problem is in eliminate_regs called by reload. In egcs 1.0.3,
  > eliminate_regs is called by reload around line 979. At the time
  > when you eliminate the frame pointer register with a stack register,
  > you don't know if PIC will do anything with the stack. Unfortunately,
  > on x86, the function prologue is expanded
  > 
  >         subl $16,%esp
  >         pushl %ebx
  >         call .L23
  > .L23:
  >         popl %ebx
  >         addl $_GLOBAL_OFFSET_TABLE_+[.-.L23],%ebx
  > 
  > But eliminate_regs knows nothing about
  > 
  >         pushl %ebx
  >         call .L23
  > .L23:
  >         popl %ebx
  >         addl $_GLOBAL_OFFSET_TABLE_+[.-.L23],%ebx
  > 
  > It doesn't know esp is changed in prologue. As the result, the stack
  > is messed up. I am enclosing a testcase for it.
But the sequence as a whole does not modify esp -- ie, the value of esp
will be the same before and after the sequence.  Reload does not need to
know that the value of esp changed in that sequence.

Please explain why this is important.  I still don't see that this is the
source of your problem.


jeff



More information about the Gcc-bugs mailing list