[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization

From: Aurelien Jarno
Subject: [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization
Date: Wed, 8 May 2013 22:42:42 +0200

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 <address@hidden>
Cc: Richard Henderson <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
 tcg/optimize.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 1b6644c..b35868a 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];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]