lto-streamer-out.c (DFS::DFS_write_tree_body): Stream DECL_EXTERNALs in BLOCKs as...
authorRichard Biener <rguenther@suse.de>
Tue, 19 Aug 2014 07:57:44 +0000 (07:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 19 Aug 2014 07:57:44 +0000 (07:57 +0000)
2014-08-19  Richard Biener  <rguenther@suse.de>

* lto-streamer-out.c (DFS::DFS_write_tree_body): Stream
DECL_EXTERNALs in BLOCKs as non-references.
* tree-streamer-out.c (streamer_write_chain): Likewise.

From-SVN: r214135

gcc/ChangeLog
gcc/lto-streamer-out.c
gcc/tree-streamer-out.c

index d0f260b..dafc0e5 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-19  Richard Biener  <rguenther@suse.de>
+
+       * lto-streamer-out.c (DFS::DFS_write_tree_body): Stream
+       DECL_EXTERNALs in BLOCKs as non-references.
+       * tree-streamer-out.c (streamer_write_chain): Likewise.
+
 2014-08-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
            Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
            Anna Tikhonova  <anna.tikhonova@intel.com>
index 1dc37ef..00a7bad 100644 (file)
@@ -648,9 +648,13 @@ DFS::DFS_write_tree_body (struct output_block *ob,
   if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
     {
       for (tree t = BLOCK_VARS (expr); t; t = TREE_CHAIN (t))
-       /* ???  FIXME.  See also streamer_write_chain.  */
-       if (!(VAR_OR_FUNCTION_DECL_P (t)
-             && DECL_EXTERNAL (t)))
+       if (VAR_OR_FUNCTION_DECL_P (t)
+           && DECL_EXTERNAL (t))
+         /* We have to stream externals in the block chain as
+            non-references.  See also
+            tree-streamer-out.c:streamer_write_chain.  */
+         DFS_write_tree (ob, expr_state, t, ref_p, false, single_p);
+       else
          DFS_follow_tree_edge (t);
 
       DFS_follow_tree_edge (BLOCK_SUPERCONTEXT (expr));
index 52e714e..15ad8f8 100644 (file)
@@ -524,11 +524,11 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p)
       /* We avoid outputting external vars or functions by reference
         to the global decls section as we do not want to have them
         enter decl merging.  This is, of course, only for the call
-        for streaming BLOCK_VARS, but other callers are safe.  */
-      /* ???  FIXME wrt SCC streaming.  Drop these for now.  */
+        for streaming BLOCK_VARS, but other callers are safe.
+        See also lto-streamer-out.c:DFS_write_tree_body.  */
       if (VAR_OR_FUNCTION_DECL_P (t)
          && DECL_EXTERNAL (t))
-       ; /* stream_write_tree_shallow_non_ref (ob, t, ref_p); */
+       stream_write_tree_shallow_non_ref (ob, t, ref_p);
       else
        stream_write_tree (ob, t, ref_p);