[lto] make builtins go

Mark Mitchell mark@codesourcery.com
Tue Dec 11 16:21:00 GMT 2007


Paolo Bonzini wrote:
> 
>> 1. If "f" calls "sin", and "f" is compiled with -fno-builtin-sin, and
>> "g" calls "f", and "g" is compiled with -fbuiltin-sin, should we perform
>> builtin optimizations?
>>
>> 2. If "f" calls "sin" and was compiled without optimization (e.g., "-g")
>>  but, now, at LTO-time, is compiled with "-O2", should we perform
>> builtin optimizations?
>>
>> I think that for (1), it makes sense not to optimize, but for (2) it
>> makes more sense to optimize.  But, I also think your suggestion is
>> reasonable, and it does have the advantage of seeming simplest to reason
>> about.
> 
> I don't think my suggestion prevents optimizing (2).  :-)   In the (2)
> case __builtin_sin will be serialized out (because -O0 does not imply
> -fno-builtin), read in by LTO, and optimize.

That makes sense.  I didn't know that we transform sin to
"__builtin_sin" even at "-O0".

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list