This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Code Bloat g++
> The place is right; the information is wrong. What system? On
> i586-pc-linux-gnu, glibc 2.1.3, shared libstdc++, I cannot at all
> reproduce this effect I'm compiling oopack_v1p8.C with -O0..4, with
> and without -g. The resulting executables are
>
> -rwxrwxr-x 1 martin martin 37767 Feb 15 23:07 o0
> -rwxrwxr-x 1 martin martin 21937 Feb 15 23:07 o1
> -rwxrwxr-x 1 martin martin 21969 Feb 15 23:07 o2
> -rwxrwxr-x 1 martin martin 22641 Feb 15 23:08 o3
>
For my system (solaris 8/ ultra 10, 2.95.2 shared libstdc++, glib
1.2.6, ) I get the following results.
-----------
153k Feb 15 14:23 O*
153k Feb 15 14:23 O2*
153k Feb 15 14:23 O3*
153k Feb 15 14:23 O3__mtune=ultrasparc*
153k Feb 15 14:23 O3__mtune=ultrasparc__mcpu=v8*
153k Feb 15 14:23 O3__mtune=ultrasparc__mcpu=v8__ffast_math*
167k Feb 15 14:23 Os*
205k Feb 15 11:48 noflags*
After stripping
48k Feb 15 14:25 O*
48k Feb 15 14:26 O2*
48k Feb 15 14:26 O3*
49k Feb 15 14:26 O3__mtune=ultrasparc*
49k Feb 15 14:26 O3__mtune=ultrasparc__mcpu=v8*
49k Feb 15 14:26 O3__mtune=ultrasparc__mcpu=v8__ffast_math*
49k Feb 15 14:26 Os*
55k Feb 15 14:25 noflags*
That is 3x more size before stripping!
-----------
The reason I brought this up is because this is one of the few cases
that gcc generates bigger binaries than sun's 5.0 compiler.
thanks,
-neelakanth