[Bug c/108296] __builtin_memcpy generating wrong code in some cases

2023-01-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296 Richard Biener changed: What|Removed |Added Resolution|DUPLICATE |INVALID --- Comment #5 from Richard Bi

[Bug c/108296] __builtin_memcpy generating wrong code in some cases

2023-01-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
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

[Bug c/108296] __builtin_memcpy generating wrong code in some cases

2023-01-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
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

[Bug c/108296] __builtin_memcpy generating wrong code in some cases

2023-01-05 Thread nyh at math dot technion.ac.il via Gcc-bugs
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

[Bug c/108296] __builtin_memcpy generating wrong code in some cases

2023-01-05 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108296 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|UNCONFIRME