public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* egcs 1.1.2 seems to generate bloated object code
@ 1999-07-09  9:29 Brian Cameron
  1999-07-09 10:25 ` Jeffrey A Law
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Cameron @ 1999-07-09  9:29 UTC (permalink / raw)
  To: egcs-bugs

I am using the egcs 1.1.2 compiler on an IBM AIX 4.3.2 environment.
I am noticing that when I compile code with egcs that the object files
are significantly bloated in comparison to using the compiler that
comes with the AIX 4.3.2 operating system.  We just recently
migrated to AIX 4.3.2 and I also have noticed these issues on
AIX 4.1.5.

I am noticing that "#include" statements seem to cause the object files
to become even more bloated when I use egcs 1.1.2 with the "-g"
option.  This confuses me sincas far as I can tell, the header files I
am including do not have any actual code in them.

Simply including "#include stdlib.h" increases the object file size 150%.
This bloating only seems to happen with the egcs 1.1.2 compiler with
the "-g" option.   Without the "-g" option the egcs 1.1.2 compiler
generates object files that are the same size regardless of whether or
not there are "#include" statements in the code.  Note the statistics
below.

I have tested this with a variety of different "#include" files and it doesn't
seem to be a problem specifically with "stdlib.h".  This issue seems to
happen regardless of which #include files are used.  The more #includes
that are added, the more the object files are bloated, although it does
not seem to be growing linearly.

I would appreciate any information about why egcs generates bloated
code, especially with "#include" files and the "-g" option.  Thank you.

Brian Cameron
Technical Analyst, TransUnion, Chicago, IL

(Statistics Follow)

The following source code was used:

main()
{
   printf("Hello world");
}

4083 bytes - default IBM compiler (cc)
5827 bytes - default IBM compiler (cc) with -g option
38809 bytes - egcs 1.1.2 compiler
40467 bytes - egcs 1.1.2 compiler with -g option

Now I add an "#include <stdlib.h>" in the source code:

4083 bytes - default IBM compiler (cc)
5827 bytes - default IBM compiler (cc) with -g option
38809 bytes - egcs 1.1.2 compiler
63393 bytes - egcs 1.1.2 compiler with -g option

Now I replace <stdlib.h> with <unistd.h> in the source code:

4083 bytes - default IBM compiler (cc)
5827 bytes - default IBM compiler (cc) with -g option
38809 bytes - egcs 1.1.2 compiler
49701 bytes - egcs 1.1.2 compiler with -g option

Now with both <stdlib.h and <unistd.h> in the source code.

4083 bytes - default IBM compiler (cc)
5827 bytes - default IBM compiler (cc) with -g option
38809 bytes - egcs 1.1.2 compiler
64341 bytes - egcs 1.1.2 compiler with -g option.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: egcs 1.1.2 seems to generate bloated object code
  1999-07-09  9:29 egcs 1.1.2 seems to generate bloated object code Brian Cameron
@ 1999-07-09 10:25 ` Jeffrey A Law
  0 siblings, 0 replies; 3+ messages in thread
From: Jeffrey A Law @ 1999-07-09 10:25 UTC (permalink / raw)
  To: Brian Cameron; +Cc: egcs-bugs

  In message < s785dce8.009@tu_async_1.tuc.com >you write:
  > I am noticing that "#include" statements seem to cause the object files
  > to become even more bloated when I use egcs 1.1.2 with the "-g"
  > option.  This confuses me sincas far as I can tell, the header files I
  > am including do not have any actual code in them.
But the compiler does need to emit various debugging information for items
found in those header files.

Note this information is not part of the load image and thus does not
effect the runtime memory requirements for the program.

It is certainly possible that egcs does not emit very compact debug symbols
relative to IBM's compilers.

jeff



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: egcs 1.1.2 seems to generate bloated object code
@ 1999-07-31 23:33 Mike Stump
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Stump @ 1999-07-31 23:33 UTC (permalink / raw)
  To: BCAMERON, egcs-bugs

Please learn what `size' is and does.  Please learn what -S does.
Please read the stabs spec and the dwarf spec to learn more about
debugging information.

In short, -g does not bloat the object code.  What it bloats is the
debugging information and it is supposed to do that!  The fact that
ours is bigger, does matter.

Also, I wonder if you are comparing apples to apples, be sure that
both compilers are statically linking or both are dynamically linking.
Comparing size differences bwteen the two isn't interesting.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-07-31 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-09  9:29 egcs 1.1.2 seems to generate bloated object code Brian Cameron
1999-07-09 10:25 ` Jeffrey A Law
1999-07-31 23:33 Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).