This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: gcc 2.95.2 HP-UX 10.20


>From: Ehrke, Christian [mailto:C.Ehrke@allweiler.de]
>Sent: 10 November 2000 13:07
>
>My Question is: Why are the programs building with gcc much bigger then
>from the default cc compiler?
>A simple "hello world" compiled as "gcc -o hello hello.c" produce a file
>size from 82 K. The cc produce a 24 K file.


Make sure you are not comparing apples and crocodiles here.

Very often vendor compilers optimize by default, and even with optimization
off, these compilers often do far more optimization than gcc at -O0 which
really means it when it says you get no optimization!

As previously mentioned, debug information can be significant in the
size of executable files. note that your question talked about size
of programs, but your data talks about size of executable files, these
are two different items. Debug information increases the size of the
file, but has no effect on program size.

Another factor can be whether shared libraries are used or not, clearly
you want to make sure you are not comparing a shared library with a
static library.

If you see a difference of 82K vs 24K you can be 100% sure that you
are NOT doing an apples to apples comparison.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]