The following avoids splitting an edge before redirecting it. This
allows the loop father of the new block to be correct in the first
place.
PR tree-optimization/113385
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
First redirect, then split the exit edge.
{
if (!alt_loop_exit_block)
{
- alt_loop_exit_block = split_edge (exit);
edge res = redirect_edge_and_branch (
- single_succ_edge (alt_loop_exit_block),
+ exit,
new_preheader);
flush_pending_stmts (res);
+ alt_loop_exit_block = split_edge (res);
continue;
}
dest = alt_loop_exit_block;