majnemer created this revision. majnemer added reviewers: asl, bruno, rjmccall, rnk. majnemer added a subscriber: cfe-commits-list.
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. http://reviews.llvm.org/D10908 Files: lib/CodeGen/TargetInfo.cpp test/CodeGenCXX/x86_64-arguments-avx.cpp Index: test/CodeGenCXX/x86_64-arguments-avx.cpp =================================================================== --- test/CodeGenCXX/x86_64-arguments-avx.cpp +++ 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: lib/CodeGen/TargetInfo.cpp =================================================================== --- lib/CodeGen/TargetInfo.cpp +++ 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: test/CodeGenCXX/x86_64-arguments-avx.cpp =================================================================== --- test/CodeGenCXX/x86_64-arguments-avx.cpp +++ 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: lib/CodeGen/TargetInfo.cpp =================================================================== --- lib/CodeGen/TargetInfo.cpp +++ 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