aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.c
diff options
context:
space:
mode:
authorDorit Naishlos <dorit@il.ibm.com>2004-12-02 14:00:30 +0000
committerDorit Nuzman <dorit@gcc.gnu.org>2004-12-02 14:00:30 +0000
commitbfe5acd6af822f4e8e668fe767b68b6704ea5d2b (patch)
tree9ef3f3215c72833063ba0dc27f3bc61dede69dc1 /gcc/tree-vectorizer.c
parent55dcbc1297c0c6212c99412ca30de1c204964f02 (diff)
downloadgcc-bfe5acd6af822f4e8e668fe767b68b6704ea5d2b.zip
gcc-bfe5acd6af822f4e8e668fe767b68b6704ea5d2b.tar.gz
gcc-bfe5acd6af822f4e8e668fe767b68b6704ea5d2b.tar.bz2
re PR tree-optimization/18716 ([ICE] verify_flow_info failed (loop))
PR tree-opt/18716 * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Properly set then and else labels. From-SVN: r91637
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r--gcc/tree-vectorizer.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 2c7738b..96ae3e2 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -665,6 +665,8 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
tree exit_label = tree_block_label (loop->single_exit->dest);
tree init = build_int_cst (TREE_TYPE (niters), 0);
tree step = build_int_cst (TREE_TYPE (niters), 1);
+ tree then_label;
+ tree else_label;
orig_cond = get_loop_exit_condition (loop);
gcc_assert (orig_cond);
@@ -677,14 +679,20 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
gcc_assert (bsi_stmt (loop_exit_bsi) == orig_cond);
if (exit_edge->flags & EDGE_TRUE_VALUE) /* 'then' edge exits the loop. */
- cond = build2 (GE_EXPR, boolean_type_node, indx_after_incr, niters);
+ {
+ cond = build2 (GE_EXPR, boolean_type_node, indx_after_incr, niters);
+ then_label = build1 (GOTO_EXPR, void_type_node, exit_label);
+ else_label = build1 (GOTO_EXPR, void_type_node, begin_label);
+ }
else /* 'then' edge loops back. */
- cond = build2 (LT_EXPR, boolean_type_node, indx_after_incr, niters);
+ {
+ cond = build2 (LT_EXPR, boolean_type_node, indx_after_incr, niters);
+ then_label = build1 (GOTO_EXPR, void_type_node, begin_label);
+ else_label = build1 (GOTO_EXPR, void_type_node, exit_label);
+ }
- begin_label = build1 (GOTO_EXPR, void_type_node, begin_label);
- exit_label = build1 (GOTO_EXPR, void_type_node, exit_label);
cond_stmt = build3 (COND_EXPR, TREE_TYPE (orig_cond), cond,
- begin_label, exit_label);
+ then_label, else_label);
bsi_insert_before (&loop_exit_bsi, cond_stmt, BSI_SAME_STMT);
/* Remove old loop exit test: */