Opened 6 years ago

Closed 5 years ago

#8849 closed bug (fixed)

Unregisterised compiler: arithmetic failure

Reported by: trommler Owned by:
Priority: high Milestone: 7.8.4
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case: arith005
Blocked By: Blocking: #8819
Related Tickets: #8819 Differential Rev(s):
Wiki Page:

Description

Compiling the following with RC2 on powerpc 64 downloaded from haskell.org:

main = putStr $ show (-1.0000000001 :: Double)

Setting -O yields:

0.0

Without optimization the correct result is displayed.

I prepared an unregisterised compiler on amd64 and see the same issue and more arithmetic tests fail in testsuite. In fact I took the above from arith005.

Attachments (2)

mini-noopt.hc (4.1 KB) - added by trommler 6 years ago.
output of ghc -C
mini.hc (4.6 KB) - added by trommler 6 years ago.
output of ghc -O -C

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by trommler

Operating System: Unknown/MultipleLinux

I should add I ran the tests on Linux.

Changed 6 years ago by trommler

Attachment: mini-noopt.hc added

output of ghc -C

Changed 6 years ago by trommler

Attachment: mini.hc added

output of ghc -O -C

comment:2 Changed 6 years ago by trommler

I produced the attached files on my amd64 machine.

In line 26 of mini.hc (with -O optimization) we see a constant 0.0 whereas line 32 in mini-noopt.hc there is 1.0000000001 and a call to GHC.Num.negate.

comment:3 Changed 5 years ago by trommler

Blocking: 8819 added
Milestone: 7.8.3

As this is a regression from 7.6.3 we should look into this for 7.8.3.

comment:4 Changed 5 years ago by thoughtpolice

Milestone: 7.8.37.8.4

Moving to 7.8.4.

comment:5 Changed 5 years ago by trommler

Status: newmerge

comment:6 Changed 5 years ago by trommler

difficulty: UnknownEasy (less than 1 hour)
Priority: normalhigh

This ticket blocks #8819 which is priority high.

The commit mentioned in comment:5 applied cleanly when I prepared a patch file for the released 7.8.3 tarball. You should be able to just cherry-pick it. If not, please assign the ticket to me and let me know what you prefer: phabricator, patch file?

comment:7 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

These have been merged into ghc-7.8.

Note: See TracTickets for help on using tickets.