]> git.proxmox.com Git - qemu.git/commitdiff
tcg/optimize: fix setcond2 optimization
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 8 May 2013 20:36:39 +0000 (22:36 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 14 May 2013 18:03:45 +0000 (13:03 -0500)
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>
(cherry picked from commit 66e61b55f158ef5628e4c056dd2f233c9351a3f5)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
tcg/optimize.c

index 973d2d679fbfea2710dbc3e0b45f4ba10f7bc0cd..be100335f06dc51b7341012d585a06d656232e0d 100644 (file)
@@ -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];