[Bug c/108296] __builtin_memcpy generating wrong code in some cases
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 5 11:14:06 GMT 2023
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.
More information about the Gcc-bugs
mailing list