re PR tree-optimization/50635 (ICE on valid: segfault in vectorize_loops)
authorIra Rosen <ira.rosen@linaro.org>
Sun, 9 Oct 2011 15:09:00 +0000 (15:09 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Sun, 9 Oct 2011 15:09:00 +0000 (15:09 +0000)
        PR tree-optimization/50635
        * tree-vect-patterns.c (vect_handle_widen_mult_by_const): Add
        DEF_STMT to the list of statements to be replaced by the
        pattern statements.
        (vect_handle_widen_mult_by_const): Don't check TYPE_OUT.

From-SVN: r179724

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr50635.c [new file with mode: 0644]
gcc/tree-vect-patterns.c

index 5fb1c9f4e53c24f9f142cb4ec15fece00cd4564a..925b62577e02f6f8733b9e25b52ff7861fcf2d80 100644 (file)
@@ -1,3 +1,11 @@
+2011-10-09  Ira Rosen  <ira.rosen@linaro.org>
+
+       PR tree-optimization/50635
+       * tree-vect-patterns.c (vect_handle_widen_mult_by_const): Add
+       DEF_STMT to the list of statements to be replaced by the
+       pattern statements.
+       (vect_handle_widen_mult_by_const): Don't check TYPE_OUT.
+
 2011-10-09  Anatoly Sokolov  <aesok@post.ru>
 
        * system.h: Commit forgotten hunk in previous patch.
index c310ab26c61f3d2db814e4b44e5ae0a468350099..67bd0400af216bff5dca662e26351c72157e6d84 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-09  Ira Rosen  <ira.rosen@linaro.org>
+
+       PR tree-optimization/50635
+       * gcc.dg/vect/pr50635.c: New test.
+
 2011-10-09  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/50659
diff --git a/gcc/testsuite/gcc.dg/vect/pr50635.c b/gcc/testsuite/gcc.dg/vect/pr50635.c
new file mode 100644 (file)
index 0000000..6a7ac52
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef signed long int32_t;
+typedef char int8_t;
+
+void f0a(int32_t * result, int32_t * arg1, int8_t * arg2, int32_t temp_3)
+{
+  int idx;
+  for (idx=0;idx<10;idx += 1)
+    {
+      int32_t temp_4;
+      int32_t temp_12;
+
+      temp_4 = (-2 & arg2[idx]) + temp_3;
+      temp_12 = -2 * arg2[idx] + temp_4;
+      result[idx] = temp_12;
+    }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index a47b87b6f1c63a2cf6eeaa610cef807ab6b151ac..44a37b91e387aa39029fea2dbe485ecb0b8a282b 100644 (file)
@@ -388,6 +388,7 @@ vect_handle_widen_mult_by_const (gimple stmt, tree const_oprnd, tree *oprnd,
           || TREE_TYPE (gimple_assign_lhs (new_stmt)) != new_type)
         return false;
 
+      VEC_safe_push (gimple, heap, *stmts, def_stmt);
       *oprnd = gimple_assign_lhs (new_stmt);
     }
   else
@@ -1424,8 +1425,6 @@ vect_pattern_recog_1 (vect_recog_func_ptr vect_recog_func,
     {
       /* No need to check target support (already checked by the pattern
          recognition function).  */
-      if (type_out)
-       gcc_assert (VECTOR_MODE_P (TYPE_MODE (type_out)));
       pattern_vectype = type_out ? type_out : type_in;
     }
   else