This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50716] New: Segmentation fault caused by misaligned vector access
- From: "tema at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Oct 2011 15:00:10 +0000
- Subject: [Bug middle-end/50716] New: Segmentation fault caused by misaligned vector access
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: tema@gcc.gnu.org
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.