https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #35 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Note, clang makes the same assumption apparently (while MSVC emits rep movs inline and ICC either that, or calls _intel_fast_memcpy). As I mentioned earlier, if glibc and other libraries provide an alias to memcpy or memmove (whichever guarantees that exact overlap will be handled right in the implementation), GCC could start using that instead of memcpy for those cases. And it would be up to the libraries to decide which implementation satisfies that.