This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack
- From: "jens dot maurer at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2004 20:43:50 -0000
- Subject: [Bug c/16660] New: attribute((aligned)) doesn't work for variables on the stack
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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();
}
--
Summary: attribute((aligned)) doesn't work for variables on the
stack
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jens dot maurer at gmx dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16660