public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Alexander Monakov <amonakov@ispras.ru>,
	 Joseph Myers <joseph@codesourcery.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] clarify documentation of -Q --help=optimizers
Date: Thu, 05 Nov 2015 15:58:00 -0000	[thread overview]
Message-ID: <563B7CA1.6080801@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.20.1511051343310.10819@monopod.intra.ispras.ru>

On 11/05/2015 03:48 AM, Alexander Monakov wrote:
> On Thu, 5 Nov 2015, Joseph Myers wrote:
>> On Wed, 4 Nov 2015, Martin Sebor wrote:
>>
>>> Improving the compiler output is a good idea. The attached patch
>>> prints "[disabled by -O0]" instead of "[enabled]" when an optimization
>>> option is enabled by default but when optimization (i.e., -O1 or
>>> greater) is not enabled.
>>
>> I don't think it's entirely accurate that all options marked as
>> Optimization in *.opt are actually disabled by -O0.  Many are, but it
>> depends on the actual logic controlling each optimization.
>
> Indeed, and Richard already pointed that out when reviewing (my) previous
> attempt.  Martin, please review the thread ending at
> https://gcc.gnu.org/ml/gcc-patches/2012-05/msg00113.html
>
> I guess eventually we can slightly overhaul optimization options to remove
> such ambiguities, but in short term I see no way to accurately determine
> whether a pass/option is ultimately in effect or not.
>
> Martin, what about taking Richard's suggestion, tacking a short explanatory
> sentence onto the end of --help=optimizers output?

I don't think that reiterating in a condensed form what the manual
doesn't make clear in many more words will help. First, even users
who do find the relevant text in the manual often misunderstand it.
Others are misled by the "[enabled]" output into expecting the
optimizations to take place at -O0. Those who are in doubt and
ask on gcc-help are then told by GCC experts that -O0 disables
all optimizations without exception, and to RTFM (see the thread
I referenced in my first post on this topic for an example).

That the individual optimizations -fxxx options have no effect
without -O1 or better is made clear in the FAQ on the Wiki (in
https://gcc.gnu.org/wiki/FAQ#optimization-options). What isn't
mentioned there is the relationship to the --help=optimizers
output.

I'd be happy to tweak the "disabled by -O0" text to something
less definitive if that would make you and Joseph more
comfortable. But the "enabled" output at -O0, even though
strictly correct, is a problem. Users don't care about the
internal state of the options. What they need to know is
whether or not their code may be subject to the corresponding
optimiziation. We seem to have consensus that even though there
might be exceptions (do we know what some of them are?) the vast
majority optimizations that have -fxxx options are in fact not
performed at -O0. I think reflecting that in the output is more
helpful than implying otherwise.

Martin

  reply	other threads:[~2015-11-05 15:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56299713.6040204@gmail.com>
2015-10-23  3:56 ` Martin Sebor
2015-11-02 21:48   ` [PING] " Martin Sebor
2015-11-03 10:19   ` Alexander Monakov
2015-11-04 23:52     ` Martin Sebor
2015-11-05  0:54       ` Joseph Myers
2015-11-05 10:48         ` Alexander Monakov
2015-11-05 15:58           ` Martin Sebor [this message]
2015-11-05 17:09             ` Segher Boessenkool
2015-11-05 21:04               ` Martin Sebor
2015-11-05 23:30                 ` Segher Boessenkool
2015-11-06  1:25                   ` Martin Sebor
2015-11-05 17:11             ` Joseph Myers
2015-11-05 17:47               ` Martin Sebor
2015-11-05 18:07                 ` Joseph Myers
2015-11-05 18:45                   ` Martin Sebor
2015-11-05 18:47                     ` Joseph Myers
2015-11-05  1:09       ` Sandra Loosemore
2015-11-05  2:40         ` Martin Sebor

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=563B7CA1.6080801@gmail.com \
    --to=msebor@gmail.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /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).