https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110298
--- Comment #4 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:916add3bf6e46467e4391e358b11ecfbc4daa275 commit r14-1939-g916add3bf6e46467e4391e358b11ecfbc4daa275 Author: Richard Biener <rguent...@suse.de> Date: Mon Jun 19 09:52:45 2023 +0200 tree-optimization/110298 - CFG cleanup and stale nb_iterations When unrolling we eventually kill nb_iterations info since it may refer to removed SSA names. But we do this only after cleaning up the CFG which in turn can end up accessing it. Fixed by swapping the two. PR tree-optimization/110298 * tree-ssa-loop-ivcanon.cc (tree_unroll_loops_completely): Clear number of iterations info before cleaning up the CFG. * gcc.dg/torture/pr110298.c: New testcase.