]> granicus.if.org Git - clang/commitdiff
x86-64 ABI: clang incorrectly passes union { long double, float } in
authorDaniel Dunbar <daniel@zuster.org>
Tue, 12 May 2009 15:22:40 +0000 (15:22 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 12 May 2009 15:22:40 +0000 (15:22 +0000)
register.
 - Merge algorithm was returning MEMORY as it should.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71556 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp
test/CodeGen/x86_64-arguments.c

index c46e7901d9f518428cfab520c3465841a22621b2..a142729343977d69e9d1db5a2723e2a7caeca76c 100644 (file)
@@ -633,7 +633,8 @@ X86_64ABIInfo::Class X86_64ABIInfo::merge(Class Accum,
     return Field;
   else if (Accum == Integer || Field == Integer) 
     return Integer;
-  else if (Field == X87 || Field == X87Up || Field == ComplexX87)
+  else if (Field == X87 || Field == X87Up || Field == ComplexX87 ||
+           Accum == X87 || Accum == X87Up)
     return Memory;
   else
     return SSE;
index fa73f7de674258d34f698c26c847b0850ea71883..2e5debe7cba7dae6cb142d62bb851f0d3e6538d7 100644 (file)
@@ -52,4 +52,7 @@ struct s9 { int a; int b; int : 0; } f9(void) {}
 struct s10 { int a; int b; int : 0; };
 void f10(struct s10 a0) {}
 
+// RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t &&
+union { long double a; float b; } f11() {}
+
 // RUN: true