[GHC] #10332: AArch64 : divbyzero test fails
GHC
ghc-devs at haskell.org
Tue Apr 21 03:34:47 UTC 2015
#10332: AArch64 : divbyzero test fails
-------------------------------------+-------------------------------------
Reporter: erikd | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.11
Keywords: | Operating System: Unknown/Multiple
Architecture: aarch64 | Type of failure: Incorrect result
Test Case: | at runtime
testsuite/tests/rts/divbyzero.hs | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
On AArch64/Linux the test in `testsuite/tests/rts/divbyzero.hs` which is:
{{{
main :: IO ()
main = print (5 `divInt` 0)
}}}
just prints "0" and exits with a zero status code.
From the "ARMv8 Instriction Set Overview" document I found (wasn't able to
find anything more recent):
https://www.element14.com/community/servlet/JiveServlet/downloadBody/41836-102-1-229511/ARM.Reference_Manual.pdf
Section 3.6 says "There is no hardware check for “divide by zero”, but
this check can be performed in the shadow of a long latency division. A
divide by zero writes zero to the destination register."
Looks like we need extra code to check for this, but not sure how to
report it. Should probably look at what GCC and Clang do.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10332>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list