https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94969
--- Comment #8 from bin cheng <amker at gcc dot gnu.org> --- Root cause is in build_classic_dist_vector -> constant_access_functions which adds unit distance vector only in case of constant access function. It should cover invariant cases. Testing a patch. Thanks