[Bug middle-end/16660] attribute((aligned)) doesn't work for variables on the stack for greater than required alignement

hjl dot tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 31 01:05:00 GMT 2008



------- Comment #14 from hjl dot tools at gmail dot com  2008-07-31 01:04 -------
(In reply to comment #0)
> Running the program below compiled with "-mpreferred-stack-boundary=2"
> gets a "segmentation fault" because the variable "tmp"
> is not properly aligned on a 16-byte boundary (required for
> movaps), violating the aligned(16) request in the attribute.
> 
> void f()
> {
>   unsigned long tmp[4] __attribute__((aligned(16)));
>   asm("movaps %%xmm0, (%0)" : : "r" (tmp) : "memory");
> }
> 
> int main()
> {
>   f();
> }

This should work with gcc 4.4 revision 138335.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16660



More information about the Gcc-bugs mailing list