[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Jim Laskey jlaskey at apple.com
Wed Nov 29 05:37:23 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.235 -> 1.236
---
Log message:

Offset for load of 32-bit arg in 64-bit world was incorrect.

---
Diffs of the changes:  (+4 -1)

 PPCISelLowering.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.235 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.236
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.235	Tue Nov 28 12:27:02 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Wed Nov 29 07:37:09 2006
@@ -1123,6 +1123,7 @@
     bool needsLoad = false;
     MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
     unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8;
+    unsigned ArgSize = ObjSize;
 
     unsigned CurArgOffset = ArgOffset;
     switch (ObjectVT) {
@@ -1138,6 +1139,7 @@
         ++GPR_idx;
       } else {
         needsLoad = true;
+        ArgSize = PtrByteSize;
       }
       break;
     case MVT::i64:  // PPC64
@@ -1203,7 +1205,8 @@
       // If the argument is actually used, emit a load from the right stack
       // slot.
       if (!Op.Val->hasNUsesOfValue(0, ArgNo)) {
-        int FI = MFI->CreateFixedObject(ObjSize, CurArgOffset);
+        int FI = MFI->CreateFixedObject(ObjSize,
+                                        CurArgOffset + (ArgSize - ObjSize));
         SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
         ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
       } else {






More information about the llvm-commits mailing list