This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Add --print-optimizers option


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]