http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61001
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> --- Please copy your testcase here. -fno-builtin-memcmp is not a hack, it is necessary, even without -flto. Without it, linking is not the only thing that may fail. gcc may look at your implementation, recognize that it is doing the same thing as memcmp, and replace it with a call to memcmp...