diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2017-12-02 02:20:08 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-12-02 02:20:08 +0100 |
commit | dff125ebb56f4b21a5b40d3aa6f9ccb7446cbdb4 (patch) | |
tree | 31d87e26d2663969fcd7eb48c0074ac4c2123afc /gcc | |
parent | 79c9f76563e0c0943c9dc44bd1b892175c3239b9 (diff) | |
download | gcc-dff125ebb56f4b21a5b40d3aa6f9ccb7446cbdb4.zip gcc-dff125ebb56f4b21a5b40d3aa6f9ccb7446cbdb4.tar.gz gcc-dff125ebb56f4b21a5b40d3aa6f9ccb7446cbdb4.tar.bz2 |
final: Improve output for -dp and -fverbose-asm
This improves the assembler output (for -dp and -fverbose-asm) in
several ways. It always prints the insn_cost. It does not print
"[length = NN]" but "[c=NN l=NN]", to save space. It does not add one
to the instruction alternative number (everything else starts counting
those at 0, too). And finally, it tries to keep things lined up in
columns a bit better.
* final.c (output_asm_name): Print insn_cost. Shorten output. Print
which_alternative instead of which_alternative + 1.
(output_asm_insn): Print an extra tab if the template is short.
From-SVN: r255348
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/final.c | 22 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b0fc04a..11ccbfb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-01 Segher Boessenkool <segher@kernel.crashing.org> + + * final.c (output_asm_name): Print insn_cost. Shorten output. Print + which_alternative instead of which_alternative + 1. + (output_asm_insn): Print an extra tab if the template is short. + 2017-12-01 Jim Wilson <jimw@sifive.com> * common.opt (use_gnu_debug_info_extensions): Delete DWARF_DEBUG from diff --git a/gcc/final.c b/gcc/final.c index fdae241..afb6906 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3469,16 +3469,20 @@ output_asm_name (void) { if (debug_insn) { - int num = INSN_CODE (debug_insn); - fprintf (asm_out_file, "\t%s %d\t%s", - ASM_COMMENT_START, INSN_UID (debug_insn), - insn_data[num].name); - if (insn_data[num].n_alternatives > 1) - fprintf (asm_out_file, "/%d", which_alternative + 1); + fprintf (asm_out_file, "\t%s %d\t", + ASM_COMMENT_START, INSN_UID (debug_insn)); + fprintf (asm_out_file, "[c=%d", + insn_cost (debug_insn, optimize_insn_for_speed_p ())); if (HAVE_ATTR_length) - fprintf (asm_out_file, "\t[length = %d]", + fprintf (asm_out_file, " l=%d", get_attr_length (debug_insn)); + fprintf (asm_out_file, "] "); + + int num = INSN_CODE (debug_insn); + fprintf (asm_out_file, "%s", insn_data[num].name); + if (insn_data[num].n_alternatives > 1) + fprintf (asm_out_file, "/%d", which_alternative); /* Clear this so only the first assembler insn of any rtl insn will get the special comment for -dp. */ @@ -3824,6 +3828,10 @@ output_asm_insn (const char *templ, rtx *operands) putc (c, asm_out_file); } + /* Try to keep the asm a bit more readable. */ + if ((flag_verbose_asm || flag_print_asm_name) && strlen (templ) < 9) + putc ('\t', asm_out_file); + /* Write out the variable names for operands, if we know them. */ if (flag_verbose_asm) output_asm_operand_names (operands, oporder, ops); |