[comp.sys.mips] When is -O2 faster than -O3 for MIPS compiler?

hsong@nvuxl.UUCP (g hugh song) (12/29/90)

I wrote yesterday about the f77 compiler 2.1 for DecStation 5000/200
with Ultrix 4.0 :
> It is running with -O2 -C.  However it does not run without -C.  Usually
> the revese is the usual case. 

("-C" is for the run-time subscript range checking, BTW)
I finally pinpointed out a routine which is affected by the compiler
bug.   (It was not easy to pinpoint out just one routine among
about 100 routines.)

The same program ran with -O3 without -C, but at slower speed.
What?  Yes. it ran more than two times slowly with higher optimization 
level. The other compiler switches I used for both cases are 
"-Olimit 2000 -align32" and either "-c" or "-j" with respect to 
-O2 or -O3.  And the loader switch is "-G 4800".

So my question is:
In what situation, is "-O2" faster than "-O3"?

My conclusion so far is there is a very critical bug in the 
compiler-optimizer.  And there is no handy mechanism for detecting
floating point errors.   Someone pointed out "fpc" in <mips/fpu.h>.
But I still do not understand how it works.
If you know how to use it, please let us know how to use it.

Thanks.

	-hsong-
	nvuxl!hsong@bellcore.bellcore.com
	hosng%nvuxl@bellcore.bellcore.com

PS: You need to type "nvuxl\!hsong@..." on Csh command line.