From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qogg6-0003ob-JV for qemu-devel@nongnu.org; Wed, 03 Aug 2011 15:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qogg5-0006Uz-77 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 15:00:26 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:33400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qogg5-0006Uu-0Y for qemu-devel@nongnu.org; Wed, 03 Aug 2011 15:00:25 -0400 Message-ID: <4E399AC4.4060906@mail.berlios.de> Date: Wed, 03 Aug 2011 21:00:20 +0200 From: Stefan Weil MIME-Version: 1.0 References: <80797ddb7efb09eef63b444485bd3f5c9fd328b9.1309865252.git.batuzovk@ispras.ru> In-Reply-To: <80797ddb7efb09eef63b444485bd3f5c9fd328b9.1309865252.git.batuzovk@ispras.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 2/6] Add copy and constant propagation. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Batuzov Cc: Blue Swirl , qemu-devel@nongnu.org, zhur@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 > --- > 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