This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, committed] Add ability to set the optimization options and on ix86 target options on a function specific basis
2008/7/23 Richard Guenther <richard.guenther@gmail.com>:
>>>
>>> It seems pretty cumbersome to have to strip the -m for each option.
>
> I requested this and I don't like options in attributes.
Ah, well, then I guess we do need a whole section in the manual to
explain the mapping between the attribute option("") and the real
options that each argument enables. I still think that having
-mfpmath=both is not very future-proof.
>> 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'.
>
> I can agree here. This is about target capabilities, not random
> command line options.
Given the above, I also agree that 'option' is totally misleading and
someone in the future will decide to use it for something else.
'target' seems much better.
>>> * 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.
>
> This is too ugly to live. Use the pragma interface instead.
>From my understanding the pragma interface has the same syntax as the
attributes. And having the same syntax seems the correct thing to do.
Anyway, I don't feel so strongly about this, since now I know the
syntax and how this works internally. Hopefully, users will read and
understand the manual, they won't request adding --params or -f* and
no GCC developer will overload the current syntax to allow that, they
will get right which "options" are allowed as arguments to 'option'
and which ones to 'optimize' and they can always ask in gcc@, I mean,
gcc-help@ to get answers.
Cheers,
Manuel.