Commit 983496fe by David Malcolm Committed by David Malcolm

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

From-SVN: r241185
parent 38e34671
2016-10-14 David Malcolm <dmalcolm@redhat.com>
* 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 <jakub@redhat.com> 2016-10-14 Jakub Jelinek <jakub@redhat.com>
PR middle-end/77959 PR middle-end/77959
......
...@@ -60,9 +60,11 @@ print_edge (FILE *outfile, edge e, bool from) ...@@ -60,9 +60,11 @@ print_edge (FILE *outfile, edge e, bool from)
/* Express edge flags as a string with " | " separator. /* Express edge flags as a string with " | " separator.
e.g. (flags "FALLTHRU | DFS_BACK"). */ e.g. (flags "FALLTHRU | DFS_BACK"). */
fprintf (outfile, " (flags \""); if (e->flags)
bool seen_flag = false; {
#define DEF_EDGE_FLAG(NAME,IDX) \ fprintf (outfile, " (flags \"");
bool seen_flag = false;
#define DEF_EDGE_FLAG(NAME,IDX) \
do { \ do { \
if (e->flags & EDGE_##NAME) \ if (e->flags & EDGE_##NAME) \
{ \ { \
...@@ -75,7 +77,10 @@ print_edge (FILE *outfile, edge e, bool from) ...@@ -75,7 +77,10 @@ print_edge (FILE *outfile, edge e, bool from)
#include "cfg-flags.def" #include "cfg-flags.def"
#undef DEF_EDGE_FLAG #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 /* 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) ...@@ -132,7 +137,9 @@ can_have_basic_block_p (const rtx_insn *insn)
If COMPACT, then instructions are printed in a compact form: If COMPACT, then instructions are printed in a compact form:
- INSN_UIDs are omitted, except for jumps and CODE_LABELs, - INSN_UIDs are omitted, except for jumps and CODE_LABELs,
- INSN_CODEs are omitted, - 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) - insn names are prefixed with "c" (e.g. "cinsn", "cnote", etc)
Example output (with COMPACT==true): Example output (with COMPACT==true):
...@@ -148,13 +155,13 @@ can_have_basic_block_p (const rtx_insn *insn) ...@@ -148,13 +155,13 @@ can_have_basic_block_p (const rtx_insn *insn)
(reg:SI di [ i ])) "t.c":2 (reg:SI di [ i ])) "t.c":2
(nil)) (nil))
(cnote NOTE_INSN_FUNCTION_BEG) (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) (mem/c:SI (plus:DI (reg/f:DI virtual-stack-vars)
(const_int -4)) [1 i+0 S4 A32])) "t.c":3 (const_int -4)) [1 i+0 S4 A32])) "t.c":3
(nil)) (nil))
(cinsn (parallel [ (cinsn (parallel [
(set (reg:SI 87 [ _2 ]) (set (reg:SI %0 [ _2 ])
(ashift:SI (reg:SI 89) (ashift:SI (reg:SI %2)
(const_int 1))) (const_int 1)))
(clobber (reg:CC flags)) (clobber (reg:CC flags))
]) "t.c":3 ]) "t.c":3
...@@ -162,11 +169,11 @@ can_have_basic_block_p (const rtx_insn *insn) ...@@ -162,11 +169,11 @@ can_have_basic_block_p (const rtx_insn *insn)
(const_int -4)) [1 i+0 S4 A32]) (const_int -4)) [1 i+0 S4 A32])
(const_int 1)) (const_int 1))
(nil))) (nil)))
(cinsn (set (reg:SI 88 [ <retval> ]) (cinsn (set (reg:SI %1 [ <retval> ])
(reg:SI 87 [ _2 ])) "t.c":3 (reg:SI %0 [ _2 ])) "t.c":3
(nil)) (nil))
(cinsn (set (reg/i:SI ax) (cinsn (set (reg/i:SI ax)
(reg:SI 88 [ <retval> ])) "t.c":4 (reg:SI %1 [ <retval> ])) "t.c":4
(nil)) (nil))
(cinsn (use (reg/i:SI ax)) "t.c":4 (cinsn (use (reg/i:SI ax)) "t.c":4
(nil)) (nil))
......
...@@ -400,6 +400,14 @@ print_rtx_operand_code_r (const_rtx in_rtx) ...@@ -400,6 +400,14 @@ print_rtx_operand_code_r (const_rtx in_rtx)
#endif #endif
if (flag_dump_unnumbered && is_insn) if (flag_dump_unnumbered && is_insn)
fputc ('#', outfile); 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 else
fprintf (outfile, " %d", regno); fprintf (outfile, " %d", regno);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment