https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115444
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- If the compile wants to vectorize the loop, knowing there are N iterations helps. Using first != last as the condition isn't necessarily just a pointer comparison for arbitrary random access iterators, so the number of iterations might be harder for the compiler to determine. Although it probably is tractable for any case where the loop is going to be vectorizable.