Clang generated binary sizes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang generated binary sizes

Clark Gaebel
When I use gcc to compile a C++ project I'm currently working on, the
final executable size is 4MB.
When I use clang++ to compile the exact same code, the final executable
size is 7MB.

The optimization flags used are -O3 -funroll-loops and -funswitch-loops.

How can I go about diagnosing this bloat?

--
Regards,
-Clark

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang generated binary sizes

Eric Christopher-2

On Jun 15, 2010, at 8:51 PM, Clark Gaebel wrote:

> When I use gcc to compile a C++ project I'm currently working on, the
> final executable size is 4MB.
> When I use clang++ to compile the exact same code, the final executable
> size is 7MB.
>
> The optimization flags used are -O3 -funroll-loops and -funswitch-loops.
>
> How can I go about diagnosing this bloat?

I'm not sure it's necessarily bloat, but you can try to find out what's going on
by looking at the code generated.  I'd particularly look at inlining of functions
as we may be doing more inlining than in your version of gcc.  Otherwise you'll
just need to look at the sizes of various functions and see why they're
larger.

-eric
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang generated binary sizes

Daniel Dunbar
In reply to this post by Clark Gaebel
I would start by comparing the sizes of individual .o files. If you
can find one that differs noticeably from GCC, that might give a clue.
It would also be interesting to know what the -O2 numbers are.

 - Daniel

On Tue, Jun 15, 2010 at 8:51 PM, Clark Gaebel <[hidden email]> wrote:

> When I use gcc to compile a C++ project I'm currently working on, the
> final executable size is 4MB.
> When I use clang++ to compile the exact same code, the final executable
> size is 7MB.
>
> The optimization flags used are -O3 -funroll-loops and -funswitch-loops.
>
> How can I go about diagnosing this bloat?
>
> --
> Regards,
> -Clark
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev