]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/116768 - wrong dependence analysis
authorRichard Biener <rguenther@suse.de>
Thu, 19 Sep 2024 12:58:18 +0000 (14:58 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 13 Oct 2024 09:18:32 +0000 (11:18 +0200)
commit18bc415ae28643d07c3d7116d3cf8484c1a9c1ba
treebf056dd4dd5557997e5dbaa6c6960f529d26e173
parent987a7b58bf2a00936ee2f418ace7c596450a17cb
tree-optimization/116768 - wrong dependence analysis

The following reverts a bogus fix done for PR101009 and instead makes
sure we get into the same_access_functions () case when computing
the distance vector for g[1] and g[1] where the constants ended up
having different types.  The generic code doesn't seem to handle
loop invariant dependences.  The special case gets us both
( 0 ) and ( 1 ) as distance vectors while formerly we got ( 1 ),
which the PR101009 fix changed to ( 0 ) with bad effects on other
cases as shown in this PR.

PR tree-optimization/116768
* tree-data-ref.cc (build_classic_dist_vector_1): Revert
PR101009 change.
* tree-chrec.cc (eq_evolutions_p): Make sure (sizetype)1
and (int)1 compare equal.

* gcc.dg/torture/pr116768.c: New testcase.

(cherry picked from commit 5b5a36b122e1205449f1512bf39521b669e713ef)
gcc/testsuite/gcc.dg/torture/pr116768.c [new file with mode: 0644]
gcc/tree-chrec.cc
gcc/tree-data-ref.cc