Skip to contentSkip to conversation

target/xtensa: add missing tcg_temp_free to gen_window_check

PATCH In review Max Filippov 2 participants 2 messages Apr 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: add missing tcg_temp_free to gen_window_check

pc and w are allocated with tcg_const_i32 but not freed in gen_window_check. Add missing tcg_temp_free for pc, use tcg_constant_i32 for w.

Fixes 2db59a76c421 ("target-xtensa: record available window in TB flags")
---
 target/xtensa/translate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
target/xtensa/translate.c +2 -1
index b1491ed625e5..f4dac27507fd 100644
@@ -572,9 +572,10 @@ static bool gen_window_check(DisasContext *dc, uint32_t mask)
 
     if (r / 4 > dc->window) {
         TCGv_i32 pc = tcg_const_i32(dc->pc);
-        TCGv_i32 w = tcg_const_i32(r / 4);
+        TCGv_i32 w = tcg_constant_i32(r / 4);
 
         gen_helper_window_check(cpu_env, pc, w);
+        tcg_temp_free(pc);
         dc->base.is_jmp = DISAS_NORETURN;
         return false;
     }
Signature · 1 line
2.30.2
#1 lore raw
Quoted 15 lines · Max Filippov

pc and w are allocated with tcg_const_i32 but not freed in gen_window_check. Add missing tcg_temp_free for pc, use tcg_constant_i32 for w.

Fixes 2db59a76c421 ("target-xtensa: record available window in TB flags")
---
  target/xtensa/translate.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
target/xtensa/translate.c +0 -0
index b1491ed625e5..f4dac27507fd 100644

target/xtensa/translate.c static bool gen_window_check(DisasContext *dc, uint32_t mask) · line 578

Quoted 8 lines
target/xtensa/translate.c +2 -1
@@ -572,9 +572,10 @@ static bool gen_window_check(DisasContext *dc, uint32_t mask)
 
      if (r / 4 > dc->window) {
          TCGv_i32 pc = tcg_const_i32(dc->pc);
-        TCGv_i32 w = tcg_const_i32(r / 4);
+        TCGv_i32 w = tcg_constant_i32(r / 4);
 
          gen_helper_window_check(cpu_env, pc, w);
+        tcg_temp_free(pc);

Should use tcg_constant_i32 for both of them, and not add the free for pc.

r~