Default stack alignment on x86-64, fedora 11

Rohit Garg rpg.314@gmail.com
Wed Aug 26 14:49:00 GMT 2009


Hi,

What is the default stack alignment for gcc 4.4 on x86-64 linux? I
assume it is 16 bytes so that SSE can use aligned loads and stores. I
have googled for it a little and found some references for it that say
so in passing, but I'd prefer to get some official blessing for it.

My real issue is that I would like to declare certain variables on
stack as aligned on 16 byte boundaries, so I can load/store them
quickly. Of course, I'd prefer if this didn't involve _any_ overhead.

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

This here says that stack can be aligned to 16 bytes, which is also
default. If I wish to avoid any code size increase, is there any
particular order of declaring these variables which I should follow so
that no extra space is consumed for padding. I would have thought that
GCC would be smart enough to reorder variables to minimize code bloat,
but.....

I am using fedora 11, so all code is compiled using gcc 4.4. Not sure
what the compilation options are.

Thanks,

-- 
Rohit Garg

http://rpg-314.blogspot.com/

Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay



More information about the Gcc-help mailing list