Mail Archives: djgpp/1996/04/01/07:52:04
In article <9603261706 DOT AA08184 AT tina DOT dei DOT unipd DOT it>, gelido AT dei DOT unipd DOT it writes:
|>Hi DJs,
|> which is the inline GCC options to make the smaller .exe ?
|>I use 'GCC -s -O3' but the output file is 2-3 times bigger than BCC.
|>Is this what I have to pay for 32 bit ?
Using -O3 will often make your files much bigger. gcc's optimizations
are targeted toward speed of execution rather than size of program.
-O3 invokes inlining (which may also involve 'cloning'), which means
that your EXE file may contain many slightly different copies of the
object code for one routine. Loop unrolling can also make your
program slightly larger. 32-bit can make your code larger just because
addresses need more bytes, but on the other hand you can often write
simpler code so the program may be smaller. If EXE size is really
important to you, try -O2 and look closer at the optimization
switches in the info file - it explains which affect speed and which
size.
But inlining and small code size are fundamentally incompatible.
Why do you want small EXE files ?
----------------------------------------------------------------------------
Kevin Ashley K DOT Ashley AT Ulcc DOT ac DOT uk
Systems Development Group Manager http://www.ulcc.ac.uk/staff/Kevin+Ashley
University of London Computer Centre. ...ukc!ncdlab!K.Ashley
This is not a signature
- Raw text -