aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-09-30 01:43:29 +0000
committerJim Grosbach <grosbach@apple.com>2009-09-30 01:43:29 +0000
commitd1a5ca6cb11763059ba1ee1c965cc69abff92e38 (patch)
treeba792843aa7837003b442117927362c8f93ca49b
parentc732adf3a1718d1b3e08adb11652100cab1efad6 (diff)
When checking whether we need to reserve a register for the scavenger,
the size of the saved frame pointer needs to be taken into account. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83136 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index a7ab3b57da..6086c1b4ba 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -654,7 +654,13 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
// adjustments also, even when the frame itself is small.
if (RS && !ExtraCSSpill) {
MachineFrameInfo *MFI = MF.getFrameInfo();
- if (estimateStackSize(MF, MFI) >= estimateRSStackSizeLimit(MF)
+ // If any of the stack slot references may be out of range of an
+ // immediate offset, make sure a register (or a spill slot) is
+ // available for the register scavenger. Note that if we're indexing
+ // off the frame pointer, the effective stack size is 4 bytes larger
+ // since the FP points to the previous FP.
+ if (estimateStackSize(MF, MFI) + (hasFP(MF) ? 4 : 0)
+ >= estimateRSStackSizeLimit(MF)
|| AFI->isThumb1OnlyFunction()) {
// If any non-reserved CS register isn't spilled, just spill one or two
// extra. That should take care of it!