[comp.lang.c] Need to optimize 8086 C code for size

nevin1@ihlpf.ATT.COM (00704a-Liber) (02/12/88)

I have a friend who is doing some development work for the 8086 PC market.
He needs to optimize for size, since the 640K limit is posing some almost
insurmountable problems.

Here are his experiences so far:

He is using Microsoft C 4.0 currently.  Unfortunately, when he turns the
optimizer on it produces incorrect (albiet shorter) code.  If he turns the
optimizer off the executable becomes too big.  He has tried Microsoft C 5.0,
but in his initial estimates 5.0 code optimized is about the same size as 4.0
unoptimized.  He is going to try Turbo C 1.5 to see if there are any
improvements.  BTW, he is using an 80386 machine for development, so size isn't
as important there; however, he needs to produce 8086 code that will run on a
640K PC.


What is the best C compiler on the market today for optimizing size?  Any
comparisons between compilers would be greatly apprieciated.

Thanks alot (in advance),
-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah

PEPRBV%CFAAMP.BITNET@husc6.harvard.EDU (Bob Babcock) (02/14/88)

nevin1@ihlpf.ATT.COM asks (about 8086 compilers):
>What is the best C compiler on the market today for optimizing size?  Any
>comparisons between compilers would be greatly apprieciated.

I am currently comparing  Computer Innovations  C86 version 2.3J,
Turbo-C version 1.5, and MSC 5.0 for a database application which
keeps everything in core.  Code size is critical because code and
data compete for the same memory.  Turbo-C  seems to be the clear
winner in size of the EXE file (about 10% smaller).  But, Turbo-C
seems  to use a memory  allocation  scheme  which takes  25% more
space for the size items  I allocate  than does CI86,  which more
than wipes out the initial memory savings.   I'm not sure how MSC
compares  in this regard because it seems to only have a function
which reports  the space remaining  in the default  data segment,
ignoring the far heap space.  These results are only preliminary,
as I have only had Turbo-C  and MSC for a few weeks.   (CI86  has
been replaced by C86PLUS, and may not be available  any more.  As
of  the  middle  of  last  year,  C86PLUS  was  not  a functional
compiler,  but that has probably  changed  by now, and they  were
claiming great things about it.)

Anyway, code size is not the only consideration if the program in
question allocates a lot of memory.