https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79088
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org Version|unknown |7.0 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- So that's exactly the case I was questioning on the ML -- we have a path crossing two loop headers but we only reset the niter info on the outer one. IMHO resetting that on the inner is enough (at least for this testcase). Note that we stop at the first crossed header because of the irredicible check (the thread source is in an irreducible region which contains a loop nest of depth 3). Index: gcc/tree-ssa-threadupdate.c =================================================================== --- gcc/tree-ssa-threadupdate.c (revision 244484) +++ gcc/tree-ssa-threadupdate.c (working copy) @@ -2110,7 +2110,8 @@ mark_threaded_blocks (bitmap threaded_bl != (dest->flags & BB_IRREDUCIBLE_LOOP)); if (crossed_headers > 1) { - vect_free_loop_info_assumptions (dest->loop_father); + vect_free_loop_info_assumptions + ((*path)[path->length () - 1]->e->dest->loop_father); break; } } fixes the testcase. Jeff?