[llvm-commits] [llvm] r56885 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/X86/X86Subtarget.cpp lib/Target/X86/X86Subtarget.h

Dan Gohman gohman at apple.com
Tue Sep 30 14:47:41 PDT 2008


On Sep 30, 2008, at 2:22 PM, Bill Wendling wrote:

> Author: void
> Date: Tue Sep 30 16:22:07 2008
> New Revision: 56885
>
> URL: http://llvm.org/viewvc/llvm-project?rev=56885&view=rev
> Log:
> Add the new `-no-builtin' flag. This flag is meant to mimic the GCC
> `-fno-builtin' flag. Currently, it's used to replace "memset" with  
> "_bzero"
> instead of "__bzero" on Darwin10+. This arguably violates the  
> meaning of this
> flag, but is currently sufficient. The meaning of this flag should  
> become more
> specific over time.

First, -fno-builtin is only intended to apply to user calls. It is not
intended to apply to libcalls that the compiler generates. For example,
specifying -fno-builtin-memcpy does not tell the compiler not to
generate calls to memcpy.

Second, it looks like there is confusion about the leading underscores.
The previous code used "__bzero" on Darwin 10, which is actually
printed as "___bzero" because of Darwin ABI rules. By introducing new
code that uses "_bzero", it will be printed as "__bzero" on Darwin,
which doesn't seem to be what was intended here.

And furthermore, if "bzero" was intended, meaning printing in the
output as "_bzero" on Darwin, that's an even more flagrant abuse of
the -fno-builtin flag.  -fno-builtin doesn't mean that the compiler can
call functions with names in the user namespace not reserved by the C
standard.

Dan




More information about the llvm-commits mailing list