[cfe-dev] Best practices

Nico Weber thakis at chromium.org
Thu Sep 27 18:53:25 PDT 2012


On Fri, Sep 28, 2012 at 1:48 AM, Domagoj Saric
<domagoj.saric at littleendian.com> wrote:
> On 23.9.2012. 16:21, Devchandra L Meetei wrote:
>> Hi clangers
>> is there any best practices which can be used to to reduce disk footprints
>> of
>> executable and lib generated by clangs,
>> Usually binaries generated by clang is larger than those of gcc.
>
>
> I can confirm that Clang's record WRT codegen size is quite far from good.
> The main problems I've identified are:
> - excessive inlining (even with -Os)
> - template bloat
> - no support for fno-inline, -fno-inline-functions or -finline-limit
>
> Here are some related tickets by me (you can find some tips how to "minimize
> damage"):
> http://llvm.org/bugs/show_bug.cgi?id=11625
> http://llvm.org/bugs/show_bug.cgi?id=11633
>
> By others:
> http://llvm.org/bugs/show_bug.cgi?id=4435
> http://llvm.org/bugs/show_bug.cgi?id=4573
> http://llvm.org/bugs/show_bug.cgi?id=5124
> http://llvm.org/bugs/show_bug.cgi?id=11083
>
> These don't help either:
> http://llvm.org/bugs/show_bug.cgi?id=11544
> http://llvm.org/bugs/show_bug.cgi?id=11624
>
>
> ...from the date of the tickets and lack of response one can only deduce
> that this is of no or very low priority to Clang developers (or in "bitch
> mode": they only care about synthetic benchmarks and not about real world
> behaviour)... :/

For what it's worth, in my experience clang produces about 10% smaller
code than gcc (relative to 4.2/mac and 4.4/linux). Admittedly, this is
at -O2, not at -Os.

Nico



More information about the cfe-dev mailing list