Subject: Another GCC bug!
To: None <current-users@NetBSD.ORG, port-i386@NetBSD.ORG>
From: Tom I Helbekkmo <tih@Hamartun.Priv.NO>
List: current-users
Date: 05/13/1996 17:12:55
Hi!

We all know that the current version of GCC in the NetBSD source tree
has a bug that can bite at "-O2" and above, unless used with the flag
"-fno-strength-reduce".  A couple of different patches for this are
floating around, and I've been using one of them, and compiling
everything (kernel, libraries, applications) at "-O2".  Until today.

It turns out that there's another nasty in there, related to floating
point stuff.  I've reproduced the problem on two different Intel 486
systems, a Digital PC with a patch for the above bug installed and a
Compaq with no patches whatsoever; just straight NetBSD-current with
the x87-dependent lines in the libm Makefile enabled.

At optimization level 2, the "paranoia" benchmark finds, using its
terminology,  1 flaw, 2 defects, 1 serious defect and 1 failure in our
floating point system.  At level 1, nothing bad happens.  (Paranoia
can be found at "ftp://ftp.cdrom.com/pub/netlib/paranoia/".)

The way I discovered this was that I compiled ACM (the air combat
flight simulator) at "-O2", and it simply didn't work -- it just
spewed out error messages.  With "-O" it started working, but it would
crash a lot, until I recompiled libm with "-O" and installed it.  ACM
has worked great since then.

Could someone "in the know" check whether this might be related to
something particular to the NetBSD implementation, and otherwise maybe
report it to the GCC folks through proper channels?

-tih
-- 
Tom Ivar Helbekkmo
tih@Hamartun.Priv.NO