From patchwork Wed May 8 20:42:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 242644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5ABBE2C00F5 for ; Thu, 9 May 2013 06:43:08 +1000 (EST) Received: from localhost ([::1]:53583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaBCc-0000ww-Is for incoming@patchwork.ozlabs.org; Wed, 08 May 2013 16:43:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaBCN-0000vD-Eq for qemu-devel@nongnu.org; Wed, 08 May 2013 16:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaBCL-0002ki-Qt for qemu-devel@nongnu.org; Wed, 08 May 2013 16:42:51 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:59069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaBCL-0002kR-KT for qemu-devel@nongnu.org; Wed, 08 May 2013 16:42:49 -0400 Received: from [2001:470:d4ed:0:ea11:32ff:fea1:831a] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UaBCJ-0004Ee-6K; Wed, 08 May 2013 22:42:47 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1UaBCH-0002bS-Uq; Wed, 08 May 2013 22:42:45 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Wed, 8 May 2013 22:42:42 +0200 Message-Id: <1368045762-9769-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f15:c4f::1 Cc: Michael Tokarev , Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Cc: Richard Henderson Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson --- 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];