diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-12 14:41:12 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-06-12 14:41:12 +0000 |
commit | da4b8721c7fe54cb8c7abf825f4a63b145a4479e (patch) | |
tree | d78ee153e238e22c85b9ff00c282bd8ba1090418 | |
parent | b5967443486ef802f2846ffa2baa0835a1bcf063 (diff) | |
download | gcc-da4b8721c7fe54cb8c7abf825f4a63b145a4479e.tar.gz |
* cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about
decl has when in streaming stage.
* lto-symtab.c (lto_symtab_merge_symbols): Likewise.
* cgraph.h (cgraph_state): Add CGRAPH_LTO_STREAMING.
* lto.c (read_cgraph_and_symbols): Set cgraph into streaming state.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200018 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cgraph.c | 2 | ||||
-rw-r--r-- | gcc/cgraph.h | 2 | ||||
-rw-r--r-- | gcc/lto-symtab.c | 11 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/lto/lto.c | 1 | ||||
-rw-r--r-- | gcc/symtab.c | 11 |
7 files changed, 32 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 99e8f506ffe..bd2d37b3eaa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-06-12 Jan Hubicka <jh@suse.cz> + + * cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about + decl has when in streaming stage. + * lto-symtab.c (lto_symtab_merge_symbols): Likewise. + * cgraph.h (cgraph_state): Add CGRAPH_LTO_STREAMING. + 2013-06-12 Roland Stigge <stigge@antcom.de> PR target/57578 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 9ebe905c27b..797d58a0020 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2291,6 +2291,8 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl) if (!decl || e->callee->global.inlined_to) return false; + if (cgraph_state == CGRAPH_LTO_STREAMING) + return false; node = cgraph_get_node (decl); /* We do not know if a node from a different partition is an alias or what it diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 96614272fd3..62591890182 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -551,6 +551,8 @@ enum cgraph_state CGRAPH_STATE_PARSING, /* Callgraph is being constructed. It is safe to add new functions. */ CGRAPH_STATE_CONSTRUCTION, + /* Callgraph is being at LTO time. */ + CGRAPH_LTO_STREAMING, /* Callgraph is built and IPA passes are being run. */ CGRAPH_STATE_IPA, /* Callgraph is built and all functions are transformed to SSA form. */ diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index a92e14c0dce..257280cb970 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -587,7 +587,7 @@ lto_symtab_merge_symbols (void) also re-populate the hash translating decls into symtab nodes*/ FOR_EACH_SYMBOL (node) { - cgraph_node *cnode; + cgraph_node *cnode, *cnode2; if (!node->symbol.analyzed && node->symbol.alias_target) { symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target); @@ -596,10 +596,17 @@ 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); + { + if (cnode && DECL_BUILT_IN (node->symbol.decl) + && (cnode2 = cgraph_get_node (node->symbol.decl)) + && cnode2 != cnode) + lto_cgraph_replace_node (cnode2, cnode); + symtab_insert_node_to_hashtable ((symtab_node)node); + } } } } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 216882afd13..4b36f440ca4 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,5 +1,9 @@ 2013-06-12 Jan Hubicka <jh@suse.cz> + * lto.c (read_cgraph_and_symbols): Set cgraph into streaming state. + +2013-06-12 Jan Hubicka <jh@suse.cz> + * lto.c (register_resolution): Take lto_file_data argument. (lto_register_var_decl_in_symtab, lto_register_function_decl_in_symtab): Update. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index a4c5d29e974..c756c31a19c 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2891,6 +2891,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) /* True, since the plugin splits the archives. */ gcc_assert (num_objects == nfiles); } + cgraph_state = CGRAPH_LTO_STREAMING; tree_with_vars = htab_create_ggc (101, htab_hash_pointer, htab_eq_pointer, NULL); diff --git a/gcc/symtab.c b/gcc/symtab.c index 0ce44a9180d..c9f32d56351 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -647,11 +647,14 @@ verify_symtab_base (symtab_node node) error_found = true; } - hashed_node = symtab_get_node (node->symbol.decl); - if (!hashed_node) + if (cgraph_state != CGRAPH_LTO_STREAMING) { - error ("node not found in symtab decl hashtable"); - error_found = true; + hashed_node = symtab_get_node (node->symbol.decl); + if (!hashed_node) + { + error ("node not found in symtab decl hashtable"); + error_found = true; + } } if (assembler_name_hash) { |