This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Large code size?
- To: slouken at devolution dot com (Sam Lantinga)
- Subject: Re: Large code size?
- From: Joe Buck <jbuck at Synopsys dot COM>
- Date: Wed, 24 Mar 99 16:44:20 PST
- Cc: jbuck at Synopsys dot COM, slouken at devolution dot com, egcs at egcs dot cygnus dot com, highlander at lokigames dot com
>
>
> > > We built robotcom.so with the compiler flags:
> > > g++ -O2 -funroll-loops -fno-exceptions -DLINUX_BETA -D_REENTRANT
> > > and the linker flags:
> > > cc -shared -nostartfiles -s -o robotcom.so ...
> ...
> That's a whopping 4.5MB decrease in size just by using -fno-exceptions
> It's still 25% larger than the equivalent VC++ code (which does have
> exception handling enabled, BTW), but .5 MB of that is additional library
> code that is a separate DLL on Windows, for a final count of only 17%
> larger.
What happens if you replace -O2 with -Os? (optimize for space ... which
in many cases does a fairly decent job of optimizing for speed as well)?
You should get smaller code.