From: Richard Henderson Date: Sat, 28 Jun 2025 15:57:53 +0000 (-0600) Subject: tcg: Fix constant propagation in tcg_reg_alloc_dup X-Git-Tag: v10.1.0-rc0~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d0fc3f4658937fb81fcc16a89738e83bd8d4795;p=thirdparty%2Fqemu.git tcg: Fix constant propagation in tcg_reg_alloc_dup The scalar constant must be replicated for dup. Cc: qemu-stable@nongnu.org Fixes: bab1671f0fa ("tcg: Manually expand INDEX_op_dup_vec") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3002 Signed-off-by: Richard Henderson --- diff --git a/tcg/tcg.c b/tcg/tcg.c index d714ae2889c..50d40b9cbec 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -5154,7 +5154,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) if (its->val_type == TEMP_VAL_CONST) { /* Propagate constant via movi -> dupi. */ - tcg_target_ulong val = its->val; + tcg_target_ulong val = dup_const(vece, its->val); if (IS_DEAD_ARG(1)) { temp_dead(s, its); }