OSDN Git Service

Fix pr7110: For non-Darwin targets UnspilledCS1GPRs may include high registers.
authorBob Wilson <bob.wilson@apple.com>
Thu, 13 May 2010 19:58:24 +0000 (19:58 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 13 May 2010 19:58:24 +0000 (19:58 +0000)
Do not use those for Thumb1 functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103730 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMBaseRegisterInfo.cpp

index bf779cc..dd62049 100644 (file)
@@ -779,7 +779,9 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
       while (NumExtras && !UnspilledCS1GPRs.empty()) {
         unsigned Reg = UnspilledCS1GPRs.back();
         UnspilledCS1GPRs.pop_back();
-        if (!isReservedReg(MF, Reg)) {
+        if (!isReservedReg(MF, Reg) &&
+            (!AFI->isThumb1OnlyFunction() || isARMLowRegister(Reg) ||
+             Reg == ARM::LR)) {
           Extras.push_back(Reg);
           NumExtras--;
         }