https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678
--- Comment #63 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Hmm, I've tested the following with 4.9 branch: diff --git a/gcc/ipa.c b/gcc/ipa.c index ebaa82dbfe41..b55b8ccab4ac 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -980,11 +980,6 @@ function_and_variable_visibility (bool whole_program) #endif symtab_dissolve_same_comdat_group_list (node); } - gcc_assert ((!DECL_WEAK (node->decl) - && !DECL_COMDAT (node->decl)) - || TREE_PUBLIC (node->decl) - || node->weakref - || DECL_EXTERNAL (node->decl)); if (cgraph_externally_visible_p (node, whole_program)) { gcc_assert (!node->global.inlined_to); diff --git a/gcc/symtab.c b/gcc/symtab.c index 288821d58ab9..cc2ee0f662b4 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -961,7 +961,6 @@ symtab_make_decl_local (tree decl) if (DECL_ONE_ONLY (decl) || DECL_COMDAT (decl)) { DECL_SECTION_NAME (decl) = 0; - DECL_COMDAT (decl) = 0; } DECL_COMDAT_GROUP (decl) = 0; DECL_WEAK (decl) = 0; and it fixes all issues. I've successfully build pykde4, kdelibs and Firefox.