[commit: ghc] ghc-7.10: dwarf: sync getIdFromTrivialExpr with exprIsTrivial (test break028 and others) (a79cfe5)

git at git.haskell.org git at git.haskell.org
Tue Dec 23 14:56:10 UTC 2014


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/a79cfe5124bede0ab6f59f3004584f9cdf96da32/ghc

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

commit a79cfe5124bede0ab6f59f3004584f9cdf96da32
Author: Sergei Trofimovich <siarheit at google.com>
Date:   Tue Dec 23 08:55:06 2014 -0600

    dwarf: sync getIdFromTrivialExpr with exprIsTrivial (test break028 and others)
    
    Summary:
    The bug manifests when built with
        EXTRA_HC_OPTS += -g
    
    +++ ./ghci.debugger/scripts/break028.run.stderr 2014-12-19 23:08:46.199876621 +0000
    @@ -0,0 +1,11 @@
    +ghc-stage2: panic! (the 'impossible' happened)
    +  (GHC version 7.9.20141219 for x86_64-unknown-linux):
    +       getIdFromTrivialExpr x_alJ
    +
    +Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
    +
    +
    +<interactive>:3:1: Not in scope: ‘g’
    +
    +<interactive>:3:3: Not in scope: data constructor ‘False’
    
    Signed-off-by: Sergei Trofimovich <siarheit at google.com>
    
    Reviewers: simonmar, austin, scpmw
    
    Reviewed By: scpmw
    
    Subscribers: carter, thomie
    
    Differential Revision: https://phabricator.haskell.org/D580
    
    (cherry picked from commit 30fdf86eec34711be07c6771b02a6fc81ac99ee2)


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

a79cfe5124bede0ab6f59f3004584f9cdf96da32
 compiler/coreSyn/CoreUtils.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs
index c520029..913dda3 100644
--- a/compiler/coreSyn/CoreUtils.hs
+++ b/compiler/coreSyn/CoreUtils.hs
@@ -663,6 +663,7 @@ getIdFromTrivialExpr :: CoreExpr -> Id
 getIdFromTrivialExpr e = go e
   where go (Var v) = v
         go (App f t) | not (isRuntimeArg t) = go f
+        go (Tick t e) | not (tickishIsCode t) = go e
         go (Cast e _) = go e
         go (Lam b e) | not (isRuntimeVar b) = go e
         go e = pprPanic "getIdFromTrivialExpr" (ppr e)



More information about the ghc-commits mailing list