https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67005
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #6) > 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? I did some measurements on a GCC regtest. The edge removal was triggered ~13000 times, but for only ~4000 out of that was "loop_exit_edge_p (bb->loop_father, e)" true -- setting LOOPS_NEED_FIXUP unconditionally would be maybe too expensive thus.