From c4d48f95f9e723f28d4c0f57f7a34b8f1ec98551 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 19 Feb 2018 18:58:13 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257819 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr84452.c | 14 ++++++++++++++ gcc/tree-vect-patterns.c | 3 ++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr84452.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 209ea145b17..13ce8f2001c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-02-19 Jakub Jelinek + + 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 PR sanitizer/82183 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b84c10f0b1b..5975b23bb88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-02-19 Jakub Jelinek + 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 index 00000000000..6e961cb04e8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr84452.c @@ -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]); +} diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 25a2efb21f8..34f69e9843d 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -1113,7 +1113,8 @@ vect_recog_pow_pattern (vec *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) -- 2.11.4.GIT