cvs commit: fptools/ghc/includes PrimOps.h fptools/ghc/compiler/p relude primops.txt.pp fptools/ghc/rts Exception.hc fptools/libraries/base/ GHC IOBase.lhs

Simon Marlow simonmar@glass.cse.ogi.edu
Thu, 19 Jun 2003 03:42:27 -0700


simonmar    2003/06/19 03:42:27 PDT

  Modified files:
    ghc/includes         PrimOps.h 
    ghc/compiler/prelude primops.txt.pp 
    ghc/rts              Exception.hc 
    libraries/base/GHC   IOBase.lhs 
  Log:
  Add raiseIO# primop.
  
  This is part of ensuring that exceptions are *precise* in the IO monad
  (as opposed to imprecise exceptions in the pure world).  If we allow
  the strictness analyser to see the definition of throwIO:
  
    throwIO e = IO $ \s -> throw e
  
  then it might re-order evaluation in the IO monad, with the result
  that we get _|_ instead of an exception, or one kind of exception when
  we were expecting another.  We therefore must prevent the strictness
  analyser from doing these reorderings in the IO monad.  Hiding the
  definition of throwIO by making it a primop solves part of the problem
  (there's more to come).
  
  See SourceForge bug #752149.
  
  Revision  Changes    Path
  1.102     +2 -1      fptools/ghc/includes/PrimOps.h
  1.27      +10 -1     fptools/ghc/compiler/prelude/primops.txt.pp
  1.28      +10 -2     fptools/ghc/rts/Exception.hc
  1.30      +3 -3      fptools/libraries/base/GHC/IOBase.lhs