http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59003
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I believe the bug is in expand_small_movmem_or_setmem, if GET_MODE_SIZE (mode) < size, then we do size / GET_MODE_SIZE (mode) first stores starting at destmem's address (correct), but then do just a single store starting at destmem's address + count - GET_MODE_SIZE (mode), which is not correct. We should have done again size / GET_MODE_SIZE (mode) stores starting at destmem's address + count - size.