[llvm-commits] [llvm-gcc-4.2] r51973 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
Dale Johannesen
dalej at apple.com
Wed Jun 4 18:24:43 PDT 2008
Author: johannes
Date: Wed Jun 4 20:24:40 2008
New Revision: 51973
URL: http://llvm.org/viewvc/llvm-project?rev=51973&view=rev
Log:
Adjust preceding patch, it seems INTEGER_SI_CLASS
can be returned for values too big to fit in an SI.
Live and learn. Fixes regression introduced into
struct-layout-1.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
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=51973&r1=51972&r2=51973&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 20:24:40 2008
@@ -1315,16 +1315,17 @@
enum machine_mode Mode = ix86_getNaturalModeForType(type);
int NumClasses = ix86_ClassifyArgument(Mode, type, Class, 0);
*DontCheckAlignment= true;
- if (NumClasses == 1 && Class[0] == X86_64_INTEGER_CLASS) {
+ if (NumClasses == 1 && (Class[0] == X86_64_INTEGER_CLASS ||
+ Class[0] == X86_64_INTEGERSI_CLASS)) {
// one int register
- *size = 8;
- return true;
- }
- if (NumClasses == 1 && Class[0] == X86_64_INTEGERSI_CLASS) {
- // one shorter-than-64-bits register
HOST_WIDE_INT Bytes =
(Mode == BLKmode) ? int_size_in_bytes(type) : (int) GET_MODE_SIZE(Mode);
- *size = Bytes;
+ if (Bytes>4)
+ *size = 8;
+ else if (Bytes>2)
+ *size = 4;
+ else
+ *size = Bytes;
return true;
}
if (NumClasses == 2 && (Class[0] == X86_64_INTEGERSI_CLASS ||
More information about the llvm-commits
mailing list