https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103393
--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> --- Note using MOVE_RATIO in gimple-fold but then always emitting just a single stmt and not honoring MOVE_MAX on that is fishy - you seem to be expecting RTL expansion to fix up but that's clearly not happening (for the reasons Jakub is talking about). So one can either teach gimple-fold to emit multiple load/store stmts or go back to MOVE_MAX. Note multiple load/store stmts wasn't done on purpose to not complicate the code and bring in additional cost considerations (size and register pressure). But sure, in principle the whole *_by_pieces machinery could be brought to GIMPLE and we could leave RTL expansion of memcpy/memset and friends to always emit calls or use optabs.