https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69466
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- I think the fix is wrong, slpeel_duplicate_current_defs_from_edges assumes from->dest and to->dest are the same (or the same kind of) block. Your patch merely papers over the issue that one of the exits leads to an unexpected forwarder block. Note that the whole slpeel infrastructure is quite fragile and should be ditched - certainly it shouldn't "abuse" set/get_current_def. But well... It seems this bug has been introduced with adding versioning to if-conversion and using the non-if-converted body for scalar iterations. And the "bug" is likely introduced by running a CFG cleanup requring an exit edge split in vect_analyze_loop_form_1. Removing that edge splitting "fixes" this testcase. I'm going to see why we needed that there.