From: Jeff Law <law@redhat.com>
To: Martin Sebor <msebor@gmail.com>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] final: Improve output for -dp and -fverbose-asm
Date: Fri, 01 Dec 2017 00:26:00 -0000 [thread overview]
Message-ID: <80093120-6508-f54a-79a6-dfb0cb8709c3@redhat.com> (raw)
In-Reply-To: <53eb6162-a9c9-ed2f-c3dc-85bc38bf29fd@gmail.com>
On 11/30/2017 03:54 PM, Martin Sebor wrote:
> On 11/30/2017 10:07 AM, Segher Boessenkool wrote:
>> On Thu, Nov 30, 2017 at 09:54:26AM -0700, Martin Sebor wrote:
>>>> It is neither line length nor amt of info that makes the second one
>>>> way better readable.
>>>
>>> The justification certainly makes it easier to read. But
>>> the abbreviations make it harder to interpret. [c=4 l=4]
>>> makes no sense to anyone not already familiar with what
>>> it means.
>>>
>>> There's nothing wrong with using mnemonics as long as they're
>>> well established and commonly understood. Absent that, they
>>> should be explained in some accessible document.
>>>
>>> Not everyone who reads the verbose assembly is familiar with
>>> GCC internals. Users read it to help debug problems in their
>>> code. They shouldn't have to also study GCC source code to
>>> understand what the contents mean.
>>
>> This is the -dp output, I hardly ever use -fverbose-asm, it has been
>> unreadable for ten years or so.
>>
>> -fverbose-asm looks like this:
>> ===
>> .L.yk:
>> Â # 81288.c:4:Â Â unsigned int *un = (f3 != 0) ? &t4 : 0;
>> Â Â Â Â Â Â Â cmpdi 0,4,0Â Â Â Â Â # tmp130, f3
>> Â Â Â Â Â Â Â beq 0,.L2Â Â Â Â Â Â Â #
>> Â # 81288.c:6:Â Â *un ^= t4;
>> Â Â Â Â Â Â Â srdi 9,3,32Â Â Â Â Â #, tmp131, t4
>> Â Â Â Â Â Â Â xor 9,9,3Â Â Â Â Â Â Â #, tmp132, tmp131, t4
>> Â # 81288.c:7:Â Â if (*un == t4)
>> Â Â Â Â Â Â Â rldicl 9,9,0,32Â # tmp133, tmp132
>> Â # 81288.c:7:Â Â if (*un == t4)
>> Â Â Â Â Â Â Â cmpd 7,9,3Â Â Â Â Â Â # t4, tmp134, tmp133
>> Â Â Â Â Â Â Â beq 7,.L7Â Â Â Â Â Â Â #
>> .L5:
>> Â # 81288.c:11: }
>> Â Â Â Â Â Â Â mr 3,4Â Â #, <retval>
>> Â Â Â Â Â Â Â blr
>> .L2:
>> Â # 81288.c:6:Â Â *un ^= t4;
>> Â Â Â Â Â Â Â lwz 9,0(4)Â Â Â Â Â Â # MEM[(unsigned int *)0B], _13
>> Â Â Â Â Â Â Â trap
>> .L7:
>> Â # 81288.c:8:Â Â Â Â f3 = !!t4;
>> Â Â Â Â Â Â Â addic 4,9,-1Â Â Â Â # tmp139, tmp133
>> Â Â Â Â Â Â Â subfe 4,4,9Â Â Â Â Â # <retval>, tmp139, tmp133
>> Â Â Â Â Â Â Â b .L5Â Â Â #
>> ===
>>
>> If we're okay with outputting that kind of stuff to *users*, then how
>> bad is [c=8 l=4] for GCC developers? Heh.
>
> I don't know if the above is okay or not. What I do know is
> that [l=4] is not an improvement over [length = 4].
It can be if the lines are getting long enough to wrap.
>
> But I think there are ways to improve the readability while
> at the same time making the output more compact. I mentioned
> documenting the labels (whatever they may be) in the manual
> as one possibility. Another idea is to print a brief legend
> at the bottom of the file explaining what l= stands for. Yet
> another is to print a header at the top of every function with
> a label for each column (like in the top command), and then
> document what each column means in the manual by referring
> to the column headers. I'm sure there are others.
And I think these could all move forward independently.
jeff
next prev parent reply other threads:[~2017-12-01 0:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 23:37 Segher Boessenkool
2017-11-30 7:52 ` Martin Sebor
2017-11-30 11:54 ` Segher Boessenkool
2017-11-30 16:06 ` Michael Matz
2017-11-30 16:36 ` Martin Sebor
2017-11-30 16:50 ` Segher Boessenkool
2017-11-30 17:02 ` Martin Sebor
2017-11-30 17:14 ` Michael Matz
2017-11-30 17:55 ` Martin Sebor
2017-12-01 0:32 ` Jeff Law
2017-12-01 22:52 ` Segher Boessenkool
2017-12-04 12:39 ` Michael Matz
2017-11-30 17:55 ` David Malcolm
2017-12-04 15:49 ` Michael Matz
2017-11-30 17:15 ` Segher Boessenkool
2017-11-30 22:59 ` Martin Sebor
2017-12-01 0:26 ` Jeff Law [this message]
2017-12-01 0:49 ` Jeff Law
2017-12-01 23:45 ` Segher Boessenkool
2017-11-30 16:44 ` Kyrill Tkachov
2017-11-30 16:54 ` Michael Matz
2017-11-30 16:55 ` Kyrill Tkachov
2017-11-30 17:07 ` Michael Matz
2017-12-01 0:22 ` Jeff Law
2017-12-01 0:25 ` Jeff Law
2017-12-01 1:17 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80093120-6508-f54a-79a6-dfb0cb8709c3@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=msebor@gmail.com \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).