diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-08-09 01:24:32 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-08-09 01:24:32 +0000 |
commit | 524a60587d1505aa441400a0065d60d8203aac82 (patch) | |
tree | 11fb040c68147b197f51f558a9ac72e1a715be4f | |
parent | eb673960210a2723acf9c99ce73b32cbbec2ad35 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15573 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PowerPCRegisterInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp index 42f2d3e9e8..7607a05824 100644 --- a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp @@ -210,9 +210,11 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const { // 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); |