https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96698
--- Comment #2 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:2130efe6ac7beba72d289e3dd145daa10aeaed54 commit r11-2882-g2130efe6ac7beba72d289e3dd145daa10aeaed54 Author: Richard Biener <rguent...@suse.de> Date: Wed Aug 26 15:12:17 2020 +0200 tree-optimization/96698 - fix ICE when vectorizing nested cycles This fixes vectorized PHI latch edge updating and delay it until all of the loop is code generated to deal with the case that the latch def is a PHI in the same block. 2020-08-26 Richard Biener <rguent...@suse.de> PR tree-optimization/96698 * tree-vectorizer.h (loop_vec_info::reduc_latch_defs): New. (loop_vec_info::reduc_latch_slp_defs): Likewise. * tree-vect-stmts.c (vect_transform_stmt): Only record stmts to update PHI latches from, perform the update ... * tree-vect-loop.c (vect_transform_loop): ... here after vectorizing those PHIs. (info_for_reduction): Properly handle non-reduction PHIs. * gcc.dg/vect/pr96698.c: New testcase.