https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102942
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- This has been discussed before but I can't find the bug report now. The non-elided memcpy happens for trivially copyable types, and GCC doesn't try to elide those.