Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1265636
  • 博文数量: 264
  • 博客积分: 10772
  • 博客等级: 上将
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-25 11:54
文章分类

全部博文(264)

文章存档

2012年(4)

2011年(51)

2010年(31)

2009年(57)

2008年(51)

2007年(70)

分类: LINUX

2010-02-09 16:00:46

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.
阅读(903) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~