]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tcg: Fix constant propagation in tcg_reg_alloc_dup
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 28 Jun 2025 15:57:53 +0000 (09:57 -0600)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 30 Jun 2025 13:42:56 +0000 (07:42 -0600)
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 <richard.henderson@linaro.org>
tcg/tcg.c

index d714ae2889ccef91bcafa6e8992be45548273f74..50d40b9cbecb044e852d877bea3a40503acbe2a1 100644 (file)
--- 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);
         }