Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath | Owner: ross Type: bug | Status: closed Priority: high| Milestone: 6.14.1 Component: Compiler|Version: 6.12.1 Resolution: fixed | Keywords: arrows guards case panic Difficulty: | Os: Unknown/Multiple Testcase: T3822 | Architecture: Unknown/Multiple Failure: Compile-time crash | -+-- Changes (by igloo): * status: merge = closed * testcase: patternGuard.hs = T3822 * resolution: = fixed * milestone: 6.12.3 = 6.14.1 Comment: Thanks! Test added. Not merging, as we won't be making another 6.12 release. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: merge Priority: high |Milestone: 6.12.3 Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Changes (by ross): * status: new = merge Comment: I believe this is fixed by {{{ Tue Jun 15 15:51:10 PDT 2010 Ross Paterson ross at soi.city.ac.uk * fix #3822: desugaring case command in arrow notation }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: new Priority: high |Milestone: 6.12.3 Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Comment(by simonmar): Ross: sorry for the delay in getting back to you. Which bit of code is responsible for recognising variables as being used? Is it arrows- specific, or somewhere else? Can you help us fix it? (Cheers, Simon Simon) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: new Priority: normal|Milestone: 6.12.2 Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Comment(by simonpj): Slightly smaller test case {{{ {-# LANGUAGE Arrows #-} module T3822 where import Control.Arrow test :: Int - Int test = proc x - do let neg = x 0 case x of x | neg - returnA - 0 -- GHC panics _ - returnA - 10 }}} Ross: can you see what is wrong? Core Lint gives the error below after desugaring: {{{ *** Core Lint errors : in result of Desugar *** no location info: [in body of letrec with binders fail_dnE :: GHC.Prim.State# GHC.Prim.RealWorld - Data.Either.Either () ()] neg_acJ is out of scope *** Offending Program *** Rec { T3822.test :: GHC.Types.Int - GHC.Types.Int [LclIdX] T3822.test = _aiG @ GHC.Types.Int @ GHC.Types.Int @ GHC.Types.Int (arr_aix @ GHC.Types.Int @ GHC.Types.Int (\ (x_acI :: GHC.Types.Int) - x_acI)) (_aiG @ GHC.Types.Int @ GHC.Types.Int @ GHC.Types.Int (arr_aix @ GHC.Types.Int @ GHC.Types.Int (\ (ds_dnJ :: GHC.Types.Int) - let { x_acI :: GHC.Types.Int [LclId] x_acI = ds_dnJ } in letrec { neg_acJ :: GHC.Bool.Bool [LclId] neg_acJ = _ai2 x_acI (GHC.Types.I# 0); neg_ai3 :: GHC.Bool.Bool [LclId] neg_ai3 = neg_acJ; } in x_acI)) (_aiG @ GHC.Types.Int @ (Data.Either.Either () ()) @ GHC.Types.Int (arr_aix @ GHC.Types.Int @ (Data.Either.Either () ()) (\ (ds_dnH :: GHC.Types.Int) - let { x_acI :: GHC.Types.Int [LclId] x_acI = ds_dnH } in let { x_ahI :: GHC.Types.Int [LclId] x_ahI = x_acI } in let { fail_dnE :: GHC.Prim.State# GHC.Prim.RealWorld - Data.Either.Either () () [LclId] fail_dnE = \ (ds_dnF :: GHC.Prim.State# GHC.Prim.RealWorld) - Data.Either.Right @ () @ () GHC.Unit.() } in case neg_acJ of wild_B1 { GHC.Bool.False - fail_dnE GHC.Prim.realWorld#; GHC.Bool.True - Data.Either.Left @ () @ () GHC.Unit.() })) (|||_aiK @ () @ GHC.Types.Int @ () (_aiG @ () @ GHC.Types.Int @ GHC.Types.Int (arr_aix @ () @ GHC.Types.Int (\ (ds_dnB :: ()) - case ds_dnB of ds_dnB { () - GHC.Types.I# 0 })) returnA_aig) (_aiG @ () @ GHC.Types.Int @ GHC.Types.Int (arr_aix @ () @ GHC.Types.Int (\ (ds_dnD :: ()) - case ds_dnD of ds_dnD { () - GHC.Types.I# 10 })) returnA_ain |||_aiK :: forall b_ami d_amj c_amk. (b_ami - d_amj) - (c_amk - d_amj) - Data.Either.Either b_ami c_amk - d_amj [LclId] |||_aiK = Control.Arrow.||| @ (-) $dArrowChoice_anx $dArrow_anw :: Control.Arrow.Arrow (-) [LclId] $dArrow_anw = $dArrow_anq first_aiH :: forall b_aiN c_aiO d_aiP. (b_aiN - c_aiO) - (b_aiN, d_aiP) - (c_aiO, d_aiP) [LclId] first_aiH = Control.Arrow.first @ (-) $dArrow_anw $dArrow_anv :: Control.Arrow.Arrow (-) [LclId] $dArrow_anv = $dArrow_anq _aiG :: forall a_aiD b_aiE c_aiF. (a_aiD - b_aiE) - (b_aiE - c_aiF) - a_aiD - c_aiF [LclId] _aiG = GHC.Desugar. @ (-) $dArrow_anv $dArrow_anu :: Control.Arrow.Arrow (-) [LclId] $dArrow_anu = $dArrow_anq arr_aix :: forall b_aiL c_aiM. (b_aiL - c_aiM) - b_aiL - c_aiM [LclId] arr_aix = Control.Arrow.arr @ (-)
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: new Priority: normal|Milestone: 6.12.2 Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Comment(by ross): Replying to [comment:7 simonpj]: Ross: can you see what is wrong? Core Lint gives the error below after desugaring: Yes, variables occurring only in guards are not being recognized as being used, so they're discarded from the pipeline before reaching the case. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: new Priority: normal|Milestone: Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Description changed by igloo: Old description: The attached test case causes this panic message: - ghc: panic! (the 'impossible' happened) (GHC version 6.12.1 for x86_64-unknown-linux): initC: srt_lbl Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug - The offending line is the one with '| neg'. It doesn't panic if you use the commented out line below it instead. This kind of case statement is specific to arrow notation (provided by the Arrows extension) - the compiler uses ArrowChoice to implement it. New description: The attached test case causes this panic message: {{{ ghc: panic! (the 'impossible' happened) (GHC version 6.12.1 for x86_64-unknown-linux): initC: srt_lbl Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} The offending line is the one with '| neg'. It doesn't panic if you use the commented out line below it instead. This kind of case statement is specific to arrow notation (provided by the Arrows extension) - the compiler uses ArrowChoice to implement it. -- -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic -+-- Reporter: StephenBlackheath |Owner: ross Type: bug | Status: new Priority: normal|Milestone: 6.12.2 Component: Compiler | Version: 6.12.1 Keywords: arrows guards case panic | Difficulty: Os: Unknown/Multiple | Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash -+-- Changes (by igloo): * milestone: = 6.12.2 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #3822: guards in arrow notation (Arrows extension) case statement cause compiler panic (was: pattern guards in arrow notation (Arrows extension) case statement cause compiler panic)
#3822: guards in arrow notation (Arrows extension) case statement cause compiler panic --+- Reporter: StephenBlackheath | Owner: ross Type: bug| Status: new Priority: normal | Component: Compiler Version: 6.12.1 |Keywords: arrows guards case panic Os: Unknown/Multiple |Testcase: patternGuard.hs Architecture: Unknown/Multiple | Failure: Compile-time crash --+- Changes (by ross): * keywords: arrows pattern guards case panic = arrows guards case panic * os: Linux = Unknown/Multiple * architecture: x86_64 (amd64) = Unknown/Multiple -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3822#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs