This is the mail archive of the
mailing list for the GCC project.
Re: patch to omit the frame pointer from leaf functions
- To: John Wehle <john at feith dot com>
- Subject: Re: patch to omit the frame pointer from leaf functions
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 21 Sep 1998 22:47:04 -0600
- cc: amylaar at cygnus dot co dot uk, egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199809211803.OAA05500@jwlab.FEITH.COM>you write:
> I believe that -fomit-frame-pointer is sometimes a performance loss on
> non-leaf functions. It's true that debugging becomes more difficult,
> which is why my change only takes effect if optimize is not zero.
> Perhaps it should only take effect if optimize >= 2.
> Actually what I'm wondering is if there's ever a performance loss when
> omitting the frame pointer in a leaf function. On the i386 Intel
> recommends always omitting the frame pointer in leaf functions.
I don't know enough about the x86 to know one way or the other. However,
if there are addressing modes or 32bit arithmetic/logicals ops that
are available on the frame pointer, but not the stack pointer, then it
is possible for frame pointer elimination to lose from a performance
However, it has been my experience that the losses on those cases are
generally dwarfed by the improved prologue/epilogue code and the extra
register made available.