From patchwork Sun Jul 4 13:26:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 57842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 67231B6F17 for ; Sun, 4 Jul 2010 23:26:48 +1000 (EST) Received: (qmail 28344 invoked by alias); 4 Jul 2010 13:26:46 -0000 Received: (qmail 28324 invoked by uid 22791); 4 Jul 2010 13:26:46 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Jul 2010 13:26:38 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 98CBA9AC850; Sun, 4 Jul 2010 15:26:35 +0200 (CEST) Date: Sun, 4 Jul 2010 15:26:35 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Dump cgraph before merging Message-ID: <20100704132635.GB22746@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 ();