diff options
author | Jan Hubicka <jh@suse.cz> | 2013-06-12 11:12:47 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2013-06-12 09:12:47 +0000 |
commit | bbf9ad070dd1acea0c60aa531a738c8fc8d410d5 (patch) | |
tree | f90b96685d9ff8fb7b5722fdf8b1ff094b9c8b96 /gcc/lto-symtab.c | |
parent | a53f90adbffa2ec9fae2b28c7dd33d1b923b5431 (diff) | |
download | gcc-bbf9ad070dd1acea0c60aa531a738c8fc8d410d5.zip gcc-bbf9ad070dd1acea0c60aa531a738c8fc8d410d5.tar.gz gcc-bbf9ad070dd1acea0c60aa531a738c8fc8d410d5.tar.bz2 |
lto-symtab.c (lto_symtab_merge_symbols): Populate symtab hashtable.
* lto-symtab.c (lto_symtab_merge_symbols): Populate symtab hashtable.
* cgraph.h (varpool_create_empty_node): Declare.
* lto-cgraph.c (input_node, input_varpool_node): Forcingly create
duplicated nodes.
* symtab.c (symtab_unregister_node): Be lax about missin entries
in node hash.
(symtab_get_node): Update comment.
* varpool.c (varpool_create_empty_node): Break out from ...
(varpool_node_for_decl): ... here.
* lto-streamer.h (lto_file_decl_data): Add RESOLUTION_MAP.
* lto.c (register_resolution): Take lto_file_data argument.
(lto_register_var_decl_in_symtab,
lto_register_function_decl_in_symtab): Update.
(read_cgraph_and_symbols): Update resolution_map handling.
From-SVN: r199990
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 5f0b971..a92e14c 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -573,16 +573,21 @@ lto_symtab_merge_symbols (void) { symtab_initialize_asm_name_hash (); - /* Do the actual merging. */ + /* Do the actual merging. + At this point we invalidate hash translating decls into symtab nodes + because after removing one of duplicate decls the hash is not correcly + updated to the ohter dupliate. */ FOR_EACH_SYMBOL (node) if (lto_symtab_symbol_p (node) && node->symbol.next_sharing_asm_name && !node->symbol.previous_sharing_asm_name) lto_symtab_merge_symbols_1 (node); - /* Resolve weakref aliases whose target are now in the compilation unit. */ + /* Resolve weakref aliases whose target are now in the compilation unit. + also re-populate the hash translating decls into symtab nodes*/ FOR_EACH_SYMBOL (node) { + cgraph_node *cnode; if (!node->symbol.analyzed && node->symbol.alias_target) { symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target); @@ -591,6 +596,10 @@ lto_symtab_merge_symbols (void) symtab_resolve_alias (node, tgt); } node->symbol.aux = NULL; + if (!(cnode = dyn_cast <cgraph_node> (node)) + || !cnode->clone_of + || cnode->clone_of->symbol.decl != cnode->symbol.decl) + symtab_insert_node_to_hashtable ((symtab_node)node); } } } |