[Haskell-cafe] Possible floating point bug in GHC?

Ian Lynagh igloo at earth.li
Fri Apr 3 16:35:05 EDT 2009

On Fri, Apr 03, 2009 at 10:10:17PM +0200, Peter Verswyvelen wrote:
> I tried both precise and fast, but that did not help. Compiling to SSE2
> fixed it, since that does not use a floating point stack I guess.

You didn't say what version of GHC you are using, but it sounds like
this might already be fixed in 6.10.2 by:

Tue Nov 11 12:56:19 GMT 2008  Simon Marlow <marlowsd at gmail.com>
  * Fix to i386_insert_ffrees (#2724, #1944)
  The i386 native code generator has to arrange that the FPU stack is
  clear on exit from any function that uses the FPU.  Unfortunately it
  was getting this wrong (and has been ever since this code was written,
  I think): it was looking for basic blocks that used the FPU and adding
  the code to clear the FPU stack on any non-local exit from the block.
  In fact it should be doing this on a whole-function basis, rather than
  individual basic blocks.


More information about the Haskell-Cafe mailing list