middle-end/101009 - fix distance vector recording
authorRichard Biener <rguenther@suse.de>
Fri, 11 Jun 2021 07:33:58 +0000 (09:33 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 11 Jun 2021 09:26:10 +0000 (11:26 +0200)
commit336c41dbcb21740f8964021e157bc69ca547059b
tree747808fec3a1f79bc69d18860fadef627d0a83f7
parent43c35d0d90214171bd037741d525a0fde73b7755
middle-end/101009 - fix distance vector recording

This fixes recording of distance vectors in case the DDR has just
constant equal indexes.  In that case we expect distance vectors
with zero distances to be recorded which is what was done when
any distance was computed for affine indexes.

2021-06-11  Richard Biener  <rguenther@suse.de>

PR middle-end/101009
* tree-data-ref.c (build_classic_dist_vector_1): Make sure
to set *init_b to true when we encounter a constant equal
index pair.
(compute_affine_dependence): Also dump the actual DR_REF.

* gcc.dg/torture/pr101009.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr101009.c [new file with mode: 0644]
gcc/tree-data-ref.c