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;
       }
 


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;
       }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to