[PATCH] D10908: [CodeGen] Don't crash classifying a union of an AVX vector and an int
David Majnemer
david.majnemer at gmail.com
Tue Jul 7 22:07:36 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL241666: [CodeGen] Don't crash classifying a union of an AVX vector and an int (authored by majnemer).
Changed prior to commit:
http://reviews.llvm.org/D10908?vs=28975&id=29240#toc
Repository:
rL LLVM
http://reviews.llvm.org/D10908
Files:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/test/CodeGenCXX/x86_64-arguments-avx.cpp
Index: cfe/trunk/test/CodeGenCXX/x86_64-arguments-avx.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/x86_64-arguments-avx.cpp
+++ cfe/trunk/test/CodeGenCXX/x86_64-arguments-avx.cpp
@@ -50,3 +50,12 @@
return x;
}
}
+
+namespace test3 {
+union U {
+ __attribute__((__vector_size__(32))) float f1;
+ int f2;
+};
+// CHECK: define i32 @_ZN5test31fENS_1UE({{.*}}* byval align 32
+int f(U u) { return u.f2; }
+}
Index: cfe/trunk/lib/CodeGen/TargetInfo.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp
@@ -2094,11 +2094,13 @@
//
if (Size > 128 && getContext().getTypeSize(i->getType()) != 256) {
Lo = Memory;
+ postMerge(Size, Lo, Hi);
return;
}
// Note, skip this test for bit-fields, see below.
if (!BitField && Offset % getContext().getTypeAlign(i->getType())) {
Lo = Memory;
+ postMerge(Size, Lo, Hi);
return;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10908.29240.patch
Type: text/x-patch
Size: 1070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150708/b8ca999c/attachment.bin>
More information about the cfe-commits
mailing list