diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-01 13:08:53 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-01 13:08:53 +0000 |
commit | 48669653091db6b1a1e1ff6fa5c2acf65fdad761 (patch) | |
tree | 227ede588b4d6d5d96381098725519f26a853909 /gcc/varpool.c | |
parent | a47321b78ae92ae535fb3f3de0c05250c1c03068 (diff) | |
download | gcc-48669653091db6b1a1e1ff6fa5c2acf65fdad761.tar.gz |
* lto-symtab.c (lto_symtab_merge_cgraph_nodes_1): Rename to ...
(lto_symtab_merge_symbols_1): ... this one.
(lto_symtab_merge_cgraph_nodes): Rename to ...
(lto_symtab_merge_symbols): ... this one; simplify.
* cgraph.c (same_body_aliases_done): Rename to ...
(cpp_implicit_aliases_done): ... this one.
(cgraph_create_function_alias): Update.
(cgraph_same_body_alias): Update.
(dump_cgraph_node): Remove alias dumping; simplify
thunk dumping.
(verify_edge_corresponds_to_fndecl): Simplify.
* cgraph.h (symtab_node_base): Add cpp_implicit_alias,
alias_target.
(cgraph_node): Remove same_body_alias.
(varpool_node): Remove alias_of and extra_name_alias.
(same_body_aliases_done): Rename to ..
(cpp_implicit_aliases_done): ... this one.
(symtab_alias_ultimate_target): Add default parameter.
(symtab_resolve_alias): New function.
(fixup_same_cpp_alias_visibility): Declare.
(cgraph_function_node): Add default parameter.
(cgraph_node_asm_name): Likewise.
(cgraph_function_or_thunk_node): Add default parameter; do
not ICE when it is NULL.
(varpool_variable_node): Likewise.
* tree-emutls.c (create_emultls_var): Update.
(ipa_lower_emutls): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Update.
(cgraph_reset_node): Reset alias info.
(cgraph_finalize_function): Update.
(fixup_same_cpp_alias_visibility): Move to symtab.c.
(analyze_function): Simplify.
(cgraph_process_same_body_aliases): Simplify.
(analyze_functions): Fixup same body aliases.
(handle_alias_pairs): Simplify.
(assemble_thunk): Update.
(assemble_thunks_and_aliases): Update.
(output_weakrefs): Rewrite.
* lto-cgraph.c (lto_output_node): Rewrite alias handling.
(lto_output_varpool_node): Likewise.
(compute_ltrans_boundary): Remve assert.
(get_alias_symbol): New functoin.
(input_node): Rewrite alias handling.
(input_varpool_node): Likewise.
* ipa-pure-const.c (propagate_pure_const): Fix formating.
* ipa.c (process_references): Handle weakrefs correctly.
(symtab_remove_unreachable_nodes): Likewise.
* trans-mem.c (get_cg_data): Update.
(ipa_tm_create_version_alias): Update.
(ipa_tm_execute): Update.
* symtab.c (dump_symtab_base): Dump aliases.
(verify_symtab_base): Verify aliases.
(symtab_node_availability): New function.
(symtab_alias_ultimate_target): Simplify.
(fixup_same_cpp_alias_visibility): Move here from cgraphunit.c;
handle all the fixup cases.
(symtab_resolve_alias): New function.
* passes.c (ipa_write_summaries): Handle weakrefs.
* varpool.c (varpool_analyze_node): Simplify.
(assemble_aliases): Update.
(varpool_create_variable_alias): Simplify.
(varpool_extra_name_alias): Simplify.
* lto-streamer.h (lto_symtab_merge_cgraph_nodes): Rename to...
(lto_symtab_merge_symbols): ... this one.
* decl2.c (cp_write_global_declarations): Replace same_body_alias
by symbol.cpp_implicit_alias.
* lto.c (read_cgraph_and_symbols): Simplify dumping; Replace
lto_symtab_merge_cgraph_nodes by lto_symtab_merge_symbols.
(do_whole_program_analysis): Update dumping.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r-- | gcc/varpool.c | 52 |
1 files changed, 14 insertions, 38 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c index 1916b76d960..7915a95fb50 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -240,30 +240,9 @@ varpool_analyze_node (struct varpool_node *node) already informed about increased alignment. */ align_variable (decl, 0); } - if (node->symbol.alias && node->alias_of) - { - struct varpool_node *tgt = varpool_node_for_decl (node->alias_of); - struct varpool_node *n; - - for (n = tgt; n && n->symbol.alias; - n = n->symbol.analyzed ? varpool_alias_target (n) : NULL) - if (n == node) - { - error ("variable %q+D part of alias cycle", node->symbol.decl); - node->symbol.alias = false; - continue; - } - if (!vec_safe_length (node->symbol.ref_list.references)) - ipa_record_reference ((symtab_node)node, (symtab_node)tgt, IPA_REF_ALIAS, NULL); - if (node->extra_name_alias) - { - DECL_WEAK (node->symbol.decl) = DECL_WEAK (node->alias_of); - DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (node->alias_of); - DECL_VISIBILITY (node->symbol.decl) = DECL_VISIBILITY (node->alias_of); - fixup_same_cpp_alias_visibility ((symtab_node) node, - (symtab_node) tgt, node->alias_of); - } - } + if (node->symbol.alias) + symtab_resolve_alias + ((symtab_node) node, (symtab_node) varpool_get_node (node->symbol.alias_target)); else if (DECL_INITIAL (decl)) record_references_in_initializer (decl, node->symbol.analyzed); node->symbol.analyzed = true; @@ -281,7 +260,7 @@ assemble_aliases (struct varpool_node *node) { struct varpool_node *alias = ipa_ref_referring_varpool_node (ref); do_assemble_alias (alias->symbol.decl, - DECL_ASSEMBLER_NAME (alias->alias_of)); + DECL_ASSEMBLER_NAME (node->symbol.decl)); assemble_aliases (alias); } } @@ -494,18 +473,7 @@ varpool_create_variable_alias (tree alias, tree decl) alias_node = varpool_node_for_decl (alias); alias_node->symbol.alias = true; alias_node->symbol.definition = true; - alias_node->alias_of = decl; - - /* Extra name alias mechanizm creates aliases really late - via DECL_ASSEMBLER_NAME mechanizm. - This is unfortunate because they are not going through the - standard channels. Ensure they get output. */ - if (cgraph_state >= CGRAPH_STATE_IPA) - { - varpool_analyze_node (alias_node); - if (TREE_PUBLIC (alias)) - alias_node->symbol.externally_visible = true; - } + alias_node->symbol.alias_target = decl; return alias_node; } @@ -522,7 +490,15 @@ varpool_extra_name_alias (tree alias, tree decl) return NULL; #endif alias_node = varpool_create_variable_alias (alias, decl); - alias_node->extra_name_alias = true; + alias_node->symbol.cpp_implicit_alias = true; + + /* Extra name alias mechanizm creates aliases really late + via DECL_ASSEMBLER_NAME mechanizm. + This is unfortunate because they are not going through the + standard channels. Ensure they get output. */ + if (cpp_implicit_aliases_done) + symtab_resolve_alias ((symtab_node)alias_node, + (symtab_node)varpool_node_for_decl (decl)); return alias_node; } |