bug report

Jeffrey A Law law@cygnus.com
Sun Jan 17 21:08:00 GMT 1999


  In message <364B502A.563972DE@mail.dotcom.fr>you write:
  > When using the '-fomit-frame-pointer' option, it seems that *not all*
  > functions use %esp instead of %ebp.
Correct.  There are cases where, when using -fomit-frame-pointer the compiler
will still be unable to eliminate the frame pointer.  The most obvious examples
are functions which use alloca, but there are others.

You should not depend on -fomit-frame-pointer always eliminating the frame
pointer.

  > Despite of this, when the %ebp is explicitly clobbered by an extended asm
  > construction, it isn't saved and restored by the compiler
Weird, but it seems that other ports have the same behavior.  Something odd
about the frame pointer in this respect.

  > Anothing thing about the '-fomit-frame-pointer' flag on the x86 is that
  > it doesn't seem to allow allocation of %ebp by the compiler - you have to
  > use '-fcall-used-ebp'.
?  I don't follow this.  When -fomit-frame-pointer is used, the compiler will
use ebp for other purposes.

Note that the %ebp register does not become available until relatively late in
the register allocation process.  This keeps %ebp from being used aggressively,
but given the current structure of the compiler, I don't see any way to change
that.

jeff



More information about the Gcc-bugs mailing list