https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127130
--- Comment #7 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:7686bcbb2b7b08688008a6a0e29e6561af1a9a98 commit r17-3818-g7686bcbb2b7b08688008a6a0e29e6561af1a9a98 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.
