What happens on the stack when calling a function? (gcc-3.4.3)

Arturas Moskvinas arturas.moskvinas@gmail.com
Mon May 16 13:23:00 GMT 2005


> Hi folks!
> 
> I stumbled across some strange stuff on the stack when calling a
> function with gcc-3.4.3.

There was similar discusion maybe month ago.
GCC just tries to align everything to 16 bytes boundary(this
optimization is very "cheap" by the way), but if you need exact
behavior then you should use -mpreferred-stack-boundary, more info
you'll find:
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/i386-and-x86_002d64-Options.html
(-mpreferred-stack-boundary)


Arturas Moskvinas



More information about the Gcc-help mailing list