[GHC] #1171: GHC generates incorrect code with -O for Haskell
98 program
GHC
trac at galois.com
Tue Feb 27 12:06:46 EST 2007
#1171: GHC generates incorrect code with -O for Haskell 98 program
----------------------+-----------------------------------------------------
Reporter: neil | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 6.6.1
Component: Compiler | Version: 6.6
Severity: major | Resolution: invalid
Keywords: | Difficulty: Unknown
Testcase: cg059 | Architecture: Multiple
Os: Multiple |
----------------------+-----------------------------------------------------
Comment (by malcolm.wallace at cs.york.ac.uk):
Wow, you really claim that if the program calls 'error' at all, then _any_
call to error will do!?
If my program has an ArithmeticOverflow, then it is OK to report
DivideByZero instead?
The semantics of H'98 clearly say that pattern-matching is left-to-right,
top-to-bottom, so
case [] of
[] -> error "OK"
_ -> error "broken"
really _must_ give the error "OK", not the error "broken".
See H'98, Section 3.17.3, Figure 3.1, case (b).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1171>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list