qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: tommusta@gmail.com, clg@fr.ibm.com, gkurz@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long
Date: Thu, 26 Jun 2014 21:26:00 -0700	[thread overview]
Message-ID: <1403843160-30332-1-git-send-email-rth@twiddle.net> (raw)

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 <rth@twiddle.net>
---
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

             reply	other threads:[~2014-06-27  4:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27  4:26 Richard Henderson [this message]
2014-06-27  5:49 ` [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long Cedric Le Goater
2014-06-27  8:33 ` Greg Kurz
2014-06-27 12:45 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403843160-30332-1-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=clg@fr.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tommusta@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).