]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/59523 (r205856 caused internal compiler error: verify_ssa...
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 Dec 2013 21:36:21 +0000 (22:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 17 Dec 2013 21:36:21 +0000 (22:36 +0100)
PR tree-optimization/59523
* tree-vectorizer.c (fold_loop_vectorized_call): Call update_stmt
on updated stmts.

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

From-SVN: r206069

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr59523.c [new file with mode: 0644]
gcc/tree-vectorizer.c

index e7989720c121c710f1e1a34cfe0e35a7bb29c326..58613eef0934bfce479dc0943445346918523f75 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/59523
+       * tree-vectorizer.c (fold_loop_vectorized_call): Call update_stmt
+       on updated stmts.
+
 2013-12-17  Aldy Hernandez  <aldyh@redhat.com>
 
        * ipa-inline.c (gate_ipa_inline): Remove.
index d0b796cb91a18854de9a0e1279a8bf90ad4c890d..29110efb85ba5ba81686451cadbb06d775faab02 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/59523
+       * gcc.dg/pr59523.c: New test.
+
 2013-12-17  Marek Polacek  <polacek@redhat.com>
 
        * c-c++-common/ubsan/overflow-int128.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr59523.c b/gcc/testsuite/gcc.dg/pr59523.c
new file mode 100644 (file)
index 0000000..b523eae
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR tree-optimization/59523 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
+
+int *
+foo (int a, int *b, int *c, int *d)
+{
+  int i, *r = __builtin_alloca (a * sizeof (int));
+  __builtin_memcpy (r, d, a * sizeof (int));
+  for (i = 0; i < 64; i++)
+    c[i] += b[i];
+  for (i = 0; i < a; i++)
+    if (r[i] == 0)
+      r[i] = 1;
+  return r;
+}
index 1c411c4dec65f64372dc69e130f754c760bd03e0..e3e552b81f2cff2706b26aaf2cb622cade286e68 100644 (file)
@@ -369,8 +369,11 @@ fold_loop_vectorized_call (gimple g, tree value)
 
   update_call_from_tree (&gsi, value);
   FOR_EACH_IMM_USE_STMT (use_stmt, iter, lhs)
-    FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
-      SET_USE (use_p, value);
+    {
+      FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+       SET_USE (use_p, value);
+      update_stmt (use_stmt);
+    }
 }
 
 /* Function vectorize_loops.