gcc對一些函數如strlen, strcpy等, 建有builtin.
如果指定了優化選項, gcc會使用這些builtin, 而不調用庫函數了.
[copied from info gcc]
`-fno-builtin'
Don't recognize builtin functions that do not begin with
`__builtin_' as prefix. Currently, the functions affected include
`abort', `abs', `alloca', `cos', `exit', `fabs', `ffs', `labs',
`memcmp', `memcpy', `sin', `sqrt', `strcmp', `strcpy', and
`strlen'.
GCC normally generates special code to handle certain builtin
functions more efficiently; for instance, calls to `alloca' may
become single instructions that adjust the stack directly, and
calls to `memcpy' may become inline copy loops. The resulting
code is often both smaller and faster, but since the function
calls no longer appear as such, you cannot set a breakpoint on
those calls, nor can you change the behavior of the functions by
linking with a different library.
The `-ansi' option prevents `alloca' and `ffs' from being builtin
functions, since these functions do not have an ANSI standard
meaning.
阅读(869) | 评论(0) | 转发(0) |