aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsRegisterInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Mips/MipsRegisterInfo.cpp')
-rw-r--r--lib/Target/Mips/MipsRegisterInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/Mips/MipsRegisterInfo.cpp b/lib/Target/Mips/MipsRegisterInfo.cpp
index cd42abd300..2c92060be9 100644
--- a/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -267,7 +267,7 @@ emitPrologue(MachineFunction &MF) const
#endif
// No need to allocate space on the stack.
- if (NumBytes == 0) return;
+ if (NumBytes == 0 && !MFI->hasCalls()) return;
int FPOffset, RAOffset;
@@ -389,7 +389,8 @@ void MipsRegisterInfo::
processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
// Set the SPOffset on the FI where GP must be saved/loaded.
MachineFrameInfo *MFI = MF.getFrameInfo();
- if (MFI->hasCalls()) {
+ bool isPIC = (MF.getTarget().getRelocationModel() == Reloc::PIC_);
+ if (MFI->hasCalls() && isPIC) {
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
#ifndef NDEBUG
DOUT << "processFunctionBeforeFrameFinalized\n";