Properly generate stack frame

llvm-svn: 75998
This commit is contained in:
Anton Korobeynikov 2009-07-16 14:12:36 +00:00
parent 6f3d11cf0b
commit a3157b1c9c
1 changed files with 5 additions and 5 deletions

View File

@ -193,8 +193,9 @@ void SystemZRegisterInfo::emitPrologue(MachineFunction &MF) const {
// Get the number of bytes to allocate from the FrameInfo.
// Note that area for callee-saved stuff is already allocated, thus we need to
// 'undo' the stack movement.
uint64_t StackSize =
MFI->getStackSize() - SystemZMFI->getCalleeSavedFrameSize();
uint64_t StackSize = MFI->getStackSize();
uint64_t NumBytes = StackSize - SystemZMFI->getCalleeSavedFrameSize();
NumBytes -= TFI.getOffsetOfLocalArea();
// Skip the callee-saved push instructions.
while (MBBI != MBB.end() &&
@ -205,9 +206,8 @@ void SystemZRegisterInfo::emitPrologue(MachineFunction &MF) const {
if (MBBI != MBB.end())
DL = MBBI->getDebugLoc();
uint64_t NumBytes = StackSize - TFI.getOffsetOfLocalArea();
if (NumBytes) // adjust stack pointer: R15 -= numbytes
// adjust stack pointer: R15 -= numbytes
if (StackSize)
emitSPUpdate(MBB, MBBI, -(int64_t)NumBytes, TII);
if (hasFP(MF)) {