diff mbox

[v3,3/3] target-arm: Use TCG temporary leak debugging facilities

Message ID 1299447595-13344-4-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 3849902cd852d7de0783abc41cb0c57949d567fd
Headers show

Commit Message

Peter Maydell March 6, 2011, 9:39 p.m. UTC
Use the new TCG temporary leak debugging facilities to
check that each ARM instruction does not leak temporaries.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff mbox

Patch

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