https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122140
David Faust <david.faust at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |david.faust at oracle dot com
--- Comment #2 from David Faust <david.faust at oracle dot com> ---
Yes, looks like two separate issues here.
First, the off-by-one in the backward loop (d'oh!).
Second, looks like the loads are getting optimized out of the forward move loop
when dest and src are based off the same pointer.
with memmove (a+1, a, ..); the first load is present, the rest are deleted
with memmove (a+2, a, ..); the first 2 loads are present
with memmove (a+3, a, ..); the first 3, etc.
The rtl at expand looks fine. And the backward loop does not seem affected
(both before and after the off-by-one fixed).