On 10/3/21 01:30, Philippe Mathieu-Daudé wrote:
> Replace uses of tcg_const_* with the allocate and free close together.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
> ---
>  target/nios2/translate.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)

> @@ -448,9 +445,8 @@ static void rdctl(DisasContext *dc, uint32_t code, 
> uint32_t flags)
>          if (likely(instr.c != R_ZERO)) {
>              tcg_gen_mov_tl(cpu_R[instr.c], cpu_R[instr.imm5 + CR_BASE]);
>  #ifdef DEBUG_MMU
> -            TCGv_i32 tmp = tcg_const_i32(instr.imm5 + CR_BASE);
> -            gen_helper_mmu_read_debug(cpu_R[instr.c], cpu_env, tmp);
> -            tcg_temp_free_i32(tmp);
> +            gen_helper_mmu_read_debug(cpu_R[instr.c], cpu_env,
> +                                      tcg_constant_i32(instr.imm5 + 
> CR_BASE));
>  #endif
>          }

I missed mmu_write() is also read-only, thus can use tcg_constant_*().

Reply via email to