https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116380
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:8f8a7e1f1904e389e736c0265b4f515f3ce13659 commit r14-10682-g8f8a7e1f1904e389e736c0265b4f515f3ce13659 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. (cherry picked from commit af0d2d95a5f767d92bd64f959679fb4612247b0b)