This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/16660] attribute((aligned)) doesn't work for variables on the stack for greater than required alignement
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2008 01:04:31 -0000
- Subject: [Bug middle-end/16660] attribute((aligned)) doesn't work for variables on the stack for greater than required alignement
- References: <bug-16660-1824@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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