From patchwork Sun Jul 4 13:26:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Dump cgraph before merging X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 57842 Message-Id: <20100704132635.GB22746@kam.mff.cuni.cz> To: gcc-patches@gcc.gnu.org Date: Sun, 4 Jul 2010 15:26:35 +0200 From: Jan Hubicka List-Id: 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 ();