From patchwork Sat Nov 24 10:58:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 201455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4425A2C008C for ; Sat, 24 Nov 2012 21:58:51 +1100 (EST) Received: from localhost ([::1]:44491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcDRg-00065e-W7 for incoming@patchwork.ozlabs.org; Sat, 24 Nov 2012 05:58:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcDRY-00064h-Ug for qemu-devel@nongnu.org; Sat, 24 Nov 2012 05:58:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcDRX-0000by-91 for qemu-devel@nongnu.org; Sat, 24 Nov 2012 05:58:40 -0500 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:48065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcDRX-0000bb-1g for qemu-devel@nongnu.org; Sat, 24 Nov 2012 05:58:39 -0500 Received: from 37-8-182-3.coucou-networks.fr ([37.8.182.3] helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TcDRM-0004ke-VZ; Sat, 24 Nov 2012 11:58:29 +0100 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TcDRF-0004sd-EZ; Sat, 24 Nov 2012 11:58:21 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 24 Nov 2012 11:58:14 +0100 Message-Id: <1353754694-18712-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:470:1f15:c4f::1 Cc: Max Filippov , Aurelien Jarno Subject: [Qemu-devel] [PATCH] tcg: mark local temps as MEM in dead_temp() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In dead_temp, local temps should always be marked as back to memory, even if they have not been allocated (i.e. they are discared before cross a basic block). It fixes the following assertion in target-xtensa: qemu-system-xtensa: tcg/tcg.c:1665: temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed. Aborted Reported-by: Max Filippov Signed-off-by: Aurelien Jarno Tested-by: Max Filippov --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 4f75696..cb193f2 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1615,7 +1615,7 @@ static inline void temp_dead(TCGContext *s, int temp) if (ts->val_type == TEMP_VAL_REG) { s->reg_to_temp[ts->reg] = -1; } - if (temp < s->nb_globals || (ts->temp_local && ts->mem_allocated)) { + if (temp < s->nb_globals || ts->temp_local) { ts->val_type = TEMP_VAL_MEM; } else { ts->val_type = TEMP_VAL_DEAD;