This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Stack frame question on x86 code generation
- From: Arturas Moskvinas <arturas dot moskvinas at gmail dot com>
- To: Niko Matsakis <niko at alum dot mit dot edu>, Gang-Ryung Uh <uh18104 at yahoo dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Sun, 24 Apr 2005 12:10:22 +0300
- Subject: Re: Stack frame question on x86 code generation
- References: <20050423180944.68016.qmail@web50304.mail.yahoo.com> <cc11f80f1f4375849a2144bba2487acd@alum.mit.edu>
- Reply-to: Arturas Moskvinas <arturas dot moskvinas at gmail dot com>
> This is to make room for the parameters to printf(); there are two, and
> each is a pointer, and hence four bytes, so the total space required is
> eight bytes.
I think you are not very correct in this part, if you write simple
function which calls function without parameter, you'll see that gcc
is also substract by 8 (12 if you use -fomit-frame-pointer). Command
pushl substracts ESP pointer by 4 itself. So i think gcc is trying to
align variable (and return address) in stack.
Arturas Moskvinas