Register allocation fixes.
This fixes the calculator button problem, but let's leave optimization
off until we've passed more tests.
Change-Id: I79b71687a1651e83f16037dead768c43f55d65da
diff --git a/src/compiler/codegen/arm/ArmRallocUtil.cc b/src/compiler/codegen/arm/ArmRallocUtil.cc
index 4af3d07..81c721d 100644
--- a/src/compiler/codegen/arm/ArmRallocUtil.cc
+++ b/src/compiler/codegen/arm/ArmRallocUtil.cc
@@ -169,6 +169,10 @@
// Promote fpRegs
for (int i = 0; (fpRegs[i].count > 0) && (i < numRegs); i++) {
if (cUnit->promotionMap[fpRegs[i].sReg].fpLocation != kLocPhysReg) {
+ if (fpRegs[i].sReg >= cUnit->numRegs) {
+ // don't promote arg regs
+ continue;
+ }
int reg = oatAllocPreservedFPReg(cUnit, fpRegs[i].sReg,
fpRegs[i].doubleStart);
if (reg < 0) {
@@ -181,6 +185,10 @@
for (int i = 0; (coreRegs[i].count > 0) && i < numRegs; i++) {
if (cUnit->promotionMap[coreRegs[i].sReg].coreLocation !=
kLocPhysReg) {
+ if (coreRegs[i].sReg >= cUnit->numRegs) {
+ // don't promote arg regs
+ continue;
+ }
int reg = oatAllocPreservedCoreReg(cUnit, coreRegs[i].sReg);
if (reg < 0) {
break; // No more left