From 2c2c4b295b36fad9ae96b73c84985609f1a36ba8 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 23 Dec 2012 00:27:49 +0100 Subject: 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 --- gcc/ChangeLog | 7 +++++++ gcc/cgraph.h | 6 ------ gcc/lto-streamer-out.c | 24 ++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8bc25ed..d625bb1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-12-22 Jan Hubicka + + 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 PR tree-optimization/55355 diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 28c3497..d783862 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1357,7 +1357,6 @@ static inline bool symtab_real_symbol_p (symtab_node node) { struct cgraph_node *cnode; - struct ipa_ref *ref; if (!is_a (node)) return true; @@ -1366,11 +1365,6 @@ symtab_real_symbol_p (symtab_node node) return false; if (cnode->abstract_and_needed) 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; } #endif /* GCC_CGRAPH_H */ diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 853b155..85c36c6 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -1257,6 +1257,26 @@ write_symbol (struct streamer_tree_cache_d *cache, 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 (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. SET and VSET are cgraph/varpool node sets we are outputting. */ @@ -1285,7 +1305,7 @@ produce_symtab (struct output_block *ob) { 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; write_symbol (cache, &stream, node->symbol.decl, seen, false); } @@ -1294,7 +1314,7 @@ produce_symtab (struct output_block *ob) { 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; write_symbol (cache, &stream, node->symbol.decl, seen, false); } -- cgit v1.1