https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112113
--- Comment #6 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:2066c29bf8dea87c9810eb261e342d941a6b2059 commit r14-5446-g2066c29bf8dea87c9810eb261e342d941a6b2059 Author: Richard Biener <rguent...@suse.de> Date: Tue Nov 14 14:26:17 2023 +0100 tree-optimization/111233 - loop splitting miscompile The change in r14-2852-gf5fb9ff2396fd4 failed to update patch_loop_exit to compensate for rewriting of a NE/EQ_EXPR to a new code. Fixed with the following. PR tree-optimization/111233 PR tree-optimization/111652 PR tree-optimization/111727 PR tree-optimization/111838 PR tree-optimization/112113 * tree-ssa-loop-split.cc (patch_loop_exit): Get the new guard code instead of the old guard stmt. (split_loop): Adjust. * gcc.dg/torture/pr111233.c: New testcase. * gcc.dg/torture/pr111652.c: Likewise. * gcc.dg/torture/pr111727.c: Likewise. * gcc.dg/torture/pr111838.c: Likewise. * gcc.dg/torture/pr112113.c: Likewise.