diff options
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 |