Subject: Re: gcc math problems on NetBSD and OpenBSD
To: Lars Bausch <>
From: Krister Walfridsson <>
List: tech-toolchain
Date: 12/29/2005 17:27:05
On Thu, 29 Dec 2005, Lars Bausch wrote:

> On NetBSD and OpenBSD on i386 I get it to work, if I use the CFLAGS 
> "-ffloat-store -funsafe-math-optimisation". The performance is 20 % slower 
> compared with other OSes on the same system. But the math will be  computed 
> right, and the results are within a vailid range.

The NetBSD gcc is configured to generate code so that it works on all
(even ancient) machines.  This means that it generates code for 386
and does not use the more fancy floating point operations.  This differs
from many Linux distributions that defaults to generating code for more
modern machines.

You could try to see if generating code for a more modern machine
(by adding e.g. -mcpu=pentium to the compiler flags) improves the
performance.  See the section "Target Options" in the gcc
documentation for the full list of hardware-related flags you can