diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-08-18 02:19:09 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-08-18 02:19:09 +0000 |
commit | 055c7eb4a47f1e69a16ac042da79c8e809a341f4 (patch) | |
tree | dc71e06655114ab27d6f951c55be47dc0197699f | |
parent | 6d32ca076283b50e93e00a98e4473767f1a31e5a (diff) | |
download | external_llvm-055c7eb4a47f1e69a16ac042da79c8e809a341f4.zip external_llvm-055c7eb4a47f1e69a16ac042da79c8e809a341f4.tar.gz external_llvm-055c7eb4a47f1e69a16ac042da79c8e809a341f4.tar.bz2 |
Fixed stack frame addressing bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41160 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Mips/MipsRegisterInfo.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/Mips/MipsRegisterInfo.cpp b/lib/Target/Mips/MipsRegisterInfo.cpp index 42e82bf..5d78d90 100644 --- a/lib/Target/Mips/MipsRegisterInfo.cpp +++ b/lib/Target/Mips/MipsRegisterInfo.cpp @@ -271,15 +271,15 @@ emitPrologue(MachineFunction &MF) const MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>(); MachineBasicBlock::iterator MBBI = MBB.begin(); - // Get the number of bytes to allocate from the FrameInfo + // Get the number of bytes to allocate from the FrameInfo. int NumBytes = (int) MFI->getStackSize(); #ifndef NDEBUG - DOUT << "\n<--- EMIT PROLOGUE --->"; + DOUT << "\n<--- EMIT PROLOGUE --->\n"; DOUT << "Stack size :" << NumBytes << "\n"; #endif - // Do we need to allocate space on the stack? + // Don't need to allocate space on the stack. if (NumBytes == 0) return; int FPOffset, RAOffset; @@ -289,13 +289,13 @@ emitPrologue(MachineFunction &MF) const // using FP, the last stack slot becomes empty // and RA is saved before it. if ((hasFP(MF)) && (MFI->hasCalls())) { - FPOffset = NumBytes; - RAOffset = (NumBytes+4); + FPOffset = NumBytes+4; + RAOffset = (NumBytes+8); } else if ((!hasFP(MF)) && (MFI->hasCalls())) { FPOffset = 0; - RAOffset = NumBytes; + RAOffset = NumBytes+4; } else if ((hasFP(MF)) && (!MFI->hasCalls())) { - FPOffset = NumBytes; + FPOffset = NumBytes+4; RAOffset = 0; } @@ -310,7 +310,7 @@ emitPrologue(MachineFunction &MF) const #endif // Align stack. - NumBytes += 8; + NumBytes += 12; unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment(); NumBytes = ((NumBytes+Align-1)/Align*Align); |