From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel <qemu-devel@nongnu.org>,
"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>
Cc: Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] qemu-system-ppc TCG assert with git master
Date: Thu, 12 Mar 2015 14:55:37 +0000 [thread overview]
Message-ID: <5501A8E9.4030601@mail.uni-paderborn.de> (raw)
In-Reply-To: <55015153.7010509@ilande.co.uk>
[-- Attachment #1.1: Type: text/plain, Size: 2393 bytes --]
Hi Mark, sorry I forgot to cc qemu-devel :/
On 03/12/2015 08:41 AM, Mark Cave-Ayland wrote:
> Hi all,
>
> Whilst testing git master in preparation for some OpenBIOS updates, I'm
> seeing the following TCG assert in one of my older test images:
>
>
> $ gdb --args ./qemu-system-ppc -cdrom
> /home/build/src/qemu/image/ppc/ubuntu-5.10-live-powerpc.iso -boot d -g
> 800x600x8
> GNU gdb (GDB) 7.4.1-debian
> Copyright (C) 2012 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /home/build/rel-qemu-git/bin/qemu-system-ppc...done.
> (gdb) r
> Starting program: /home/build/rel-qemu-git/bin/qemu-system-ppc -cdrom
> /home/build/src/qemu/image/ppc/ubuntu-5.10-live-powerpc.iso -boot d -g
> 800x600x8
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library
> "/lib/x86_64-linux-gnu/libthread_db.so.1".
> [New Thread 0x7fffe9ef3700 (LWP 11437)]
> [New Thread 0x7fffe5bf1700 (LWP 11438)]
> [New Thread 0x7fffe53f0700 (LWP 11439)]
> [Thread 0x7fffe5bf1700 (LWP 11438) exited]
> [New Thread 0x7fffe5bf1700 (LWP 11443)]
> [Thread 0x7fffe5bf1700 (LWP 11443) exited]
> qemu-system-ppc: /home/build/src/qemu/git/qemu/tcg/optimize.c:212:
> tcg_opt_gen_mov: Assertion `temps[src].state != TCG_TEMP_CONST' failed.
does this fix it?
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 96adf9a..4c8ff70 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -396,7 +396,11 @@ static inline void tcg_gen_and_i32(TCGv_i32 ret,
TCGv_i32 arg1, TCGv_i32 arg2)
static inline void tcg_gen_or_i32(TCGv_i32 ret, TCGv_i32 arg1,
TCGv_i32 arg2)
{
- tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2);
+ if (TCGV_EQUAL_I32(arg1, arg2)) {
+ tcg_gen_mov_i32(ret, arg1);
+ } else {
+ tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2);
+ }
}
static inline void tcg_gen_xor_i32(TCGv_i32 ret, TCGv_i32 arg1,
TCGv_i32 arg2)
The patch is also attached. It is just a revert of tcg_gen_or_i32. I'll
investigate some more why the optimizer fails here.
Cheers,
Bastian
[-- Attachment #1.2: Type: text/html, Size: 4098 bytes --]
[-- Attachment #2: 0001-tcg-tcg_gen_or_i32-causing-in-some-cases-tcg_opt_gen.patch --]
[-- Type: text/x-patch, Size: 1059 bytes --]
>From 64c6c9e8a312ae6030794ae1c0fb8e45ce0d77a3 Mon Sep 17 00:00:00 2001
From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Date: Thu, 12 Mar 2015 14:47:29 +0000
Subject: [PATCH] tcg: tcg_gen_or_i32 causing in some cases tcg_opt_gen_mov to
fail
A first try to fix this is to emit the mov in tcg_or_i32.
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
tcg/tcg-op.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 96adf9a..4c8ff70 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -396,7 +396,11 @@ static inline void tcg_gen_and_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
static inline void tcg_gen_or_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
{
- tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2);
+ if (TCGV_EQUAL_I32(arg1, arg2)) {
+ tcg_gen_mov_i32(ret, arg1);
+ } else {
+ tcg_gen_op3_i32(INDEX_op_or_i32, ret, arg1, arg2);
+ }
}
static inline void tcg_gen_xor_i32(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2)
--
2.3.2
next prev parent reply other threads:[~2015-03-12 13:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 8:41 [Qemu-devel] qemu-system-ppc TCG assert with git master Mark Cave-Ayland
2015-03-12 10:30 ` Mark Cave-Ayland
2015-03-12 14:55 ` Bastian Koppelmann [this message]
2015-03-12 23:34 ` Mark Cave-Ayland
2015-03-12 15:41 ` Richard Henderson
2015-03-12 16:51 ` Bastian Koppelmann
2015-03-12 23:38 ` Mark Cave-Ayland
2015-03-13 19:27 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2015-03-12 23:49 Richard Henderson
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=5501A8E9.4030601@mail.uni-paderborn.de \
--to=kbastian@mail.uni-paderborn.de \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
/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).