This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/18716] [ICE] verify_flow_info failed (loop)


------- Additional Comments From dorit at il dot ibm dot com  2004-12-01 18:34 -------
This patch should fix the problem:

Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.42
diff -c -3 -p -r2.42 tree-vectorizer.c
*** tree-vectorizer.c   25 Nov 2004 22:31:09 -0000      2.42
--- tree-vectorizer.c   1 Dec 2004 18:30:50 -0000
*************** slpeel_make_loop_iterate_ntimes (struct
*** 665,670 ****
--- 665,672 ----
    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);
*************** slpeel_make_loop_iterate_ntimes (struct
*** 677,690 ****
    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);
    else /* 'then' edge loops back.  */
!     cond = build2 (LT_EXPR, boolean_type_node, indx_after_incr, niters);

-   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);
    bsi_insert_before (&loop_exit_bsi, cond_stmt, BSI_SAME_STMT);

    /* Remove old loop exit test:  */
--- 679,698 ----
    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);
!       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);
!       then_label = build1 (GOTO_EXPR, void_type_node, begin_label);
!       else_label = build1 (GOTO_EXPR, void_type_node, exit_label);
!     }

    cond_stmt = build3 (COND_EXPR, TREE_TYPE (orig_cond), cond,
!                    then_label, else_label);
    bsi_insert_before (&loop_exit_bsi, cond_stmt, BSI_SAME_STMT);

    /* Remove old loop exit test:  */

I'll submit a patch to mainline shortly.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18716


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]