[llvm-commits] [llvm-gcc-4.2] r51959 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-abi.h
Dale Johannesen
dalej at apple.com
Wed Jun 4 12:31:55 PDT 2008
Author: johannes
Date: Wed Jun 4 14:31:55 2008
New Revision: 51959
URL: http://llvm.org/viewvc/llvm-project?rev=51959&view=rev
Log:
x86-64 ABI conformance; for objects of 4 or 12 bytes
pass the 4-byte piece as 4 bytes not 8 bytes.
Fixes all but 1 struct-layout-1 failure (does not,
however, fix 477.dealII).
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=51959&r1=51958&r2=51959&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Wed Jun 4 14:31:55 2008
@@ -1315,20 +1315,28 @@
enum machine_mode Mode = ix86_getNaturalModeForType(type);
int NumClasses = ix86_ClassifyArgument(Mode, type, Class, 0);
*DontCheckAlignment= true;
- if (NumClasses == 1 && (Class[0] == X86_64_INTEGERSI_CLASS ||
- Class[0] == X86_64_INTEGER_CLASS)) {
+ if (NumClasses == 1 && Class[0] == X86_64_INTEGER_CLASS) {
/* 8 byte object, one int register */
*size = 8;
return true;
}
+ if (NumClasses == 1 && Class[0] == X86_64_INTEGERSI_CLASS) {
+ /* 4 byte object, one int register */
+ *size = 4;
+ return true;
+ }
if (NumClasses == 2 && (Class[0] == X86_64_INTEGERSI_CLASS ||
Class[0] == X86_64_INTEGER_CLASS)) {
- if (Class[1] == X86_64_INTEGERSI_CLASS ||
- Class[1] == X86_64_INTEGER_CLASS) {
+ if (Class[1] == X86_64_INTEGER_CLASS) {
/* 16 byte object, 2 int registers */
*size = 16;
return true;
}
+ if (Class[1] == X86_64_INTEGERSI_CLASS) {
+ /* 12 byte object, 2 int registers */
+ *size = 12;
+ return true;
+ }
if (Class[1] == X86_64_NO_CLASS) {
/* 16 byte object, only 1st register has information */
*size = 8;
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=51959&r1=51958&r2=51959&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Wed Jun 4 14:31:55 2008
@@ -570,7 +570,7 @@
Elts.push_back(Type::Int8Ty);
Size -= 1;
}
- assert((origSize || Size == 0) && "Didn't cover value?");
+ assert(Size == 0 && "Didn't cover value?");
const StructType *STy = StructType::get(Elts, false);
unsigned i = 0;
More information about the llvm-commits
mailing list