https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63393
--- Comment #3 from Mikael Pettersson <mikpelinux at gmail dot com> --- I don't know if this is supposed to be "fixed" (for all str* and mem* functions one might want to implement oneself), but the standard workaround is to compile with -fno-tree-loop-distribute-patterns. The -ffreestanding does nothing for these annoying transformations.