From 08346abd1968a14666f6a99ae8be09914d9ed088 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 12 Jun 2013 00:41:54 +0200 Subject: c-common.c (handle_alias_ifunc_attribute): Do not set DECL_EXTERNAL for weakref variables. * c-family/c-common.c (handle_alias_ifunc_attribute): Do not set DECL_EXTERNAL for weakref variables. * c-family/c-pragma.c (handle_pragma_weak): Make sure aliases are not declared as external. * cgraph.c (cgraph_create_function_alias): Set weakref flag. * cgraph.h (symtab_node_base): Add weakref flag. * cgraphunit.c (cgraph_reset_node): Clear weakref flag. (handle_alias_pairs): Set weakref flag, do not set DECL_EXTERNAL. (output_weakrefs): Use weakref flag. * fold-const.c (simple_operand_p): Handle WEAK. * gimple-fold.c (can_refer_decl_in_current_unit_p): Drop weakref. * ipa.c (varpool_externally_visible_p): Drop weakref. (function_and_variable_visibility): Update comment; fix weakref sanity checks; do not clear DECL_WEAK on them. * lto-cgraph.c (lto_output_node): update. (lto_output_varpool_node): Update. (input_overwrite_node): Update. (input_node): Update. (input_varpool_node): Update. * lto-symtab.c (lto_symtab_symbol_p): Do not special case weakrefs. (lto_symtab_merge_symbols): Add sanity check. (lto_symtab_prevailing_decl): Do not special case weakrefs. * passes.c (rest_of_decl_compilation): Set static flag, too. * symtab.c (dump_symtab_base): Dump weakref. (verify_symtab_base): Sanity check weakrefs. (symtab_make_decl_local): Remove duplicated code. (symtab_alias_ultimate_target): Simplify. * varpool.c (varpool_create_variable_alias): Set weakref flag. * lto-partition.c (get_symbol_class): Simplify weakref handling. (add_symbol_to_partition_1): Likewise. (contained_in_symbol): Likewise. (lto_balanced_map): Likewise. (rename_statics): Drop weakref. From-SVN: r199971 --- gcc/c-family/ChangeLog | 7 +++++++ gcc/c-family/c-common.c | 8 +------- gcc/c-family/c-pragma.c | 7 ++++++- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'gcc/c-family') diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index aaa1b76..3d8f68f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2013-06-11 Jan Hubicka + + * c-common.c (handle_alias_ifunc_attribute): Do not set + DECL_EXTERNAL for weakref variables. + * c-pragma.c (handle_pragma_weak): Make sure aliases + are not declared as external. + 2013-06-07 Balaji V. Iyer * array-notation-common.c (length_mismatch_in_expr_p): Moved this diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index dec887f..7cb8734 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7576,13 +7576,7 @@ handle_alias_ifunc_attribute (bool is_alias, tree *node, tree name, tree args, if (TREE_CODE (decl) == FUNCTION_DECL) DECL_INITIAL (decl) = error_mark_node; else - { - if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))) - DECL_EXTERNAL (decl) = 1; - else - DECL_EXTERNAL (decl) = 0; - TREE_STATIC (decl) = 1; - } + TREE_STATIC (decl) = 1; if (!is_alias) /* ifuncs are also aliases, so set that attribute too. */ diff --git a/gcc/c-family/c-pragma.c b/gcc/c-family/c-pragma.c index d63cbd2..309859f 100644 --- a/gcc/c-family/c-pragma.c +++ b/gcc/c-family/c-pragma.c @@ -367,7 +367,12 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy)) { apply_pragma_weak (decl, value); if (value) - assemble_alias (decl, value); + { + DECL_EXTERNAL (decl) = 0; + if (TREE_CODE (decl) == VAR_DECL) + TREE_STATIC (decl) = 1; + assemble_alias (decl, value); + } } else { -- cgit v1.1