diff options
author | Richard Biener <rguenther@suse.de> | 2018-11-13 15:07:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-11-13 15:07:53 +0000 |
commit | 41b32876b8a0b8c19b35b768f942bdad1f96f893 (patch) | |
tree | 95a01f415a6fb153248e65e4d99e7d4a42dfff37 | |
parent | 160576e1ac9bbee90af9e09e1507f64d58473358 (diff) | |
download | gcc-41b32876b8a0b8c19b35b768f942bdad1f96f893.zip gcc-41b32876b8a0b8c19b35b768f942bdad1f96f893.tar.gz gcc-41b32876b8a0b8c19b35b768f942bdad1f96f893.tar.bz2 |
re PR tree-optimization/87931 (ICE in vectorizable_reduction, at tree-vect-loop.c:6193 since r265876)
2018-11-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/87931
* tree-vect-loop.c (vect_is_simple_reduction): Restrict
nested cycles we support to latch computations vectorizable_reduction
handles.
* gcc.dg/graphite/pr87931.c: New testcase.
From-SVN: r266075
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/pr87931.c | 22 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 16 |
4 files changed, 50 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0b82b95..f9b23f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-11-13 Richard Biener <rguenther@suse.de> + + PR tree-optimization/87931 + * tree-vect-loop.c (vect_is_simple_reduction): Restrict + nested cycles we support to latch computations vectorizable_reduction + handles. + 2018-11-13 Martin Liska <mliska@suse.cz> PR tree-optimization/87885 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 70d9e76..e61f978 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-13 Richard Biener <rguenther@suse.de> + + PR tree-optimization/87931 + * gcc.dg/graphite/pr87931.c: New testcase. + 2018-11-13 Martin Liska <mliska@suse.cz> PR sanitizer/87930 diff --git a/gcc/testsuite/gcc.dg/graphite/pr87931.c b/gcc/testsuite/gcc.dg/graphite/pr87931.c new file mode 100644 index 0000000..9ef8610 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr87931.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-tree-copy-prop -fgraphite-identity" } */ + +#define N 40 +#define M 128 +float in[N+M]; +float coeff[M]; +float fir_out[N]; + +void fir () +{ + int i,j,k; + float diff; + + for (i = 0; i < N; i++) { + diff = 0; + for (j = 0; j < M; j++) { + diff += in[j+i]*coeff[j]; + } + fir_out[i] = diff; + } +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a6f0b82..1a39b3b 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2976,6 +2976,22 @@ vect_is_simple_reduction (loop_vec_info loop_info, stmt_vec_info phi_info, if (nested_in_vect_loop && !check_reduction) { + /* FIXME: Even for non-reductions code generation is funneled + through vectorizable_reduction for the stmt defining the + PHI latch value. So we have to artificially restrict ourselves + for the supported operations. */ + switch (get_gimple_rhs_class (code)) + { + case GIMPLE_BINARY_RHS: + case GIMPLE_TERNARY_RHS: + break; + default: + /* Not supported by vectorizable_reduction. */ + if (dump_enabled_p ()) + report_vect_op (MSG_MISSED_OPTIMIZATION, def_stmt, + "nested cycle: not handled operation: "); + return NULL; + } if (dump_enabled_p ()) report_vect_op (MSG_NOTE, def_stmt, "detected nested cycle: "); return def_stmt_info; |