size of code gcc creates (was "m68k-coff-gcc and NOPs")

Christopher Bahns chris@bahns.com
Thu Aug 10 11:11:00 GMT 2000


Hello Chris (and Scott),

Regarding a CrossGCC post you made back in January, I too have to deal
with size increases going from MRI to GNU. In my case the MRI build is
about 94k (of 96k available) and the GNU build is about 107k, which is
over the limit on my flash. If I can just get it close then I can look
into other methods to reduce it further, but at the moment that would be
hopeless.

Here is your post:
__________________________________________________________________
Scott,
        I too have been comparing code size with Microtec's compiler. I
found the following options useful in reducing it: -Os
-fomit-frame-pointer
-fno-force-mem. The results are then comparable to Microtec's.

        I also noticed that the run time library was much bigger. On
investigation I found all the string functions had an option to do the
operations one long word at a time. This makes the code much longer on a
68K
cpu, and also slower. In some cases it also fails to work! Recompiling
with
the PREFER_SIZE_OVER_SPEED macro defined, produces more traditional
implementations which are much smaller.

Chris
__________________________________________________________________

Do you recommend applying the -Os, -fomit-frame-pointer, and
-fno-force-mem when building the project, the compiler or both (I'm
already applying the first two when building my program, but none of
them when building the compiler (at least not that I know of -- just
using the default options that configure.sh generates)? If applying to
the build of the compiler, exactly how do I do this (see next
paragraph)?

I have looked into applying -DPREFER_SIZE_OVER_SPEED but it did not seem
clear exactly how to do this, and what I did try caused the build of the
compiler to fail. Can you tell EXACTLY how to add this define? Naturally
I'd prefer to specify it on the make (or configure) command line, since
editing the make files directly after configuration gets a bit messy and
makes the automation of the build process a bit more difficult.

Thanks a lot for any help.
Chris


More information about the crossgcc mailing list