Make sure there is enough room for RA. getStackSize needs to be cleaned up but
authorAkira Hatanaka <ahatanaka@mips.com>
Mon, 17 Sep 2012 20:02:42 +0000 (20:02 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Mon, 17 Sep 2012 20:02:42 +0000 (20:02 +0000)
we will do that when we implement the full save/restore.

Patch by Reed Kotler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164051 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Mips/Mips16FrameLowering.cpp

index 030042f2e8326f4ec0703010b40acd4b591dbf9f..a671df4bc12d1221e383aacdd333a8dcd181ba4b 100644 (file)
@@ -35,6 +35,8 @@ void Mips16FrameLowering::emitPrologue(MachineFunction &MF) const {
   DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
   uint64_t StackSize = MFI->getStackSize();
 
+  StackSize += 16; // need to allocate space for RA. Clean this up later
+                   // when we fix the save/restore instruction. TBD..
   // No need to allocate space on the stack.
   if (StackSize == 0 && !MFI->adjustsStack()) return;
 
@@ -52,6 +54,8 @@ void Mips16FrameLowering::emitEpilogue(MachineFunction &MF,
   DebugLoc dl = MBBI->getDebugLoc();
   uint64_t StackSize = MFI->getStackSize();
 
+  StackSize += 16; // need to allocate space for RA. Clean this up later
+                   // when we fix the save/restore instruction. TBD..
   if (!StackSize)
     return;