diff options
author | Alan Hayward <alan.hayward@arm.com> | 2016-08-01 14:33:23 +0000 |
---|---|---|
committer | Alan Hayward <alahay01@gcc.gnu.org> | 2016-08-01 14:33:23 +0000 |
commit | 2a93954eab0822f95212374d7677b85b659ae4a1 (patch) | |
tree | 0c23f044f302a6722804484bf9304b6a52934064 /gcc/tree-vect-loop-manip.c | |
parent | 9839ff60d0c7756ca9e69de7e644d84643d2d7cd (diff) | |
download | gcc-2a93954eab0822f95212374d7677b85b659ae4a1.zip gcc-2a93954eab0822f95212374d7677b85b659ae4a1.tar.gz gcc-2a93954eab0822f95212374d7677b85b659ae4a1.tar.bz2 |
re PR tree-optimization/71818 (ICE in as_a, at is-a.h:192 w/ -O2 -ftree-vectorize)
2016-08-01 Alan Hayward <alan.hayward@arm.com>
gcc/
PR tree-optimization/71818
* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Don't advance IVs
with non invariant evolutions
testsuite/
PR tree-optimization/71818
* gcc.dg/vect/pr71818.c: New
From-SVN: r238955
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index c1381b3..ec863b4 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see #include "cfgloop.h" #include "tree-scalar-evolution.h" #include "tree-vectorizer.h" +#include "tree-ssa-loop-ivopts.h" /************************************************************************* Simple Loop Peeling Utilities @@ -1592,10 +1593,26 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo) } /* FORNOW: We do not transform initial conditions of IVs + which evolution functions are not invariants in the loop. */ + + if (!expr_invariant_in_loop_p (loop, evolution_part)) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "evolution not invariant in loop.\n"); + return false; + } + + /* FORNOW: We do not transform initial conditions of IVs which evolution functions are a polynomial of degree >= 2. */ if (tree_is_chrec (evolution_part)) - return false; + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "evolution is chrec.\n"); + return false; + } } return true; |