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

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

https://gcc.gnu.org/g:6c21617221f2b8241ba228b2cce16a741008a05a

commit r16-9669-g6c21617221f2b8241ba228b2cce16a741008a05a
Author: Richard Biener <[email protected]>
Date:   Tue Sep 1 15:09:42 2026 +0200

    tree-optimization/127130 - avoid peeled CHREC with UB

    The following properly guards the peeled CHREC optimization
    when we are analyzing a CHREC with non-wrapping overflow.
    Otherwise we can introduce UB which can manifest via
    infer_loop_bounds_from_signedness and thus wrong niter analysis.

    This regresses gcc.dg/gomp/static-chunk-size-one.c because we
    can no longer replace a signed IV via a peeled chrec and lack
    other means.

            PR tree-optimization/127130
            * tree-scalar-evolution.cc (simplify_peeled_chrec):
            Guard against signed integer overflow UB.

            * gcc.dg/torture/pr127130-1.c: New testcase.
            * gcc.dg/torture/pr127130-2.c: Likewise.
            * gcc.dg/gomp/static-chunk-size-one.c: Adjust.

    (cherry picked from commit 7686bcbb2b7b08688008a6a0e29e6561af1a9a98)

Reply via email to