summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-03-20 19:28:25 +0000
committerBob Wilson <bob.wilson@apple.com>2012-03-20 19:28:25 +0000
commitb60f8f875c7170ff66a2f8a5c0cd745cd9ceca75 (patch)
tree988c5ada91f27b967c7ab9fa3a5ca9c0e1c12bfa /llvm/lib/Target
parentca690320fb687d3b818edec55299fa6ac4696a61 (diff)
downloadbcm5719-llvm-b60f8f875c7170ff66a2f8a5c0cd745cd9ceca75.tar.gz
bcm5719-llvm-b60f8f875c7170ff66a2f8a5c0cd745cd9ceca75.zip
Require a base pointer for stack realignment when SP may vary dynamically.
ARMBaseRegisterInfo::canRealignStack was checking for variable-sized objects but not for stack adjustments around calls. Use hasReservedCallFrame() to check for both. The hasBasePointer function was already correctly checking both conditions, so the effect of this was that a base pointer would be used without checking whether the base pointer register could be reserved. I don't have a small testcase for this. <rdar://problem/11075906> llvm-svn: 153110
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 8fd77e54500..202da9bf2f6 100644
--- a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -532,8 +532,9 @@ bool ARMBaseRegisterInfo::canRealignStack(const MachineFunction &MF) const {
// register allocation with frame pointer elimination, it is too late now.
if (!MRI->canReserveReg(FramePtr))
return false;
- // We may also need a base pointer if there are dynamic allocas.
- if (!MFI->hasVarSizedObjects())
+ // We may also need a base pointer if there are dynamic allocas or stack
+ // pointer adjustments around calls.
+ if (MF.getTarget().getFrameLowering()->hasReservedCallFrame(MF))
return true;
if (!EnableBasePointer)
return false;
OpenPOWER on IntegriCloud