From a50638ba8b983616da3cf1aa941038bea56159e5 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 2 Nov 2011 15:15:06 -0700 Subject: Register allocation fixes. This fixes the calculator button problem, but let's leave optimization off until we've passed more tests. Change-Id: I79b71687a1651e83f16037dead768c43f55d65da --- src/compiler/codegen/arm/ArmRallocUtil.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/compiler/codegen/arm/ArmRallocUtil.cc') diff --git a/src/compiler/codegen/arm/ArmRallocUtil.cc b/src/compiler/codegen/arm/ArmRallocUtil.cc index 4af3d0713a..81c721dc88 100644 --- a/src/compiler/codegen/arm/ArmRallocUtil.cc +++ b/src/compiler/codegen/arm/ArmRallocUtil.cc @@ -169,6 +169,10 @@ extern void oatDoPromotion(CompilationUnit* cUnit) // 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 @@ extern void oatDoPromotion(CompilationUnit* cUnit) 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 -- cgit v1.2.3-59-g8ed1b