]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Replace the min size rtx with GEN_INT (min_size)
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 26 Jun 2026 21:22:21 +0000 (05:22 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 26 Jun 2026 22:07:56 +0000 (06:07 +0800)
commit cbc56384029c9224280b0a1018fb9502797f243d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jun 26 08:43:20 2026 +0800

    determine_block_size: Set len_rtx to min size if min size == max size

added

+    gcc_assert (min_size != max_size
+           || rtx_equal_p (ops[2].value, ops[6].value));

But the number of operands isn't fixed and may be less than 7.  Replace
the min size rtx with GEN_INT (min_size) to support different numbers of
operands.

PR middle-end/125977
* expr.cc (emit_block_move_via_pattern): Replace ops[6].value
in assert with GEN_INT (min_size).

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
gcc/expr.cc

index 43931687d63e161bfa8f03ec7882d076bbdcbcf2..469c4d013b4b06e8f1a7da1f0a9d0e457c4926cb 100644 (file)
@@ -2321,7 +2321,7 @@ emit_block_move_via_pattern (rtx x, rtx y, rtx size, unsigned int align,
                create_fixed_operand (&ops[8], NULL);
            }
          gcc_assert (min_size != max_size
-                     || rtx_equal_p (ops[2].value, ops[6].value));
+                     || rtx_equal_p (ops[2].value, GEN_INT (min_size)));
          if (maybe_expand_insn (code, nops, ops))
            return true;
        }
@@ -4048,7 +4048,7 @@ set_storage_via_setmem (rtx object, rtx size, rtx val, unsigned int align,
                create_fixed_operand (&ops[8], NULL);
            }
          gcc_assert (min_size != max_size
-                     || rtx_equal_p (ops[1].value, ops[6].value));
+                     || rtx_equal_p (ops[1].value, GEN_INT (min_size)));
          if (maybe_expand_insn (code, nops, ops))
            return true;
        }