https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think all of the above snippets have UB, whether using memcpy, __builtin_memcpy or overlapping structure assignment. It is all user error. If you need overlapping copies, always use memmove/__builtin_memmove.