[LLVMdev] Prevent clang from replacing code with library calls

Jim Grosbach grosbach at apple.com
Thu Aug 7 14:49:42 PDT 2014


> On Aug 7, 2014, at 4:12 AM, Anton Korobeynikov <anton at korobeynikov.info> wrote:
> 
>> I downloaded the latest NDK (r10) and compiled with the following cmd:
>> arm-linux-androideabi-clang myMemcpy.c -S -fno-builtin -o0
>> It still produces assembly with a call to "memcpy". Maybe the -fno-builtin
>> is broken also in the latest release.
> It's not broken. Even freestanding implementation is supposed to
> provide mem* functions.
> 

It’s also supposed to be possible to write a memcpy() implementation in C without the compiler’s idiom recognizer just transforming it into a call to the system memcpy(). -fno-builtin is supposed to be how to do that, right?

-jim



More information about the llvm-dev mailing list