https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116768
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:e03339ea6545ea7fbe17f672fde9671b995e54de commit r13-9317-ge03339ea6545ea7fbe17f672fde9671b995e54de Author: Richard Biener <rguent...@suse.de> Date: Thu Sep 19 14:58:18 2024 +0200 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)