https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82885
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- gcc (illegally) generates some calls to memcpy(p,q,n) where p and q may be the same pointer, although they mustn't overlap in any more complicated way. That makes such an optimization problematic (although this memcpy generation seems to happen at expansion time, so doing the optimization earlier might be ok).