From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcNCG-000767-0S for qemu-devel@nongnu.org; Tue, 14 May 2013 17:55:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcNCE-0003uC-Pt for qemu-devel@nongnu.org; Tue, 14 May 2013 17:55:47 -0400 Sender: fluxion From: Michael Roth Date: Tue, 14 May 2013 16:53:05 -0500 Message-Id: <1368568392-2127-9-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1368568392-2127-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1368568392-2127-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 08/15] tcg/optimize: fix setcond2 optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, qemu-stable@nongnu.org From: Aurelien Jarno 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 --- tcg/optimize.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index 973d2d6..be10033 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]; -- 1.7.9.5