https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81657
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- No matter what, I don't see how you could use much common infrastructure here. Say if the tailcall pass sees strlen (something) + something being returned, it could turn that into strchr (something, 0), because both functions are standard. We can't do that if we see memcpy (x, y, len) + len, because mempcpy is not a C standard function, while memcpy is, so if the information that mempcpy was originally used is lost, then it is completely lost.