Skip to content

Commit

Permalink
tcg/optimize: fix setcond2 optimization
Browse files Browse the repository at this point in the history
When setcond2 is rewritten into setcond, the state of the destination
temp should be reset, so that a copy of the previous value is not
used instead of the result.

Reported-by: Michael Tokarev <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
  • Loading branch information
aurel32 committed May 9, 2013
1 parent 47ec15c commit 66e61b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tcg/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
/* Simplify LT/GE comparisons vs zero to a single compare
vs the high word of the input. */
s->gen_opc_buf[op_index] = INDEX_op_setcond_i32;
reset_temp(args[0]);
gen_args[0] = args[0];
gen_args[1] = args[2];
gen_args[2] = args[4];
Expand Down

0 comments on commit 66e61b5

Please sign in to comment.