This is the mail archive of the gcc-bugs@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: A serious -fpic and -fomit-frame-pointer bug in egcs 1.0.3/1.1



  In message <m0ymTjF-00026AC@ocean.lucon.org>you write:
  > Have you tried my testcase? Does that make sense? I just want to
  > double check that there is a bug.
I suspect you have found a bug, but I don't have the time to run the
testcase right now.  I'm very behind due to recent travel.  I suspect
you have found a bug of some kind; however based on the information
you've presented so far, I think you're looking in the wrong place
for the problem.

  > That is fine to put the PIC base register in ebx. But eliminate_regs ()
  > doesn't know anything about PIC and ebx. When eliminate_regs replaces
  > ebp with esp, it assumes the top of the stack is for the temporary
  > variable. But with PIC, the top of the stack is changed to ebx. When
  > the function epilogue pops ebx, some garbage is put into ebx. You
  > can see the asm output for yourself.
I don't see how eliminate_regs plays into this at all.

All the code does is "call" to the next instruction (which pushes a value
onto the stack).  The call site pops that value off the stack, leaving
the stack in its original state.

That sequence should not trash any useful item on the stack, nor does
it leave the stack pointer in a state that is different than when
the sequence started.



jeff


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