summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/parallel_move_resolver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/parallel_move_resolver.cc')
-rw-r--r--compiler/optimizing/parallel_move_resolver.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/optimizing/parallel_move_resolver.cc b/compiler/optimizing/parallel_move_resolver.cc
index 1e93ece2ef..b8f5070999 100644
--- a/compiler/optimizing/parallel_move_resolver.cc
+++ b/compiler/optimizing/parallel_move_resolver.cc
@@ -37,10 +37,12 @@ void ParallelMoveResolver::EmitNativeCode(HParallelMove* parallel_move) {
// Perform the moves with constant sources.
for (size_t i = 0; i < moves_.Size(); ++i) {
- const MoveOperands& move = *moves_.Get(i);
- if (!move.IsEliminated()) {
- DCHECK(move.GetSource().IsConstant());
+ MoveOperands* move = moves_.Get(i);
+ if (!move->IsEliminated()) {
+ DCHECK(move->GetSource().IsConstant());
EmitMove(i);
+ // Eliminate the move, in case following moves need a scratch register.
+ move->Eliminate();
}
}