#11728 closed bug (fixed)

Core lint errors

Reported by: Iceland_jack Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 8.1
Keywords: PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case: ghci/scripts/T11728
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

I have an older version (8.1.20160117), does this still occur?

Compiling with ghci -dcore-lint -ignore-dot-ghci

Attachments (3)

error.hs (666 bytes) - added by Iceland_jack 21 months ago.
source file
error.log (10.3 KB) - added by Iceland_jack 21 months ago.
Error log from running "ghci -dcore-lint -ignore-dot-ghci /tmp/error.hs &> error.log"
Error.hs (682 bytes) - added by Iceland_jack 21 months ago.

Download all attachments as: .zip

Change History (11)

Changed 21 months ago by Iceland_jack

Attachment: error.hs added

source file

Changed 21 months ago by Iceland_jack

Attachment: error.log added

Error log from running "ghci -dcore-lint -ignore-dot-ghci /tmp/error.hs &> error.log"

comment:1 Changed 21 months ago by Iceland_jack

Keywords: PatternSynonyms added

comment:2 Changed 21 months ago by goldfire

Yes, it still happens. :(

Changed 21 months ago by Iceland_jack

Attachment: Error.hs added

comment:3 Changed 21 months ago by Iceland_jack

I think Error.hs has the same problem, uses UndecidableSuperclasses.

comment:4 Changed 21 months ago by simonpj

Status: newmerge

The original report is fixed by this commit (I made a typo in the ticket number).

commit 356e5e03e63558019fd0571b6c462740aceb7810
Author: Simon Peyton Jones <simonpj@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.

comment:5 Changed 21 months ago by simonpj

The Error.hs problem (between comment:2 and comment:3) is utterly different. I opened #11754 for it.

comment:6 Changed 21 months ago by Simon Peyton Jones <simonpj@…>

In b416630f/ghc:

Test Trac #11728

comment:7 Changed 21 months ago by simonpj

Test Case: ghci/scripts/T11728

comment:8 Changed 21 months ago by bgamari

Milestone: 8.0.1
Resolution: fixed
Status: mergeclosed
Type of failure: None/UnknownOther
Note: See TracTickets for help on using tickets.