Adjust processFunctionBeforeCalleeSavedScan() to correctly reserve a stack

slot for the register scavenger when compiling Thumb1 functions.

llvm-svn: 83023
This commit is contained in:
Jim Grosbach 2009-09-28 22:08:06 +00:00
parent 74e63461d2
commit 9cb82ce219

View File

@ -536,7 +536,8 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
}
}
if (CSRegClasses[i] == ARM::GPRRegisterClass) {
if (CSRegClasses[i] == ARM::GPRRegisterClass ||
CSRegClasses[i] == ARM::tGPRRegisterClass) {
if (Spilled) {
NumGPRSpills++;
@ -667,7 +668,8 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
NumExtras--;
}
}
while (NumExtras && !UnspilledCS2GPRs.empty()) {
while (NumExtras && !UnspilledCS2GPRs.empty() &&
!AFI->isThumb1OnlyFunction()) {
unsigned Reg = UnspilledCS2GPRs.back();
UnspilledCS2GPRs.pop_back();
if (!isReservedReg(MF, Reg)) {