A problem with aligment attribute

Jim Wilson wilson@specifixinc.com
Thu Feb 5 09:48:00 GMT 2004


H. J. Lu wrote:
> void
> foo (int i, float128_type x)
> {
>...
>   if (((long) (&x.word0) & 15) != 0)
>     abort ();

You are asking for a function argument to have 16-byte alignment, but 
the ABI does not support that.  PARM_BOUNDARY is 32, so an argument can 
have at most 4 byte alignment.

Try passing in a pointer, or using a global or local instead of an argument.

We could perhaps emit a warning if someone tries to use an aligned type 
in an argument list, and the aligned type requires greater alignment 
than the ABI will give.  I don't think we should be changing ABIs to 
make this work.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list