https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
Richard Biener changed:
What|Removed |Added
Resolution|DUPLICATE |INVALID
--- Comment #5 from Richard Bi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
--- Comment #4 from Jakub Jelinek ---
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_memm
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
--- Comment #2 from Nadav Har'El ---
Thanks. Interesting. So __builtin_memcpy() is simply not supposed to work
correctly for overlapping areas? I now realize that according to memcpy(3)
documentation, memcpy() is also not guaranteed to work corr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|UNCONFIRME