diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-02-21 09:34:01 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-11-07 08:13:47 -0500 |
commit | dc9aa75e2a299aa1175fd838f595ce41ea837822 (patch) | |
tree | f1b5ff4dfc3bde4cfe6daf2ba5c8934fd28c4e64 | |
parent | efe714d65f5acfdc1da23b85192ff040f36f6b6a (diff) | |
download | haskell-dc9aa75e2a299aa1175fd838f595ce41ea837822.tar.gz |
Don't do binder-swap for GlobalIds
This patch disables the binder-swap transformation in the
(relatively rare) case when the scrutinee is a GlobalId.
Reason: we are getting Lint errors so that GHC doesn't
even validate. Trac #16346.
This is NOT the final solution -- it's just a stop-gap
to get us running again.
The final solution is in Trac #16296
(cherry picked from commit 0eb7cf03da3783ca887d5de44d312cf6f3a4113c)
-rw-r--r-- | compiler/simplCore/OccurAnal.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 8b16422960..8b6bc2eed2 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2373,9 +2373,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr _ -> (env { occ_encl = OccVanilla }, Nothing) where - add_scrut v rhs = ( env { occ_encl = OccVanilla - , occ_gbl_scrut = pe `extendVarSet` v } - , Just (localise v, rhs) ) + add_scrut v rhs + | isGlobalId v = (env { occ_encl = OccVanilla }, Nothing) + | otherwise = ( env { occ_encl = OccVanilla + , occ_gbl_scrut = pe `extendVarSet` v } + , Just (localise v, rhs) ) + -- ToDO: this isGlobalId stuff is a TEMPORARY FIX + -- to avoid the binder-swap for GlobalIds + -- See Trac #16346 case_bndr' = Var (zapIdOccInfo case_bndr) -- See Note [Zap case binders in proxy bindings] |