1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

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
This commit is contained in:
Bob Wilson 2012-03-20 19:28:25 +00:00
parent 4fb4d4c6e0
commit 52b3ad9532

View File

@ -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;