https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94823
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >In particular when __k is zero we're taking '(2^64 - 1) mod __n', which is not >necessarily __n - 1, the last position in the buffer, right? Yes that is correct except when __k is 0, then __begin will the same values so it does not matter in the end ... std::fill(__begin, __end, _Type(0x8b8b8b8bu)); ..... for (size_t __k = 0; __k < __m; ++__k) { _Type __arg = (__begin[__k % __n] ^ __begin[(__k + __p) % __n] ^ __begin[(__k - 1) % __n]); So when __k == 0, then all three of those loads will be _Type(0x8b8b8b8bu) really; no matter what the values of __n, __p will be. So it does not matter in the end. The rest will be similar. __n can never be 0 because of: if (__begin == __end) return; If __n is a value which is greater than SSIZE_MAX, that would be an undefined case (__begin > __end).