https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121846
--- Comment #3 from Robert Seacord <rcseacord at gmail dot com> --- > Dup. > > *** This bug has been marked as a duplicate of bug 112783 *** I don't think this is a duplicate because I'm reporting this as a bug against the compiler optimizer and not the library. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf which was adopted into C2Y eliminates this undefined behavior so that calling memcpy, memmove, memset, memcmp and various other functions with a null pointer argument and length 0 is well-defined. We also put this on the list of papers https://www.open-std.org/jtc1/sc22/wg14/www/previous.html that should be applied to "obsolete versions of C".(In reply to Andrew Pinski from comment #2)
