https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111336
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:44e7e4498c3cdc27e087ab80aa76dac41819702f commit r14-4789-g44e7e4498c3cdc27e087ab80aa76dac41819702f Author: Richard Biener <rguent...@suse.de> Date: Fri Oct 20 14:08:46 2023 +0200 tree-optimization/110243 - IVOPTs introducing undefined overflow The following addresses IVOPTs rewriting expressions in its strip_offset without caring for definedness of overflow. Rather than the earlier attempt of just using the proper split_constant_offset from data-ref analysis the following adjusts IVOPTs helper trying to minimize changes from this fix, possibly easing backports. PR tree-optimization/110243 PR tree-optimization/111336 * tree-ssa-loop-ivopts.cc (strip_offset_1): Rewrite operations with undefined behavior on overflow to unsigned arithmetic. * gcc.dg/torture/pr110243.c: New testcase. * gcc.dg/torture/pr111336.c: Likewise.