comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Creating really small binaries?
Date: 26 Jun 2002 11:09:58 -0400
Date: 2002-06-26T15:17:46+00:00	[thread overview]
Message-ID: <uptyejcu1.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 5ee5b646.0206260008.4a99c12d@posting.google.com

dewar@gnat.com (Robert Dewar) writes:

> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> wrote in message
> news:<u1yb4zghs.fsf@gsfc.nasa.gov>... 
> 
> > Or -O3, inline options, suppress checks, eliminate unused subprograms, etc.
> 
> -O3 can only make executables larger, same with inlining, so this is
> not a good idea!

I believe I have seen programs where the combination of -O3 with
inlining made things smaller. The inlined program could be better
optimized than the non-inlined program, and the inlined subprogram was
only used in one place. Whole branches of if statements could be
eliminated, because the condition was known to be static in the
inlined case. Well, maybe it was -O2; I'm not sure.

I don't have an example handy.

The point was to try all the options, and measure the result.
Sometimes the results are surprising, so it's worth trying.

-- 
-- Stephe



  reply	other threads:[~2002-06-26 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-18  6:53 Creating really small binaries? Caffeine Junky
2002-06-18 16:41 ` Stephen Leake
2002-06-18 20:01   ` Caffeine Junky
2002-06-19 15:50     ` Stephen Leake
2002-06-24 19:23   ` Robert C. Leif
2002-06-26  8:08   ` Robert Dewar
2002-06-26 15:09     ` Stephen Leake [this message]
2002-06-28 22:34       ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox