aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/ARM/ARMRegisterInfo.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Target/ARM/ARMRegisterInfo.cpp b/lib/Target/ARM/ARMRegisterInfo.cpp
index 4d48a7a078..d76aedb0af 100644
--- a/lib/Target/ARM/ARMRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMRegisterInfo.cpp
@@ -881,13 +881,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF) const {
}
}
- if (hasFP(MF)) {
- MF.changePhyRegUsed(FramePtr, true);
- NumGPRSpills++;
- CanEliminateFrame = false;
- }
-
- if (!CanEliminateFrame) {
+ if (!CanEliminateFrame || hasFP(MF)) {
AFI->setHasStackFrame(true);
// If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled.
@@ -902,7 +896,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF) const {
// Darwin ABI requires FP to point to the stack slot that contains the
// previous FP.
- if (STI.isTargetDarwin()) {
+ if (STI.isTargetDarwin() || hasFP(MF)) {
MF.changePhyRegUsed(FramePtr, true);
NumGPRSpills++;
}