Commit 2c2c4b29 by Jan Hubicka Committed by Jan Hubicka

re PR lto/54728 (ICE in input_gimple_stmt, at gimple-streamer-in.c:254)

	PR lto/54728
	* cgraph.h (symtab_real_symbol_p): Drop code looking for external functions.
	* lto-streamer-out.c (output_symbol_p): New function.
	(produce_symtab) Use it.

From-SVN: r194700
parent 4038d0fb
2012-12-22 Jan Hubicka <jh@suse.cz>
PR lto/54728
* cgraph.h (symtab_real_symbol_p): Drop code looking for external functions.
* lto-streamer-out.c (output_symbol_p): New function.
(produce_symtab) Use it.
2012-12-21 Martin Jambor <mjambor@suse.cz> 2012-12-21 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55355 PR tree-optimization/55355
...@@ -1357,7 +1357,6 @@ static inline bool ...@@ -1357,7 +1357,6 @@ static inline bool
symtab_real_symbol_p (symtab_node node) symtab_real_symbol_p (symtab_node node)
{ {
struct cgraph_node *cnode; struct cgraph_node *cnode;
struct ipa_ref *ref;
if (!is_a <cgraph_node> (node)) if (!is_a <cgraph_node> (node))
return true; return true;
...@@ -1366,11 +1365,6 @@ symtab_real_symbol_p (symtab_node node) ...@@ -1366,11 +1365,6 @@ symtab_real_symbol_p (symtab_node node)
return false; return false;
if (cnode->abstract_and_needed) if (cnode->abstract_and_needed)
return false; return false;
/* We keep virtual clones in symtab. */
if (!cnode->analyzed
|| DECL_EXTERNAL (cnode->symbol.decl))
return (cnode->callers
|| ipa_ref_list_referring_iterate (&cnode->symbol.ref_list, 0, ref));
return true; return true;
} }
#endif /* GCC_CGRAPH_H */ #endif /* GCC_CGRAPH_H */
...@@ -1257,6 +1257,26 @@ write_symbol (struct streamer_tree_cache_d *cache, ...@@ -1257,6 +1257,26 @@ write_symbol (struct streamer_tree_cache_d *cache,
lto_output_data_stream (stream, &slot_num, 4); lto_output_data_stream (stream, &slot_num, 4);
} }
/* Return true if NODE should appear in the plugin symbol table. */
bool
output_symbol_p (symtab_node node)
{
struct cgraph_node *cnode;
struct ipa_ref *ref;
if (!symtab_real_symbol_p (node))
return false;
/* We keep external functions in symtab for sake of inlining
and devirtualization. We do not want to see them in symbol table as
references. */
cnode = dyn_cast <cgraph_node> (node);
if (cnode && DECL_EXTERNAL (cnode->symbol.decl))
return (cnode->callers
|| ipa_ref_list_referring_iterate (&cnode->symbol.ref_list, 0, ref));
return true;
}
/* Write an IL symbol table to OB. /* Write an IL symbol table to OB.
SET and VSET are cgraph/varpool node sets we are outputting. */ SET and VSET are cgraph/varpool node sets we are outputting. */
...@@ -1285,7 +1305,7 @@ produce_symtab (struct output_block *ob) ...@@ -1285,7 +1305,7 @@ produce_symtab (struct output_block *ob)
{ {
symtab_node node = lsei_node (lsei); symtab_node node = lsei_node (lsei);
if (!symtab_real_symbol_p (node) || DECL_EXTERNAL (node->symbol.decl)) if (!output_symbol_p (node) || DECL_EXTERNAL (node->symbol.decl))
continue; continue;
write_symbol (cache, &stream, node->symbol.decl, seen, false); write_symbol (cache, &stream, node->symbol.decl, seen, false);
} }
...@@ -1294,7 +1314,7 @@ produce_symtab (struct output_block *ob) ...@@ -1294,7 +1314,7 @@ produce_symtab (struct output_block *ob)
{ {
symtab_node node = lsei_node (lsei); symtab_node node = lsei_node (lsei);
if (!symtab_real_symbol_p (node) || !DECL_EXTERNAL (node->symbol.decl)) if (!output_symbol_p (node) || !DECL_EXTERNAL (node->symbol.decl))
continue; continue;
write_symbol (cache, &stream, node->symbol.decl, seen, false); write_symbol (cache, &stream, node->symbol.decl, seen, false);
} }
......
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