From patchwork Wed Sep 26 12:39:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 187065 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 D34BA2C0082 for ; Wed, 26 Sep 2012 22:40:23 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349268024; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=wAzaJgv2hazmOWX12zd1fD4GNtM=; b=jYlzaTrgJQlOhRa/VFU4wQLaIb0KVy/6ws3AOmXlBXrZ2VXkizOsZT/MORQL2e sQ6V+K6BNO+2DpMeBIMBO+KQPCWZIf8/4NPB0hbvcK1bBc6jHvPypc3Mc4+Z6rcd CzzKtmENCPSiBuQumgvOgxH9sbgwd33NzM2FlCLGmbQ2g= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=VC/Rso2duFjl+orvT8nMA+LoA/JFqOaFx/L0RJrtc2ckEyKu08DkfrI3HUge6k lKjrAuhVmp4WR/O0NGiNuWBOXZAQRScb6EQXzMIAKeA9/vziZth5SVh2HlQ1D+eQ vC7zSh1qEnste31f5tbkHvUYd0UL79QC60QoANam7I/Qk=; Received: (qmail 3836 invoked by alias); 26 Sep 2012 12:40:16 -0000 Received: (qmail 3813 invoked by uid 22791); 26 Sep 2012 12:40:13 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SINGLE_HEADER_2K X-Spam-Check-By: sourceware.org Received: from mail-oa0-f47.google.com (HELO mail-oa0-f47.google.com) (209.85.219.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 26 Sep 2012 12:39:59 +0000 Received: by oagn9 with SMTP id n9so602953oag.20 for ; Wed, 26 Sep 2012 05:39:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.7.229 with SMTP id m5mr322749oea.10.1348663198890; Wed, 26 Sep 2012 05:39:58 -0700 (PDT) Received: by 10.76.9.200 with HTTP; Wed, 26 Sep 2012 05:39:58 -0700 (PDT) In-Reply-To: References: <20120509064637.22949A2081@nabu.mtv.corp.google.com> Date: Wed, 26 Sep 2012 14:39:58 +0200 Message-ID: Subject: Re: [PATCH] Add option for dumping to stderr (issue6190057) From: Richard Guenther To: Sharad Singhai Cc: Xinliang David Li , Gabriel Dos Reis , "gcc-patches@gcc.gnu.org" , Andrew Pinski X-IsSubscribed: yes 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 On Mon, Sep 24, 2012 at 10:10 PM, Sharad Singhai wrote: > Ping. Some minor issues: * c/c-decl.c (c_write_global_declarations): Use different method to determine if the dump has ben initialized. * cp/decl2.c (cp_write_global_declarations): Ditto. * testsuite/gcc.target/i386/vect-double-1.c: Fix test. these subdirs all have their separate ChangeLog entry from where the directory name is omitted. +++ combine.c (working copy) ... Likewise a patch just doing this re-name is pre-approved and should be checked in separately. @@ -410,6 +419,10 @@ handle_common_deferred_options (void) stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (opt->arg)); break; + case OPT_ftree_vectorizer_verbose_: + dump_remap_tree_vectorizer_verbose (opt->arg); + break; + can you please move that function here (opts-global.c) and make it static? Index: Makefile.in =================================================================== --- Makefile.in (revision 191490) +++ Makefile.in (working copy) remember to adjust for any changes you do above Otherwise the patch looks ok to me. Thanks, Richard. Index: tree-dump.c =================================================================== --- tree-dump.c (revision 191490) +++ tree-dump.c (working copy) @@ -24,9 +24,11 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "gimple-pretty-print.h" #include "splay-tree.h" #include "filenames.h" #include "diagnostic-core.h" +#include "rtl.h" what do you need gimple-pretty-print.h and rtl.h for? + +extern void dump_bb (FILE *, basic_block, int, int); + that should be declared in some header +/* Dump gimple statement GS with SPC indentation spaces and + EXTRA_DUMP_FLAGS on the dump streams if DUMP_KIND is enabled. */ + +void +dump_gimple_stmt (int dump_kind, int extra_dump_flags, gimple gs, int spc) +{ the gimple stuff really belongs in to gimple-pretty-print.c (parts of tree-dump.c should be moved to a new file dumpfile.c) +/* Dump tree T using EXTRA_DUMP_FLAGS on dump streams if DUMP_KIND is + enabled. */ + +void +dump_generic_expr (int dump_kind, int extra_dump_flags, tree t) +{ belongs to tree-pretty-print.c (to where the routines are it calls) +int +dump_start (int phase, int *flag_ptr) +{ perfect candidate for dumpfile.c You can do this re-shuffling as followup, but please try to not include rtl.h or gimple-pretty-print.h from tree-dump.c. Thus re-shuffling required by that do now. tree-dump.c should only know about dumping 'tree'. Index: tree-dump.h =================================================================== --- tree-dump.h (revision 191490) +++ tree-dump.h (working copy) @@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_TREE_DUMP_H #define GCC_TREE_DUMP_H +#include "input.h" probably no longer required. Index: dumpfile.h =================================================================== --- dumpfile.h (revision 191490) +++ dumpfile.h (working copy) @@ -22,6 +22,9 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_DUMPFILE_H #define GCC_DUMPFILE_H 1 +#include "coretypes.h" +#include "input.h" likewise for input.h. Index: testsuite/gcc.target/i386/vect-double-1.c =================================================================== --- testsuite/gcc.target/i386/vect-double-1.c (revision 191490) +++ testsuite/gcc.target/i386/vect-double-1.c (working copy) @@ -32,5 +32,5 @@ sse2_test (void) } } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "Vectorized loops: 1" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ I am sure you need a gazillion more testsuite adjustments? Thus, did you really test the patch by a bootstrap and a toplevel make -k check for regressions? Index: opts.c =================================================================== --- opts.c (revision 191490) +++ opts.c (working copy) @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "intl.h" #include "coretypes.h" +#include "dumpfile.h" I don't see that you add a use for this. Please double-check all your include file changes. Index: gimple-pretty-print.c =================================================================== --- gimple-pretty-print.c (revision 191490) +++ gimple-pretty-print.c (working copy) @@ -69,7 +69,7 @@ maybe_init_pretty_print (FILE *file) } ... Index: gimple-pretty-print.h =================================================================== --- gimple-pretty-print.h (revision 191490) +++ gimple-pretty-print.h (working copy) @@ -31,6 +31,6 @@ extern void debug_gimple_seq (gimple_seq); extern void print_gimple_seq (FILE *, gimple_seq, int, int); extern void print_gimple_stmt (FILE *, gimple, int, int); extern void print_gimple_expr (FILE *, gimple, int, int); -extern void dump_gimple_stmt (pretty_printer *, gimple, int, int); +extern void pp_gimple_stmt_1 (pretty_printer *, gimple, int, int); it looks like changes to these files are only renaming of existing dump_ functions to print_ functions. Consider testing and applying those separately (hereby pre-approved). Index: profile.c =================================================================== --- profile.c (revision 191490) +++ profile.c (working copy) @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see please leave further changes to passes as followup, thus omit changes to this file for the initial commit and submit it separately. Index: rtl.h =================================================================== --- rtl.h (revision 191490) +++ rtl.h (working copy) @@ -2482,8 +2482,8 @@ extern bool validate_subreg (enum machine_mode, en /* In combine.c */ extern unsigned int extended_count (const_rtx, enum machine_mode, int); extern rtx remove_death (unsigned int, rtx); -extern void dump_combine_stats (FILE *); -extern void dump_combine_total_stats (FILE *); +extern void debug_combine_stats (FILE *); +extern void print_combine_total_stats (FILE *); extern rtx make_compound_operation (rtx, enum rtx_code); Index: combine.c =================================================================== --- combine.c (revision 191490)