http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51867
--- Comment #1 from amker.cheng <amker.cheng at gmail dot com> 2012-01-16
10:15:59 UTC ---
The cause is in function expand_builtin, gcc checks following conditions:
----------------------------------------------
/* When not optimizing, generate calls to library functions for a certain
set of builtins. */
if (!optimize
&& !called_as_built_in (fndecl)
&& DECL_ASSEMBLER_NAME_SET_P (fndecl)
&& fcode != BUILT_IN_ALLOCA
&& fcode != BUILT_IN_ALLOCA_WITH_ALIGN
&& fcode != BUILT_IN_FREE)
return expand_call (exp, target, ignore);
The control flow is:
1, DECL_ASSEMBLER_NAME_SET_P (fndecl) is false at the first time when compiling
a;
2, It is then set in following codes when expanding sqrtf call in function a;
3, When compiling function b, gcc checks DECL_ASSEMBLER_NAME_SET_P (fndecl)
again and this time it's true;