Code Bloat g++

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue Feb 15 14:18:00 GMT 2000


> I am not sure if this is the right place to discuss this, but I am
> seeing massive code bloat with g++ 2.95.2

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

-rwxrwxr-x   1 martin   martin      62535 Feb 15 23:08 o0g
-rwxrwxr-x   1 martin   martin      46809 Feb 15 23:08 o1g
-rwxrwxr-x   1 martin   martin      46745 Feb 15 23:08 o2g
-rwxrwxr-x   1 martin   martin      48753 Feb 15 23:08 o3g

All those are unstripped. After stripping, I get

-rwxrwxr-x   1 martin   martin      13412 Feb 15 23:10 o0
-rwxrwxr-x   1 martin   martin      10948 Feb 15 23:10 o1
-rwxrwxr-x   1 martin   martin      10980 Feb 15 23:10 o2
-rwxrwxr-x   1 martin   martin      11652 Feb 15 23:10 o3

So this is a factor of 2 for the -O3 executable.

Anyway, as Alexandre points out: this is debugging information, so
what is the problem?

Regards,
Martin


More information about the Gcc mailing list