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/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/symtab.c')
-rw-r--r-- | gcc/symtab.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c index 7a02270..0ce44a9 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -269,7 +269,11 @@ symtab_unregister_node (symtab_node node) node->symbol.previous = NULL; slot = htab_find_slot (symtab_hash, node, NO_INSERT); - if (*slot == node) + + /* During LTO symtab merging we temporarily corrupt decl to symtab node + hash. */ + gcc_assert ((slot && *slot) || in_lto_p); + if (slot && *slot && *slot == node) { symtab_node replacement_node = NULL; if (cgraph_node *cnode = dyn_cast <cgraph_node> (node)) @@ -291,10 +295,14 @@ symtab_get_node (const_tree decl) symtab_node *slot; struct symtab_node_base key; +#ifdef ENABLE_CHECKING + /* Check that we are called for sane type of object - functions + and static or external variables. */ gcc_checking_assert (TREE_CODE (decl) == FUNCTION_DECL || (TREE_CODE (decl) == VAR_DECL && (TREE_STATIC (decl) || DECL_EXTERNAL (decl) || in_lto_p))); +#endif if (!symtab_hash) return NULL; |