This is the mail archive of the gcc-patches@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: patch to omit the frame pointer from leaf functions



  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
standpoint.

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.

jeff


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