http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50716
Bug #: 50716
Summary: Segmentation fault caused by misaligned vector access
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: [email protected]
ReportedBy: [email protected]
The following code segfaults on i386 + sse targets:
typedef int vec __attribute__((vector_size(16)));
int main ()
{
int * arr = __builtin_malloc (1024);
vec *p = (vec *) &arr[1];
*p = (vec){1, 2, 3, 4};
return *(char *)p;
}
The problem is that *p = (vec){1,2,3,4} produces aligned move instead of
unaligned. Most likely this could be reproduced on any target with SIMD
extensions, where aligned move differs from unaligned.