From f43083d560565aea46c602adb86423daeefe589d Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 7 Nov 2014 10:48:10 +0000 Subject: Do not update Out after it has a valid location. Slow paths use LocationSummary to know where to move things around, and they are executed at the end of the code generation. This fix is needed for https://android-review.googlesource.com/#/c/113345/. Change-Id: Id336c6409479b1de6dc839b736a7234d08a7774a --- compiler/optimizing/code_generator.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index c75980d856..0dfbad25f5 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -281,16 +281,22 @@ void CodeGenerator::InitLocations(HInstruction* instruction) { HInstruction* previous = instruction->GetPrevious(); Location temp_location = GetTemporaryLocation(instruction->AsTemporary()); Move(previous, temp_location, instruction); - previous->GetLocations()->SetOut(temp_location); } return; } AllocateRegistersLocally(instruction); for (size_t i = 0, e = instruction->InputCount(); i < e; ++i) { Location location = instruction->GetLocations()->InAt(i); + HInstruction* input = instruction->InputAt(i); if (location.IsValid()) { // Move the input to the desired location. - Move(instruction->InputAt(i), location, instruction); + if (input->GetNext()->IsTemporary()) { + // If the input was stored in a temporary, use that temporary to + // perform the move. + Move(input->GetNext(), location, instruction); + } else { + Move(input, location, instruction); + } } } } -- cgit v1.2.3-59-g8ed1b