This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] final: Improve output for -dp and -fverbose-asm


On 11/30/2017 04:16 AM, Segher Boessenkool wrote:
On Wed, Nov 29, 2017 at 08:46:41PM -0700, Martin Sebor wrote:
On 11/29/2017 04:13 PM, Segher Boessenkool wrote:
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.

Tested on powerpc64-linux {-m32,-m64}; is this okay for trunk?

[c=NN l=NN] will be meaningless to those without some deeper
insight into/experience with what's actually being printed.
It might as well say [NN NN].  But such extreme terseness would

Length isn't printed on all targets, fwiw.

seem to run counter to the documented purpose of -fverbose-asm
to "Put extra commentary information in the generated assembly
code to make it more readable."

The point is that [length = 12] takes up an awful lot of space.  The
output of -fverbose-asm alread suffers from information overload.

Amount of space vs amount of detail are two different concerns.
If you feel that the output is overly detailed then adding even
more to it won't help.  Other than that, I don't think trading
readability for space savings makes sense in a format whose main
purpose is to be readable.  If it's line length that's a concern
then using spaces instead of tabs would make them look shorter.
You can also remove the brackets and use length=NN to shave off
a couple of bytes.  Or print length only when it's not the typical
default.  Or print the hex encoding instead.

Looking further in the manual I don't see the [length=NN] bit
mentioned (nor does your patch add a mention of it) so while
the meaning of [length=NN] isn't exactly obvious, using [l=NN]
instead certainly won't make it easier to read.  Does the manual
need updating?

Should -fverbose-asm print length (and cost) at all?  They should be
printed for -dp (which is for debugging the *compiler*), but are they
very useful for -fverbose-asm (which is primarily for debugging the
*user program*)?

I don't have the answers to these questions.  What I can say
is that using one letter abbreviations for short words is not
going to make it more readable, on the contrary.  len= would
be okay.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]