[comp.sys.sun] gcc performance on Sun 4/110?

cmc3@bellcore.bellcore.com (C Chase) (04/04/89)

I have a Sun 4/110 and I am using the X Window System (version 11,
release3).  It has been rumored that using the GNU compiler (gcc) on the
X11 server will make it faster.  Does anyone know whether this is indeed
the case for Sun 4
             -----

I recently snarfed the Dhrystone 1.1 program from bu-it.bu.edu (I think
that's where I got it, I was randomly checking archive sites for
interesting junk).

Well the results of a quick experiment with this integer arithmetic
benchmark were very interesting.

the sun compiler (Sun OS 4.0), hereafter called cc, produced the fastest
code with, "cc -O4 -DREG=register", (use register declarations, maximum
level of optimization).  I consistantly got results of just over 14,000
dhrystones/second.

However, the gcc compiler behaved strangely.
"gcc -O" seems faster than "gcc -O -DREGS=register" (i.e. it's faster
NOT to use registers) ~12,400 vs ~11,000

And even when I started throwing the serious compiler options
	-finline-functions
	-fstrength-reduce
	-fomit-frame-pointer
	-fforce-mem
	-fforce-addr
	-fcombine-regs
at the problem, it still couldn't touch Sun's compiler.

The best performance I've gotten is about 12,700 dhrystones per second
with "gcc -O -finline-functions -fstrength-reduce -fomit-frame-pointer"

Well, I'm about to take my system down to single user mode to verify these
performance differences under more controlled conditions.  (I don't think
there'll be any significant change, I tried some combinations under single
user mode already, and cc -O3 was much faster than the couple of gcc -O
etc etc I tried, (single user mode is such a pain for any type of
interactive work, so I brought up X to try more combinations and send this
posting))

I am also going to try recompiling the X server with cc -O4 (instead of
the default -O2).  I'll try to post any findings, but it may take a while
(I have to scrounge together enough disk space).

In the mean time, does anyone have any theories about what's going on?
Does anyone have any authoritative information about how gcc and cc are
supposed to compare?

Does anyone know where I can get a nice floating point benchmark?
(whetstone?) 

Craig Chase

cmc3@nvuxr.bellcore.com