aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-06-12 16:41:12 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-06-12 14:41:12 +0000
commitca0f62a888b8dab2761501f7b5452ad354e19c00 (patch)
treed78ee153e238e22c85b9ff00c282bd8ba1090418 /gcc
parent5c3decfd177102539ce87838154f30d01e30a41b (diff)
downloadgcc-ca0f62a888b8dab2761501f7b5452ad354e19c00.zip
gcc-ca0f62a888b8dab2761501f7b5452ad354e19c00.tar.gz
gcc-ca0f62a888b8dab2761501f7b5452ad354e19c00.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cgraph.c2
-rw-r--r--gcc/cgraph.h2
-rw-r--r--gcc/lto-symtab.c11
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto.c1
-rw-r--r--gcc/symtab.c11
7 files changed, 32 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 99e8f50..bd2d37b 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 9ebe905..797d58a 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 9661427..6259189 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 a92e14c..257280c 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 216882a..4b36f44 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 a4c5d29..c756c31 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 0ce44a9..c9f32d5 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)
{