This is the mail archive of the gcc-patches@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]

Dump cgraph before merging


Hi,
while working on Mozilla LTO problems I found useful to have dump of callgraph
before merging is done.
Bootstrapped/regtested x86_64-linux, will commit it later today.

Honza

	* cgraphunit.c (init_cgraph): Only initialize dump file if it is not already
	initialized. 
	* lto/lto.c (read_cgraph_and_symbols): Dump cgraph before merging.
Index: cgraphunit.c
===================================================================
--- cgraphunit.c	(revision 161774)
+++ cgraphunit.c	(working copy)
@@ -2070,7 +2070,8 @@ cgraph_build_static_cdtor (char which, t
 void
 init_cgraph (void)
 {
-  cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
+  if (!cgraph_dump_file)
+    cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
 }
 
 /* The edges representing the callers of the NEW_VERSION node were
Index: lto/lto.c
===================================================================
--- lto/lto.c	(revision 161774)
+++ lto/lto.c	(working copy)
@@ -1435,6 +1449,7 @@ read_cgraph_and_symbols (unsigned nfiles
   struct cgraph_node *node;
 
   lto_stats.num_input_files = nfiles;
+  init_cgraph ();
 
   timevar_push (TV_IPA_LTO_DECL_IO);
 
@@ -1534,6 +1549,13 @@ read_cgraph_and_symbols (unsigned nfiles
 
   /* Finally merge the cgraph according to the decl merging decisions.  */
   timevar_push (TV_IPA_LTO_CGRAPH_MERGE);
+  if (cgraph_dump_file)
+    {
+      if (cgraph_dump_file)
+	fprintf (cgraph_dump_file, "Before merging:\n");
+      dump_cgraph (cgraph_dump_file);
+      dump_varpool (cgraph_dump_file);
+    }
   lto_symtab_merge_cgraph_nodes ();
   ggc_collect ();
 


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