This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto] make builtins go
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Nathan Froyd <froydnj at codesourcery dot com>
- Date: Tue, 11 Dec 2007 08:11:57 -0800
- Subject: Re: [lto] make builtins go
- References: <20071129220256.GN24671@codesourcery.com> <475D42B9.3080106@gnu.org> <475D9FFD.2020900@codesourcery.com> <475E606E.5000207@gnu.org>
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