diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-vectorizer.c | 18 |
2 files changed, 19 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46bfcc7..6b4ce0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-12-02 Dorit Naishlos <dorit@il.ibm.com> + + PR tree-opt/18716 + * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Properly set + then and else labels. + 2004-12-02 Andreas Schwab <schwab@suse.de> * Makefile.in (WERROR_FLAGS): Renamed from WERROR. 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: */ |