public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Dump slim RTL to assembly file if the final dump is slim
@ 2012-07-31 10:20 Steven Bosscher
  2012-07-31 10:28 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Bosscher @ 2012-07-31 10:20 UTC (permalink / raw)
  To: GCC Patches

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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-31 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 10:20 [patch] Dump slim RTL to assembly file if the final dump is slim Steven Bosscher
2012-07-31 10:28 ` Richard Guenther

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).