diff options
author | Vladimir Marko <vmarko@google.com> | 2015-04-23 17:00:40 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2015-04-23 17:00:40 +0100 |
commit | 084f7d43f4dc38bfc71446b1a3b07af085d778bf (patch) | |
tree | 025c24678e8014c0184dd15bd93f8758422db85e /compiler/dex/quick | |
parent | 4ceed922d44b68c3fa7cbe670014c9e2e003b92b (diff) | |
download | android_art-084f7d43f4dc38bfc71446b1a3b07af085d778bf.tar.gz android_art-084f7d43f4dc38bfc71446b1a3b07af085d778bf.tar.bz2 android_art-084f7d43f4dc38bfc71446b1a3b07af085d778bf.zip |
Quick: Fix out of temp regs in ArmMir2Lir::GenMulLong().
This fixes running out of temp registers for mul-long that
needs a temporary to store the result, i.e. when it's stored
to stack location [sp, #offset] with offset >= 1024. The bug
is currently not reproducible because ARM_R4_SUSPEND_FLAG is
off and thus we have the extra register available. However,
the code generation could be cleaned up and make use of that
extra register, so pre-emptively fix it anyway.
Bug: 20110806
Change-Id: I8362c349961dbe28fc3ec8a9299b66fd72f26779
Diffstat (limited to 'compiler/dex/quick')
-rw-r--r-- | compiler/dex/quick/arm/int_arm.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/dex/quick/arm/int_arm.cc b/compiler/dex/quick/arm/int_arm.cc index 8d20f1b37e..7598e50977 100644 --- a/compiler/dex/quick/arm/int_arm.cc +++ b/compiler/dex/quick/arm/int_arm.cc @@ -1326,11 +1326,6 @@ void ArmMir2Lir::GenMulLong(Instruction::Code opcode, RegLocation rl_dest, } } - // Now, restore lr to its non-temp status. - FreeTemp(tmp1); - Clobber(rs_rARM_LR); - UnmarkTemp(rs_rARM_LR); - if (reg_status != 0) { // We had manually allocated registers for rl_result. // Now construct a RegLocation. @@ -1338,7 +1333,14 @@ void ArmMir2Lir::GenMulLong(Instruction::Code opcode, RegLocation rl_dest, rl_result.reg = RegStorage::MakeRegPair(res_lo, res_hi); } + // Free tmp1 but keep LR as temp for StoreValueWide() if needed. + FreeTemp(tmp1); + StoreValueWide(rl_dest, rl_result); + + // Now, restore lr to its non-temp status. + Clobber(rs_rARM_LR); + UnmarkTemp(rs_rARM_LR); } void ArmMir2Lir::GenArithOpLong(Instruction::Code opcode, RegLocation rl_dest, RegLocation rl_src1, |