http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59000
--- Comment #3 from ma.jiang at zte dot com.cn --- (In reply to Richard Biener from comment #2) > This works on trunk, but of course symtab merging is pre-empted here by tree > merging I think. The error can be reproduced on trunk with t1.i ---- > __attribute__((weak)) float scalbnf(float z) { return z; } t2.i ---- > __attribute__((weak)) float scalbnf(float x, int y) { return x*y; } > which would be kind of invalid, of course. Or with t1.i ---- > __attribute__((weak,used)) float scalbnf(float x, int y) { return x*y; } > t2.i ---- __attribute__((weak)) float scalbnf(float x, int y) { return > x*y; } or with any other unrelated and harmless extra attribute on one > decl. This never worked btw. Thanks for the reply.Yes, the problem can be reproduced by any built-in functions when there are two global definitions(of cources,with the same name) in the lto linking process. The tree merging decided to merge the two definitions as there can only be one global definition in a object file.This is right ,but the lto_symtab_merge_cgraph_nodes_1 refuse to do the real merge. Built-in functions which are NOT defined by user have no real bodys in the object file, so they does not need a real merge.I think that is what lto_symtab_merge_cgraph_nodes_1 really want to do.Unfortunately,It make a mistake by using DECL_BUILT_IN rather than DECL_IS_BUILTIN.