This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 3.0.3 produces large code
- From: Ingo Krabbe <i dot krabbe at dokom dot net>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 31 Jan 2002 16:47:23 +0100
- Subject: Re: GCC 3.0.3 produces large code
- Organization: ask (automatische system komponenten)
- References: <Pine.LNX.4.33.0201310543010.20842-100000@pandora.x256.com>
I'm not sure about that topic, but I don't think that code size reduction
is pushed too far in the development process of gcc, since it isn't used
by too many people ?! I would be interested in the results of -O2 replacing
-Os. The code structure optimizations of -O2 may also result in a reduction
of code size.
BTW. in my opinion is the usage of two return statements in one function
a design fault. It is also remarkeble that the most cleanest code concerning
function design compiles into the smallest result. That's exactly what
I want from my gcc.
CU INGO
Am Donnerstag, 31. Januar 2002 14:49 schrieben Sie:
>
> g++ -Os -fomit-frame-pointer-falign-labels=1 -falign-jumps=1
> -fno-exceptions -o test test.cpp
>
> I chose -Os for obvious reasons... the others are also in an attempt to
> get file size down. The version, as mentioned in the subject, is 3.0.3.
> Can anyone suggest how to make it compile the code any smaller? And
> perhaps the people responsible for optimisations might take note of this.
> I can understand maybe why the code needs to be so big with -O3, but with
> -Os, it seems to me it could be a lot smaller, and really routines like
> this benefit most from being small rather than fast (they'll never really
> be all that fast). Maybe the compiler can be super-smart about it, and
> automatically optimise small functions for size and large functions for
> speed?
>
> Anyway, I hope someone can improve the situation a bit.
>
>
> Thanks,
> Nicholas
>
> P.S. Other than code size, GCC 3.0.3 seems great.