https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118569
--- Comment #3 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:1d25e357c047f48cee50df318e965a0fbf84e2fe commit r15-7098-g1d25e357c047f48cee50df318e965a0fbf84e2fe Author: Richard Biener <rguent...@suse.de> Date: Tue Jan 21 09:45:41 2025 +0100 tree-optimization/118569 - LC SSA broken after unrolling The following amends the previous fix to mark all of the loop BBs as need to be scanned for new LC PHI uses when its nesting parents changed, noticing one caller of fix_loop_placement was already doing that. So the following moves this code into fix_loop_placement, covering both callers now. PR tree-optimization/118569 * cfgloopmanip.cc (fix_loop_placement): When the loops nesting parents changed, mark all blocks to be scanned for LC PHI uses. (fix_bb_placements): Remove code moved into fix_loop_placement. * gcc.dg/torture/pr118569.c: New testcase.