http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54709
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-26 13:33:07 UTC --- For non-LTO binds_local_p says no to memcpy, for LTO it says yes. else if (TREE_CODE (exp) == FUNCTION_DECL && TREE_PUBLIC (exp)) { struct cgraph_node *node = cgraph_get_node (exp); if (node && resolution_local_p (node->symbol.resolution)) resolved_locally = true; makes the difference because we have a resolution recorded (resoved_ir) and that makes us skip /* Variables defined outside this object might not be local. */ else if (DECL_EXTERNAL (exp) && !resolved_locally) local_p = false; and fall into /* If defined in this object and visibility is not default, must be local. */ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT) local_p = true; which says "defined in this object" but doesn't check that (well, the resolution is wrong). The resolutions from the linker are just 2 t1.o 1 165 beb4fef7e77e8790 PREVAILING_DEF_IRONLY foo t2.o 1 165 6eae315f149cc09b PREVAILING_DEF_IRONLY bar but lto_symtab_resolve_symbols assigns LDPR_RESOLVED_IR :(