summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-08-18 02:19:09 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-08-18 02:19:09 +0000
commiteabe61b0801a7facc2dc352b2c605d0af5a33214 (patch)
tree5fc2ae36d97c8218a2d6ffb282b977f9279762c4 /llvm/lib
parentf3c55807f21b676603a8a64c672b7aaf363fb7ae (diff)
downloadbcm5719-llvm-eabe61b0801a7facc2dc352b2c605d0af5a33214.tar.gz
bcm5719-llvm-eabe61b0801a7facc2dc352b2c605d0af5a33214.zip
Fixed stack frame addressing bug
llvm-svn: 41160
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/MipsRegisterInfo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index 42e82bf5258..5d78d902c98 100644
--- a/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud