[PATCH, committed] Add ability to set the optimization options and on ix86 target options on a function specific basis

Michael Meissner gnu@the-meissners.org
Wed Jul 23 14:01:00 GMT 2008


On Wed, Jul 23, 2008 at 01:32:43PM +0200, Manuel López-Ibáñez wrote:
> 2008/7/23 Michael Meissner <gnu@the-meissners.org>:
> > I committed the following patch to revision 138075 on the mainline to add
> > function specific optimization/target option support.  I did not move the
> > optimization and target options data structures from being trees containing the
> > structure to the structure itself that Steven Bosscher suggested, because it
> > got complicated with regard to garbage collection and hashing.  I might look at
> > it later, but I wanted to get the main patches checked in.
> 
> I am sorry I comment on this so late but I just found out about the
> current syntax. If my comments have already been answered, feel free
> to point me to some thread where I can read the rationale for the
> design decisions.

Hmmm, I did sent out the patch several times over the last two months.

> * Why don't make a 1-to-1 mapping between the command-line option and
> the argument to option("") ?
> 
> It seems pretty cumbersome to have to strip the -m for each option.

This is due to feedback from another reviewer to strip the '-' and 'm'.  The
optimize code allows this as an option.  It is fairly easy to add.

> Moreover, if we extend the current code to handle -Ox -f* -W* and
> whatever we wish to handle (--param?), things get worse.

Note, the same patch also added the optimize(...) attribute/pragma.  As I said,
stripping the '-' was something other people asked for.  I just want the
ability to set the options for a specific function, I'm willing to change the
syntax if there is a consensus of what syntax people would like.  For example
'option' might be better spelled 'target'.

> * In relation to the previous. Why separate options with commas
> instead of spaces? In other words, why not make the argument of
> option("") behave as the command-line. That is,  the commandline "gcc
> -march=i686 -mfpmath=sse,387" has a 1-to-1 mapping to
> option("-march=i686 -mfpmath=sse,387"). Also, you don't need to work
> around commas.

It should be simple to do.

-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org



More information about the Gcc-patches mailing list