qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Kirill Batuzov <batuzovk@ispras.ru>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org, zhur@ispras.ru
Subject: Re: [Qemu-devel] [PATCH v3 2/6] Add copy and constant propagation.
Date: Wed, 03 Aug 2011 21:00:20 +0200	[thread overview]
Message-ID: <4E399AC4.4060906@mail.berlios.de> (raw)
In-Reply-To: <80797ddb7efb09eef63b444485bd3f5c9fd328b9.1309865252.git.batuzovk@ispras.ru>

Am 07.07.2011 14:37, schrieb Kirill Batuzov:
> Make tcg_constant_folding do copy and constant propagation. It is a
> preparational work before actual constant folding.
>
> Signed-off-by: Kirill Batuzov<batuzovk@ispras.ru>
> ---
>   tcg/optimize.c |  182 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>   1 files changed, 180 insertions(+), 2 deletions(-)
>
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index c7c7da9..f8afe71 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
>    
...

This patch breaks QEMU on 32 bit hosts (tested on 386 Linux
and w32 hosts). Simply running qemu (BIOS only) terminates
with abort(). As the error is easy to reproduce, I don't provide
a stack frame here.

> +static void tcg_opt_gen_mov(TCGArg *gen_args, TCGArg dst, TCGArg src,
> +                            int nb_temps, int nb_globals)
> +{
> +        reset_temp(dst, nb_temps, nb_globals);
> +        assert(temps[src].state != TCG_TEMP_COPY);
> +        if (src>= nb_globals) {
> +            assert(temps[src].state != TCG_TEMP_CONST);
> +            if (temps[src].state != TCG_TEMP_HAS_COPY) {
> +                temps[src].state = TCG_TEMP_HAS_COPY;
> +                temps[src].next_copy = src;
> +                temps[src].prev_copy = src;
> +            }
> +            temps[dst].state = TCG_TEMP_COPY;
> +            temps[dst].val = src;
> +            temps[dst].next_copy = temps[src].next_copy;
> +            temps[dst].prev_copy = src;
> +            temps[temps[dst].next_copy].prev_copy = dst;
> +            temps[src].next_copy = dst;
> +        }
> +        gen_args[0] = dst;
> +        gen_args[1] = src;
> +}
>    

QEMU with a modified tcg_opt_gen_mov() (without the if block) works.

Kind regards,
Stefan Weil

  reply	other threads:[~2011-08-03 19:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 12:37 [Qemu-devel] [PATCH v3 0/6] Implement constant folding and copy propagation in TCG Kirill Batuzov
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 1/6] Add TCG optimizations stub Kirill Batuzov
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 2/6] Add copy and constant propagation Kirill Batuzov
2011-08-03 19:00   ` Stefan Weil [this message]
2011-08-03 20:20     ` Blue Swirl
2011-08-03 20:56       ` Stefan Weil
2011-08-03 21:03         ` Stefan Weil
2011-08-04 18:42           ` Blue Swirl
2011-08-04 19:24             ` Blue Swirl
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 3/6] Do constant folding for basic arithmetic operations Kirill Batuzov
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 4/6] Do constant folding for boolean operations Kirill Batuzov
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 5/6] Do constant folding for shift operations Kirill Batuzov
2011-07-30 12:25   ` Blue Swirl
2011-07-30 19:13     ` Blue Swirl
2011-07-07 12:37 ` [Qemu-devel] [PATCH v3 6/6] Do constant folding for unary operations Kirill Batuzov
2011-07-07 12:54 ` [Qemu-devel] [PATCH v3 0/6] Implement constant folding and copy propagation in TCG Peter Maydell
2011-07-07 14:22   ` Kirill Batuzov
2011-07-30 10:52 ` Blue Swirl

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=4E399AC4.4060906@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=batuzovk@ispras.ru \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhur@ispras.ru \
    /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).