From d293fb40cf1cd23ead34f6002da037cead69cba2 Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Mon, 19 May 2014 15:45:42 +0700 Subject: [PATCH] x86: For integer ALU operation handle v+=v case When destination and operand are the same Virtual Register we should ensure that destination RegLocation is updated after operand is loaded with LoadValue in physical register. Change-Id: I59da106471b0c494203af01c99583f51dbc0f9ee Signed-off-by: Serguei Katkov --- compiler/dex/quick/x86/int_x86.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/dex/quick/x86/int_x86.cc b/compiler/dex/quick/x86/int_x86.cc index b70922c2b..48bff6e6a 100644 --- a/compiler/dex/quick/x86/int_x86.cc +++ b/compiler/dex/quick/x86/int_x86.cc @@ -2198,6 +2198,10 @@ void X86Mir2Lir::GenArithOpInt(Instruction::Code opcode, RegLocation rl_dest, } } rl_rhs = LoadValue(rl_rhs, kCoreReg); + // It might happen rl_rhs and rl_dest are the same VR + // in this case rl_dest is in reg after LoadValue while + // rl_result is not updated yet, so do this + rl_result = UpdateLocTyped(rl_dest, kCoreReg); if (rl_result.location != kLocPhysReg) { // Okay, we can do this into memory. OpMemReg(op, rl_result, rl_rhs.reg.GetReg()); -- 2.11.0