This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc's -Os flag is trumped by -m486
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc's -Os flag is trumped by -m486
- From: Michael Deutschmann <michael at khar-pern dot talamasca>
- Date: Wed, 17 Nov 1999 06:18:07 -0800 (PST)
Recently I was wondering how much using full optimization (-O3) was
costing me in terms of space, so I did a comparision against -Os using
sh-utils-2.0. (A program I was building for my own use at the time.)
(All of this was done using gcc-2.95.2, glibc-2.1.2, on
i386-pc-linux-gnu. Additionally, "-pipe -fstrict-aliasing
-fomit-frame-pointer" were used on all tests -- these are my usual
options for builds.)
I was using 486 optimization for the build. Measuring the space of all
binary files for an -O3 and an -Os build, I get:
"-O3 -m486": 315320 bytes
"-Os -m486": 299512 bytes a 5.0% savings
I happened to check the "-m386" mode, which was a cheap way to reduce
executable size back before "-Os" existed. (since 486 tuning includes
excessive alignment).
"-Os -m386": 292792 bytes a 7.1% savings
Switching to 386 mode significantly decreases the size. This is wrong --
"-Os" should do everything to reduce size, and vetoing `processor-tuning'
optimizations that create bloat is an obvious one.
---- Michael Deutschmann <michael@talamasca.wkpowerlink.com>