Ability to disable 32-byte alignment of bss/data symbols with size > 32 bytes

Ian Lance Taylor iant@google.com
Thu Apr 30 00:34:00 GMT 2009


Yuly Finkelberg <yuly.finkelberg@gmail.com> writes:

> If I pass "-Os", the alignments drop to 4 bytes (as expected);
> "__attribute__ ((aligned(4))" also works.  However, I'd very much like
> a way to control this behavior globally without getting everything
> else that "-Os" comes with.  A "-f" switch perhaps?  I was able to
> find http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30004, which appears
> to have relaxed the alignment under "-Os" specifically.

For the i386 gcc will align large data objects to the maximum alignment.
This is so that aligned loads can be used with the SSE registers.
Unfortunately there is no way to request a smaller alignmnt, other than
the ones you mention.

Ian



More information about the Gcc-help mailing list