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 improve i386 epilogue (version 5)



  In message <199810091947.PAA16557@jwlab.FEITH.COM>you write:
  > > Am I missing something, or are you working way too hard for this?
  > > 
  > > /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function
  > ,
  > >    the stack pointer does not matter.  The value is tested only in
  > >    functions that have frame pointers.
  > >    No definition is equivalent to always zero.  */
  > > /* Note on the 386 it might be more efficient not to define this since 
  > >    we have to restore it ourselves from the frame pointer, in order to
  > >    use pop */
  > > 
  > > #define EXIT_IGNORE_STACK 1
  > 
  > I belive that not defining EXIT_IGNORE_STACK disables some useful
  > optimizations.  The idea is to let gcc do these optimizations
  > and to simply notice when they haven't been done which means that
  > the stack pointer doesn't need to be reloaded.
Correct.

EXIT_IGNORE_STACK allows the compiler to delete insns which pop args off the
stack if control will be passing to the end of the function.  In fact, it is
precisely this optimization which prevents us from using the stack pointer
in the epilogue to begin with.

jeff


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