https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116380
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:ad9e846e25a7907920faecafa1f034526e86d348 commit r13-9315-gad9e846e25a7907920faecafa1f034526e86d348 Author: Richard Biener <[email protected]> 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)
