aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-12-23 00:27:49 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2012-12-22 23:27:49 +0000
commit2c2c4b295b36fad9ae96b73c84985609f1a36ba8 (patch)
tree6b77a3e817d0f1e1f924bfa1c3f34edc9996c080
parent4038d0fb1f156f136ea94f8fa17f91150da9cbbd (diff)
downloadgcc-2c2c4b295b36fad9ae96b73c84985609f1a36ba8.zip
gcc-2c2c4b295b36fad9ae96b73c84985609f1a36ba8.tar.gz
gcc-2c2c4b295b36fad9ae96b73c84985609f1a36ba8.tar.bz2
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cgraph.h6
-rw-r--r--gcc/lto-streamer-out.c24
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 <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>
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 <cgraph_node> (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 <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.
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);
}