Commit ca0f62a8 by Jan Hubicka Committed by Jan Hubicka

cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about decl has when in streaming stage.


	* 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.

From-SVN: r200018
parent 5c3decfd
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
......
......@@ -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
......
......@@ -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. */
......
......@@ -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);
}
}
}
}
......
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.
......
......@@ -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);
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment