From patchwork Tue May 14 21:53:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 243847 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 B46152C00A8 for ; Wed, 15 May 2013 08:01:51 +1000 (EST) Received: from localhost ([::1]:45262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcNI5-00007T-VL for incoming@patchwork.ozlabs.org; Tue, 14 May 2013 18:01:49 -0400 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 Received: from mail-ie0-x22d.google.com ([2607:f8b0:4001:c03::22d]:63252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcNCE-0003tx-AU; Tue, 14 May 2013 17:55:46 -0400 Received: by mail-ie0-f173.google.com with SMTP id k5so2216864iea.32 for ; Tue, 14 May 2013 14:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=dpWVZ4iknKZJXQd4LJy1w/UHBuufEGpqtGXzVZ5OSNg=; b=b7GKjVCNm2tqrTPFTx8Bm/Y8neDdfpzOwtyVL/jBHZp/0yQiFrX0+xeNmOpK0n4nCy pArQTrbxL+V/Kdk97uJnTMKycvt4cYrtVo/NjEzO/5iwGE2GYOEbwVnZ5CjJpsDwxlAP Ys0PcAUNd8JoDagysF9T0tS5cXXg+y4KbFdPzEvJRyDf7RzWwmgQzxygxn3lDEVkcqDC aEzOqH0PpQkH0mJ3XwAsyDejloMaKgUK3AzGO1mcWD0uMvUf3edtMA6F5t7DXRrY9MAw 5EYIyJpePhesCG6sRQLsq6nSWlgYrYG08GZLg7my9Gfa2UAejX7klotwf398JdQB633w mBNA== X-Received: by 10.50.78.34 with SMTP id y2mr3665493igw.50.1368568545615; Tue, 14 May 2013 14:55:45 -0700 (PDT) Received: from localhost (cpe-72-177-121-217.austin.res.rr.com. [72.177.121.217]) by mx.google.com with ESMTPSA id b6sm204214igv.5.2013.05.14.14.55.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 May 2013 14:55:45 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Tue, 14 May 2013 16:53:05 -0500 Message-Id: <1368568392-2127-9-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 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> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22d Cc: aliguori@us.ibm.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 08/15] 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 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];