Patchwork [2/2] target-xtensa: don't emit extra tcg_gen_goto_tb

login
register
mail settings
Submitter Max Filippov
Date Sept. 20, 2012, 10:59 p.m.
Message ID <1348181990-23415-3-git-send-email-jcmvbkbc@gmail.com>
Download mbox | patch
Permalink /patch/185521/
State New
Headers show

Comments

Max Filippov - Sept. 20, 2012, 10:59 p.m.
Unconditional gen_check_loop_end at the end of disas_xtensa_insn
can emit tcg_gen_goto_tb with slot id already used in the TB (e.g. when
TB ends at LEND with a branch).

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
---
 target-xtensa/translate.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 7a1c528..b6643eb 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -2520,7 +2520,9 @@  static void disas_xtensa_insn(DisasContext *dc)
         break;
     }
 
-    gen_check_loop_end(dc, 0);
+    if (dc->is_jmp == DISAS_NEXT) {
+        gen_check_loop_end(dc, 0);
+    }
     dc->pc = dc->next_pc;
 
     return;