https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67005
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Hm, adding || (e2->flags & EDGE_IRREDUCIBLE_LOOP) doesn't work; the E2 edge doesn't have the EDGE_IRREDUCIBLE_LOOP flag, even if I recompute that flag via mark_irreducible_loops. So maybe set LOOPS_NEED_FIXUP every time we remove an edge? FTR, the CFG looks like f () { int a.0_4; int a.0_7; <bb 2>: a.0_4 = a; if (a.0_4 == 0) goto <bb 3> (lbl); else goto <bb 4>; lbl: <bb 4>: a.0_7 = a; if (a.0_7 != 0) goto <bb 5>; else goto <bb 3> (lbl); <bb 5>: a = 8; goto <bb 3> (lbl); } so the 2 -> 4 and 2 -> 3 edges are multiple entries of a loop -- why aren't they EDGE_IRREDUCIBLE_LOOP?