[GHC] #11728: Core lint errors
GHC
ghc-devs at haskell.org
Fri Mar 25 09:35:54 UTC 2016
#11728: Core lint errors
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: bug | Status: merge
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by simonpj):
* status: new => merge
Comment:
The original report is fixed by this commit (I made a typo in the ticket
number).
{{{
commit 356e5e03e63558019fd0571b6c462740aceb7810
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Mar 25 09:23:17 2016 +0000
Do not eta-reduce across Ticks in CorePrep
The function tryEtaReducePrep was being over-ambitious.
When Breakpoint ticks were involved (i.e. in GHCi), eta
reduction left an out-of-scope variable in the Tick.
Easily fixed. Fixes the original report in Trac #111728.
>---------------------------------------------------------------
356e5e03e63558019fd0571b6c462740aceb7810
compiler/coreSyn/CorePrep.hs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs
index 58eda2f..fb00f2b 100644
--- a/compiler/coreSyn/CorePrep.hs
+++ b/compiler/coreSyn/CorePrep.hs
@@ -967,8 +967,13 @@ tryEtaReducePrep bndrs (Let bind@(NonRec _ r) body)
where
fvs = exprFreeVars r
-tryEtaReducePrep bndrs (Tick tickish e)
- = fmap (mkTick tickish) $ tryEtaReducePrep bndrs e
+-- NB: do not attempt to eta-reduce across ticks
+-- Otherwise we risk reducing
+-- \x. (Tick (Breakpoint {x}) f x)
+-- ==> Tick (breakpoint {x}) f
+-- which is bogus (Trac #17228)
+-- tryEtaReducePrep bndrs (Tick tickish e)
+-- = fmap (mkTick tickish) $ tryEtaReducePrep bndrs e
tryEtaReducePrep _ _ = Nothing
}}}
I'll add a test. Please merge.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11728#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list