OSDN Git Service

new folding rule
[pf3gnuchains/gcc-fork.git] / gcc / lto-streamer-out.c
index d5431ba..f375282 100644 (file)
@@ -518,8 +518,8 @@ pack_ts_type_value_fields (struct bitpack_d *bp, tree expr)
   bp_pack_value (bp, TYPE_STRING_FLAG (expr), 1);
   bp_pack_value (bp, TYPE_NO_FORCE_BLK (expr), 1);
   bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING(expr), 1);
-  if (TREE_CODE (expr) == UNION_TYPE)
-    bp_pack_value (bp, TYPE_TRANSPARENT_UNION (expr), 1);
+  if (TREE_CODE (expr) == UNION_TYPE || TREE_CODE (expr) == RECORD_TYPE)
+    bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1);
   bp_pack_value (bp, TYPE_PACKED (expr), 1);
   bp_pack_value (bp, TYPE_RESTRICT (expr), 1);
   bp_pack_value (bp, TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr), 2);
@@ -1978,6 +1978,8 @@ output_unreferenced_globals (cgraph_node_set set)
 
       if (TREE_CODE (var) == VAR_DECL)
         {
+         struct varpool_node *alias;
+
           /* Output the object in order to output references used in the
              initialization. */
           lto_output_tree (ob, var, true);
@@ -1985,6 +1987,17 @@ output_unreferenced_globals (cgraph_node_set set)
           /* If it is public we also need a reference to the object itself. */
           if (TREE_PUBLIC (var))
             lto_output_tree_ref (ob, var);
+
+         /* Also output any extra_name aliases for this variable.  */
+         for (alias = vnode->extra_name; alias; alias = alias->next)
+           {
+             lto_output_tree (ob, alias->decl, true);
+             output_record_start (ob, LTO_var_decl_alias);
+             lto_output_var_decl_index (ob->decl_state, ob->main_stream,
+                                        alias->decl);
+             lto_output_var_decl_index (ob->decl_state, ob->main_stream,
+                                        var);
+           }
         }
     }