From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21586 invoked by alias); 31 Jul 2012 10:24:46 -0000 Received: (qmail 21578 invoked by uid 22791); 31 Jul 2012 10:24:46 -0000 X-SWARE-Spam-Status: No, hits=-4.9 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 X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Jul 2012 10:24:24 +0000 Received: by obcva7 with SMTP id va7so11174377obc.20 for ; Tue, 31 Jul 2012 03:24:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.51.65 with SMTP id i1mr22572923obo.45.1343730263325; Tue, 31 Jul 2012 03:24:23 -0700 (PDT) Received: by 10.76.90.71 with HTTP; Tue, 31 Jul 2012 03:24:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 Jul 2012 10:28:00 -0000 Message-ID: Subject: Re: [patch] Dump slim RTL to assembly file if the final dump is slim From: Richard Guenther To: Steven Bosscher Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg01547.txt.bz2 On Tue, Jul 31, 2012 at 12:13 PM, Steven Bosscher wrote: > Hello, > > For me, the slim RTL dumps are much easier to read than the default > lisp-like representation. I use the -dAP option frequently, to see > where an assembly instruction came from. This patch scratches an itch: > The insns dumped to the assembly file are always dumped as lisp-like, > ignoring the "slim" in the -fdump-rtl-final-slim flag. With the patch > applied, final will dump slim RTL if the final dump is asked as slim > RTL. > > Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk? Ok. Thanks, Richard. > Ciao! > Steven > > > > * sched-vis.c (dump_insn_slim): Print print_rtx_head at the > start of each new line. > * final.c (final_scan_insn): If the final dump is requested as > slim RTL, dump slim RTL to the assembly file also. > > Index: sched-vis.c > =================================================================== > --- sched-vis.c (revision 189997) > +++ sched-vis.c (working copy) > @@ -767,11 +767,13 @@ dump_insn_slim (FILE *f, const_rtx x) > rtx note; > > print_insn (t, x, 1); > + fputs (print_rtx_head, f); > fputs (t, f); > putc ('\n', f); > if (INSN_P (x) && REG_NOTES (x)) > for (note = REG_NOTES (x); note; note = XEXP (note, 1)) > { > + fputs (print_rtx_head, f); > print_value (t, XEXP (note, 0), 1); > fprintf (f, " %s: %s\n", > GET_REG_NOTE_NAME (REG_NOTE_KIND (note)), t); > Index: final.c > =================================================================== > --- final.c (revision 189997) > +++ final.c (working copy) > @@ -2747,11 +2747,16 @@ final_scan_insn (rtx insn, FILE *file, int optimiz > insn_code_number = recog_memoized (insn); > cleanup_subreg_operands (insn); > > - /* Dump the insn in the assembly for debugging. */ > + /* Dump the insn in the assembly for debugging (-dAP). > + If the final dump is requested as slim RTL, dump slim > + RTL to the assembly file also. */ > if (flag_dump_rtl_in_asm) > { > print_rtx_head = ASM_COMMENT_START; > - print_rtl_single (asm_out_file, insn); > + if (! (dump_flags & TDF_SLIM)) > + print_rtl_single (asm_out_file, insn); > + else > + dump_insn_slim (asm_out_file, insn);