Opened 8 years ago

Closed 8 years ago

#5747 closed bug (fixed)

Floating point error with -msse2

Reported by: augustss Owned by: simonmar
Priority: highest Milestone: 7.4.1
Component: Compiler (NCG) Version: 7.2.1
Keywords: Cc: shelarcy@…
Operating System: Unknown/Multiple Architecture: x86
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Compile and run this program:

main = print (cos 0)

And you get

$ ghc -O2 -fforce-recomp -msse2 Main.hs
[1 of 1] Compiling Main             ( Main.hs, Main.o )
Linking Main.exe ...
$ ./Main
5.249681779125557e-308

(This is a bug in ghc 7.2.2, but that 7.2.2 is not one of the available version choices.)

Change History (5)

comment:1 Changed 8 years ago by shelarcy

Cc: shelarcy@… added

comment:2 Changed 8 years ago by simonmar

Component: CompilerCompiler (NCG)
difficulty: Unknown
Milestone: 7.4.1
Operating System: WindowsUnknown/Multiple
Owner: set to simonmar
Priority: normalhighest

I have a fix for this in my validate queue.

comment:3 Changed 8 years ago by marlowsd@…

commit 23a0ded304d9e2089e5f667fd08ae9436e741030

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Thu Jan 5 14:01:58 2012 +0000

    We must emit DELTA pseudo-instructions when moving %esp (#5747)

 compiler/nativeGen/X86/CodeGen.hs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

comment:4 Changed 8 years ago by simonmar

Status: newmerge

comment:5 Changed 8 years ago by igloo

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.