https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #55 from Florian Weimer <fw at gcc dot gnu.org> --- (In reply to post+gcc from comment #52) > For the point discussed earlier with the `restrict` in the musl memcpy, I > had another look at the definition of `restrict` and it's not entirely clear > to me any more that there is UB here. The restrict rules only apply to > objects that are "also modified (by any means)". Now the question is, does > "*X = *X" modify the object? C11 says this: | NOTE: “Modify” includes the case where the new value being stored is the same as the previous value. So at least this should be quite clear (although I think notes are supposedly informal).