https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116380
--- Comment #5 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:af0d2d95a5f767d92bd64f959679fb4612247b0b commit r15-3069-gaf0d2d95a5f767d92bd64f959679fb4612247b0b Author: Richard Biener <rguent...@suse.de> Date: Wed Aug 21 13:56:40 2024 +0200 tree-optimization/116380 - bogus SSA update with loop distribution When updating LC PHIs after copying loops we have to handle defs defined outside of the loop appropriately (by not setting them to NULL ...). This mimics how we handle this in the SSA updating code of the vectorizer. PR tree-optimization/116380 * tree-loop-distribution.cc (copy_loop_before): Handle out-of-loop defs appropriately. * gcc.dg/torture/pr116380.c: New testcase.