summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-08 05:07:05 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-08 05:07:05 +0000
commit699dd04a13beb0ebb4a4fca8d5646c9ede3da4ab (patch)
tree7ea8ff2fbcb8c659d7ecf5ffcb948912dae37eae
parentd2bc0d8423717d212367f99868ca5808e16f2353 (diff)
downloadbcm5719-llvm-699dd04a13beb0ebb4a4fca8d5646c9ede3da4ab.tar.gz
bcm5719-llvm-699dd04a13beb0ebb4a4fca8d5646c9ede3da4ab.zip
[CodeGen] Don't crash classifying a union of an AVX vector and an int
We forgot to run postMerge after decided that the union had to be classified as MEMORY. This left us with Lo == MEMORY and Hi == SSEUp which is an invalid combination. This fixes PR24021. Differential Revision: http://reviews.llvm.org/D10908 llvm-svn: 241666
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp2
-rw-r--r--clang/test/CodeGenCXX/x86_64-arguments-avx.cpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index e5ba200e1c5..dbb9e8d9039 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2094,11 +2094,13 @@ void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase,
//
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;
}
diff --git a/clang/test/CodeGenCXX/x86_64-arguments-avx.cpp b/clang/test/CodeGenCXX/x86_64-arguments-avx.cpp
index 29e693451d1..2933d9445b7 100644
--- a/clang/test/CodeGenCXX/x86_64-arguments-avx.cpp
+++ b/clang/test/CodeGenCXX/x86_64-arguments-avx.cpp
@@ -50,3 +50,12 @@ UU2 PR23082(UU2 x) {
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; }
+}
OpenPOWER on IntegriCloud