#1171: GHC generates incorrect code with -O for Haskell 98 program
----------------------+-----------------------------------------------------
 Reporter:  neil      |          Owner:          
     Type:  bug       |         Status:  reopened
 Priority:  low       |      Milestone:  _|_     
Component:  Compiler  |        Version:  6.6     
 Severity:  normal    |     Resolution:          
 Keywords:            |     Difficulty:  Unknown 
 Testcase:  cg059     |   Architecture:  Multiple
       Os:  Multiple  |  
----------------------+-----------------------------------------------------
Comment (by neil):

 For reference, Yhc has now been patched to do |unsafePerformIO $ putStrLn
 "msg" >> exit|, which should fix this behaviour.

 Perhaps the problem is that there are two different uses of error, one is
 as an internal assertion - typically introduced by an incomplete pattern.
 The other is the programmer explicitly stating that the program should
 stop now and give the user a message. The Safe [1] library provides an
 "abort" function to handle the latter, partly so automated checkers can
 tell the difference between good and bad calls to error.


 [1] http://www-users.cs.york.ac.uk/~ndm/projects/safe/Safe.html#v%3Aabort

-- 
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