When __builtin_memcpy is replaced with libc's memcpy
问题 There is a version of C99/posix memcpy function in GCC: __builtin_memcpy . Sometimes it can be replaced by GCC to inline version of memcpy and in other cases it is replaced by call to libc's memcpy. E.g. it was noted here: Finally, on a compiler note, __builtin_memcpy can fall back to emitting a memcpy function call. What is the logic in this selection? Is it logic the same in other gcc-compatible compilers, like clang/llvm, intel c++ compiler, PCC, suncc (oracle studio)? When I should prefer