From: Steven Bosscher <stevenb.gcc@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [patch] Dump slim RTL to assembly file if the final dump is slim
Date: Tue, 31 Jul 2012 10:20:00 -0000 [thread overview]
Message-ID: <CABu31nOGvZkneJrifxgMg+NxfS=BHiDHb=e5WTGB81z3qg9gbA@mail.gmail.com> (raw)
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?
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);
next reply other threads:[~2012-07-31 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-31 10:20 Steven Bosscher [this message]
2012-07-31 10:28 ` Richard Guenther
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABu31nOGvZkneJrifxgMg+NxfS=BHiDHb=e5WTGB81z3qg9gbA@mail.gmail.com' \
--to=stevenb.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).