From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14256 invoked by alias); 5 Nov 2015 23:30:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14167 invoked by uid 89); 5 Nov 2015 23:30:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 05 Nov 2015 23:30:15 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id tA5NU8PV029728; Thu, 5 Nov 2015 17:30:08 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id tA5NU725029727; Thu, 5 Nov 2015 17:30:07 -0600 Date: Thu, 05 Nov 2015 23:30:00 -0000 From: Segher Boessenkool To: Martin Sebor Cc: Alexander Monakov , Joseph Myers , Gcc Patch List Subject: Re: [PATCH] clarify documentation of -Q --help=optimizers Message-ID: <20151105233006.GA27541@gate.crashing.org> References: <56299713.6040204@gmail.com> <562997A9.3090203@gmail.com> <563A9A31.5060306@gmail.com> <563B7CA1.6080801@gmail.com> <20151105170929.GA22951@gate.crashing.org> <563BC46F.7050908@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563BC46F.7050908@gmail.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00537.txt.bz2 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