aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-symtab.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-06-12 00:41:54 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-06-11 22:41:54 +0000
commit08346abd1968a14666f6a99ae8be09914d9ed088 (patch)
tree686df94f949e2cec6e2a798766deecbc25911199 /gcc/lto-symtab.c
parente1745b439ebf2196d30206e4473a4844f5e06c6d (diff)
downloadgcc-08346abd1968a14666f6a99ae8be09914d9ed088.zip
gcc-08346abd1968a14666f6a99ae8be09914d9ed088.tar.gz
gcc-08346abd1968a14666f6a99ae8be09914d9ed088.tar.bz2
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
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r--gcc/lto-symtab.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 2b41933..5f0b971 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -235,9 +235,6 @@ lto_symtab_symbol_p (symtab_node e)
{
if (!TREE_PUBLIC (e->symbol.decl) && !DECL_EXTERNAL (e->symbol.decl))
return false;
- /* weakrefs are really static variables that are made external by a hack. */
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (e->symbol.decl)))
- return false;
return symtab_real_symbol_p (e);
}
@@ -589,6 +586,7 @@ lto_symtab_merge_symbols (void)
if (!node->symbol.analyzed && node->symbol.alias_target)
{
symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target);
+ gcc_assert (node->symbol.weakref);
if (tgt)
symtab_resolve_alias (node, tgt);
}
@@ -617,11 +615,6 @@ lto_symtab_prevailing_decl (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
return decl;
- /* As an anoying special cases weakrefs are really static variables with
- EXTERNAL flag. */
- if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
- return decl;
-
/* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));