huge c++ binaries compared to gcc

dpeterc
Total Points:
675
Status Points:
175
Brown Belt
September 10, 2008 6:13 AM PDT
Rate
 
#4 Reply to #3
I found the true culprit for the huge binary size: C++ exceptions.
Lucily, I do not use them in my code.
So I report the binary sizes with the new options:
-O3 -s -fno-exceptions -fno-inline GCC: 1.25 MB ICC: 1 MB
So ICC can actaully make significantly smaller C++ code than gcc, if we use
-fno-exceptions -fno-inline
even with -O3, which enables advanced optimizations.
For me, to reduce the binary size from 2.8 MB to 1 MB is a big thing.

I found this tip in the following document:
http://developer.apple.com/documentation/Performance/Conceptual/CodeFootprint/Articles/CompilerOptions.html
It is GCC and Apple specific, but the ideas and compiler options are also mostly valid for Linux and ICC.


Intel Software Network Forums Statistics

8479 users have contributed to 31612 threads and 100674 posts to date.
In the past 24 hours, we have 29 new thread(s) 112 new posts(s), and 168 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member zhpn