https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63897
Bug ID: 63897 Summary: [5.0 regression] gcc.dg/torture/vector-2.c fails at on x86_64-apple-darwin14 Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: fxcoudert at gcc dot gnu.org Created attachment 33987 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33987&action=edit Assembler generated by "gcc -msse vector-2.c -O1 -m32 -S" gcc.dg/torture/vector-2.c currently fails on trunk, when compiled with "-msse vector-2.c -O1 -m32". Here is a minimal reproducer: ---------------------------- #define vector __attribute__((vector_size(16) )) vector int f0(vector int t) { ((int*)&t)[0] = 1; return t; } vector int f1(vector int t) { ((int*)&t)[1] = 1; return t; } int main(void) { vector int a = {0, 0, 0, 0}; vector int b = {1, 0, 0, 0}; vector int c = {0, 1, 0, 0}; vector int a0 = f0(a); if (__builtin_memcmp (&a0, &b, sizeof(a0))) __builtin_abort (); a0 = f1(a); if (__builtin_memcmp (&a0, &c, sizeof(a0))) __builtin_abort (); return 0; } ---------------------------- When compiled with "gcc -msse vector-2.c -O1 -m32", this segfaults at runtime. The backtrace is: * thread #1: tid = 0xdc2a68, 0x00001ea9 a.out`main + 81, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xb0) frame #0: 0x00001ea9 a.out`main + 81 a.out`main + 81: -> 0x1ea9: movd 0xb0(%eax), %xmm0 0x1eb1: pshufd $-0x1f, %xmm0, %xmm0 0x1eb6: movaps %xmm0, 0x10(%esp) 0x1ebb: subl $0x4, %esp The assembler generated is attached.