This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/55792] [4.8 Regression] Bad memory access with profiledbootstrap and LTO


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55792

--- Comment #34 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-14 13:42:36 UTC ---
static void
output_node_opt_summary (struct output_block *ob,
                         struct cgraph_node *node,
                         lto_symtab_encoder_t encoder)
{
...
      gcc_assert (EXPR_LOCATION (map->new_tree) == UNKNOWN_LOCATION);

isn't recursively checking EXPR_LOCATION.

Index: gcc/lto-cgraph.c
===================================================================
--- gcc/lto-cgraph.c    (revision 195144)
+++ gcc/lto-cgraph.c    (working copy)
@@ -1492,6 +1492,22 @@ output_edge_opt_summary (struct output_b
 {
 }

+static tree
+verify_no_location (tree *tp, int *walk_subtrees, void *)
+{
+  if (EXPR_P (*tp))
+    gcc_assert (EXPR_LOCATION (*tp) == UNKNOWN_LOCATION);
+  else
+    *walk_subtrees = 0;
+  return NULL_TREE;
+}
+
+static void
+verify_no_location (tree expr)
+{
+  walk_tree (&expr, verify_no_location_r, NULL, NULL);
+}
+
 /* Output optimization summary for NODE to OB.  */

 static void
@@ -1536,7 +1552,9 @@ output_node_opt_summary (struct output_b
          mechanism to store function local declarations into summaries.  */
       gcc_assert (parm);
       streamer_write_uhwi (ob, parm_num);
-      gcc_assert (EXPR_LOCATION (map->new_tree) == UNKNOWN_LOCATION);
+#ifdef ENABLE_CHECKING
+      verify_no_location (map->new_tree);
+#endif
       stream_write_tree (ob, map->new_tree, true);
       bp = bitpack_create (ob->main_stream);
       bp_pack_value (&bp, map->replace_p, 1);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]