https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124250
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Xi Ruoyao <[email protected]>: https://gcc.gnu.org/g:1139fdadc85a0b602a2833e6b7f2cfe2a8a90cdb commit r16-7717-g1139fdadc85a0b602a2833e6b7f2cfe2a8a90cdb Author: Xi Ruoyao <[email protected]> Date: Thu Feb 26 11:55:22 2026 +0800 middle-end: extend the narrower shift amount before broadcasting it [PR 124250] The comment above expand_vector_broadcast() states a precondition that the mode of op must be the element mode of vmode. But when expand_binop() called expand_vector_broadcast() to broadcast the shift amount, it only truncated the shift amount if it's too wide, but no action is performed if the shift amount is too narrow. PR middle-end/124250 PR target/123807 gcc/ * optabs.cc (expand_vector_broadcast): Add a checking assert to verify the precondition about the input modes. (expand_binop): Extend the shift amount if it's narrower than the element of the shifted vector. gcc/testsuite/ * gcc.c-torture/compile/pr124250.c: New test.
