vect: Fix an ICE in vect_loop_versioning [PR95570]
authorFei Yang <felix.yang@huawei.com>
Fri, 12 Jun 2020 10:37:00 +0000 (11:37 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 12 Jun 2020 10:37:00 +0000 (11:37 +0100)
commitd30846a02eb9ea43b61311e74fbf05692ffefba2
treeff2094dc7651fb89194c9657397bd7e474fd1f96
parent135a8ad3a59972ea64b1244b0e221cdded9a6ec6
vect: Fix an ICE in vect_loop_versioning [PR95570]

In the test case for PR95570, the only data reference in the loop is a
gather-statter access.  Scalar evolution analysis for this data reference
failed, so DR_STEP is NULL_TREE.  This leads to the segmentation fault.
We should filter out scatter-gather access in vect_enhance_data_refs_alignment.

2020-06-12  Felix Yang  <felix.yang@huawei.com>

gcc/
PR tree-optimization/95570
* tree-vect-data-refs.c (vect_relevant_for_alignment_p): New function.
(vect_verify_datarefs_alignment): Call it to filter out data references
in the loop whose alignment is irrelevant.
(vect_get_peeling_costs_all_drs): Likewise.
(vect_peeling_supportable): Likewise.
(vect_enhance_data_refs_alignment): Likewise.

gcc/testsuite/

PR tree-optimization/95570
* gcc.dg/vect/pr95570.c: New test.
gcc/testsuite/gcc.dg/vect/pr95570.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c