https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111917
--- 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:d96bd4aade170fcd86f5f09b68b770dde798e631 commit r14-4857-gd96bd4aade170fcd86f5f09b68b770dde798e631 Author: Richard Biener <rguent...@suse.de> Date: Mon Oct 23 11:25:17 2023 +0200 tree-optimization/111917 - bougs IL after guard hoisting The unswitching code to hoist guards inserts conditions in wrong places. The following fixes this, simplifying code. PR tree-optimization/111917 * tree-ssa-loop-unswitch.cc (hoist_guard): Always insert new conditional after last stmt. * gcc.dg/torture/pr111917.c: New testcase.