re PR tree-optimization/89440 (ICE in vect_create_epilog_for_reduction, at tree-vect...
authorRichard Biener <rguenther@suse.de>
Fri, 22 Feb 2019 10:52:49 +0000 (10:52 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 22 Feb 2019 10:52:49 +0000 (10:52 +0000)
2019-02-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/89440
* tree-vect-loop.c (vect_create_epilog_for_reduction): Remove
not necessary assert.

* gcc.dg/vect/pr89440.c: New testcase.

From-SVN: r269111

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

index f14cbbce4775151a1d1e490e3c73ab1c45468498..b2b413c7536112a7a23205e459612ce7e1663d58 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-22  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/89440
+       * tree-vect-loop.c (vect_create_epilog_for_reduction): Remove
+       not necessary assert.
+
 2019-02-22  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR fortran/72741
index 709e1b1ee04a917df32d36d15fd13e6622d5476e..1dd1d4b065e9baf5537cb57d50dd951c381bc421 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-22  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/89440
+       * gcc.dg/vect/pr89440.c: New testcase.
+
 2019-02-22  Thomas Schwinge  <thomas@codesourcery.com>
 
        * lib/target-supports.exp (check_effective_target_offload_nvptx):
diff --git a/gcc/testsuite/gcc.dg/vect/pr89440.c b/gcc/testsuite/gcc.dg/vect/pr89440.c
new file mode 100644 (file)
index 0000000..668f48e
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ffast-math" } */
+
+#include "tree-vect.h"
+
+float __attribute__((noinline,noclone))
+f (float x)
+{
+  int i;
+  float j;
+  float a = 0;
+  for (i = 0; i < 4; ++i)
+    {
+      for (j = 0; j < 4; ++j)
+       {
+         a += 1;
+         x += a;
+       }
+    }
+  return x;
+}
+
+int
+main()
+{
+  check_vect ();
+  if (f (1.0f) != 137.0f)
+    abort ();
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" { target vect_float } } } */
index d63d3825f2018c885405440e07c4e9fcd9daea82..e088b6f79e8f6645ae8a524e9f844549ccfabd01 100644 (file)
@@ -5494,13 +5494,6 @@ vect_finalize_reduction:
                = loop_vinfo->lookup_stmt (exit_phi);
               gphi *vect_phi;
 
-              /* FORNOW. Currently not supporting the case that an inner-loop
-                 reduction is not used in the outer-loop (but only outside the
-                 outer-loop), unless it is double reduction.  */
-              gcc_assert ((STMT_VINFO_RELEVANT_P (exit_phi_vinfo)
-                           && !STMT_VINFO_LIVE_P (exit_phi_vinfo))
-                          || double_reduc);
-
              if (double_reduc)
                STMT_VINFO_VEC_STMT (exit_phi_vinfo) = inner_phi;
              else