[Bug middle-end/109609] Invalid strncpy/strncat optimization in GCC 12

2023-04-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > Note strcpy arguments cannot be overlapping if the dst overlaps with the > src, then the behavior is undefined. I think you are hitting that undefined > behavior

[Bug middle-end/109609] Invalid strncpy/strncat optimization in GCC 12

2023-04-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109609 --- Comment #1 from Andrew Pinski --- Note strcpy arguments cannot be overlapping if the dst overlaps with the src, then the behavior is undefined. I think you are hitting that undefined behavior here.