This function was not catching all forms of trivial recursion, meaning:
void *memcpy(void *a, const void *b, size_t n) { return __builtin_memcpy(a, b, n); }
would be considered trivially recursive, whereas
void *memcpy(void *a, const void *b, size_t n) { return memcpy(a, b, n); }
would not.