https://gcc.gnu.org/g:10f654cd90ffd58f91bf1ee8a0af762040346ab4

commit r17-1928-g10f654cd90ffd58f91bf1ee8a0af762040346ab4
Author: H.J. Lu <[email protected]>
Date:   Sat Jun 27 05:22:21 2026 +0800

    Replace the min size rtx with GEN_INT (min_size)
    
    commit cbc56384029c9224280b0a1018fb9502797f243d
    Author: H.J. Lu <[email protected]>
    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 <[email protected]>

Diff:
---
 gcc/expr.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/expr.cc b/gcc/expr.cc
index 43931687d63e..469c4d013b4b 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -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;
        }

Reply via email to