https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123807

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Xi Ruoyao <[email protected]>:

https://gcc.gnu.org/g:e0c46cdf3d12dd0d41d14f56dde890181497bed3

commit r15-10877-ge0c46cdf3d12dd0d41d14f56dde890181497bed3
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.

    Note that the assertion in expand_vector_broadcast is deliberately
    skipped in the backport, in order not to wake up latent "harmless" bugs.

            PR middle-end/124250
            PR target/123807

    gcc/
            * optabs.cc (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.

    (cherry picked from commit 1139fdadc85a0b602a2833e6b7f2cfe2a8a90cdb)

Reply via email to