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

Reid Spencer reid at x10sys.com
Sun Aug 8 18:24:42 PDT 2004



Changes in directory llvm/lib/Target/PowerPC:

PowerPCRegisterInfo.cpp updated: 1.24 -> 1.25
---
Log message:

Fix stack size processing now that the return address isn't an implied 
push onto the top of the stack like x86, which uses the local area 
offset.  This will allow the removal of PowerPCPEI.cpp soon.


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

Index: llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.24 llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.25
--- llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp:1.24	Fri Aug  6 01:58:50 2004
+++ llvm/lib/Target/PowerPC/PowerPCRegisterInfo.cpp	Sun Aug  8 20:24:32 2004
@@ -210,9 +210,11 @@
   // Do we need to allocate space on the stack?
   if (NumBytes == 0) return;
 
-  // Round the size to a multiple of the alignment
+  // Add the size of R1 to  NumBytes size for the store of R1 to the bottom 
+  // of the stack and round the size to a multiple of the alignment.
   unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
-  NumBytes = (NumBytes+Align-1)/Align*Align;
+  unsigned Size = getRegClass(PPC32::R1)->getSize();
+  NumBytes = (NumBytes+Size+Align-1)/Align*Align;
 
   // Update frame info to pretend that this is part of the stack...
   MFI->setStackSize(NumBytes);






More information about the llvm-commits mailing list