https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107997
--- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:6c02edca8d41e380d3da60e35faade7663400cc9 commit r15-10355-g6c02edca8d41e380d3da60e35faade7663400cc9 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. (cherry picked from commit 00cd34b1046076a3272f8e8e85c97dc8f4d2ea44)