diff options
author | Jan Hubicka <jh@suse.cz> | 2013-08-30 17:41:26 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-08-30 15:41:26 +0000 |
commit | 8a41354f5b0ce051d47ec8465048a1873a62e8e6 (patch) | |
tree | 3b9154fede0868d904d1f675f33c7c0dbcdfd5e6 /gcc/symtab.c | |
parent | a624d5fe08ca0e8bf755a33b4849ff03d511958e (diff) | |
download | gcc-8a41354f5b0ce051d47ec8465048a1873a62e8e6.zip gcc-8a41354f5b0ce051d47ec8465048a1873a62e8e6.tar.gz gcc-8a41354f5b0ce051d47ec8465048a1873a62e8e6.tar.bz2 |
cgraph.c (cgraph_function_body_availability): Handle weakref correctly.
* cgraph.c (cgraph_function_body_availability): Handle weakref
correctly.
* passes.def: Remove pass_fixup_cfg.
* ipa-inline.c (ipa_inline): When not optimizing, do not inline;
track when we need to remove functions.
(gate_ipa_inline): Execute inlining always; add comment why.
(pass_data_ipa_inline): Remove TODO_remove_functions.
* ipa-inline-analysis.c (inline_generate_summary): When not optimizing
do not produce summaries.
* symtab.c (change_decl_assembler_name): Handle renaming of weakrefs.
(symtab_nonoverwritable_alias): Assert we are not called on weakref.
* varpool.c (cgraph_variable_initializer_availability): Fix weakrefs,
constant pool and vtable.
From-SVN: r202111
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r-- | gcc/symtab.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index a86bf6b..bfbc03b 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -390,6 +390,9 @@ change_decl_assembler_name (tree decl, tree name) if (name == DECL_ASSEMBLER_NAME (decl)) return; + tree alias = (IDENTIFIER_TRANSPARENT_ALIAS (DECL_ASSEMBLER_NAME (decl)) + ? TREE_CHAIN (DECL_ASSEMBLER_NAME (decl)) + : NULL); if (node) unlink_from_assembler_name_hash (node, true); if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) @@ -397,6 +400,11 @@ change_decl_assembler_name (tree decl, tree name) warning (0, "%D renamed after being referenced in assembly", decl); SET_DECL_ASSEMBLER_NAME (decl, name); + if (alias) + { + IDENTIFIER_TRANSPARENT_ALIAS (name) = 1; + TREE_CHAIN (DECL_ASSEMBLER_NAME (name)) = alias; + } if (node) insert_to_assembler_name_hash (node, true); } @@ -1065,11 +1073,17 @@ symtab_nonoverwritable_alias (symtab_node node) { tree new_decl; symtab_node new_node = NULL; + + /* First try to look up existing alias or base object + (if that is already non-overwritable). */ + node = symtab_alias_ultimate_target (node, NULL); + gcc_assert (!node->symbol.alias && !node->symbol.weakref); symtab_for_node_and_aliases (node, symtab_nonoverwritable_alias_1, (void *)&new_node, true); if (new_node) return new_node; + /* Otherwise create a new one. */ new_decl = copy_node (node->symbol.decl); DECL_NAME (new_decl) = clone_function_name (node->symbol.decl, "localalias"); if (TREE_CODE (new_decl) == FUNCTION_DECL) |