From 6c73025d20c3541e5a9a8754b47e622d3f33963b Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 14 Oct 2016 20:22:23 +0000 Subject: [PATCH] Tweaks to print_rtx_function gcc/ChangeLog: * print-rtl-function.c (print_edge): Omit "(flags)" when none are set. (print_rtx_function): Update example in comment for... * print-rtl.c (print_rtx_operand_code_r): In compact mode, print non-virtual pseudos with a '%' sigil followed by the regno, offset by (LAST_VIRTUAL_REGISTER + 1), so that the first non-virtual pseudo is dumped as "%0". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241185 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/print-rtl-function.c | 29 ++++++++++++++++++----------- gcc/print-rtl.c | 8 ++++++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 732ccb28f0e..2cf3f940d88 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-10-14 David Malcolm + + * print-rtl-function.c (print_edge): Omit "(flags)" when none are + set. + (print_rtx_function): Update example in comment for... + * print-rtl.c (print_rtx_operand_code_r): In compact mode, print + non-virtual pseudos with a '%' sigil followed by the regno, offset + by (LAST_VIRTUAL_REGISTER + 1), so that the first non-virtual + pseudo is dumped as "%0". + 2016-10-14 Jakub Jelinek PR middle-end/77959 diff --git a/gcc/print-rtl-function.c b/gcc/print-rtl-function.c index 2abae849ab9..f46304bf944 100644 --- a/gcc/print-rtl-function.c +++ b/gcc/print-rtl-function.c @@ -60,9 +60,11 @@ print_edge (FILE *outfile, edge e, bool from) /* Express edge flags as a string with " | " separator. e.g. (flags "FALLTHRU | DFS_BACK"). */ - fprintf (outfile, " (flags \""); - bool seen_flag = false; -#define DEF_EDGE_FLAG(NAME,IDX) \ + if (e->flags) + { + fprintf (outfile, " (flags \""); + bool seen_flag = false; +#define DEF_EDGE_FLAG(NAME,IDX) \ do { \ if (e->flags & EDGE_##NAME) \ { \ @@ -75,7 +77,10 @@ print_edge (FILE *outfile, edge e, bool from) #include "cfg-flags.def" #undef DEF_EDGE_FLAG - fprintf (outfile, "\"))\n"); + fprintf (outfile, "\")"); + } + + fprintf (outfile, ")\n"); } /* If BB is non-NULL, print the start of a "(block)" directive for it @@ -132,7 +137,9 @@ can_have_basic_block_p (const rtx_insn *insn) If COMPACT, then instructions are printed in a compact form: - INSN_UIDs are omitted, except for jumps and CODE_LABELs, - INSN_CODEs are omitted, - - register numbers are omitted for hard and virtual regs + - register numbers are omitted for hard and virtual regs, and + non-virtual pseudos are offset relative to the first such reg, and + printed with a '%' sigil e.g. "%0" for (LAST_VIRTUAL_REGISTER + 1), - insn names are prefixed with "c" (e.g. "cinsn", "cnote", etc) Example output (with COMPACT==true): @@ -148,13 +155,13 @@ can_have_basic_block_p (const rtx_insn *insn) (reg:SI di [ i ])) "t.c":2 (nil)) (cnote NOTE_INSN_FUNCTION_BEG) - (cinsn (set (reg:SI 89) + (cinsn (set (reg:SI %2) (mem/c:SI (plus:DI (reg/f:DI virtual-stack-vars) (const_int -4)) [1 i+0 S4 A32])) "t.c":3 (nil)) (cinsn (parallel [ - (set (reg:SI 87 [ _2 ]) - (ashift:SI (reg:SI 89) + (set (reg:SI %0 [ _2 ]) + (ashift:SI (reg:SI %2) (const_int 1))) (clobber (reg:CC flags)) ]) "t.c":3 @@ -162,11 +169,11 @@ can_have_basic_block_p (const rtx_insn *insn) (const_int -4)) [1 i+0 S4 A32]) (const_int 1)) (nil))) - (cinsn (set (reg:SI 88 [ ]) - (reg:SI 87 [ _2 ])) "t.c":3 + (cinsn (set (reg:SI %1 [ ]) + (reg:SI %0 [ _2 ])) "t.c":3 (nil)) (cinsn (set (reg/i:SI ax) - (reg:SI 88 [ ])) "t.c":4 + (reg:SI %1 [ ])) "t.c":4 (nil)) (cinsn (use (reg/i:SI ax)) "t.c":4 (nil)) diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index f114cb4055d..46f3c4dc070 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -400,6 +400,14 @@ print_rtx_operand_code_r (const_rtx in_rtx) #endif if (flag_dump_unnumbered && is_insn) fputc ('#', outfile); + else if (flag_compact) + { + /* In compact mode, print pseudos with a '%' sigil following + by the regno, offset by (LAST_VIRTUAL_REGISTER + 1), so that the + first non-virtual pseudo is dumped as "%0". */ + gcc_assert (regno > LAST_VIRTUAL_REGISTER); + fprintf (outfile, " %%%d", regno - (LAST_VIRTUAL_REGISTER + 1)); + } else fprintf (outfile, " %d", regno); -- 2.11.4.GIT