PR tree-optimization/55110
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Nov 2012 13:34:11 +0000 (13:34 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Nov 2012 13:34:11 +0000 (13:34 +0000)
* tree-vect-loop.c (vectorizable_reduction): Don't assert
that STMT_VINFO_RELATED_STMT of orig_stmt is stmt.

* gcc.dg/pr55110.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193845 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 75da526..23ec9aa 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/55110
+       * tree-vect-loop.c (vectorizable_reduction): Don't assert
+       that STMT_VINFO_RELATED_STMT of orig_stmt is stmt.
+
 2012-11-27  Richard Biener  <rguenther@suse.de>
 
        * gimple-fold.c (fold_stmt_1): Remove unnecessary code.
index ff025c1..1e1448b 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/55110
+       * gcc.dg/pr55110.c: New test.
+
 2012-11-27  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/55331
diff --git a/gcc/testsuite/gcc.dg/pr55110.c b/gcc/testsuite/gcc.dg/pr55110.c
new file mode 100644 (file)
index 0000000..2a031a5
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR tree-optimization/55110 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize" } */
+
+int
+foo (int x)
+{
+  int a, b;
+  for (b = 0; b < 8; b++)
+    for (a = 0; a < 2; a++)
+      x /= 3;
+  return x;
+}
index 04c3760..633d3d1 100644 (file)
@@ -4624,7 +4624,6 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
   if (orig_stmt)
     {
       orig_stmt_info = vinfo_for_stmt (orig_stmt);
-      gcc_assert (STMT_VINFO_RELATED_STMT (orig_stmt_info) == stmt);
       gcc_assert (STMT_VINFO_IN_PATTERN_P (orig_stmt_info));
       gcc_assert (!STMT_VINFO_IN_PATTERN_P (stmt_info));
     }