-malign-double switch patch?

Jamie Lokier egcs@tantalophile.demon.co.uk
Sat Aug 10 18:12:00 GMT 2002


Nix wrote:
> > Apparently you didn't read the documentation, in which it is said
> > that the switch affects the abi, and therefore should be used only
> > with extreme caution under controled conditions.
> 
> GCC-3.1.x's manual says
> 
> ,----
> | `-malign-double'
> | `-mno-align-double'
> |      Control whether GCC aligns `double', `long double', and `long
> |      long' variables on a two word boundary or a one word boundary.
> |      Aligning `double' variables on a two word boundary will produce
> |      code that runs somewhat faster on a `Pentium' at the expense of
> |      more memory.
> `----
> 
> i.e., it doesn't mention the ABI breakage :( perhaps this is only in the
> trunk...

The next paragraph says:

     *Warning:* if you use the `-malign-double' switch, structures
     containing the above types will be aligned differently than the
     published application binary interface specifications for the 386.

Now, if you're not using structures, perhaps it isn't obvious that you
can still have ABI breakage...  (Argument alignment on the stack
changes, doesn't it?)

-- Jamie



More information about the Gcc mailing list