https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85899
--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> --- It appears that fallthru edges to the exit block are unusual in that they don't obey the invariant e->dest == e->src->next_bb (i.e. next_bb may be anything). If so, the assert in haifa-sched needs to be relaxed, so I'm going to bootstrap/regtest the following: --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -8082,7 +8082,7 @@ find_fallthru_edge_from (basic_block pred) if (e) { - gcc_assert (e->dest == succ); + gcc_assert (e->dest == succ || e->dest->index == EXIT_BLOCK); return e; } }