RFC: #pragma optimization_level

Mark Mitchell mark@codesourcery.com
Fri Apr 1 20:16:00 GMT 2005


Richard Guenther wrote:
> On Apr 1, 2005 9:36 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> 
>>Diego Novillo wrote:
>>
>>>On Fri, Apr 01, 2005 at 11:24:06AM -0800, Mark Mitchell wrote:
>>>
>>>
>>>>Dale Johannesen wrote:
>>>>
>>>>
>>>>
>>>>>So I guess question 1 is, Mark, do you feel negatively enough about this
>>>>>feature to block its acceptance in mainline?
>>>>
>>>>I'm not sure that I *could* block it, but, no, I don't feel that negatively.
>>>>
>>>
>>>I don't mind either way.  But I do have a question, what's the
>>>granularity of this #pragma?  Function-level, I hope?
>>
>>That's what I assumed.  Anything finer than that is insane. :-)
> 
> 
> Well, if we're inventing something that can annotate functions we may as
> well invent it in a way that it can be extended to handle statement
> annotations.  Just like for
> 
>    for (;;)
> #pragma inline
>       foo();

The concept I was calling insane was trying to optimize the first half 
of a function with -O2 and the second half with -O0.

Your example is different; you're talking about how to treat the call to 
"foo", not how to optimize the entire function (including the "for"). 
Something like what you're suggesting doesn't seem entirely unreasonable 
to me.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list