tree-optimization/108816 - vect versioning check split confusion
authorRichard Biener <rguenther@suse.de>
Mon, 20 Feb 2023 09:59:15 +0000 (10:59 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 20 Feb 2023 10:55:55 +0000 (11:55 +0100)
commit63471c5008819bbf6ec32a6f4d8701fe57b96fa9
tree259f1b22c3d45829cea1f4913ff4d4340a8ca579
parent7b8916a6fd098546e4e53e53b37a5153664ba17f
tree-optimization/108816 - vect versioning check split confusion

The split of the versioning condition assumes the definition is
in the condition block which is ensured by the versioning code.
But that only works when we actually have to insert any statements
for the versioning condition.  The following adjusts the guard
accordingly and asserts this condition.

PR tree-optimization/108816
* tree-vect-loop-manip.cc (vect_loop_versioning): Adjust
versioning condition split prerequesite, assert required
invariant.

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