]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cgraph.c (verify_edge_corresponds_to_fndecl): Be lax about decl has when in streaming...
authorJan Hubicka <jh@suse.cz>
Wed, 12 Jun 2013 14:41:12 +0000 (16:41 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 12 Jun 2013 14:41:12 +0000 (14:41 +0000)
* 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

gcc/ChangeLog
gcc/cgraph.c
gcc/cgraph.h
gcc/lto-symtab.c
gcc/lto/ChangeLog
gcc/lto/lto.c
gcc/symtab.c

index 99e8f506ffe93112fbc9c22526832951165300b9..bd2d37b3eaac90b88da179597e5864a3041d4e73 100644 (file)
@@ -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
index 9ebe905c27bf48b8299e62728afe5095994a1805..797d58a00200297ca811ba477dab043dd74d1963 100644 (file)
@@ -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
index 96614272fd391f63a7fde555a112f0577a48652b..62591890182dc82df7fe10a5711fb8ab8d603048 100644 (file)
@@ -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.  */
index a92e14c0dceae6fd6a8f7f93d7916e3e773c5a62..257280cb9703622d6f8446c431698533f64bd6cb 100644 (file)
@@ -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);
+           }
        }
     }
 }
index 216882afd13a75808e0020166763d690161c7116..4b36f440ca42f90f31720338e078e249790a88d8 100644 (file)
@@ -1,3 +1,7 @@
+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.
index a4c5d29e974e634912df73bd3c9d34987dccf4a0..c756c31a19c2d157ef4d0aa836b55a0655ff0a7f 100644 (file)
@@ -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);
index 0ce44a9180db7bfe4274af5009b22d07612380db..c9f32d5635126053fbf6fc4d98049f2ff718da35 100644 (file)
@@ -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)
     {