[PATCH 14/26] target/mips: Fix missing else in gen_goto_tb

Richard Henderson posted 26 patches 4 years, 7 months ago
There is a newer version of this series
[PATCH 14/26] target/mips: Fix missing else in gen_goto_tb
Posted by Richard Henderson 4 years, 7 months ago
Do not emit dead code for the singlestep_enabled case,
after having exited the TB with a debug exception.

Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/mips/tcg/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index d59986b340..99827ee740 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -5030,8 +5030,9 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
         if (ctx->base.singlestep_enabled) {
             save_cpu_state(ctx, 0);
             gen_helper_raise_exception_debug(cpu_env);
+        } else {
+            tcg_gen_lookup_and_goto_ptr();
         }
-        tcg_gen_lookup_and_goto_ptr();
     }
 }
 
-- 
2.25.1


Re: [PATCH 14/26] target/mips: Fix missing else in gen_goto_tb
Posted by Philippe Mathieu-Daudé 4 years, 7 months ago
On 6/21/21 3:34 AM, Richard Henderson wrote:
> Do not emit dead code for the singlestep_enabled case,
> after having exited the TB with a debug exception.
> 
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/mips/tcg/translate.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>