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

Scott A Sumner sasumner@juno.com
Sat Apr 1 00:00:00 GMT 2000


All good points, Ola!

All compilers ARE different, so there should be some difference in size. 
However, I consider the 17% a significant difference for the following
reasons:

* the gcc code is as optimized as I've been able to make it for size
* the commercial code is unoptimized

The code size for my application is not that big of a deal.  I've got a 1
Mbyte flash.  Problem comes in when we talk about the flash boot loader. 
It has to fit in a certain size block of memory.  With the commercial
compiler it fits with plenty to spare.  With the gcc compiler, well....it
doesn't fit so well.

So, does anyone else have any comments regarding squeezing some more size
out of my gcc generated code?




> I don't think a 17% difference is much when you compare different
> compilers. You can have much larger differences for the same 
> compiler
> using different compiler options (which interacts subtly with how 
> you
> write your code) or different versions of the same compiler (which I
> have experienced with gcc for 68K). Different compilers are designed
> and implemented differently and are you sure exactly the same 
> optimizations
> are performed?
> --
> 	Ola Liljedahl



On Sat, 15 Jan 2000 17:48:18 +0100 Ola Liljedahl <olli@enea.se> writes:
> Scott A Sumner wrote:
> > 
> > Speaking of being out of prom space, from what I've been able to
> > determine, gcc is a pig when it comes to code space.
> > 
> > My application is buildable under two toolsets, Fiddes' gcc 
> version 4 and
> > Mentor Graphics Microtec Research version 4.4.  Here's a 
> comparison of
> > code (ROM) sizes with the two toolsets:
> > 
> > gcc:  655KB
> > Microtec:  560KB
> > 
> > As you can see, the code produced by gcc is almost 17% 
> bigger--quite a
> > disparity!
> > 
> > Anyone have an opinion as to why this is so?

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list