https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98289
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- --- gcc/shrink-wrap.c.jj 2020-07-28 15:39:09.983756571 +0200 +++ gcc/shrink-wrap.c 2020-12-15 19:15:00.213861334 +0100 @@ -494,7 +494,7 @@ can_get_prologue (basic_block pro, HARD_ edge e; edge_iterator ei; FOR_EACH_EDGE (e, ei, pro->preds) - if (e->flags & (EDGE_COMPLEX | EDGE_CROSSING) + if (e->flags & EDGE_COMPLEX && !dominated_by_p (CDI_DOMINATORS, e->src, pro)) return false; fixes it for me. Not sure I understand why EDGE_CROSSING has been listed there, if pro is in the cold partition and has EDGE_CROSSING edge leading to it, then why can't the prologue be added to the cold partition and the jump redirected to it?