summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authordorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-20 13:47:28 +0000
committerdorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-20 13:47:28 +0000
commit27d19ab7df481e2d3388b06d4001a0fd8a8371a3 (patch)
tree5d56727878f3d5d78be2d2dd2101cd88470f6ee4 /gcc
parent73a25e762b6f43e7c2fb9614b4a24a0300a2262f (diff)
downloadgcc-27d19ab7df481e2d3388b06d4001a0fd8a8371a3.tar.gz
PR tree-optimization/19951
* tree-vect-analyze.c (vect_analyze_loop_form): Check if loop exit edge is abnormal. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95301 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vect-analyze.c25
2 files changed, 26 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb1a9be39eb..4a059c97108 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 7071199bfa0..fd26c90687e 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -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)