This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- To: law at cygnus dot com
- Subject: Re: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- From: Robert Wilhelm <robert at physiol dot med dot tu-muenchen dot de>
- Date: Mon, 9 Feb 1998 11:41:11 +0100
- Cc: John Hughes <john at AtlanTech dot COM>, "'John Carr'" <jfc at mit dot edu>, "egcs-bugs at cygnus dot com" <egcs-bugs at cygnus dot com>
- References: <01BD3541.A9DE33A0@malvinas.AtlanTech.COM> <5731.887018552@hurl.cygnus.com>
On Mon, Feb 09, 1998 at 03:02:32AM -0700, Jeffrey A Law wrote:
>
> So my question is what exactly does push %esp do on modern x86 machines?
> (or more correctly an x86 machine that gcc can compile code for -- 8086
> does not count :-)
My Intel Pentium Processor User's Manual section 25-230 (PUSH) says:
The PUSH ESP instruction pushes the value of the ESP register as it existed
before the instruction. This differs from the 8086, where the PUSH SP
instruction pushes the new value (decremented by 2).
Likewise, a PUSH-from-memory instruction, which uses the stack pointer (ESP)
as a base register,references memory before the PUSH. The base used is the value
of the ESP before the instruction executes.
Robert