changeset 1131:f2f13f111e2e

Workaround for LLVM PR 3861 (http://llvm.org/PR3861). (LLVM abort()s in codegen if the second integer in a return value is <= i8 on x86/x86-64) This was breaking native compilation of Tango's TempFile module on x86-64.
author Frits van Bommel <fvbommel wxs.nl>
date Mon, 23 Mar 2009 01:01:55 +0100
parents 30663babccff
children 76e72fdef04d
files gen/abi-x86-64.cpp
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/abi-x86-64.cpp	Sun Mar 22 14:51:03 2009 +0100
+++ b/gen/abi-x86-64.cpp	Mon Mar 23 01:01:55 2009 +0100
@@ -400,6 +400,15 @@
     bool retStructInRegs(TypeStruct* st) {
         // 'fastcc' allows returns in up to two registers of each kind:
         DRegCount state(2, 2, 2);
+    #if 1
+        // TODO: Disable this if and when LLVM PR 3861 gets fixed.
+        
+        // LLVM currently doesn't allow a second int to be an i1 or i8.
+        // (See <http://llvm.org/PR3861>)
+        // Rather than complicating shouldPassStructInRegs(), just disallow
+        // second integers for now.
+        state.ints = 1;
+    #endif
         return shouldPassStructInRegs(st, state);
     }