[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C compilers on sparcs



I have received a good deal of mail about the reliability of various
compilers on the sparcs for compilation with AKCL.

I have tested the following compilers on sparcs.  My main concern has
been the correctness of the resulting code.   After Sun OS release 4.03,
Sun has been distributing the normal compiler with the release and a
second version for which they charge extra money.

Unfortunately their having to test and release two compilers seems to
have lowered the quality of both.  It certainly has doubled our work
in testing releases since we now must test with both compilers (of
course it is many times more than double if they are flaky).


Summary

           Compile AKCL    | Compile NQTHM | Run NQTHM lisp files
-------------------------------------------------------------
cc-4.03       YES               YES              YES
cc-4.1.1       NO                 ?                ?
cc-money      YES(not -O4)     YES               YES
gcc-1.39      YES               NO             run with .o by cc-4.03

Recommend: Use cc-4.03

Explanation of abbreviations:

cc-4.03  [ Best Buy ]
   If running OS 4.1 or 4.1.1, install in  /usr/local/lib/cc-4.03 the 3 files
   /lib/{ccom,cg,iropt} which are on rascal in cc-4.03.tar.Z  If not
   under utexas sun license you must have permission from sun
   to copy these--they are from the sun OS version 4.03.
   Then instead of cc use 
   cc -Qpath /usr/local/lib/cc-4.03 -U__BUILTIN_VA_ARG_INCR
cc-4.1.1
   standard C compiler supplied by sun from 4.1.1 or 4.1
cc-money
   Optional unbundled C compiler available from sun.   Does not seem
   to understand correct volatile declarations, but does not need them.
   use -DVOL=.   This compiler seems fine if you use -O not -O4.
   [see note on size below!]
gcc-1.39
   gcc version 1.39.   Make sure you have installed
   /usr/local/lib/gcc-include/varargs.h ->  gcc-1.39/gvarargs.h
   /usr/local/lib/gcc-include/stdarg.h ->  gcc-1.39/stdarg.h
   and that when you use gcc -E it is really getting those versions!
   gcc is very close to working, but there is still some bug.
   It is very much faster at compiling, and has the big advantage
   of allowing debugging info in optimized code. [note that gcc would
   not compile the base system before akcl-1-592 because some volatile
   declarations were missing].

Additional Remarks:

0) cc-4.03 is the only compiler which produced correct code under all
optimizations (ie on -O4).  The code is reasonably small.  The 3 extra
compiler files only take up 1/2 MB.  You will save a great deal of
time by taking the trouble to obtain these.

1) Clearly one needs to avoid cc-4.1.1 and hope they correct the
problems in the next release.  Even with optimize off, it did not
produce code which ran reliably.  The errors produced caused RANDOM
failure.  Code compiled with it would work ten times and fail the
11'th.   This makes finding the bug almost impossible.  Steer clear
of it.

2) I used -O4 on all files but format.c.  If used there the lisp
format did not work correctly (sometimes dropped args--users will
notice this the first time they try to compile a file, since the
pathname gets dropped when format is used to build the command to
invoke the compiler).  Here are text sizes of some of o/format.o
compiled with various compiler flags.

CODE SIZE of o/format.o
==== ====
   cc-money -O4   74032
   cc-money -O    28736
   cc-4.03  -O4   29072
   cc-4.1.1 -O4   29240
   gcc-1.39 -O    29216

As you can see cc-money -O4 is a loser from the point of view of size.
I guess the huge extra size with -O4 somehow introduces a bug.
I did not find errors in other files compiled by cc-money.

Bill Schelter