https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89112
--- Comment #4 from acsawdey at gcc dot gnu.org --- Well I can't blame this one on the linker or optimization. The splitting for the case where the branch destination is too far is wrong in <bd>tf_<mode>: static char seq[96]; char *bcs = output_cbranch (operands[3], "$+8", 1, insn); sprintf(seq, "<bd_neg> $+12\;%s;b %%l0", bcs); return seq; This is wrong in both gcc 8 and 9. I'll get this fixed right away. The longer term question is how do I convince gcc to keep the code for a memcmp expansion together? I think this is happening because it thinks some of the code is cold and is throwing it at the end of the function.