https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113734
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- Another bug in the dependence checking code is if (dr_may_alias_p (dr_ref, dr_read, loop_nest)) which will end up using TBAA - dr_may_alias_p doesn't think you are ever going to move stores down across loads. To verify if that's possible you need to use if (dr_may_alias_p (dr_read, dr_ref, loop_nest)) instead. Note there's still my very original review consideration that you move stmts out-of-order but the main dependence checking the vectorizer does assumes the stores and loads appear in their original order. I'm not sure whether with the above we prove this doesn't matter.