On Wed, 24 Jun 2015, Marek Polacek wrote: > diff --git gcc/c/c-decl.c gcc/c/c-decl.c > index fc1fdf9..ab54db9 100644 > --- gcc/c/c-decl.c > +++ gcc/c/c-decl.c > @@ -2650,9 +2650,8 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, > tree oldtype) > tree_code_size (TREE_CODE (olddecl)) - sizeof (struct > tree_decl_common)); > olddecl->decl_with_vis.symtab_node = snode; > > - if ((DECL_EXTERNAL (olddecl) > - || TREE_PUBLIC (olddecl) > - || TREE_STATIC (olddecl)) > + if ((is_global_var (olddecl) > + || TREE_PUBLIC (olddecl)) > && DECL_SECTION_NAME (newdecl) != NULL) > set_decl_section_name (olddecl, DECL_SECTION_NAME (newdecl)); >
At least this case covers both FUNCTION_DECL and VAR_DECL. If is_global_var is appropriate for functions as well as variables, I think it should be renamed (and have its comment updated to explain what it means for functions). -- Joseph S. Myers jos...@codesourcery.com