Received: from eggs.gnu.org ([208.118.235.92]:59756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UaBIs-00027N-4I for qemu-devel@nongnu.org; Wed, 08 May 2013 16:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UaBIq-0004ol-Sd for qemu-devel@nongnu.org; Wed, 08 May 2013 16:49:34 -0400 Date: Wed, 8 May 2013 22:49:31 +0200 From: Aurelien Jarno Message-ID: <20130508204931.GF31148@hall.aurel32.net> References: <1368045762-9769-1-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1368045762-9769-1-git-send-email-aurelien@aurel32.net> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH for 1.5] tcg/optimize: fix setcond2 optimization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-stable@nongnu.org Cc: Michael Tokarev , Richard Henderson On Wed, May 08, 2013 at 10:42:42PM +0200, Aurelien Jarno wrote: > 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 > --- > 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]; I have just noticed that the problem is there since release 1.3, even if it appeared more clearly only with commit 7eb0cc85. All 64-bit targets on 32-bit hosts are possibly affected. Therefore it should be fixed in the next stable releases. Hence the Cc to qemu-stable@nongnu.org. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net