https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667
--- Comment #73 from Florian Weimer <fw at gcc dot gnu.org> --- (In reply to Patrick J. LoPresti from comment #71) > (In reply to Eric Botcazou from comment #70) > > > > No, there is no bug in GCC, since it effectively does not apply "restrict" > > to the internal calls to memcpy it generates. > > "restrict" is not something you apply to a call; it is something the call > applies to you. If a function declares two argument pointers "restrict" and > you pass in overlapping (or identical) memory regions, you are invoking > undefined behavior. I don't think that's completely accurate. Whether undefined behavior occurs depends on how the called function is implemented because restrict is not defined in terms of overlaps.
