https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107997
--- Comment #19 from GCC 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:00cd34b1046076a3272f8e8e85c97dc8f4d2ea44 commit r16-3666-g00cd34b1046076a3272f8e8e85c97dc8f4d2ea44 Author: Richard Biener <rguent...@suse.de> Date: Mon Sep 8 14:32:38 2025 +0200 tree-optimization/121844 - IVOPTs and asm goto in latch When there's an asm goto in the latch of a loop we may not use IP_END IVs since instantiating those would (need to) split the latch edge which in turn invalidates IP_NORMAL position handling. This is a revision of the PR107997 fix. PR tree-optimization/107997 PR tree-optimization/121844 * tree-ssa-loop-ivopts.cc (allow_ip_end_pos_p): Do not allow IP_END for latches ending with a control stmt. (create_new_iv): Do not split the latch edge, instead assert that's not necessary. * gcc.dg/torture/pr121844.c: New testcase.