[commit: ghc] master: Extensive Notes on can_fail and has_side_effects (ab6480b)

git at git.haskell.org git at git.haskell.org
Thu Aug 7 08:55:51 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ab6480b8d8ea45ae6958558245266153df071aa5/ghc

>---------------------------------------------------------------

commit ab6480b8d8ea45ae6958558245266153df071aa5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Aug 7 07:46:24 2014 +0100

    Extensive Notes on can_fail and has_side_effects
    
    In fixing Trac #9390 I discovered that I *still* didn't really understand
    what the can_fail and has_side_effects properties of a PrimOp mean, precisely.
    
    The big new things I learned are
    
    * has_side_effects needs to be true only of *write* effects,
      Reads (which are, strictly speaking, effects) don't matter here.
    
    * has_side_effects must be true of primops that can throw a synchronous
      Haskell exception (eg raiseIO#)
    
    * can_fail is true only of primops that can cause an *unchecked* (not
      Haskell) system exception, like divide by zero, or accessing memory
      out of range through an array read or write.
    
    I've documented all this now.  The changes in this patch are only
    in comments.


>---------------------------------------------------------------

ab6480b8d8ea45ae6958558245266153df071aa5
 compiler/coreSyn/CoreUtils.lhs |  19 ++++--
 compiler/prelude/PrimOp.lhs    | 149 ++++++++++++++++++++++++++++-------------
 compiler/simplCore/FloatIn.lhs |   1 +
 3 files changed, 119 insertions(+), 50 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ab6480b8d8ea45ae6958558245266153df071aa5


More information about the ghc-commits mailing list