This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] clarify documentation of -Q --help=optimizers
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Alexander Monakov <amonakov at ispras dot ru>, Joseph Myers <joseph at codesourcery dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 5 Nov 2015 17:30:07 -0600
- Subject: Re: [PATCH] clarify documentation of -Q --help=optimizers
- Authentication-results: sourceware.org; auth=none
- References: <56299713 dot 6040204 at gmail dot com> <562997A9 dot 3090203 at gmail dot com> <alpine dot LNX dot 2 dot 20 dot 1511031309390 dot 3529 at monopod dot intra dot ispras dot ru> <563A9A31 dot 5060306 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1511050053500 dot 18787 at digraph dot polyomino dot org dot uk> <alpine dot LNX dot 2 dot 20 dot 1511051343310 dot 10819 at monopod dot intra dot ispras dot ru> <563B7CA1 dot 6080801 at gmail dot com> <20151105170929 dot GA22951 at gate dot crashing dot org> <563BC46F dot 7050908 at gmail dot com>
On Thu, Nov 05, 2015 at 02:04:47PM -0700, Martin Sebor wrote:
> On 11/05/2015 10:09 AM, Segher Boessenkool wrote:
> >On Thu, Nov 05, 2015 at 08:58:25AM -0700, Martin Sebor wrote:
> >>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.
> >
> >The -Q --help* output is primarily aimed at GCC developers, just
> >like plain -Q is. The main problem here seems to be that the
> >documentation pushes beginner GCC users to use this.
> >
> >Perhaps we should have a higher-level, more easy to use way to query
> >what flags will do what, possibly integrated with the pass manager.
>
> I think that would be ideal (i.e., hiding each flag_xxx under
> a get_flag_xxx() and set_flag_xxx() interface that would make
> it possible to compute and dynamically query individual option
> settings based on non-trivial dependencies). It strikes me as
> quite a project.
I was thinking more of showing at every flag whether it is relevant at
all, or maybe not showing irrelevant ones except maybe when some
--verbose or so option is given; and if you want to get really fancy
(but also very helpful to both users and developers), have some option
that shows all dependencies for a flag to take effect.
This of course requires expressing some dependencies manually in the
.opt files, but hopefully most can be done automatically with some
magic.
> >>Those who are in doubt and
> >>ask on gcc-help are then told by GCC experts that -O0 disables
> >>all optimizations without exception,
> >
> >And it does, for the plain meaning of "optimization"; anything else
> >is arguably a bug. But people have many different understandings
> >of what a "compiler optimization" is, all the way to "anything the
> >compiler does".
>
> Yes, that also sometimes causes confusion, though it's not something
> I'm trying to solve with this patch.
It's not something you _can_ solve as far as I see. There is a
considerable gap between what beginner and advanced users expect from
the compiler, understand about the compiler, and worst of all, think
they understand about the compiler. GCC should be a useful compiler
to that whole spectrum of audiences. Currently -Q --help shows just
the gory details, which is functionality we want to keep IMO, but not
something we want to recommend everyone to use.
Does that make sense? I'm not sure I'm expressing myself well here,
you cannot see my frantic handwaving :-)
Segher