https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81657
--- Comment #14 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #11) > 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. I believe there is a way to check whether you've seen a declaration. If that fails you can still know whether a function originally contained mempcpy just like alloca.