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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <[email protected]>:

https://gcc.gnu.org/g:44c0f794dd4129f279ca9010955095307b981b55

commit r17-5766-g44c0f794dd4129f279ca9010955095307b981b55
Author: Richard Biener <[email protected]>
Date:   Fri Oct 30 15:12:31 2026 +0100

    tree-optimization/128267 - fix IV update of vect_step_op_sh{lr}

    The IV update for the scalar epilog is prone to overflow since
    the validity check is performed in the IVs type.  Perform the
    check with widest_int instead.  Disallow the early-exit case
    which has non-constant skip_niters, but add (LLM generated)
    test coverage to all relevant cases.

    Assisted-By: Claude Opus 5.5

            PR tree-optimization/128267
            * tree-vect-loop.cc (vect_peel_nonlinear_iv_init): For
            vect_step_op_sh{lr} check whether the update shift is >= prec
            using widest_int.
            * tree-vect-loop-manip.cc (vect_can_peel_nonlinear_iv_p): Disallow
            early break for vect_step_op_sh{lr} as well.

            * gcc.dg/vect/vect-pr128267-1.c: New testcase.
            * gcc.dg/vect/vect-pr128267-2.c: Likewise.
            * gcc.dg/vect/vect-early-break_147-pr128267.c: Likewise.
            * gcc.dg/vect/vect-early-break_148-pr128267.c: Likewise.

Reply via email to