Hi,
TYPE_VALUES are currently only used to output warnings on ODR mismatched enums.
I think those warnings are useful and thus we want to stream them to WPA, but
there is no need to stream them further to ltrans units.

Bootstrapped/regtested x86_64-linux, OK?

        * tree-streamer-out.c (write_ts_type_non_common_tree_pointers):
        Do not stream TYPE_VALUES to ltrans units.
        * lto-streamer-out.c (DFS::DFS_write_tree_body): Likewise.
Index: tree-streamer-out.c
===================================================================
--- tree-streamer-out.c (revision 264180)
+++ tree-streamer-out.c (working copy)
@@ -700,7 +700,9 @@ write_ts_type_non_common_tree_pointers (
                                        bool ref_p)
 {
   if (TREE_CODE (expr) == ENUMERAL_TYPE)
-    stream_write_tree (ob, TYPE_VALUES (expr), ref_p);
+    /* At WPA time we do not need to stream type values; those are only needed
+       to output ODR warnings.  */
+    stream_write_tree (ob, flag_wpa ? NULL : TYPE_VALUES (expr), ref_p);
   else if (TREE_CODE (expr) == ARRAY_TYPE)
     stream_write_tree (ob, TYPE_DOMAIN (expr), ref_p);
   else if (RECORD_OR_UNION_TYPE_P (expr))
Index: lto-streamer-out.c
===================================================================
--- lto-streamer-out.c  (revision 264180)
+++ lto-streamer-out.c  (working copy)
@@ -864,7 +992,9 @@ DFS::DFS_write_tree_body (struct output_
 
   if (CODE_CONTAINS_STRUCT (code, TS_TYPE_NON_COMMON))
     {
-      if (TREE_CODE (expr) == ENUMERAL_TYPE)
+      /* At WPA time we do not need to stream type values; those are only 
needed
+         to output ODR warnings.  */
+      if (TREE_CODE (expr) == ENUMERAL_TYPE && !flag_wpa)
        DFS_follow_tree_edge (TYPE_VALUES (expr));
       else if (TREE_CODE (expr) == ARRAY_TYPE)
        DFS_follow_tree_edge (TYPE_DOMAIN (expr));

Reply via email to