From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Nju-0000yr-QD for qemu-devel@nongnu.org; Fri, 27 Jun 2014 00:26:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0Njo-0005Qs-Rr for qemu-devel@nongnu.org; Fri, 27 Jun 2014 00:26:18 -0400 Received: from mail-qa0-x22a.google.com ([2607:f8b0:400d:c00::22a]:54712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Njo-0005Qn-Nt for qemu-devel@nongnu.org; Fri, 27 Jun 2014 00:26:12 -0400 Received: by mail-qa0-f42.google.com with SMTP id dc16so3698065qab.29 for ; Thu, 26 Jun 2014 21:26:12 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 26 Jun 2014 21:26:00 -0700 Message-Id: <1403843160-30332-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: tommusta@gmail.com, clg@fr.ibm.com, gkurz@linux.vnet.ibm.com With rt != r0 on loads, we use rt for scratch. If we need an index register different from base, we can't use rt, but r0 is usable. Signed-off-by: Richard Henderson --- This ought to fix the problem that Greg reported. That we need to use --enable-debug-tcg to see the assert, and that I didn't previously do testing with that is disappointing. I'm thinking that we ought to do something like gcc wrt --enable-checking=release vs development, so that we can't do normal development withing these asserts enabled. More on that later... r~ --- tcg/ppc/tcg-target.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index c83fd9f..dd84e76 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -805,7 +805,10 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt, /* For unaligned, or very large offsets, use the indexed form. */ if (offset & align || offset != (int32_t)offset) { - tcg_debug_assert(rs != base && (!is_store || rs != rt)); + if (rs == base) { + rs = TCG_REG_R0; + } + tcg_debug_assert(!is_store || rs != rt); tcg_out_movi(s, TCG_TYPE_PTR, rs, orig); tcg_out32(s, opx | TAB(rt, base, rs)); return; -- 1.9.3