------- Comment #10 from dwmw2 at infradead dot org 2006-08-18 11:11 ------- I've hacked around this for now by reverting the patch for PR25795 and doing this instead:
--- gcc/c-decl.c~ 2006-01-19 23:48:07.000000000 +0000 +++ gcc/c-decl.c 2006-08-15 21:43:43.000000000 +0100 @@ -1660,6 +1660,25 @@ merge_decls (tree newdecl, tree olddecl, if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; + if (TREE_CODE (newdecl) == FUNCTION_DECL) + { + struct cgraph_node *n = cgraph_node (newdecl); + if (n->local.externally_visible) + { + struct cgraph_node *o = cgraph_node (olddecl); + o->local.externally_visible = true; + } + } + else if (TREE_CODE (newdecl) == VAR_DECL) + { + struct cgraph_varpool_node *n = cgraph_varpool_node (newdecl); + if (n->externally_visible) + { + struct cgraph_varpool_node *o = cgraph_varpool_node (olddecl); + o->externally_visible = true; + } + } + /* Keep source location of definition rather than declaration and of prototype rather than non-prototype unless that prototype is built-in. */ --- gcc/c-common.c~ 2006-08-18 10:35:10.000000000 +0100 +++ gcc/c-common.c 2006-08-18 10:52:18.000000000 +0100 @@ -4243,7 +4243,7 @@ handle_externally_visible_attribute (tre { tree node = *pnode; - if ((!TREE_STATIC (node) && TREE_CODE (node) != FUNCTION_DECL) + if (0 && (!TREE_STATIC (node) && TREE_CODE (node) != FUNCTION_DECL) || !TREE_PUBLIC (node)) { warning (OPT_Wattributes, -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28744