------- Comment #16 from irar at il dot ibm dot com  2007-10-15 10:42 -------
This patch fixes the ICE and doesn't cause regressions in the vectorizer
testsuite:

Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c     (revision 129292)
+++ tree-data-ref.c     (working copy)
@@ -571,11 +571,16 @@ split_constant_offset (tree exp, tree *v
        if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
          {
            tree def_stmt_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
+            tree arr = NULL_TREE;
+
+            if (TREE_CODE (def_stmt_rhs) == ADDR_EXPR)
+              arr = TREE_OPERAND (def_stmt_rhs, 0);

            if (!TREE_SIDE_EFFECTS (def_stmt_rhs)
                && EXPR_P (def_stmt_rhs)
                && !REFERENCE_CLASS_P (def_stmt_rhs)
-               && !get_call_expr_in (def_stmt_rhs))
+               && !get_call_expr_in (def_stmt_rhs)
+                && (!arr || TREE_THIS_NOTRAP (arr)))
              {
                split_constant_offset (def_stmt_rhs, &var0, &off0);
                var0 = fold_convert (type, var0);

This way we avoid arrays with unknown size.

Ira


-- 


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

Reply via email to