This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: When is the stack pointer unreliable?
- To: John Wehle <john at feith dot com>
- Subject: Re: When is the stack pointer unreliable?
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 06 Sep 1998 15:00:33 -0600
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199809060409.AAA02189@jwlab.FEITH.COM>you write:
> I noticed that i386 backend reloads the stack pointer in
> situations where it shouldn't be necessary. In i386.c
> (ix86_epilogue) is the comment:
>
> /* sp is often unreliable so we must go off the frame pointer.
>
> Since reloading the stack pointer causes a stall on some processors
> it should be avoided when possible. Under what situations is sp
> unreliable?
alloca calls, variable sized objects in the stack come immediately
to mind.
You might also need to check if the compiler has optimized away
popping of args after a function call if we unconditionally reach the
epilogue after performing the call.
jeff