From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,945d0baf2e74e805 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-26 08:13:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Creating really small binaries? Date: 26 Jun 2002 11:09:58 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <5ee5b646.0206260008.4a99c12d@posting.google.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1025104666 9441 128.183.220.71 (26 Jun 2002 15:17:46 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 26 Jun 2002 15:17:46 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:26715 Date: 2002-06-26T15:17:46+00:00 List-Id: dewar@gnat.com (Robert Dewar) writes: > Stephen Leake wrote in message > news:... > > > 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