tree-streamer.c (streamer_tree_cache_insert_1): Update the index associated with...
authorRichard Biener <rguenther@suse.de>
Wed, 5 Jun 2013 08:21:02 +0000 (08:21 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 5 Jun 2013 08:21:02 +0000 (08:21 +0000)
2013-06-05  Richard Biener  <rguenther@suse.de>

* tree-streamer.c (streamer_tree_cache_insert_1): Update the
index associated with the tree we are supposed to replace.
* tree-streamer-out.c (pack_ts_base_value_fields): Output
TREE_ASM_WRITTEN as zero for everything but SSA names.

lto/
* lto.c (num_merged_types): New global variable.
(uniquify_nodes): Increase num_merged_types when merging a type.
(print_lto_report_1): Output the number of merged types.

From-SVN: r199683

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

index 673102f36e2731d545856f5b45d30e456c37d971..cc304241ec3aa57b8e4ab488712861ed3760a40e 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-05  Richard Biener  <rguenther@suse.de>
+
+       * tree-streamer.c (streamer_tree_cache_insert_1): Update the
+       index associated with the tree we are supposed to replace.
+       * tree-streamer-out.c (pack_ts_base_value_fields): Output
+       TREE_ASM_WRITTEN as zero for everything but SSA names.
+
 2013-06-05  David Malcolm  <dmalcolm@redhat.com>
 
        * tree-ssa-structalias.c (call_stmt_vars): Make static.
index 0a01c1b4f12f897b13f087b7677b5a2295fa56c9..f98c31d725aafd771814f773b06bf2b1c475975e 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-05  Richard Biener  <rguenther@suse.de>
+
+       * lto.c (num_merged_types): New global variable.
+       (uniquify_nodes): Increase num_merged_types when merging a type.
+       (print_lto_report_1): Output the number of merged types.
+
 2013-06-01  Jan Hubicka  <jh@suse.cz>
 
        * lto.c (read_cgraph_and_symbols): Simplify dumping; Replace
index 05867e1ecf9ce4e6876856ec761e0c36b19a1ff4..c90a2d8496eb301a80a4da75d1a46ea78452ce3e 100644 (file)
@@ -1788,6 +1788,7 @@ lto_register_function_decl_in_symtab (struct data_in *data_in, tree decl)
     }
 }
 
+static unsigned long num_merged_types = 0;
 
 /* Given a streamer cache structure DATA_IN (holding a sequence of trees
    for one compilation unit) go over all trees starting at index FROM until the
@@ -1817,7 +1818,10 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
             to reset that flag afterwards - nothing that refers
             to those types is left and they are collected.  */
          if (newt != t)
-           TREE_VISITED (t) = 1;
+           {
+             num_merged_types++;
+             TREE_VISITED (t) = 1;
+           }
        }
     }
 
@@ -3136,6 +3140,7 @@ print_lto_report_1 (void)
             htab_collisions (type_hash_cache));
   else
     fprintf (stderr, "[%s] GIMPLE type hash cache table is empty\n", pfx);
+  fprintf (stderr, "[%s] Merged %lu types\n", pfx, num_merged_types);
 
   print_gimple_types_stats (pfx);
   print_lto_report (pfx);
index 2625dd6b42f7b007c53ae39617ba4dc8f2e2cd8f..39b212e47b3cda311908640d44d4f96fbf0b3e78 100644 (file)
@@ -87,8 +87,9 @@ pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
     bp_pack_value (bp, TYPE_UNSIGNED (expr), 1);
   else
     bp_pack_value (bp, 0, 1);
-  /* We write debug info two times, do not confuse the second one.  */
-  bp_pack_value (bp, ((TYPE_P (expr) || TREE_CODE (expr) == TYPE_DECL)
+  /* We write debug info two times, do not confuse the second one.
+     The only relevant TREE_ASM_WRITTEN use is on SSA names.  */
+  bp_pack_value (bp, (TREE_CODE (expr) != SSA_NAME
                      ? 0 : TREE_ASM_WRITTEN (expr)), 1);
   if (TYPE_P (expr))
     bp_pack_value (bp, TYPE_ARTIFICIAL (expr), 1);
index f29690f62b9b3ffdad6037e681f2d3d0ecd5edf0..e4d948b4cca95641ef251a36f3b9436f7e7f3b15 100644 (file)
@@ -152,6 +152,7 @@ streamer_tree_cache_insert_1 (struct streamer_tree_cache_d *cache,
             the requested location slot.  */
          ix = *ix_p;
          streamer_tree_cache_add_to_node_array (cache, ix, t);
+         *slot = (void *)(size_t) (ix + 1);
        }
 
       /* Indicate that T was already in the cache.  */