https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85720
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to Mathias Stearn from comment #2) > Hmm. Taking the example from the -ftree-loop-distribute-patterns > documentation, it still seems to generate poor code, this time at both -O2 > and -O3: https://godbolt.org/g/EsQDj8 > > Why isn't that transformed to memset(A, 0, N); memset(B, 1, N); ? This feels > similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85721. Should I make > a new ticket with this example? Again, you are ignoring aliasing issues (just like in your other PR the function copy isn't equivalent to memmove). Does adding __restrict change the result? Also, B[i]=B[i]+1 doesn't look like a memset...