From patchwork Sun Mar 6 21:39:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 396 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:17 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs80655qah; Sun, 6 Mar 2011 13:40:02 -0800 (PST) Received: by 10.43.69.197 with SMTP id yd5mr3833541icb.362.1299447601992; Sun, 06 Mar 2011 13:40:01 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id jq2si5291879icb.96.2011.03.06.13.39.58 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2011 13:40:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1PwLgB-0003Tl-7h; Sun, 06 Mar 2011 21:39:55 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH v3 3/3] target-arm: Use TCG temporary leak debugging facilities Date: Sun, 6 Mar 2011 21:39:55 +0000 Message-Id: <1299447595-13344-4-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299447595-13344-1-git-send-email-peter.maydell@linaro.org> References: <1299447595-13344-1-git-send-email-peter.maydell@linaro.org> Use the new TCG temporary leak debugging facilities to check that each ARM instruction does not leak temporaries. Signed-off-by: Peter Maydell --- target-arm/translate.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index c8cbb9c..f9bb573 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -9150,6 +9150,8 @@ static inline void gen_intermediate_code_internal(CPUState *env, gen_icount_start(); + tcg_clear_temp_count(); + /* A note on handling of the condexec (IT) bits: * * We want to avoid the overhead of having to write the updated condexec @@ -9259,6 +9261,11 @@ static inline void gen_intermediate_code_internal(CPUState *env, gen_set_label(dc->condlabel); dc->condjmp = 0; } + + if (tcg_check_temp_count()) { + fprintf(stderr, "TCG temporary leak before %08x\n", dc->pc); + } + /* Translation stops when a conditional branch is encountered. * Otherwise the subsequent code could get translated several times. * Also stop translation when a page boundary is reached. This