re PR tree-optimization/84452 (ICE in expand_simd_clones at gcc/omp-simd-clone.c...
authorJakub Jelinek <jakub@redhat.com>
Mon, 19 Feb 2018 18:58:13 +0000 (19:58 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 19 Feb 2018 18:58:13 +0000 (19:58 +0100)
PR tree-optimization/84452
* tree-vect-patterns.c (vect_recog_pow_pattern): Don't call
expand_simd_clones if targetm.simd_clone.compute_vecsize_and_simdlen
is NULL.

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

From-SVN: r257819

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

index 209ea145b17e5ba5c6172de9f2ece34560f30378..13ce8f2001c7b5775461d70dbd46919755761db4 100644 (file)
@@ -1,3 +1,10 @@
+2018-02-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/84452
+       * tree-vect-patterns.c (vect_recog_pow_pattern): Don't call
+       expand_simd_clones if targetm.simd_clone.compute_vecsize_and_simdlen
+       is NULL.
+
 2018-02-19  Martin Liska  <mliska@suse.cz>
 
        PR sanitizer/82183
index b84c10f0b1b46a274dc1e7edb37a5c787f8c9e30..5975b23bb880841c746894f71e3899aed4ec6a61 100644 (file)
@@ -1,5 +1,8 @@
 2018-02-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/84452
+       * gcc.dg/pr84452.c: New test.
+
        PR c++/79064
        * g++.dg/template/overload15.C (f): Use 0u - 1ll instead of 0u - 1l.
 
diff --git a/gcc/testsuite/gcc.dg/pr84452.c b/gcc/testsuite/gcc.dg/pr84452.c
new file mode 100644 (file)
index 0000000..6e961cb
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR tree-optimization/84452 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+double pow (double, double) __attribute__((simd));
+double exp (double) __attribute__((simd));
+extern double a[1024], b[1024];
+
+void
+foo (void)
+{
+  for (int i = 0; i < 1024; ++i)
+    a[i] = pow (2.0, b[i]);
+}
index 25a2efb21f8ca062bb0763fdfa7ffcbbfef0ffed..34f69e9843d5fa301f53af167c053eb2f846b8b5 100644 (file)
@@ -1113,7 +1113,8 @@ vect_recog_pow_pattern (vec<gimple *> *stmts, tree *type_in,
              cgraph_node *node = cgraph_node::get_create (exp_decl);
              if (node->simd_clones == NULL)
                {
-                 if (node->definition)
+                 if (targetm.simd_clone.compute_vecsize_and_simdlen == NULL
+                     || node->definition)
                    return NULL;
                  expand_simd_clones (node);
                  if (node->simd_clones == NULL)