re PR tree-optimization/19951 (ICE in tree_split_edge, at tree-cfg.c:3199 with -ftree-vectorize)

PR tree-optimization/19951
        * tree-vect-analyze.c (vect_analyze_loop_form): Check if loop exit edge
        is abnormal.

From-SVN: r95301
This commit is contained in:
Dorit Naishlos 2005-02-20 13:47:28 +00:00 committed by Dorit Nuzman
parent b7d3bbceb7
commit ac59a95936
2 changed files with 26 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2005-02-20 Dorit Naishlos <dorit@il.ibm.com>
PR tree-optimization/19951
* tree-vect-analyze.c (vect_analyze_loop_form): Check if loop exit edge
is abnormal.
2005-02-19 Steven Bosscher <stevenb@suse.de>
PR middle-end/19698

View File

@ -2312,17 +2312,32 @@ vect_analyze_loop_form (struct loop *loop)
}
/* Make sure we have a preheader basic block. */
if (!loop->pre_header)
if (!loop->pre_header || EDGE_COUNT (loop->pre_header->succs) != 1)
{
edge e = loop_preheader_edge (loop);
loop_split_edge_with (e, NULL);
if (vect_print_dump_info (REPORT_DETAILS, loop_loc))
fprintf (vect_dump, "split preheader edge.");
rescan = true;
loop_split_edge_with (loop_preheader_edge (loop), NULL);
}
/* Make sure there exists a single-predecessor exit bb: */
if (EDGE_COUNT (loop->exit_edges[0]->dest->preds) != 1)
if (EDGE_COUNT (loop->single_exit->dest->preds) != 1)
{
rescan = true;
loop_split_edge_with (loop->exit_edges[0], NULL);
edge e = loop->single_exit;
if (!(e->flags & EDGE_ABNORMAL))
{
loop_split_edge_with (e, NULL);
if (vect_print_dump_info (REPORT_DETAILS, loop_loc))
fprintf (vect_dump, "split exit edge.");
rescan = true;
}
else
{
if (vect_print_dump_info (REPORT_BAD_FORM_LOOPS, loop_loc))
fprintf (vect_dump, "not vectorized: abnormal loop exit edge.");
return NULL;
}
}
if (rescan)