diff options
| author | 2011-11-02 15:15:06 -0700 | |
|---|---|---|
| committer | 2011-11-02 15:15:06 -0700 | |
| commit | a50638ba8b983616da3cf1aa941038bea56159e5 (patch) | |
| tree | db7d9f0080d264ab3735bc7495da9dd9df929f9e /src/compiler/codegen/arm/ArmRallocUtil.cc | |
| parent | 5d76c435082332ef79a22962386fa92a0870e378 (diff) | |
Register allocation fixes.
This fixes the calculator button problem, but let's leave optimization
off until we've passed more tests.
Change-Id: I79b71687a1651e83f16037dead768c43f55d65da
Diffstat (limited to 'src/compiler/codegen/arm/ArmRallocUtil.cc')
| -rw-r--r-- | src/compiler/codegen/arm/ArmRallocUtil.cc | 8 |
1 files changed, 8 insertions, 0 deletions
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 |