tree-optimization/97835 - fix step vector construction for SLP induction
authorRichard Biener <rguenther@suse.de>
Mon, 16 Nov 2020 08:06:41 +0000 (09:06 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 16 Nov 2020 08:33:04 +0000 (09:33 +0100)
commitd12603b746986554981f5ee220926a36a6cb6baf
tree15d11b0beea6361085e43d7020db3d43bddee765
parentaaccdb9cec423ef4de9d541dbe0a95fa3346f430
tree-optimization/97835 - fix step vector construction for SLP induction

We're stripping conversions off access functions of inductions and
thus the step can be of different sign.  Fix bogus step CTORs by
converting the elements rather than the whole vector.

2020-11-16  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97835
* tree-vect-loop.c (vectorizable_induction): Convert step
scalars rather than step vector.

* gcc.dg/vect/pr97835.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr97835.c [new file with mode: 0644]
gcc/tree-vect-loop.c