From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cVz-0007N5-FQ for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0cVv-0002Vq-FT for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:17:27 -0400 Received: from mail-vn0-x234.google.com ([2607:f8b0:400c:c0f::234]:36348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cVv-0002Vl-97 for qemu-devel@nongnu.org; Thu, 04 Jun 2015 17:17:23 -0400 Received: by vnbg1 with SMTP id g1so6770363vnb.3 for ; Thu, 04 Jun 2015 14:17:23 -0700 (PDT) Sender: Richard Henderson Message-ID: <5570C05F.3000207@twiddle.net> Date: Thu, 04 Jun 2015 14:17:19 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1433447228-29425-1-git-send-email-aurelien@aurel32.net> <1433447228-29425-2-git-send-email-aurelien@aurel32.net> In-Reply-To: <1433447228-29425-2-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/2] tcg: fix register allocation with two aliased dead inputs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno , qemu-devel@nongnu.org On 06/04/2015 12:47 PM, Aurelien Jarno wrote: > For TCG ops with two outputs registers (add2, sub2, div2, div2u), when > the same input temp is used for the two inputs aliased to the two > outputs, and when these inputs are both dead, the register allocation > code wrongly assigned the same register to the same output. > > This happens for example with sub2 t1, t2, t3, t3, t4, t5, when t3 is > not used anymore after the TCG op. In that case the same register is > used for t1, t2 and t3. > > The fix is to look for already allocated aliased input when allocating > a dead aliased input and check that the register is not already > used. > > Cc: Richard Henderson > Signed-off-by: Aurelien Jarno > --- > tcg/tcg.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) Reviewed-by: Richard Henderson r~