https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120276
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jennifer Schmitz <jschm...@gcc.gnu.org>: https://gcc.gnu.org/g:2ec5082dd24cef5149ba645ee88a9acd8b4c290a commit r16-727-g2ec5082dd24cef5149ba645ee88a9acd8b4c290a Author: Jennifer Schmitz <jschm...@nvidia.com> Date: Thu May 15 07:16:15 2025 -0700 regcprop: Return from copy_value for unordered modes The ICE in PR120276 resulted from a comparison of VNx4QI and V8QI using partial_subreg_p in the function copy_value during the RTL pass regcprop, failing the assertion in inline bool partial_subreg_p (machine_mode outermode, machine_mode innermode) { /* Modes involved in a subreg must be ordered. In particular, we must always know at compile time whether the subreg is paradoxical. */ poly_int64 outer_prec = GET_MODE_PRECISION (outermode); poly_int64 inner_prec = GET_MODE_PRECISION (innermode); gcc_checking_assert (ordered_p (outer_prec, inner_prec)); return maybe_lt (outer_prec, inner_prec); } Returning from the function if the modes are not ordered before reaching the call to partial_subreg_p resolves the ICE and passes bootstrap and testing without regression. OK for mainline? Signed-off-by: Jennifer Schmitz <jschm...@nvidia.com> gcc/ PR middle-end/120276 * regcprop.cc (copy_value): Return in case of unordered modes. gcc/testsuite/ PR middle-end/120276 * gcc.dg/torture/pr120276.c: New test.