https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61422
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Comment on attachment 32896 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32896 Proposed patch Can't reproduce it, are you sure you don't have extra patches in the tree (stringops currently don't use the the real_size_in_bytes != size_in_bytes accesses). The fix is good, except for the bogus whitespace after [ and incorrect testcase (you should be really using "+m" instead of "=m", otherwise the compiler could optimize away the stores of 1 or 3. Also, please don't add * sizeof (char) there, that is * 1 by definition. And please use __builtin_memcpy instead of unprototyped memcpy. And copying around uninitialized bytes probably isn't a good idea either, so you should first memset it or fill in or something.