#endif
// No need to allocate space on the stack.
- if (NumBytes == 0) return;
+ if (NumBytes == 0 && !MFI->hasCalls()) return;
int FPOffset, RAOffset;
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";