Avoid ICE for nested inductions (PR 83914)
commit4ca4c75db56ee3a4fc59afecec7f71f6deae968c
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2018 11:57:34 +0000 (19 11:57 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jan 2018 11:57:34 +0000 (19 11:57 +0000)
treec5cf9e658d84fb886f540d045d804e2242056a67
parent83447a6fa1a4bc33c5c68a8378d14f24390bc272
Avoid ICE for nested inductions (PR 83914)

This testcase ICEd because we converted the initial value of an
induction to the vector element type even for nested inductions.
This isn't necessary because the initial expression is vectorised
normally, and it meant that init_expr was no longer the original
statement operand by the time we called vect_get_vec_def_for_operand.

Also, adding the conversion code here made the existing SLP conversion
redundant.

2018-01-19  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83914
* tree-vect-loop.c (vectorizable_induction): Don't convert
init_expr or apply the peeling adjustment for inductions
that are nested within the vectorized loop.

gcc/testsuite/
PR tree-optimization/83914
* gcc.dg/vect/pr83914.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256884 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr83914.c [new file with mode: 0644]
gcc/tree-vect-loop.c