From patchwork Wed Apr 18 16:35:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 153540 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 EA0B7B6FBB for ; Thu, 19 Apr 2012 02:36:30 +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=1335371792; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=ISYwnaT SXGZTjK2OTPo2AZWaofY=; b=rAgMwQOA0lDleEmuefuXPEqUfgub6iumQYmc+H4 K4W2vRBuDN8y07g43qBB9+dbU5Gi2v2PqisiCTsvLehWqwovGZ9ZTAkh5GCaBDtF dRQUCFpz8hX4G73UrSkNjTurdHTntKnpLz5jrbPCRuH0ApNod4QBU2j1ImlHZlIg vs4Q= 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:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=dHznx/DrV0QZykA1QcjoyvdtbaZBEuJ/DZmTXNaoxw3shc8GQlvVTNuI303Zl4 ndE+xe2oVHmK8znQyC5EKOt5rIrWOlRVE+aFs8OvyG7iUZlEk3Gj+leHP0bLYg21 eDh+Nrg4EFvzADxCZUu9nq/ywIaOenZfDf6KmqTOnc8J8=; Received: (qmail 28709 invoked by alias); 18 Apr 2012 16:36:19 -0000 Received: (qmail 28385 invoked by uid 22791); 18 Apr 2012 16:36:14 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL, BAYES_00, FROM_12LTRDOM, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Apr 2012 16:35:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SKXr5-0004IC-9z from Andrew_Stubbs@mentor.com for gcc-patches@gcc.gnu.org; Wed, 18 Apr 2012 09:35:43 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 18 Apr 2012 09:35:42 -0700 Received: from [172.30.0.151] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Wed, 18 Apr 2012 17:35:40 +0100 Message-ID: <4F8EED58.6050801@codesourcery.com> Date: Wed, 18 Apr 2012 17:35:36 +0100 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH] Add -fdump-rtl--quiet 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 This patch scratches an itch I've had for a while. Basically it just reduces all tree and RTL dumps to just the function dump. This means that the files are easier to diff. This can still be combined with the other options of course: e.g. -fdump-rtl-all-quiet-slim is quite nice. Obviously, most of the passes do dumps by calling fprintf directly, and I don't want to edit each and every case, so I've implemented this by setting dump_file=NULL in execute_one_pass. OK to commit? Andrew 2012-04-18 Andrew Stubbs gcc/ * tree-pass.h (TDF_QUIET): New define. * tree-dump.c (dump_options): Add "quiet". * passes.c (execute_one_pass): Handle TDF_QUIET. * doc/invoke.texi: Document -fdump-tree-quiet. Mention -fdump-rtl-pass-options form. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index a13ddfa..1082b13 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5229,6 +5229,7 @@ of option arguments. @item -d@var{letters} @itemx -fdump-rtl-@var{pass} +@itemx -fdump-rtl-@var{pass}-@var{options} @opindex d Says to make debugging dumps during compilation at times specified by @var{letters}. This is used for debugging the RTL-based passes of the @@ -5244,6 +5245,9 @@ explicitly specified and it is not an executable, otherwise it is the basename of the source file. These switches may have different effects when @option{-E} is used for preprocessing. +The @option{-fdump-rtl-@var{pass}-@var{options}} form uses the same +@var{options} as @option{-fdump-tree-@var{pass}-@var{options}}. + Debug dumps can be enabled with a @option{-fdump-rtl} switch or some @option{-d} option @var{letters}. Here are the possible letters for use in @var{pass} and @var{letters}, and their meanings: @@ -5672,9 +5676,11 @@ Enable showing the tree dump for each statement. Enable showing the EH region number holding each statement. @item scev Enable showing scalar evolution analysis details. +@item quiet +Disable all but the function dump. @item all -Turn on all options, except @option{raw}, @option{slim}, @option{verbose} -and @option{lineno}. +Turn on all options, except @option{raw}, @option{slim}, @option{verbose}, +@option{lineno} and @option{quiet}. @end table The following tree dumps are possible: diff --git a/gcc/passes.c b/gcc/passes.c index a786881..e946c63 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2078,8 +2078,16 @@ execute_one_pass (struct opt_pass *pass) /* Do it! */ if (pass->execute) { + FILE *tmp = dump_file; + + if (dump_flags & TDF_QUIET) + dump_file = NULL; + todo_after = pass->execute (); do_per_function (clear_last_verified, NULL); + + if (dump_flags & TDF_QUIET) + dump_file = tmp; } /* Stop timevar. */ diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index 3e89cdf..81f3262 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -824,9 +824,11 @@ static const struct dump_option_value_info dump_options[] = {"nouid", TDF_NOUID}, {"enumerate_locals", TDF_ENUMERATE_LOCALS}, {"scev", TDF_SCEV}, + {"quiet", TDF_QUIET}, {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE - | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV)}, + | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV + | TDF_QUIET)}, {NULL, 0} }; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 6f1fd6a..ed47dd1 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -84,6 +84,7 @@ enum tree_dump_index #define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */ #define TDF_CSELIB (1 << 23) /* Dump cselib details. */ #define TDF_SCEV (1 << 24) /* Dump SCEV details. */ +#define TDF_QUIET (1 << 25) /* Dump only function content. */ /* In tree-dump.c */