Xref: utzoo comp.sys.mips:1248 comp.sys.dec:4796 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!usc!cs.utexas.edu!uunet!bellcore!porthos!pyuxe!nvuxl!hsong From: hsong@nvuxl.UUCP (g hugh song) Newsgroups: comp.sys.mips,comp.sys.dec Subject: When is -O2 faster than -O3 for MIPS compiler? Keywords: MIPS, optimization, compiler Message-ID: <765@nvuxl.UUCP> Date: 28 Dec 90 17:13:22 GMT Followup-To: comp.sys.dec Organization: Bellcore, Livingston, NJ Lines: 33 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 . 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.