summaryrefslogtreecommitdiff
path: root/tcg/optimize.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2013-05-08 22:36:39 +0200
committerAurelien Jarno <aurelien@aurel32.net>2013-05-09 16:14:58 +0200
commit66e61b55f158ef5628e4c056dd2f233c9351a3f5 (patch)
tree6db143a8c30e4b43c91d629be686d1686c240a97 /tcg/optimize.c
parent47ec15cdd44877e553ed0bd0a16aea8a295dad62 (diff)
downloadqemu-66e61b55f158ef5628e4c056dd2f233c9351a3f5.tar.gz
qemu-66e61b55f158ef5628e4c056dd2f233c9351a3f5.tar.bz2
qemu-66e61b55f158ef5628e4c056dd2f233c9351a3f5.zip
tcg/optimize: fix setcond2 optimization
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 <mjt@tls.msk.ru> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tcg/optimize.c')
-rw-r--r--tcg/optimize.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 1b6644c6c9..b35868afbc 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -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];