This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Add --print-optimizers option
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 01 Dec 2006 12:54:25 -0800
- Subject: Re: RFA: Add --print-optimizers option
- References: <m3u00kexp4.fsf@redhat.com> <456DCEB6.6060608@codesourcery.com> <456FFC42.7050904@redhat.com>
Nick Clifton wrote:
> The intended use (from my point of view) is to enable a script to
> automatically discover which optimization switches are supported by gcc
> so that it can then iterate over these switches looking for the
> combination that provides the best overall optimization for a given
> program.
Thanks for explaining. Unfortunately, this does mean a human has to
label the options; you presumably only want to try those which are
compatible with your current ABI. (Or, maybe you do want to try
changing the ABI, if you have multiple runtime libraries around with
different ABIs?)
(There are certainly some grey areas. For example, is -fuse-cxa-atexit
an optimization option? If the runtime library has that feature, then
it might be. But, if not, then it's an ABI-breaking option. I'm not
sure the grey-areaness matters, as some options are clearly optimization
options; I'm just thinking out loud.)
Do you also want to display permitted values for switches, or are you
just looking at on/off flags? (I'm thinking of -mcpu=<foo> options, or
-moptimize-me-harder=N options.)
I think that it would be very helpful to integrate this with --help.
That output already lists all the options; we could start by having it
also list the actual values in use, whether specified by the user or
computed.
Then, perhaps for your purposes, all that would be required would be to
group the --help output with optimization options in a block distinct
from other things. That seems like it would help all users (including
the case you mentioned of users wanting to know what -O2 turns on), and
it would also be readily digestable for Acovea.
What do you think?
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713