]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/ppc: Fix temp usage in gen_op_arith_modw
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 8 Apr 2023 07:05:47 +0000 (00:05 -0700)
committerCédric Le Goater <clg@kaod.org>
Sun, 9 Apr 2023 17:21:27 +0000 (19:21 +0200)
Fix a crash writing to 't3', which is now a constant.
Instead, write the result of the remu to 't0'.

Fixes: 7058ff5231a ("target/ppc: Avoid tcg_const_* in translate.c")
Reported-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
[ clg: amend commit log s/t1/t0/ ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
target/ppc/translate.c

index 9d05357d03eb7055d33eab44c8f5b89d8bd988e2..f603f1a939e168cfb5535e151edc18bb3c34fcc9 100644 (file)
@@ -1807,8 +1807,8 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1,
         TCGv_i32 t2 = tcg_constant_i32(1);
         TCGv_i32 t3 = tcg_constant_i32(0);
         tcg_gen_movcond_i32(TCG_COND_EQ, t1, t1, t3, t2, t1);
-        tcg_gen_remu_i32(t3, t0, t1);
-        tcg_gen_extu_i32_tl(ret, t3);
+        tcg_gen_remu_i32(t0, t0, t1);
+        tcg_gen_extu_i32_tl(ret, t0);
     }
 }