Re: Default stack alignment on x86-64, fedora 11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rohit Garg <rpg.314@xxxxxxxxx> writes:

> 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.

You should be able to use __attribute__ ((aligned (16))) to make this
happen.

> 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.....

gcc will normally sort the stack variables to avoid wasting stack space.
The order in which you declare the variables in your program is
irrelevant.  That said, stack space is fairly cheap.  Why do you need to
optimize it?

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux