tree-optimization/98117 - fix range set by vectorization on niter IVs
authorRichard Biener <rguenther@suse.de>
Mon, 7 Dec 2020 09:29:07 +0000 (10:29 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 7 Dec 2020 11:05:51 +0000 (12:05 +0100)
commitcdcbef3c3310a14f2994982b44cb1f8e14c77232
treee35a3e2519b0b7e6a17937c430446f92c80ad6b4
parentf8fb01fbb0c3c6b8ec0e5a301651b0824aaf880b
tree-optimization/98117 - fix range set by vectorization on niter IVs

This avoids the degenerate case of a TYPE_MAX_VALUE latch iteration
count value causing wrong range info for the vector IV.  There's
still the case of VF == 1 where if we don't know whether we hit the
above case we cannot emit a range.

2020-12-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98117
* tree-vect-loop-manip.c (vect_gen_vector_loop_niters):
Properly handle degenerate niter when setting the vector
loop IV range.

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