From: Aurelien Jarno Date: Wed, 8 May 2013 20:36:39 +0000 (+0200) Subject: tcg/optimize: fix setcond2 optimization X-Git-Tag: v1.4.2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93399d08275ff0243ef8c0a2709098bd6192343e;p=thirdparty%2Fqemu.git 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 Reviewed-by: Richard Henderson Signed-off-by: Aurelien Jarno (cherry picked from commit 66e61b55f158ef5628e4c056dd2f233c9351a3f5) Signed-off-by: Michael Roth --- diff --git a/tcg/optimize.c b/tcg/optimize.c index 973d2d679fb..be100335f06 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1024,6 +1024,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];