[GHC] #12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O"
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- On Debian GNU/Linux x86, GHC 8.0.1 crashes compiling the attached code, but only when "-O1" is given. Without optimization, it compiles fine. {{{#!hs {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} module Main where import Prelude hiding ( (.) , (+) , (*) ) import qualified Prelude main :: IO () main = return () x :: Int x = 42 f a b c = (c * (a + b)) == ((c * a) + (c * b)) g = f x x x newtype Sum a = Sum { getSum :: a } newtype Product a = Product { getProduct :: a } type family CatParam t :: * class Semigroupoid p where type CatSrc p t :: * type CatDest p t :: * type CatT p a b :: * (.) :: ( p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c ) => catBC -> catAB -> catAC data BasicSumSemigroup (t :: *) :: * type instance CatParam (Sum Int) = BasicSumSemigroup Int instance (Num t) => Semigroupoid (BasicSumSemigroup t) where type CatSrc (BasicSumSemigroup _) _ = () type CatDest (BasicSumSemigroup _) _ = () type CatT (BasicSumSemigroup t) _ _ = Sum t (Sum x) . (Sum y) = Sum ((Prelude.+) x y) data BasicProductSemigroup (t :: *) :: * type instance CatParam (Product Int) = BasicProductSemigroup Int instance (Num t) => Semigroupoid (BasicProductSemigroup t) where type CatSrc (BasicProductSemigroup _) _ = () type CatDest (BasicProductSemigroup _) _ = () type CatT (BasicProductSemigroup t) _ _ = Product t (Product x) . (Product y) = Product ((Prelude.*) x y) type family RingParamFromSum p :: * type family RingParamFromProduct p :: * class NearRingWithoutId t where type SumP t type ProdP t type LeftDistrib t origLeftCat rightArg type RightDistrib t origLeftCat leftArg (+) :: ( t ~ RingParamFromSum sumP, Semigroupoid sumP, p ~ sumP, p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c, catAB ~ Sum noSumCatAB, catBC ~ Sum noSumCatBC, catAC ~ Sum noSumCatAC ) => noSumCatBC -> noSumCatAB -> noSumCatAC (+) x y = getSum ((Sum x) . (Sum y)) (*) :: ( t ~ RingParamFromProduct prodP, Semigroupoid prodP, p ~ prodP, p ~ CatParam catAB, p ~ CatParam catBC, p ~ CatParam catAC, a ~ CatSrc p catAB, b ~ CatSrc p catBC, a ~ CatSrc p catAC, b ~ CatDest p catAB, c ~ CatDest p catBC, c ~ CatDest p catAC, catAB ~ CatT p a b, catBC ~ CatT p b c, catAC ~ CatT p a c, catAB ~ Product noProdCatAB, catBC ~ Product noProdCatBC, catAC ~ Product noProdCatAC, sumCatAB ~ Sum noProdCatAB, sumCatBC ~ Sum noProdCatBC, sumCatAC ~ Sum noProdCatAC, ps ~ sumP, ps ~ CatParam sumCatAB, ps ~ CatParam sumCatBC, ps ~ CatParam sumCatAC, sumABSrc ~ CatSrc p sumCatAB, sumBCSrc ~ CatSrc p sumCatBC, sumACSrc ~ CatSrc p sumCatAC, sumABDest ~ CatDest p sumCatAB, sumBCDest ~ CatDest p sumCatBC, sumACDest ~ CatDest p sumCatAC, sumACSrc ~ LeftDistrib t sumBCSrc noProdCatAB, sumACSrc ~ RightDistrib t sumACSrc noProdCatBC, sumACDest ~ LeftDistrib t sumBCDest noProdCatAB, sumACDest ~ RightDistrib t sumACDest noProdCatBC ) => noProdCatBC -> noProdCatAB -> noProdCatAC (*) x y = getProduct ((Product x) . (Product y)) data TestInt type instance RingParamFromSum (BasicSumSemigroup Int) = TestInt type instance RingParamFromProduct (BasicProductSemigroup Int) = TestInt instance NearRingWithoutId TestInt where type SumP TestInt = BasicSumSemigroup Int type ProdP TestInt = BasicProductSemigroup Int type LeftDistrib TestInt _ _ = () type RightDistrib TestInt _ _ = () }}} The following error results: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.0.1 for x86_64-unknown-linux): Template variable unbound in rewrite rule Variable: cobox_s3PM Rule "SPEC f @ Int @ Int @ Int @ Int @ Int @ Int @ Int" Rule bndrs: [cobox_s3PM, cobox_s3PN, cobox_s3PO, cobox_s3PP, cobox_s3PQ, cobox_s3PR, cobox_s3PS, cobox_s3PT, cobox_s3PU, cobox_s3PV, cobox_s3PW, cobox_s3PX, cobox_s3PY, cobox_s3PZ, cobox_s3Q0, cobox_s3Q1, cobox_s3Q2, cobox_s3Q3, cobox_s3Q4, cobox_s3Q5, cobox_s3Q6, cobox_s3Q7, cobox_s3Q8, cobox_s3Q9, cobox_s3Qa, cobox_s3Qb, cobox_s3Qc, cobox_s3Qd, cobox_s3Qe, cobox_s3Qf, cobox_s3Qg, cobox_s3Qh, cobox_s3Qi, cobox_s3Qj, cobox_s3Qk, cobox_s3Ql, cobox_s3Qm, cobox_s3Qn, cobox_s3Qo, cobox_s3Qp, cobox_s3Qq, cobox_s3Qr, cobox_s3Qs, cobox_s3Qt, cobox_s3Qu, cobox_s3Qv, cobox_s3Qw, cobox_s3Qx, cobox_s3Qy, cobox_s3Qz, cobox_s3QA, cobox_s3QB, $dSemigroupoid_X3SC, $dSemigroupoid_X3SE, $dNearRingWithoutId_s3QE, $dNearRingWithoutId_s3QF, $dEq_s3QG] LHS args: [TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: cobox_s3PP, CO: cobox_s3PQ, CO: cobox_s3PR, CO: cobox_s3PS, CO: cobox_s3PT, CO: cobox_s3PU, CO: cobox_s3PV, CO: cobox_s3PW, CO: cobox_s3PX, CO: cobox_s3PY, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: cobox_s3Q0, CO: <CatParam (Product Int)>_N, CO: cobox_s3Q2, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: cobox_s3Q6, CO: cobox_s3Q7, CO: cobox_s3Q8, CO: cobox_s3Q9, CO: cobox_s3Qa, CO: cobox_s3Qb, CO: cobox_s3Qc, CO: cobox_s3Qd, CO: cobox_s3Qe, CO: <CatParam (Product Int)>_N, CO: cobox_s3Qg, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qk, CO: cobox_s3Ql, CO: cobox_s3Qm, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qs, CO: <CatParam (Sum Int)>_N, CO: cobox_s3Qu, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: cobox_s3Qz, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, $dSemigroupoid_X3SC, $dSemigroupoid_X3SE, $dNearRingWithoutId_s3QE, $dNearRingWithoutId_s3QF, $dEq_s3QG] Actual args: [TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, TYPE: Int, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamSum[0]) <Sum Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: (CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N ; Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Product Int>_N)_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatDest D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (RightDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((LeftDistrib ((RingParamFromProduct D:R:CatParamProduct[0])_N ; D:R:RingParamFromProductBasicProductSemigroup[0]) ((CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) <Int>_N)_N ; D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) <Int>_N)_N ; D:R:RightDistribTestInt__1[0] <()>_N <Int>_N ; Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N, CO: (CatSrc D:R:CatParamProduct[0] <Sum Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:RightDistribTestInt__1[0] <()>_N <Int>_N) ; (RightDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:LeftDistribTestInt__1[0] <()>_N <Int>_N) ; (LeftDistrib (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N) (Sym (D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatSrc (Sym D:R:CatParamProduct[0]) <Sum Int>_N)_N) <Int>_N)_N) <Int>_N)_N, CO: (CatT D:R:CatParamProduct[0] ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: (CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N ; Sym (D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ; (CatDest (Sym D:R:CatParamSum[0]) <Sum Int>_N)_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatDest (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatParam (Sum Int)>_N, CO: (CatT D:R:CatParamSum[0] ((CatSrc D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatSrcBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N) ((CatDest D:R:CatParamSum[0] <Sum Int>_N)_N ; D:R:CatDestBasicSumSemigroup_1[0] <Int>_N <Sum Int>_N))_N ; D:R:CatTBasicSumSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Sum Int)) (Sum Int)>_N, CO: <CatParam (Sum Int)>_N, CO: <CatDest (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, CO: (CatT D:R:CatParamProduct[0] ((CatSrc D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatSrcBasicProductSemigroup_1[0] <Int>_N <Product Int>_N) ((CatDest D:R:CatParamProduct[0] <Product Int>_N)_N ; D:R:CatDestBasicProductSemigroup_1[0] <Int>_N <Product Int>_N))_N ; D:R:CatTBasicProductSemigroup__1[0] <Int>_N <()>_N <()>_N, CO: <CatSrc (CatParam (Product Int)) (Product Int)>_N, CO: <CatParam (Product Int)>_N, ($c._a32V @ Int $fNumInt) `cast` (Sym (N:Semigroupoid[0] <BasicSumSemigroup Int>_N) ; (Semigroupoid (Sym D:R:CatParamSum[0]))_R :: ((forall catAB_awI[sk] catBC_awJ[sk] catAC_awK[sk] a_awL[sk] b_awM[sk] c_awN[sk]. ((BasicSumSemigroup Int :: *) ~ (CatParam catAB_awI[sk] :: *), (BasicSumSemigroup Int :: *) ~ (CatParam catBC_awJ[sk] :: *), (BasicSumSemigroup Int :: *) ~ (CatParam catAC_awK[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catAB_awI[sk] :: *), (b_awM[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catBC_awJ[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicSumSemigroup Int) catAC_awK[sk] :: *), (b_awM[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catAB_awI[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catBC_awJ[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicSumSemigroup Int) catAC_awK[sk] :: *), (catAB_awI[sk] :: *) ~ (CatT (BasicSumSemigroup Int) a_awL[sk] b_awM[sk] :: *), (catBC_awJ[sk] :: *) ~ (CatT (BasicSumSemigroup Int) b_awM[sk] c_awN[sk] :: *), (catAC_awK[sk] :: *) ~ (CatT (BasicSumSemigroup Int) a_awL[sk] c_awN[sk] :: *)) => catBC_awJ[sk] -> catAB_awI[sk] -> catAC_awK[sk]) :: *) ~R# (Semigroupoid (CatParam (Sum Int)) :: Constraint)), ($c._a32m @ Int $fNumInt) `cast` (Sym (N:Semigroupoid[0] <BasicProductSemigroup Int>_N) ; (Semigroupoid (Sym D:R:CatParamProduct[0]))_R :: ((forall catAB_awI[sk] catBC_awJ[sk] catAC_awK[sk] a_awL[sk] b_awM[sk] c_awN[sk]. ((BasicProductSemigroup Int :: *) ~ (CatParam catAB_awI[sk] :: *), (BasicProductSemigroup Int :: *) ~ (CatParam catBC_awJ[sk] :: *), (BasicProductSemigroup Int :: *) ~ (CatParam catAC_awK[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catAB_awI[sk] :: *), (b_awM[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catBC_awJ[sk] :: *), (a_awL[sk] :: *) ~ (CatSrc (BasicProductSemigroup Int) catAC_awK[sk] :: *), (b_awM[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catAB_awI[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catBC_awJ[sk] :: *), (c_awN[sk] :: *) ~ (CatDest (BasicProductSemigroup Int) catAC_awK[sk] :: *), (catAB_awI[sk] :: *) ~ (CatT (BasicProductSemigroup Int) a_awL[sk] b_awM[sk] :: *), (catBC_awJ[sk] :: *) ~ (CatT (BasicProductSemigroup Int) b_awM[sk] c_awN[sk] :: *), (catAC_awK[sk] :: *) ~ (CatT (BasicProductSemigroup Int) a_awL[sk] c_awN[sk] :: *)) => catBC_awJ[sk] -> catAB_awI[sk] -> catAC_awK[sk]) :: *) ~R# (Semigroupoid (CatParam (Product Int)) :: Constraint)), $fNearRingWithoutIdTestInt `cast` ((NearRingWithoutId (Sym D:R:RingParamFromSumBasicSumSemigroup[0] ; (RingParamFromSum (Sym D:R:CatParamSum[0]))_N))_R :: (NearRingWithoutId TestInt :: Constraint) ~R# (NearRingWithoutId (RingParamFromSum (CatParam (Sum Int))) :: Constraint)), $fNearRingWithoutIdTestInt `cast` ((NearRingWithoutId (Sym D:R:RingParamFromProductBasicProductSemigroup[0] ; (RingParamFromProduct (Sym D:R:CatParamProduct[0]))_N))_R :: (NearRingWithoutId TestInt :: Constraint) ~R# (NearRingWithoutId (RingParamFromProduct (CatParam (Product Int))) :: Constraint)), $fEqInt, x, x, x] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by clinton): * Attachment "ring_bug.hs" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by clinton): * Attachment "error.txt" added. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge Comment: I think this is a dup of #12212. Certianly it works with HEAD; I checked. The fix for #12212 has been merged to the 8.0 branch, I think. I have not checked that it works with the 8.0 branch. I'll set status to 'merge' just to invite someone to test that. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Indeed the example compiles fine with b5ec09dff6b865550f3bd225f86028a304596c61. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12408: "ghc: panic! (the 'impossible' happened)" only when compiled with "-O" -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.0.2 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12408#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC