From patchwork Tue Dec 18 07:21:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 207035 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 DB2FD2C008A for ; Tue, 18 Dec 2012 18:21:48 +1100 (EST) Received: from localhost ([::1]:43019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkrUn-0004E6-6k for incoming@patchwork.ozlabs.org; Tue, 18 Dec 2012 02:21:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkrUg-0004Cv-6Z for qemu-devel@nongnu.org; Tue, 18 Dec 2012 02:21:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkrUf-0004aS-8F for qemu-devel@nongnu.org; Tue, 18 Dec 2012 02:21:38 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:43780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkrUe-0004aK-Vd; Tue, 18 Dec 2012 02:21:37 -0500 Received: by mail-lb0-f176.google.com with SMTP id k6so339933lbo.21 for ; Mon, 17 Dec 2012 23:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=8/ubRNsnjqAIYKbRrNpCfohaDBvuBRBpCfiWcJxTafA=; b=ooS1FsgY3D9FRPbaFK08of5MDCRlDqsqbOdOsFVCvjEK+s3ligrwch8FldmmuQI/AU +gqLH3Zc80DnVOW55DXKc18efN2/LXQtvFkkH8a9BAx7yb1lP2HsYhPAfNBYy73iYKJ1 DBbiJ1QvChsLK31ldNF9iMwRWYAE7Z1Wn5HyeNdEXTLhJKlaiJelUPVtbdIVDfF6RE5C CjGP3tgdTnSPIj61XvogISIhde1oIEsYaMSO4IK1ikzWdW9UqPhQs9kfFmBh4hI3lXjm 7KQpDWkLep9Vb4VCdQSmv/i4SXVnhJ34GPAHE0X45XVCaNlSBFqtmE2BIsffdGF5L9AQ yz0w== X-Received: by 10.152.114.65 with SMTP id je1mr947773lab.33.1355815295501; Mon, 17 Dec 2012 23:21:35 -0800 (PST) Received: from octofox.metropolis ([188.134.19.124]) by mx.google.com with ESMTPS id gr12sm274253lab.3.2012.12.17.23.21.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2012 23:21:34 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 18 Dec 2012 11:21:25 +0400 Message-Id: <1355815285-18550-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.7.7.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.176 Cc: Blue Swirl , Max Filippov , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] target-xtensa: fix search_pc for the last TB opcode 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 Zero out tcg_ctx.gen_opc_instr_start for instructions representing the last guest opcode in the TB. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov --- target-xtensa/translate.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 5d8762c..d109a08 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -3005,7 +3005,13 @@ static void gen_intermediate_code_internal( gen_icount_end(tb, insn_count); *tcg_ctx.gen_opc_ptr = INDEX_op_end; - if (!search_pc) { + if (search_pc) { + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; + lj++; + while (lj <= j) { + tcg_ctx.gen_opc_instr_start[lj++] = 0; + } + } else { tb->size = dc.pc - pc_start; tb->icount = insn_count; }