https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78384
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Any progress with this? Briefly looking at the testcase, it seems patch_loop_exit assumes that single_exit (loop)->src == single_pred_edge (loop->latch)->src, but doesn't actually verify it in the caller. So either the caller should verify it and punt if that is not the case, or it should allow also some bbs in between single_exit (loop)->src and loop->latch. On the testcase from this PR there is an extra empty block, single_exit (loop)->src has one edge to that (the other is loop exit) and that empty block has just a single pred and single succ (loop->latch). One could also just set stay to the other edge from single_exit (loop)->src (look through both edges and pick one that is not equal to exit). The question is if it won't try to split loops that shouldn't be split that way.