https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119867
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Yichao Yu from comment #5) > Yeah adding explicit bounds check do work but I still don't think the > compiler should be warning about this type of possible out-of-bound access. The problem is more complex since the bounds check that is added for std::array[] allows for the one past the last element (since that is valid for an address). And with that extra information, GCC's vectorizer is getting confused due to that too.