This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: Stack frame question on x86 code generation


Thank you!
Your explanation helps a lot.

Best regards,

--- Arturas Moskvinas <arturas.moskvinas@gmail.com>
wrote:
> > 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
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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