[commit: ghc] ghc-8.2: Remove utterly bogus code (844c5a7)

git at git.haskell.org git at git.haskell.org
Wed Mar 29 23:41:54 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/844c5a719dc29d755949774f3254c66a3fc3aa5f/ghc

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

commit 844c5a719dc29d755949774f3254c66a3fc3aa5f
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Mar 27 14:33:55 2017 +0100

    Remove utterly bogus code
    
    The commit 6746549772c5cc0ac66c0fce562f297f4d4b80a2
        Author: Richard Eisenberg <eir at cis.upenn.edu>
        Date:   Fri Dec 11 18:19:53 2015 -0500
    
        Add kind equalities to GHC.
    
    added this entirely bogus code to Simplify.simplLam:
    
        env' | Coercion co <- arg
             = extendCvSubst env bndr co
             | otherwise
             = env
    
    It's bogus because 'co' is an 'InCoercion', but a CvSubst should have
    only OutCoercions in it.  Moreover, completeBind does the job nicely.
    
    This led to an ASSERT failure in an experimental branch; but I have
    not got a repro case that works on HEAD.  But still, the patch deletes
    code and fixes a bug, so it must be good.
    
    The only mystery is why Richard added it in the first place :-).
    I hope I'm not missing anything.  But it validates fine.
    
    (cherry picked from commit de4723fd6d97b285bb754d8b95531c86d34c4032)


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

844c5a719dc29d755949774f3254c66a3fc3aa5f
 compiler/simplCore/Simplify.hs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs
index 977fa25..944d8de 100644
--- a/compiler/simplCore/Simplify.hs
+++ b/compiler/simplCore/Simplify.hs
@@ -1369,13 +1369,8 @@ simplLam env (bndr:bndrs) body (ApplyToTy { sc_arg_ty = arg_ty, sc_cont = cont }
 simplLam env (bndr:bndrs) body (ApplyToVal { sc_arg = arg, sc_env = arg_se
                                            , sc_cont = cont })
   = do  { tick (BetaReduction bndr)
-        ; simplNonRecE env' (zap_unfolding bndr) (arg, arg_se) (bndrs, body) cont }
+        ; simplNonRecE env (zap_unfolding bndr) (arg, arg_se) (bndrs, body) cont }
   where
-    env' | Coercion co <- arg
-         = extendCvSubst env bndr co
-         | otherwise
-         = env
-
     zap_unfolding bndr  -- See Note [Zap unfolding when beta-reducing]
       | isId bndr, isStableUnfolding (realIdUnfolding bndr)
       = setIdUnfolding bndr NoUnfolding



More information about the ghc-commits mailing list