Steve Ellcey <s...@cup.hp.com> writes:

> On Fri, 2009-05-29 at 09:38 -0700, Ian Lance Taylor wrote:
>> Steve Ellcey <s...@cup.hp.com> writes:
>> 
>> > So instead of 
>> >    if (flag_var_tracking)
>> > we would have
>> >    if (targetm.get_optimization_flag_value(OPT_fvar_tracking))
>> 
>> I don't particularly want to have to make an indirect function call
>> every time we check a flag.  I don't see why we should check every time
>> when we can determine the value once when the compiler starts.
>
> But if we want to fully support things like the __optimize__ attribute
> then we can't just check once when the compiler starts.  The flag could
> be changed during compilation by the optimize attribute so at the very
> least we need to override some values every time we see this attribute
> (which is what we are not doing now).

Fair enough, but 99.9% of compilations will not use the __optimize__
attribute.  So I still don't want to make an indirect function call
every time we check a flag.

Joseph's suggestion of a more disciplined approach to option
interactions may be the way to go.  We can at least handle many simple
cases that way (this backend always enables/disables this option), while
retaining a C function escape clause if there are complex ones.

Ian

Reply via email to