#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 [EMAIL PROTECTED]):

 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
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to