From git at git.haskell.org Sun Sep 2 21:16:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 2 Sep 2018 21:16:13 +0000 (UTC) Subject: [commit: ghc] master: Reject class instances with type families in kinds (6dea7c1) Message-ID: <20180902211613.4F7B53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6dea7c161e458ddb3ea4afd366887c8d963c6585/ghc >--------------------------------------------------------------- commit 6dea7c161e458ddb3ea4afd366887c8d963c6585 Author: Ryan Scott Date: Sun Sep 2 22:03:53 2018 +0200 Reject class instances with type families in kinds Summary: GHC doesn't know how to handle type families that appear in class instances. Unfortunately, GHC didn't reject instances where type families appear in //kinds//, leading to #15515. This is easily rectified by calling `checkValidTypePat` on all arguments to a class in an instance (and not just the type arguments). Test Plan: make test TEST=T15515 Reviewers: bgamari, goldfire, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15515 Differential Revision: https://phabricator.haskell.org/D5068 >--------------------------------------------------------------- 6dea7c161e458ddb3ea4afd366887c8d963c6585 compiler/typecheck/TcValidity.hs | 62 ++++++++++++++-------- compiler/types/Type.hs | 9 +++- .../indexed-types/should_fail/SimpleFail13.stderr | 14 ++--- .../tests/indexed-types/should_fail/T2203a.stderr | 8 +-- .../tests/indexed-types/should_fail/T9097.stderr | 9 ++-- testsuite/tests/polykinds/T11520.stderr | 4 +- .../tests/typecheck/should_fail/T13909.stderr | 6 +++ testsuite/tests/typecheck/should_fail/T15515.hs | 20 +++++++ .../tests/typecheck/should_fail/T15515.stderr | 6 +++ testsuite/tests/typecheck/should_fail/all.T | 1 + 10 files changed, 101 insertions(+), 38 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6dea7c161e458ddb3ea4afd366887c8d963c6585 From git at git.haskell.org Sun Sep 2 21:16:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 2 Sep 2018 21:16:16 +0000 (UTC) Subject: [commit: ghc] master: make iToBase62's inner loop stricter in one of its arguments (ed78951) Message-ID: <20180902211616.1E07D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ed789516e201e4fad771e5588da47a62e53b42b8/ghc >--------------------------------------------------------------- commit ed789516e201e4fad771e5588da47a62e53b42b8 Author: Alp Mestanogullari Date: Sun Sep 2 22:06:55 2018 +0200 make iToBase62's inner loop stricter in one of its arguments Summary: hadrian's support for dynamic ways is currently broken (see hadrian#641 [1]). The stage 1 GHCs that hadrian produces end up producing bad code for the `iToBase62` function after a few optimisation passes. In the case where `quotRem` returns (overflowError, 0), GHC isn't careful enough to realise q is _|_ and happily inlines, distributes and floats code around until we end up trying to access index `minBound :: Int` of an array of 62 chars, as a result of inlining the definition of `quotRem` for Ints, in particular the minBound branch [2]. I will separately look into reproducing the bad transformation on a small self-contained example and filling a ticket. [1]: https://github.com/snowleopard/hadrian/issues/641 [2]: https://git.haskell.org/ghc.git/blob/HEAD:/libraries/base/GHC/Real.hs#l366 Test Plan: fixes hadrian#641 Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: tdammers, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5106 >--------------------------------------------------------------- ed789516e201e4fad771e5588da47a62e53b42b8 compiler/basicTypes/Unique.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/basicTypes/Unique.hs b/compiler/basicTypes/Unique.hs index 4a709d2..b5c0fce 100644 --- a/compiler/basicTypes/Unique.hs +++ b/compiler/basicTypes/Unique.hs @@ -325,7 +325,7 @@ iToBase62 n_ go n cs | n < 62 = let !c = chooseChar62 n in c : cs | otherwise - = go q (c : cs) where (q, r) = quotRem n 62 + = go q (c : cs) where (!q, r) = quotRem n 62 !c = chooseChar62 r chooseChar62 :: Int -> Char From git at git.haskell.org Mon Sep 3 08:06:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 3 Sep 2018 08:06:25 +0000 (UTC) Subject: [commit: ghc] master: canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) (2e226a4) Message-ID: <20180903080625.861C03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e226a46c422c12f78dc3d3f62fe5a15e22bd986/ghc >--------------------------------------------------------------- commit 2e226a46c422c12f78dc3d3f62fe5a15e22bd986 Author: Simon Peyton Jones Date: Mon Sep 3 09:00:49 2018 +0100 canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) As Trac #15577 showed, it was possible for a /homo-kinded/ constraint to trigger the /hetero-kinded/ branch of canCFunEqCan, and that triggered an infinite loop. The fix is easier, but there remains a deeper questions: why is the flattener producing giant refexive coercions? >--------------------------------------------------------------- 2e226a46c422c12f78dc3d3f62fe5a15e22bd986 compiler/typecheck/TcCanonical.hs | 20 ++++++++-- testsuite/tests/polykinds/T15577.hs | 21 ++++++++++ testsuite/tests/polykinds/T15577.stderr | 71 +++++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 1 + 4 files changed, 109 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index d6aed31..201504d 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1714,6 +1714,11 @@ the new one, so we use dischargeFmv. This also kicks out constraints from the inert set; this behavior is correct, as the kind-change may allow more constraints to be solved. +We use `isTcReflexiveCo`, to ensure that we only use the hetero-kinded case +if we really need to. Of course `flattenArgsNom` should return `Refl` +whenever possible, but Trac #15577 was an infinite loop because even +though the coercion was homo-kinded, `kind_co` was not `Refl`, so we +made a new (identical) CFunEqCan, and then the entire process repeated. -} canCFunEqCan :: CtEvidence @@ -1733,13 +1738,20 @@ canCFunEqCan ev fn tys fsk flav = ctEvFlavour ev ; (ev', fsk') - -- See Note [canCFunEqCan] - <- if isTcReflCo kind_co - then do { let fsk_ty = mkTyVarTy fsk + <- if isTcReflexiveCo kind_co -- See Note [canCFunEqCan] + then do { traceTcS "canCFunEqCan: refl" (ppr new_lhs $$ ppr lhs_co) + ; let fsk_ty = mkTyVarTy fsk ; ev' <- rewriteEqEvidence ev NotSwapped new_lhs fsk_ty lhs_co (mkTcNomReflCo fsk_ty) ; return (ev', fsk) } - else do { (ev', new_co, new_fsk) + else do { traceTcS "canCFunEqCan: non-refl" $ + vcat [ text "Kind co:" <+> ppr kind_co + , text "RHS:" <+> ppr fsk <+> dcolon <+> ppr (tyVarKind fsk) + , text "LHS:" <+> hang (ppr (mkTyConApp fn tys)) + 2 (dcolon <+> ppr (typeKind (mkTyConApp fn tys))) + , text "New LHS" <+> hang (ppr new_lhs) + 2 (dcolon <+> ppr (typeKind new_lhs)) ] + ; (ev', new_co, new_fsk) <- newFlattenSkolem flav (ctEvLoc ev) fn tys' ; let xi = mkTyVarTy new_fsk `mkCastTy` kind_co -- sym lhs_co :: F tys ~ F tys' diff --git a/testsuite/tests/polykinds/T15577.hs b/testsuite/tests/polykinds/T15577.hs new file mode 100644 index 0000000..18ebc42 --- /dev/null +++ b/testsuite/tests/polykinds/T15577.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +{-# LANGUAGE TypeOperators #-} +module Bug where + +import Data.Kind +import Data.Proxy +import Data.Type.Equality + +type family F (x :: f (a :: k)) :: f a + +f :: forall k (f :: k -> Type) (a :: k) (r :: f a). Proxy r -> F r :~: r +f = undefined + +g :: forall (f :: Type -> Type) (a :: Type) (r :: f a). Proxy r -> F r :~: r +g r | Refl <- f -- Uncommenting the line below makes it work again + -- @Type + @f @a @r r + = Refl diff --git a/testsuite/tests/polykinds/T15577.stderr b/testsuite/tests/polykinds/T15577.stderr new file mode 100644 index 0000000..fef1709 --- /dev/null +++ b/testsuite/tests/polykinds/T15577.stderr @@ -0,0 +1,71 @@ + +T15577.hs:20:18: error: + • Expecting one more argument to ‘f’ + Expected a type, but ‘f’ has kind ‘* -> *’ + • In the type ‘f’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + +T15577.hs:20:21: error: + • Expected kind ‘f1 -> *’, but ‘a’ has kind ‘*’ + • In the type ‘a’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:20:24: error: + • Couldn't match kind ‘* -> *’ with ‘*’ + When matching kinds + f1 :: * -> * + f1 a1 :: * + Expected kind ‘f1’, but ‘r’ has kind ‘f1 a1’ + • In the type ‘r’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:20:26: error: + • Couldn't match kind ‘* -> *’ with ‘*’ + When matching kinds + f1 :: * -> * + a1 :: * + • In the fourth argument of ‘f’, namely ‘r’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:21:7: error: + • Could not deduce: F r1 ~ r1 + from the context: r0 ~ F r0 + bound by a pattern with constructor: + Refl :: forall k (a :: k). a :~: a, + in a pattern binding in + a pattern guard for + an equation for ‘g’ + at T15577.hs:18:7-10 + ‘r1’ is a rigid type variable bound by + the type signature for: + g :: forall (f1 :: * -> *) a1 (r1 :: f1 a1). + Proxy r1 -> F r1 :~: r1 + at T15577.hs:17:1-76 + Expected type: F r1 :~: r1 + Actual type: r1 :~: r1 + • In the expression: Refl + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 3e37205..ae4ee51 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -192,3 +192,4 @@ test('T15116', normal, compile_fail, ['']) test('T15116a', normal, compile_fail, ['']) test('T15170', normal, compile, ['']) test('T14939', normal, compile, ['-O']) +test('T15577', normal, compile_fail, ['-O']) From git at git.haskell.org Mon Sep 3 11:07:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 3 Sep 2018 11:07:49 +0000 (UTC) Subject: [commit: ghc] master: Remove duplicate "since" field in glasgow_exts.rst (d1514e8) Message-ID: <20180903110749.54EFD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1514e8f0e146e7b917bbb05465f875a5de4b2a4/ghc >--------------------------------------------------------------- commit d1514e8f0e146e7b917bbb05465f875a5de4b2a4 Author: Josh Price <2855417+WhistlePayer at users.noreply.github.com> Date: Sun Sep 2 19:20:28 2018 -0400 Remove duplicate "since" field in glasgow_exts.rst >--------------------------------------------------------------- d1514e8f0e146e7b917bbb05465f875a5de4b2a4 docs/users_guide/glasgow_exts.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index abd679a..4659351 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -3211,8 +3211,6 @@ Record field disambiguation :since: 6.8.1 - :since: 6.8.1 - Allow the compiler to automatically choose between identically-named record selectors based on type (if the choice is unambiguous). From git at git.haskell.org Tue Sep 4 07:21:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:21:50 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-accum' created Message-ID: <20180904072150.438CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-accum Referencing: 2d7211e8ffc89990e4723725bec2b349c21cd83e From git at git.haskell.org Tue Sep 4 07:21:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:21:53 +0000 (UTC) Subject: [commit: ghc] wip/T14880-accum: Test #14904 in dependent/should_compile/T14904 (e1f8b68) Message-ID: <20180904072153.DE1C43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-accum Link : http://ghc.haskell.org/trac/ghc/changeset/e1f8b6832fda181024ddd016f0d247d80286dd1f/ghc >--------------------------------------------------------------- commit e1f8b6832fda181024ddd016f0d247d80286dd1f Author: Richard Eisenberg Date: Mon Apr 2 15:53:42 2018 -0400 Test #14904 in dependent/should_compile/T14904 >--------------------------------------------------------------- e1f8b6832fda181024ddd016f0d247d80286dd1f testsuite/tests/dependent/should_compile/T14904.hs | 11 +++++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + 2 files changed, 12 insertions(+) diff --git a/testsuite/tests/dependent/should_compile/T14904.hs b/testsuite/tests/dependent/should_compile/T14904.hs new file mode 100644 index 0000000..e61170e --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T14904.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TypeFamilies, RankNTypes, TypeInType #-} + +module T14904 where + +import Data.Kind + +type family F (f :: forall a. g a) where + F (f :: forall a. g a) = Int + +type family F' f :: Type where + F' ((f :: forall a. g a) :: forall a. g a) = Int diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 418fba2..dc43651 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -54,3 +54,4 @@ test('DkNameRes', normal, compile, ['']) test('T15346', normal, compile, ['']) test('T15419', normal, compile, ['']) test('T14066h', normal, compile, ['']) +test('T14904', expect_broken(14904), compile, ['']) From git at git.haskell.org Tue Sep 4 07:21:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:21:56 +0000 (UTC) Subject: [commit: ghc] wip/T14880-accum: Rewrite tyCoVarsOfType in terms of TypeSet (6bf31b3) Message-ID: <20180904072156.BA71E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-accum Link : http://ghc.haskell.org/trac/ghc/changeset/6bf31b30781f38518cc73bd8ee9ff452aa05f72b/ghc >--------------------------------------------------------------- commit 6bf31b30781f38518cc73bd8ee9ff452aa05f72b Author: Tobias Dammers Date: Tue Jul 31 22:32:34 2018 +0200 Rewrite tyCoVarsOfType in terms of TypeSet >--------------------------------------------------------------- 6bf31b30781f38518cc73bd8ee9ff452aa05f72b compiler/types/TyCoRep.hs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 81cd2b0..9601740 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1525,7 +1525,15 @@ so, so it's easiest to do it here. -- synonym. tyCoVarsOfType :: Type -> TyCoVarSet -- See Note [Free variables of types] -tyCoVarsOfType ty = fvVarSet $ tyCoFVsOfType ty +-- tyCoVarsOfType ty = fvVarSet $ tyCoFVsOfType ty +tyCoVarsOfType (TyVarTy v) = extendVarSet (tyCoVarsOfType (tyVarKind v)) v +tyCoVarsOfType (TyConApp _ tys) = tyCoVarsOfTypes tys +tyCoVarsOfType (LitTy {}) = emptyVarSet +tyCoVarsOfType (AppTy fun arg) = (tyCoVarsOfType fun `unionVarSet` tyCoVarsOfType arg) +tyCoVarsOfType (FunTy arg res) = (tyCoVarsOfType arg `unionVarSet` tyCoVarsOfType res) +tyCoVarsOfType (ForAllTy bndr ty) = tyCoVarSetsBndr bndr (tyCoVarsOfType ty) +tyCoVarsOfType (CastTy ty co) = (tyCoVarsOfType ty `unionVarSet` tyCoVarsOfCo co) +tyCoVarsOfType (CoercionTy co) = tyCoVarsOfCo co -- | `tyCoFVsOfType` that returns free variables of a type in a deterministic -- set. For explanation of why using `VarSet` is not deterministic see @@ -1534,6 +1542,11 @@ tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet -- See Note [Free variables of types] tyCoVarsOfTypeDSet ty = fvDVarSet $ tyCoFVsOfType ty +tyCoVarSetsBndr :: TyVarBinder -> VarSet -> VarSet +-- Free vars of (forall b. ) +tyCoVarSetsBndr (TvBndr tv _) fvs = (delVarSet fvs tv) + `unionVarSet` tyCoVarsOfType (tyVarKind tv) + -- | `tyCoFVsOfType` that returns free variables of a type in deterministic -- order. For explanation of why using `VarSet` is not deterministic see -- Note [Deterministic FV] in FV. From git at git.haskell.org Tue Sep 4 07:21:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:21:59 +0000 (UTC) Subject: [commit: ghc] wip/T14880-accum: Implement tyCoVarsOfCo(s) in terms of VarSet (f3a61ed) Message-ID: <20180904072159.8DADA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-accum Link : http://ghc.haskell.org/trac/ghc/changeset/f3a61edf30c739611881420104678272c4fb72a7/ghc >--------------------------------------------------------------- commit f3a61edf30c739611881420104678272c4fb72a7 Author: Tobias Dammers Date: Wed Aug 1 11:59:52 2018 +0200 Implement tyCoVarsOfCo(s) in terms of VarSet >--------------------------------------------------------------- f3a61edf30c739611881420104678272c4fb72a7 compiler/types/TyCoRep.hs | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 9601740..a0dbb25 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1584,14 +1584,15 @@ tyCoFVsBndr (TvBndr tv _) fvs = (delFV tv fvs) -- synonym. tyCoVarsOfTypes :: [Type] -> TyCoVarSet -- See Note [Free variables of types] -tyCoVarsOfTypes tys = fvVarSet $ tyCoFVsOfTypes tys +-- tyCoVarsOfTypes tys = fvVarSet $ tyCoFVsOfTypes tys +tyCoVarsOfTypes tys = mapUnionVarSet tyCoVarsOfType tys -- | Returns free variables of types, including kind variables as -- a non-deterministic set. For type synonyms it does /not/ expand the -- synonym. tyCoVarsOfTypesSet :: TyVarEnv Type -> TyCoVarSet -- See Note [Free variables of types] -tyCoVarsOfTypesSet tys = fvVarSet $ tyCoFVsOfTypes $ nonDetEltsUFM tys +tyCoVarsOfTypesSet tys = tyCoVarsOfTypes $ nonDetEltsUFM tys -- It's OK to use nonDetEltsUFM here because we immediately forget the -- ordering by returning a set @@ -1616,8 +1617,38 @@ tyCoFVsOfTypes [] fv_cand in_scope acc = emptyFV fv_cand in_scope acc tyCoVarsOfCo :: Coercion -> TyCoVarSet -- See Note [Free variables of types] -tyCoVarsOfCo co = fvVarSet $ tyCoFVsOfCo co - +-- tyCoVarsOfCo co = fvVarSet $ tyCoFVsOfCo co +tyCoVarsOfCo (Refl _ ty) = tyCoVarsOfType ty +tyCoVarsOfCo (TyConAppCo _ _ cos) = tyCoVarsOfCos cos +tyCoVarsOfCo (AppCo co arg) + = (tyCoVarsOfCo co `unionVarSet` tyCoVarsOfCo arg) +tyCoVarsOfCo (ForAllCo tv kind_co co) + = (delVarSet (tyCoVarsOfCo co) tv `unionVarSet` tyCoVarsOfCo kind_co) +tyCoVarsOfCo (FunCo _ co1 co2) + = (tyCoVarsOfCo co1 `unionVarSet` tyCoVarsOfCo co2) +tyCoVarsOfCo (CoVarCo v) + = tyCoVarsOfCoVar v +tyCoVarsOfCo (HoleCo h) + = tyCoVarsOfCoVar (coHoleCoVar h) + -- See Note [CoercionHoles and coercion free variables] +tyCoVarsOfCo (AxiomInstCo _ _ cos) = tyCoVarsOfCos cos +tyCoVarsOfCo (UnivCo p _ t1 t2) + = (tyCoVarsOfProv p `unionVarSet` tyCoVarsOfType t1 + `unionVarSet` tyCoVarsOfType t2) +tyCoVarsOfCo (SymCo co) = tyCoVarsOfCo co +tyCoVarsOfCo (TransCo co1 co2) = (tyCoVarsOfCo co1 `unionVarSet` tyCoVarsOfCo co2) +tyCoVarsOfCo (NthCo _ _ co) = tyCoVarsOfCo co +tyCoVarsOfCo (LRCo _ co) = tyCoVarsOfCo co +tyCoVarsOfCo (InstCo co arg) = (tyCoVarsOfCo co `unionVarSet` tyCoVarsOfCo arg) +tyCoVarsOfCo (CoherenceCo c1 c2) = (tyCoVarsOfCo c1 `unionVarSet` tyCoVarsOfCo c2) +tyCoVarsOfCo (KindCo co) = tyCoVarsOfCo co +tyCoVarsOfCo (SubCo co) = tyCoVarsOfCo co +tyCoVarsOfCo (AxiomRuleCo _ cs) = tyCoVarsOfCos cs + +tyCoVarsOfCoVar :: CoVar -> VarSet +tyCoVarsOfCoVar v + = (unitVarSet v `unionVarSet` tyCoVarsOfType (varType v)) +-- -- | Get a deterministic set of the vars free in a coercion tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet -- See Note [Free variables of types] @@ -1677,10 +1708,12 @@ tyCoFVsOfProv (ProofIrrelProv co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand tyCoFVsOfProv (PluginProv _) fv_cand in_scope acc = emptyFV fv_cand in_scope acc tyCoVarsOfCos :: [Coercion] -> TyCoVarSet -tyCoVarsOfCos cos = fvVarSet $ tyCoFVsOfCos cos +-- tyCoVarsOfCos cos = fvVarSet $ tyCoFVsOfCos cos +tyCoVarsOfCos cos = mapUnionVarSet tyCoVarsOfCo cos tyCoVarsOfCosSet :: CoVarEnv Coercion -> TyCoVarSet -tyCoVarsOfCosSet cos = fvVarSet $ tyCoFVsOfCos $ nonDetEltsUFM cos +-- tyCoVarsOfCosSet cos = fvVarSet $ tyCoFVsOfCos $ nonDetEltsUFM cos +tyCoVarsOfCosSet cos = tyCoVarsOfCos $ nonDetEltsUFM cos -- It's OK to use nonDetEltsUFM here because we immediately forget the -- ordering by returning a set From git at git.haskell.org Tue Sep 4 07:22:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:22:02 +0000 (UTC) Subject: [commit: ghc] wip/T14880-accum: Use an accumulator version of tyCoVarsOfType (d0a25e7) Message-ID: <20180904072202.7D2EF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-accum Link : http://ghc.haskell.org/trac/ghc/changeset/d0a25e71157666ee3c436de273dd41b3ef1262b6/ghc >--------------------------------------------------------------- commit d0a25e71157666ee3c436de273dd41b3ef1262b6 Author: Simon Peyton Jones Date: Fri Aug 31 14:18:55 2018 +0100 Use an accumulator version of tyCoVarsOfType In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! >--------------------------------------------------------------- d0a25e71157666ee3c436de273dd41b3ef1262b6 compiler/types/TyCoRep.hs | 382 +++++++++++++++++++++++++++++++--------------- 1 file changed, 261 insertions(+), 121 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d0a25e71157666ee3c436de273dd41b3ef1262b6 From git at git.haskell.org Tue Sep 4 07:22:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 07:22:05 +0000 (UTC) Subject: [commit: ghc] wip/T14880-accum: Fix merge conflicts between #14880 and master (2d7211e) Message-ID: <20180904072205.4E29D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-accum Link : http://ghc.haskell.org/trac/ghc/changeset/2d7211e8ffc89990e4723725bec2b349c21cd83e/ghc >--------------------------------------------------------------- commit 2d7211e8ffc89990e4723725bec2b349c21cd83e Author: Tobias Dammers Date: Tue Sep 4 09:20:23 2018 +0200 Fix merge conflicts between #14880 and master >--------------------------------------------------------------- 2d7211e8ffc89990e4723725bec2b349c21cd83e compiler/types/TyCoRep.hs | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 3c1133a..5373d26 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1673,8 +1673,9 @@ tyCoVarsOfCos cos = ty_co_vars_of_cos cos emptyVarSet emptyVarSet ty_co_vars_of_co :: Coercion -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet -ty_co_vars_of_co (Refl ty) is acc = ty_co_vars_of_type ty is acc --- ty_co_vars_of_co (Refl _ ty) is acc = ty_co_vars_of_type ty is acc +ty_co_vars_of_co (Refl ty) is acc = ty_co_vars_of_type ty is acc +ty_co_vars_of_co (GRefl _ ty mrefl) is acc = ty_co_vars_of_type ty is $ + ty_co_vars_of_mco mrefl is acc ty_co_vars_of_co (TyConAppCo _ _ cos) is acc = ty_co_vars_of_cos cos is acc ty_co_vars_of_co (AppCo co arg) is acc = ty_co_vars_of_co co is $ ty_co_vars_of_co arg is acc @@ -1696,12 +1697,16 @@ ty_co_vars_of_co (NthCo _ _ co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co (LRCo _ co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co (InstCo co arg) is acc = ty_co_vars_of_co co is $ ty_co_vars_of_co arg is acc -ty_co_vars_of_co (CoherenceCo c1 c2) is acc = ty_co_vars_of_co c1 is $ - ty_co_vars_of_co c2 is acc +-- ty_co_vars_of_co (CoherenceCo c1 c2) is acc = ty_co_vars_of_co c1 is $ +-- ty_co_vars_of_co c2 is acc ty_co_vars_of_co (KindCo co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co (SubCo co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co (AxiomRuleCo _ cs) is acc = ty_co_vars_of_cos cs is acc +ty_co_vars_of_mco :: MCoercion -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet +ty_co_vars_of_mco MRefl _is acc = acc +ty_co_vars_of_mco (MCo co) is acc = ty_co_vars_of_co co is acc + ty_co_vars_of_co_var :: CoVar -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_co_var v is acc | v `elemVarSet` is = acc @@ -1875,9 +1880,9 @@ coVarsOfType ty = getCoVarSet (tyCoFVsOfType ty) coVarsOfTypes :: [Type] -> TyCoVarSet coVarsOfTypes tys = getCoVarSet (tyCoFVsOfTypes tys) -coVarsOfMCo :: MCoercion -> CoVarSet -coVarsOfMCo MRefl = emptyVarSet -coVarsOfMCo (MCo co) = coVarsOfCo co +-- coVarsOfMCo :: MCoercion -> CoVarSet +-- coVarsOfMCo MRefl = emptyVarSet +-- coVarsOfMCo (MCo co) = coVarsOfCo co coVarsOfCo :: Coercion -> CoVarSet coVarsOfCo co = getCoVarSet (tyCoFVsOfCo co) @@ -1903,14 +1908,14 @@ coVarsOfCo co = getCoVarSet (tyCoFVsOfCo co) -- coVarsOfCo (SubCo co) = coVarsOfCo co -- coVarsOfCo (AxiomRuleCo _ cs) = coVarsOfCos cs -coVarsOfCoVar :: CoVar -> CoVarSet -coVarsOfCoVar v = unitVarSet v `unionVarSet` coVarsOfType (varType v) - -coVarsOfProv :: UnivCoProvenance -> CoVarSet -coVarsOfProv UnsafeCoerceProv = emptyVarSet -coVarsOfProv (PhantomProv co) = coVarsOfCo co -coVarsOfProv (ProofIrrelProv co) = coVarsOfCo co -coVarsOfProv (PluginProv _) = emptyVarSet +-- coVarsOfCoVar :: CoVar -> CoVarSet +-- coVarsOfCoVar v = unitVarSet v `unionVarSet` coVarsOfType (varType v) +-- +-- coVarsOfProv :: UnivCoProvenance -> CoVarSet +-- coVarsOfProv UnsafeCoerceProv = emptyVarSet +-- coVarsOfProv (PhantomProv co) = coVarsOfCo co +-- coVarsOfProv (ProofIrrelProv co) = coVarsOfCo co +-- coVarsOfProv (PluginProv _) = emptyVarSet coVarsOfCos :: [Coercion] -> CoVarSet coVarsOfCos cos = getCoVarSet (tyCoFVsOfCos cos) From git at git.haskell.org Tue Sep 4 08:11:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 08:11:58 +0000 (UTC) Subject: [commit: ghc] master: Fix typos in -Wsimplifiable-class-constraints flag docs (fa3143c) Message-ID: <20180904081158.5F3423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa3143c76ac77ee96fd89559cacc089205abaa20/ghc >--------------------------------------------------------------- commit fa3143c76ac77ee96fd89559cacc089205abaa20 Author: Sergey Vinokurov Date: Tue Sep 4 00:09:45 2018 +0100 Fix typos in -Wsimplifiable-class-constraints flag docs >--------------------------------------------------------------- fa3143c76ac77ee96fd89559cacc089205abaa20 docs/users_guide/using-warnings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 2d28fdd..a715fc1 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -1203,10 +1203,10 @@ of ``-W(no-)*``. we warn when this special treatment of ``(*)`` takes place. .. ghc-flag:: -Wsimplifiable-class-constraints - :shortdesc: 2arn about class constraints in a type signature that can + :shortdesc: Warn about class constraints in a type signature that can be simplified using a top-level instance declaration. :type: dynamic - :reverse: -Wno-overlapping-patterns + :reverse: -Wno-simplifiable-class-constraints :category: :since: 8.2 From git at git.haskell.org Tue Sep 4 13:36:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 13:36:03 +0000 (UTC) Subject: [commit: ghc] master: Compiler panic on invalid syntax (unterminated pragma) (df363a6) Message-ID: <20180904133603.5E81A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/df363a646b66f4dd13d63ec70f18e427cabc8878/ghc >--------------------------------------------------------------- commit df363a646b66f4dd13d63ec70f18e427cabc8878 Author: roland Date: Tue Sep 4 14:09:20 2018 +0200 Compiler panic on invalid syntax (unterminated pragma) Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic. Test Plan: make test TEST=T15053 Reviewers: Phyx, thomie, bgamari, monoidal, osa1 Reviewed By: Phyx, monoidal, osa1 Subscribers: tdammers, osa1, rwbarton, carter GHC Trac Issues: #15053 Differential Revision: https://phabricator.haskell.org/D5093 >--------------------------------------------------------------- df363a646b66f4dd13d63ec70f18e427cabc8878 compiler/main/HeaderInfo.hs | 22 ++++++++++++++++------ testsuite/tests/parser/should_fail/T15053.stderr | 5 +++++ testsuite/tests/parser/should_fail/all.T | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index 76f67b2..127cc6d 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -244,7 +244,8 @@ getOptions' dflags toks | IToptions_prag str <- getToken open , ITclose_prag <- getToken close = case toArgs str of - Left err -> panic ("getOptions'.parseToks: " ++ err) + Left _err -> optionsParseError str dflags $ -- #15053 + combineSrcSpans (getLoc open) (getLoc close) Right args -> map (L (getLoc open)) args ++ parseToks xs parseToks (open:close:xs) | ITinclude_prag str <- getToken open @@ -314,17 +315,15 @@ checkExtension dflags (L l ext) languagePragParseError :: DynFlags -> SrcSpan -> a languagePragParseError dflags loc = - throw $ mkSrcErr $ unitBag $ - (mkPlainErrMsg dflags loc $ + throwErr dflags loc $ vcat [ text "Cannot parse LANGUAGE pragma" , text "Expecting comma-separated list of language options," , text "each starting with a capital letter" - , nest 2 (text "E.g. {-# LANGUAGE TemplateHaskell, GADTs #-}") ]) + , nest 2 (text "E.g. {-# LANGUAGE TemplateHaskell, GADTs #-}") ] unsupportedExtnError :: DynFlags -> SrcSpan -> String -> a unsupportedExtnError dflags loc unsup = - throw $ mkSrcErr $ unitBag $ - mkPlainErrMsg dflags loc $ + throwErr dflags loc $ text "Unsupported extension: " <> text unsup $$ if null suggestions then Outputable.empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions) where @@ -340,3 +339,14 @@ optionsErrorMsgs dflags unhandled_flags flags_lines _filename ErrUtils.mkPlainErrMsg dflags flagSpan $ text "unknown flag in {-# OPTIONS_GHC #-} pragma:" <+> text flag +optionsParseError :: String -> DynFlags -> SrcSpan -> a -- #15053 +optionsParseError str dflags loc = + throwErr dflags loc $ + vcat [ text "Error while parsing OPTIONS_GHC pragma." + , text "Expecting whitespace-separated list of GHC options." + , text " E.g. {-# OPTIONS_GHC -Wall -O2 #-}" + , text ("Input was: " ++ show str) ] + +throwErr :: DynFlags -> SrcSpan -> SDoc -> a -- #15053 +throwErr dflags loc doc = + throw $ mkSrcErr $ unitBag $ mkPlainErrMsg dflags loc doc diff --git a/testsuite/tests/parser/should_fail/T15053.stderr b/testsuite/tests/parser/should_fail/T15053.stderr new file mode 100644 index 0000000..0544327 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15053.stderr @@ -0,0 +1,5 @@ +T15053.hs:1:16: + Error while parsing OPTIONS_GHC pragma. + Expecting whitespace-separated list of GHC options. + E.g. {-# OPTIONS_GHC -Wall -O2 #-} + Input was: " -O1 }/n/"/n " diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 73e817d..8233d76 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -126,4 +126,4 @@ test('typeops_A', normal, compile_fail, ['']) test('typeops_B', normal, compile_fail, ['']) test('typeops_C', normal, compile_fail, ['']) test('typeops_D', normal, compile_fail, ['']) -test('T15053', expect_broken(15053), compile_fail, ['']) # shouldn't panic +test('T15053', normal, compile_fail, ['']) From git at git.haskell.org Tue Sep 4 13:43:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 13:43:33 +0000 (UTC) Subject: [commit: ghc] master: Add a test for Trac #15586 (a3a1a17) Message-ID: <20180904134333.7837C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a3a1a17ba7ddbc40b093c732e7e3a916b9531eac/ghc >--------------------------------------------------------------- commit a3a1a17ba7ddbc40b093c732e7e3a916b9531eac Author: Krzysztof Gogolewski Date: Tue Sep 4 15:42:52 2018 +0200 Add a test for Trac #15586 Summary: The bug is already fixed in master. Test Plan: make test TEST=T15586 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15586 Differential Revision: https://phabricator.haskell.org/D5118 >--------------------------------------------------------------- a3a1a17ba7ddbc40b093c732e7e3a916b9531eac testsuite/tests/typecheck/should_compile/T15586.hs | 12 ++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 13 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T15586.hs b/testsuite/tests/typecheck/should_compile/T15586.hs new file mode 100644 index 0000000..e8fd4f3 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15586.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE GADTs #-} + +module STree where + +data STree a where + STreeIM :: { + l :: v a , + stree :: a + } -> STree a + +insert :: STree a -> STree a +insert s = s { stree = undefined } diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 64df3a8..c3a90ee 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -649,3 +649,4 @@ test('T15412', normal, compile, ['']) test('T15141', normal, compile, ['']) test('T15473', normal, compile_fail, ['']) test('T15499', normal, compile, ['']) +test('T15586', normal, compile, ['']) From git at git.haskell.org Tue Sep 4 17:10:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 17:10:47 +0000 (UTC) Subject: [commit: ghc] master: testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridable (2254912) Message-ID: <20180904171047.02CF43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2254912036597cee3f1c2544320a35d1115c1e6e/ghc >--------------------------------------------------------------- commit 2254912036597cee3f1c2544320a35d1115c1e6e Author: Alp Mestanogullari Date: Tue Sep 4 19:09:06 2018 +0200 testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridable Summary: Without this patch, boilerplate.mk (which is included by a lot of Makefiles from our testsuite) just assumes they reside in the usual inplace directory, which is not friendly to hadrian and this makes a lot of tests (e.g T10255) fail when building GHC and running the testsuite with hadrian. With this patch, the said tests pass. Test Plan: api annotation tests (with hadrian) Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5127 >--------------------------------------------------------------- 2254912036597cee3f1c2544320a35d1115c1e6e testsuite/mk/boilerplate.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk index c38bf85..4c32f30 100644 --- a/testsuite/mk/boilerplate.mk +++ b/testsuite/mk/boilerplate.mk @@ -219,8 +219,14 @@ CP = cp RM = rm -f PYTHON = python3 +ifeq "$(CHECK_API_ANNOTATIONS)" "" CHECK_API_ANNOTATIONS := $(abspath $(TOP)/../inplace/bin/check-api-annotations) -CHECK_PPR := $(abspath $(TOP)/../inplace/bin/check-ppr) +endif + +ifeq "$(CHECK_PPR)" "" +CHECK_PPR := $(abspath $(TOP)/../inplace/bin/check-ppr) +endif + # ----------------------------------------------------------------------------- # configuration of TEST_HC From git at git.haskell.org Tue Sep 4 20:25:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 4 Sep 2018 20:25:38 +0000 (UTC) Subject: [commit: ghc] master: Fix tests ghci057 and T9293. (#15071) (24d610a) Message-ID: <20180904202538.4ACE13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/24d610a48acc363c99a278399518c716732b9802/ghc >--------------------------------------------------------------- commit 24d610a48acc363c99a278399518c716732b9802 Author: roland Date: Tue Sep 4 22:23:55 2018 +0200 Fix tests ghci057 and T9293. (#15071) Summary: As both tests specify -fno-ghci-leak-check, the GHCi :set command is not expected to list the -fghci-leak check flag. Test Plan: WINDOWS: make test TESTS="ghci057 T9293" Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #15071 Differential Revision: https://phabricator.haskell.org/D5125 >--------------------------------------------------------------- 24d610a48acc363c99a278399518c716732b9802 testsuite/tests/ghci/scripts/T9293.stdout-mingw32 | 4 ---- testsuite/tests/ghci/scripts/ghci057.stdout-mingw32 | 4 ---- 2 files changed, 8 deletions(-) diff --git a/testsuite/tests/ghci/scripts/T9293.stdout-mingw32 b/testsuite/tests/ghci/scripts/T9293.stdout-mingw32 index fe0c830..c5be11a 100644 --- a/testsuite/tests/ghci/scripts/T9293.stdout-mingw32 +++ b/testsuite/tests/ghci/scripts/T9293.stdout-mingw32 @@ -9,7 +9,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -28,7 +27,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -46,7 +44,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -66,7 +63,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: diff --git a/testsuite/tests/ghci/scripts/ghci057.stdout-mingw32 b/testsuite/tests/ghci/scripts/ghci057.stdout-mingw32 index fe0c830..c5be11a 100644 --- a/testsuite/tests/ghci/scripts/ghci057.stdout-mingw32 +++ b/testsuite/tests/ghci/scripts/ghci057.stdout-mingw32 @@ -9,7 +9,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -28,7 +27,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -46,7 +44,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: @@ -66,7 +63,6 @@ other dynamic, non-language, flag settings: -fignore-optim-changes -fignore-hpc-changes -fno-ghci-history - -fghci-leak-check -fimplicit-import-qualified -fshow-warning-groups warning settings: From git at git.haskell.org Wed Sep 5 11:11:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 11:11:54 +0000 (UTC) Subject: [commit: ghc] master: Skip eventlog tests in GHCi way (c0e5087) Message-ID: <20180905111154.6473F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c0e5087d01e2912f00feede6c259a2ee87685c90/ghc >--------------------------------------------------------------- commit c0e5087d01e2912f00feede6c259a2ee87685c90 Author: Ömer Sinan Ağacan Date: Wed Sep 5 13:11:30 2018 +0200 Skip eventlog tests in GHCi way Summary: (GHCi doesn't generate event logs) Test Plan: These tests were failing in GHCi way, they're now skipped in GHCi way as GHCi doesn't generate eventlogs Reviewers: bgamari, simonmar, maoe, alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15587 Differential Revision: https://phabricator.haskell.org/D5119 >--------------------------------------------------------------- c0e5087d01e2912f00feede6c259a2ee87685c90 testsuite/tests/rts/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index d68722d..6e1d90d 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -135,11 +135,11 @@ test('T2615', # omit dyn and profiling ways, because we don't build dyn_l or p_l # variants of the RTS by default -test('traceEvent', [ omit_ways(['dyn'] + prof_ways), +test('traceEvent', [ omit_ways(['dyn', 'ghci'] + prof_ways), extra_run_opts('+RTS -ls -RTS') ], compile_and_run, ['-eventlog']) -test('traceBinaryEvent', [ omit_ways(['dyn'] + prof_ways), +test('traceBinaryEvent', [ omit_ways(['dyn', 'ghci'] + prof_ways), extra_run_opts('+RTS -ls -RTS') ], compile_and_run, ['-eventlog']) From git at git.haskell.org Wed Sep 5 11:23:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 11:23:56 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Add test for #15368 (49d50b2) Message-ID: <20180905112356.010233A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/49d50b2b7d194dca0b23de6fe4dcc717562e90a7/ghc >--------------------------------------------------------------- commit 49d50b2b7d194dca0b23de6fe4dcc717562e90a7 Author: Ben Gamari Date: Wed Sep 5 13:22:24 2018 +0200 testsuite: Add test for #15368 Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, monoidal, rwbarton, thomie, carter GHC Trac Issues: #15368 Differential Revision: https://phabricator.haskell.org/D4958 >--------------------------------------------------------------- 49d50b2b7d194dca0b23de6fe4dcc717562e90a7 testsuite/tests/typecheck/should_compile/T15368.hs | 11 ++++++ .../tests/typecheck/should_compile/T15368.stderr | 45 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 3 files changed, 57 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T15368.hs b/testsuite/tests/typecheck/should_compile/T15368.hs new file mode 100644 index 0000000..2db4857 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15368.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TypeFamilies #-} + +module T15368 where + +transitive :: (a, b) -> (b, c) -> (a, c) +transitive = undefined + +trigger :: a -> b -> (F a b, F b a) +trigger _ _ = _ `transitive` trigger _ _ + +type family F (n :: *) (m :: *) :: * diff --git a/testsuite/tests/typecheck/should_compile/T15368.stderr b/testsuite/tests/typecheck/should_compile/T15368.stderr new file mode 100644 index 0000000..36650d0 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T15368.stderr @@ -0,0 +1,45 @@ + +T15368.hs:9:15: warning: [-Wtyped-holes (in -Wdefault)] + • Found hole: _ :: (F a b, F a0 b0) + Where: ‘a0’ is an ambiguous type variable + ‘b0’ is an ambiguous type variable + ‘a’, ‘b’ are rigid type variables bound by + the type signature for: + trigger :: forall a b. a -> b -> (F a b, F b a) + at T15368.hs:8:1-35 + • In the first argument of ‘transitive’, namely ‘_’ + In the expression: _ `transitive` trigger _ _ + In an equation for ‘trigger’: + trigger _ _ = _ `transitive` trigger _ _ + • Relevant bindings include + trigger :: a -> b -> (F a b, F b a) (bound at T15368.hs:9:1) + +T15368.hs:9:15: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Couldn't match type ‘F b a’ with ‘F b0 a0’ + Expected type: (F a b, F b a) + Actual type: (F a b, F b0 a0) + NB: ‘F’ is a non-injective type family + The type variables ‘b0’, ‘a0’ are ambiguous + • In the expression: _ `transitive` trigger _ _ + In an equation for ‘trigger’: + trigger _ _ = _ `transitive` trigger _ _ + • Relevant bindings include + trigger :: a -> b -> (F a b, F b a) (bound at T15368.hs:9:1) + +T15368.hs:9:38: warning: [-Wtyped-holes (in -Wdefault)] + • Found hole: _ :: a0 + Where: ‘a0’ is an ambiguous type variable + • In the first argument of ‘trigger’, namely ‘_’ + In the second argument of ‘transitive’, namely ‘trigger _ _’ + In the expression: _ `transitive` trigger _ _ + • Relevant bindings include + trigger :: a -> b -> (F a b, F b a) (bound at T15368.hs:9:1) + +T15368.hs:9:40: warning: [-Wtyped-holes (in -Wdefault)] + • Found hole: _ :: b0 + Where: ‘b0’ is an ambiguous type variable + • In the second argument of ‘trigger’, namely ‘_’ + In the second argument of ‘transitive’, namely ‘trigger _ _’ + In the expression: _ `transitive` trigger _ _ + • Relevant bindings include + trigger :: a -> b -> (F a b, F b a) (bound at T15368.hs:9:1) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index c3a90ee..b9cb68e 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -650,3 +650,4 @@ test('T15141', normal, compile, ['']) test('T15473', normal, compile_fail, ['']) test('T15499', normal, compile, ['']) test('T15586', normal, compile, ['']) +test('T15368', normal, compile, ['-fdefer-type-errors']) From git at git.haskell.org Wed Sep 5 11:41:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 11:41:46 +0000 (UTC) Subject: [commit: ghc] master: base: Add references to Notes for certain special imports (a811d93) Message-ID: <20180905114146.AAD993A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a811d938acb09b23b11173842143a0fa946bf5cc/ghc >--------------------------------------------------------------- commit a811d938acb09b23b11173842143a0fa946bf5cc Author: Chaitanya Koparkar Date: Wed Sep 5 13:41:24 2018 +0200 base: Add references to Notes for certain special imports Summary: Modules like GHC.Integer, GHC.Natural etc. are special and sometimes have to be imported just to resolve build ordering issues. It's useful to refer to the appropriate Notes at such import sites. Test Plan: Read it. Reviewers: RyanGlScott, bgamari, hvr, simonpj Reviewed By: RyanGlScott, simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15526 Differential Revision: https://phabricator.haskell.org/D5092 >--------------------------------------------------------------- a811d938acb09b23b11173842143a0fa946bf5cc libraries/base/Data/Semigroup/Internal.hs-boot | 2 +- libraries/base/GHC/Err.hs | 4 +++- libraries/base/GHC/IO.hs-boot | 2 +- libraries/base/GHC/Maybe.hs | 2 +- libraries/base/GHC/Stack/Types.hs | 6 +++--- libraries/base/Unsafe/Coerce.hs | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libraries/base/Data/Semigroup/Internal.hs-boot b/libraries/base/Data/Semigroup/Internal.hs-boot index 8075024..3624929 100644 --- a/libraries/base/Data/Semigroup/Internal.hs-boot +++ b/libraries/base/Data/Semigroup/Internal.hs-boot @@ -4,7 +4,7 @@ module Data.Semigroup.Internal where import {-# SOURCE #-} GHC.Real (Integral) import {-# SOURCE #-} GHC.Base (Semigroup,Monoid,Maybe) -import GHC.Integer () -- Note [Depend on GHC.Integer] +import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a diff --git a/libraries/base/GHC/Err.hs b/libraries/base/GHC/Err.hs index 1f1ad90..095ccd8 100644 --- a/libraries/base/GHC/Err.hs +++ b/libraries/base/GHC/Err.hs @@ -29,7 +29,9 @@ import GHC.Stack.Types import GHC.Prim import GHC.Integer () -- Make sure Integer and Natural are compiled first import GHC.Natural () -- because GHC depends on it in a wired-in way - -- so the build system doesn't see the dependency + -- so the build system doesn't see the dependency. + -- See Note [Depend on GHC.Integer] and + -- Note [Depend on GHC.Natural] in GHC.Base. import {-# SOURCE #-} GHC.Exception ( errorCallWithCallStackException , errorCallException ) diff --git a/libraries/base/GHC/IO.hs-boot b/libraries/base/GHC/IO.hs-boot index f1e50fe..aa2e5cc 100644 --- a/libraries/base/GHC/IO.hs-boot +++ b/libraries/base/GHC/IO.hs-boot @@ -4,7 +4,7 @@ module GHC.IO where import GHC.Types -import GHC.Integer () -- see Note [Depend upon GHC.Integer] in libraries/base/GHC/Base.hs +import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base failIO :: [Char] -> IO a mplusIO :: IO a -> IO a -> IO a diff --git a/libraries/base/GHC/Maybe.hs b/libraries/base/GHC/Maybe.hs index 373fd48..2bdfac5 100644 --- a/libraries/base/GHC/Maybe.hs +++ b/libraries/base/GHC/Maybe.hs @@ -6,7 +6,7 @@ module GHC.Maybe ) where -import GHC.Integer () -- for build order +import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base import GHC.Classes default () diff --git a/libraries/base/GHC/Stack/Types.hs b/libraries/base/GHC/Stack/Types.hs index 4c8a106..45b1121 100644 --- a/libraries/base/GHC/Stack/Types.hs +++ b/libraries/base/GHC/Stack/Types.hs @@ -51,9 +51,9 @@ import GHC.Classes (Eq) import GHC.Types (Char, Int) -- Make implicit dependency known to build system -import GHC.Tuple () -import GHC.Integer () -import GHC.Natural () +import GHC.Tuple () -- See Note [Depend on GHC.Tuple] in GHC.Base +import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base +import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base ---------------------------------------------------------------------- -- Explicit call-stacks built via ImplicitParams diff --git a/libraries/base/Unsafe/Coerce.hs b/libraries/base/Unsafe/Coerce.hs index d9a7977..5bcbb01 100644 --- a/libraries/base/Unsafe/Coerce.hs +++ b/libraries/base/Unsafe/Coerce.hs @@ -31,8 +31,8 @@ module Unsafe.Coerce (unsafeCoerce) where -import GHC.Integer () -- for build ordering -import GHC.Natural () -- for build ordering +import GHC.Integer () -- See Note [Depend on GHC.Integer] in GHC.Base +import GHC.Natural () -- See Note [Depend on GHC.Natural] in GHC.Base import GHC.Prim (unsafeCoerce#) local_id :: a -> a From git at git.haskell.org Wed Sep 5 11:48:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 11:48:14 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Use bools for booleans, not ints (ecde954) Message-ID: <20180905114814.4CA993A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ecde9546e7768a57bb57d742c8ef3b7cf7fde80e/ghc >--------------------------------------------------------------- commit ecde9546e7768a57bb57d742c8ef3b7cf7fde80e Author: Ben Gamari Date: Wed Sep 5 13:45:50 2018 +0200 testsuite: Use bools for booleans, not ints Summary: Just as it says on the tin. Test Plan: Validate Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, monoidal, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D5010 >--------------------------------------------------------------- ecde9546e7768a57bb57d742c8ef3b7cf7fde80e testsuite/driver/testglobals.py | 22 +++++++++++----------- testsuite/driver/testlib.py | 30 +++++++++++++++--------------- testsuite/mk/test.mk | 6 +++--- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 067b7d4..311e39b 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -27,9 +27,9 @@ class TestConfig: self.only = set() # Accept new output which differs from the sample? - self.accept = 0 - self.accept_platform = 0 - self.accept_os = 0 + self.accept = False + self.accept_platform = False + self.accept_os = False # File in which to save the summary self.summary_file = '' @@ -117,7 +117,7 @@ class TestConfig: # threads self.threads = 1 - self.use_threads = 0 + self.use_threads = False # Should we skip performance tests self.skip_perf_tests = False @@ -168,7 +168,7 @@ def getTestRun(): class TestOptions: def __init__(self): # skip this test? - self.skip = 0 + self.skip = False # skip these ways self.omit_ways = [] @@ -193,7 +193,7 @@ class TestOptions: self.ignore_stderr = False # Backpack test - self.compile_backpack = 0 + self.compile_backpack = False # We sometimes want to modify the compiler_always_flags, so # they are copied from config.compiler_always_flags when we @@ -230,15 +230,15 @@ class TestOptions: self.alone = False # Does this test use a literate (.lhs) file? - self.literate = 0 + self.literate = False # Does this test use a .c, .m or .mm file? - self.c_src = 0 - self.objc_src = 0 - self.objcpp_src = 0 + self.c_src = False + self.objc_src = False + self.objcpp_src = False # Does this test use a .cmm file? - self.cmm_src = 0 + self.cmm_src = False # Should we put .hi/.o files in a subdirectory? self.outputdir = None diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 6402efe..ff6a8c8 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -84,7 +84,7 @@ def normal( name, opts ): return; def skip( name, opts ): - opts.skip = 1 + opts.skip = True def expect_fail( name, opts ): # The compiler, testdriver, OS or platform is missing a certain @@ -423,19 +423,19 @@ def multi_cpu_race(name, opts): # --- def literate( name, opts ): - opts.literate = 1; + opts.literate = True def c_src( name, opts ): - opts.c_src = 1; + opts.c_src = True def objc_src( name, opts ): - opts.objc_src = 1; + opts.objc_src = True def objcpp_src( name, opts ): - opts.objcpp_src = 1; + opts.objcpp_src = True def cmm_src( name, opts ): - opts.cmm_src = 1; + opts.cmm_src = True def outputdir( odir ): return lambda name, opts, d=odir: _outputdir(name, opts, d) @@ -973,19 +973,19 @@ def compile_fail( name, way, extra_hc_opts ): return do_compile( name, way, 1, '', [], extra_hc_opts ) def backpack_typecheck( name, way, extra_hc_opts ): - return do_compile( name, way, 0, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 ) + return do_compile( name, way, 0, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=True ) def backpack_typecheck_fail( name, way, extra_hc_opts ): - return do_compile( name, way, 1, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=1 ) + return do_compile( name, way, 1, '', [], "-fno-code -fwrite-interface " + extra_hc_opts, backpack=True ) def backpack_compile( name, way, extra_hc_opts ): - return do_compile( name, way, 0, '', [], extra_hc_opts, backpack=1 ) + return do_compile( name, way, 0, '', [], extra_hc_opts, backpack=True ) def backpack_compile_fail( name, way, extra_hc_opts ): - return do_compile( name, way, 1, '', [], extra_hc_opts, backpack=1 ) + return do_compile( name, way, 1, '', [], extra_hc_opts, backpack=True ) def backpack_run( name, way, extra_hc_opts ): - return compile_and_run__( name, way, '', [], extra_hc_opts, backpack=1 ) + return compile_and_run__( name, way, '', [], extra_hc_opts, backpack=True ) def multimod_compile( name, way, top_mod, extra_hc_opts ): return do_compile( name, way, 0, top_mod, [], extra_hc_opts ) @@ -1577,14 +1577,14 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file, # See Note [Output comparison]. r = runCmd('diff -uw "{0}" "{1}"'.format(expected_normalised_path, actual_normalised_path), - print_output = 1) + print_output=True) # If for some reason there were no non-whitespace differences, # then do a full diff if r == 0: r = runCmd('diff -u "{0}" "{1}"'.format(expected_normalised_path, actual_normalised_path), - print_output = 1) + print_output=True) if config.accept and (getTestOpts().expect == 'fail' or way in getTestOpts().expect_fail_for): @@ -1800,7 +1800,7 @@ def dump_file(f): except Exception: print('') -def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, print_output=0): +def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, print_output=False): timeout_prog = strip_quotes(config.timeout_prog) timeout = str(int(ceil(config.timeout * timeout_multiplier))) @@ -1832,7 +1832,7 @@ def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, pr finally: if stdin_file: stdin_file.close() - if config.verbose >= 1 and print_output >= 1: + if config.verbose >= 1 and print_output: if stdout_buffer: sys.stdout.buffer.write(stdout_buffer) if stderr_buffer: diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 3e9f4d6..d9a13aa 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -296,14 +296,14 @@ setspeed = endif ifeq "$(accept)" "YES" -setaccept = -e config.accept=1 +setaccept = -e config.accept=True ifeq "$(PLATFORM)" "YES" -setaccept += -e config.accept_platform=1 +setaccept += -e config.accept_platform=True endif ifeq "$(OS)" "YES" -setaccept += -e config.accept_os=1 +setaccept += -e config.accept_os=True endif else From git at git.haskell.org Wed Sep 5 12:28:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 12:28:05 +0000 (UTC) Subject: [commit: ghc] master: Expose 'moduleToPkgConfAll' from 'PackageState' (e29ac2d) Message-ID: <20180905122805.1CB123A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e29ac2db000efead4610b3ce674aa3d0060238cf/ghc >--------------------------------------------------------------- commit e29ac2db000efead4610b3ce674aa3d0060238cf Author: Alec Theriault Date: Wed Sep 5 14:27:40 2018 +0200 Expose 'moduleToPkgConfAll' from 'PackageState' Summary: Having direct access to this field is going to enable Haddock to compute in batch which modules to load before looking up instances of external packages. Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5100 >--------------------------------------------------------------- e29ac2db000efead4610b3ce674aa3d0060238cf compiler/main/Packages.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 68940a7..04efa1f 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -7,7 +7,7 @@ module Packages ( module PackageConfig, -- * Reading the package config, and processing cmdline args - PackageState(preloadPackages, explicitPackages, requirementContext), + PackageState(preloadPackages, explicitPackages, moduleToPkgConfAll, requirementContext), PackageConfigMap, emptyPackageState, initPackages, From git at git.haskell.org Wed Sep 5 16:26:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 16:26:39 +0000 (UTC) Subject: [commit: ghc] master: Define activeAfterInitial, activeDuringFinal (1152a3b) Message-ID: <20180905162639.C4CA43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1152a3bee1aef3e24a03e0c2e4e5272ca926f7ab/ghc >--------------------------------------------------------------- commit 1152a3bee1aef3e24a03e0c2e4e5272ca926f7ab Author: Simon Peyton Jones Date: Wed Sep 5 15:53:15 2018 +0100 Define activeAfterInitial, activeDuringFinal This is pure refactoring, just adding a couple of definitions to BasicTypes, and using them. Plus some whitespace stuff. >--------------------------------------------------------------- 1152a3bee1aef3e24a03e0c2e4e5272ca926f7ab compiler/basicTypes/BasicTypes.hs | 10 ++++++++++ compiler/basicTypes/MkId.hs | 2 +- compiler/specialise/Rules.hs | 12 ++++++------ compiler/stranal/WorkWrap.hs | 4 ++-- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index ce46962..151a040 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -81,6 +81,7 @@ module BasicTypes( Activation(..), isActive, isActiveIn, competesWith, isNeverActive, isAlwaysActive, isEarlyActive, + activeAfterInitial, activeDuringFinal, RuleMatchInfo(..), isConLike, isFunLike, InlineSpec(..), noUserInlineSpec, @@ -1142,6 +1143,15 @@ instance Outputable CompilerPhase where ppr (Phase n) = int n ppr InitialPhase = text "InitialPhase" +activeAfterInitial :: Activation +-- Active in the first phase after the initial phase +-- Currently we have just phases [2,1,0] +activeAfterInitial = ActiveAfter NoSourceText 2 + +activeDuringFinal :: Activation +-- Active in the final simplification phase (which is repeated) +activeDuringFinal = ActiveAfter NoSourceText 0 + -- See note [Pragma source text] data Activation = NeverActive | AlwaysActive diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 4cd20ff..47fbce7 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -594,7 +594,7 @@ mkDataConRep dflags fam_envs wrap_name mb_bangs data_con | otherwise = topDmd wrap_prag = alwaysInlinePragma `setInlinePragmaActivation` - ActiveAfter NoSourceText 2 + activeAfterInitial -- See Note [Activation for data constructor wrappers] -- The wrapper will usually be inlined (see wrap_unf), so its diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index 4a4abf7..ad6a075 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -55,7 +55,7 @@ import NameSet import NameEnv import UniqFM import Unify ( ruleMatchTyKiX ) -import BasicTypes ( Activation, CompilerPhase, isActive, pprRuleName ) +import BasicTypes import DynFlags ( DynFlags ) import Outputable import FastString @@ -290,9 +290,10 @@ addRuleInfo (RuleInfo rs1 fvs1) (RuleInfo rs2 fvs2) = RuleInfo (rs1 ++ rs2) (fvs1 `unionDVarSet` fvs2) addIdSpecialisations :: Id -> [CoreRule] -> Id -addIdSpecialisations id [] - = id addIdSpecialisations id rules + | null rules + = id + | otherwise = setIdSpecialisation id $ extendRuleInfo (idSpecialisation id) rules @@ -312,9 +313,8 @@ ruleIsVisible _ BuiltinRule{} = True ruleIsVisible vis_orphs Rule { ru_orphan = orph, ru_origin = origin } = notOrphan orph || origin `elemModuleSet` vis_orphs -{- -Note [Where rules are found] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Where rules are found] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The rules for an Id come from two places: (a) the ones it is born with, stored inside the Id iself (idCoreRules fn), (b) rules added in other modules, stored in the global RuleBase (imp_rules) diff --git a/compiler/stranal/WorkWrap.hs b/compiler/stranal/WorkWrap.hs index 6289ba0..34cfd64 100644 --- a/compiler/stranal/WorkWrap.hs +++ b/compiler/stranal/WorkWrap.hs @@ -551,8 +551,8 @@ splitFun dflags fam_envs fn_id fn_info wrap_dmds res_info rhs wrap_rhs = wrap_fn work_id wrap_act = case fn_act of -- See Note [Wrapper activation] ActiveAfter {} -> fn_act - NeverActive -> ActiveAfter NoSourceText 0 - _ -> ActiveAfter NoSourceText 2 + NeverActive -> activeDuringFinal + _ -> activeAfterInitial wrap_prag = InlinePragma { inl_src = SourceText "{-# INLINE" , inl_inline = NoUserInline , inl_sat = Nothing From git at git.haskell.org Wed Sep 5 16:26:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 5 Sep 2018 16:26:43 +0000 (UTC) Subject: [commit: ghc] master: Preserve specialisations despite CSE (3addf72) Message-ID: <20180905162643.D92B03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3addf72a6f40747cff213653382eb4476bdb53da/ghc >--------------------------------------------------------------- commit 3addf72a6f40747cff213653382eb4476bdb53da Author: Simon Peyton Jones Date: Wed Sep 5 15:54:48 2018 +0100 Preserve specialisations despite CSE Trac #15445 showed that, as a result of CSE, a function with an automatically generated specialisation RULE could be inlined before the RULE had a chance to fire. This patch attaches a NOINLINE[2] activation to the Id, during CSE, to stop this happening. See Note [Delay inlining after CSE] ---- Historical note --- This patch is simpler and more direct than an earlier version: commit 2110738b280543698407924a16ac92b6d804dc36 Author: Simon Peyton Jones Date: Mon Jul 30 13:43:56 2018 +0100 Don't inline functions with RULES too early We had to revert this patch because it made GHC itself slower. Why? It delayed inlining of /all/ functions with RULES, and that was very bad in TcFlatten.flatten_ty_con_app * It delayed inlining of liftM * That delayed the unravelling of the recursion in some dictionary bindings. * That delayed some eta expansion, leaving flatten_ty_con_app = \x y. let in \z. blah * That allowed the float-out pass to put sguff between the \y and \z. * And that permanently stopped eta expasion of the function, even once was simplified. -- End of historical note --- >--------------------------------------------------------------- 3addf72a6f40747cff213653382eb4476bdb53da compiler/simplCore/CSE.hs | 68 ++++++++++++++++++---- .../tests/numeric/should_compile/T14465.stdout | 2 +- .../tests/numeric/should_compile/T7116.stdout | 4 +- testsuite/tests/simplCore/should_compile/T15445.hs | 8 +++ .../tests/simplCore/should_compile/T15445.stderr | 13 +++++ .../tests/simplCore/should_compile/T15445a.hs | 10 ++++ testsuite/tests/simplCore/should_compile/all.T | 4 +- 7 files changed, 94 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3addf72a6f40747cff213653382eb4476bdb53da From git at git.haskell.org Thu Sep 6 08:40:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 08:40:19 +0000 (UTC) Subject: [commit: ghc] master: Remove an incorrect assertion in threadPaused: (16bc7ae) Message-ID: <20180906084019.9ADDD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/16bc7ae8b191153071b5fd1dde2b02e51171860e/ghc >--------------------------------------------------------------- commit 16bc7ae8b191153071b5fd1dde2b02e51171860e Author: Ömer Sinan Ağacan Date: Thu Sep 6 11:39:46 2018 +0300 Remove an incorrect assertion in threadPaused: The assertion is triggered when we have a loop in the program (in which case we see the same update frame multiple times in the stack). See #14915 for more details. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14915 Differential Revision: https://phabricator.haskell.org/D5133 >--------------------------------------------------------------- 16bc7ae8b191153071b5fd1dde2b02e51171860e rts/ThreadPaused.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index 3f7bdde..a916891 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -306,13 +306,6 @@ threadPaused(Capability *cap, StgTSO *tso) continue; } - // We should never have made it here in the event of blackholes that - // we already own; they should have been marked when we blackholed - // them and consequently we should have stopped our stack walk - // above. - ASSERT(!((bh_info == &stg_BLACKHOLE_info) - && (((StgInd*)bh)->indirectee == (StgClosure*)tso))); - // zero out the slop so that the sanity checker can tell // where the next closure is. OVERWRITING_CLOSURE(bh); From git at git.haskell.org Thu Sep 6 10:01:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 10:01:29 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-reengineered' created Message-ID: <20180906100129.558753A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-reengineered Referencing: 2b243dfbff008b6eb4aada102f8180bfb5fcb9f2 From git at git.haskell.org Thu Sep 6 10:01:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 10:01:32 +0000 (UTC) Subject: [commit: ghc] wip/T14880-reengineered: Upgrade haddock submodule to avoid bug (ea87c45) Message-ID: <20180906100132.1E4DC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-reengineered Link : http://ghc.haskell.org/trac/ghc/changeset/ea87c45cf0ee420e9763a5f4b16de615cafe9994/ghc >--------------------------------------------------------------- commit ea87c45cf0ee420e9763a5f4b16de615cafe9994 Author: Tobias Dammers Date: Wed Aug 1 16:56:53 2018 +0200 Upgrade haddock submodule to avoid bug >--------------------------------------------------------------- ea87c45cf0ee420e9763a5f4b16de615cafe9994 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 0d903e5..0731855 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 0d903e5e7ea877cbf6e8a7a84c9c8b6ef8c78ef6 +Subproject commit 0731855bd1c05379a91a3d761458b05c2d75b6d9 From git at git.haskell.org Thu Sep 6 10:01:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 10:01:34 +0000 (UTC) Subject: [commit: ghc] wip/T14880-reengineered: Apply -accum patch from #14880 (2b243df) Message-ID: <20180906100134.E2AB23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-reengineered Link : http://ghc.haskell.org/trac/ghc/changeset/2b243dfbff008b6eb4aada102f8180bfb5fcb9f2/ghc >--------------------------------------------------------------- commit 2b243dfbff008b6eb4aada102f8180bfb5fcb9f2 Author: Tobias Dammers Date: Thu Sep 6 12:00:27 2018 +0200 Apply -accum patch from #14880 >--------------------------------------------------------------- 2b243dfbff008b6eb4aada102f8180bfb5fcb9f2 compiler/types/TyCoRep.hs | 127 ++++++++++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 48 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2b243dfbff008b6eb4aada102f8180bfb5fcb9f2 From git at git.haskell.org Thu Sep 6 12:53:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 12:53:37 +0000 (UTC) Subject: [commit: ghc] master: Fix a race between GC threads in concurrent scavenging (c6fbac6) Message-ID: <20180906125337.D7FF43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c6fbac6a6a69a2f4be89701b2c386ae53214f9a3/ghc >--------------------------------------------------------------- commit c6fbac6a6a69a2f4be89701b2c386ae53214f9a3 Author: Ömer Sinan Ağacan Date: Thu Sep 6 15:52:53 2018 +0300 Fix a race between GC threads in concurrent scavenging While debugging #15285 I realized that free block lists (free_list in BlockAlloc.c) get corrupted when multiple scavenge threads allocate and release blocks concurrently. Here's a picture of one such race: Thread 2 (Thread 32573.32601): #0 check_tail (bd=0x940d40 ) at rts/sm/BlockAlloc.c:860 #1 0x0000000000928ef7 in checkFreeListSanity () at rts/sm/BlockAlloc.c:896 #2 0x0000000000928979 in freeGroup (p=0x7e998ce02880) at rts/sm/BlockAlloc.c:721 #3 0x0000000000928a17 in freeChain (bd=0x7e998ce02880) at rts/sm/BlockAlloc.c:738 #4 0x0000000000926911 in freeChain_sync (bd=0x7e998ce02880) at rts/sm/GCUtils.c:80 #5 0x0000000000934720 in scavenge_capability_mut_lists (cap=0x1acae80) at rts/sm/Scav.c:1665 #6 0x000000000092b411 in gcWorkerThread (cap=0x1acae80) at rts/sm/GC.c:1157 #7 0x000000000090be9a in yieldCapability (pCap=0x7f9994e69e20, task=0x7e9984000b70, gcAllowed=true) at rts/Capability.c:861 #8 0x0000000000906120 in scheduleYield (pcap=0x7f9994e69e50, task=0x7e9984000b70) at rts/Schedule.c:673 #9 0x0000000000905500 in schedule (initialCapability=0x1acae80, task=0x7e9984000b70) at rts/Schedule.c:293 #10 0x0000000000908d4f in scheduleWorker (cap=0x1acae80, task=0x7e9984000b70) at rts/Schedule.c:2554 #11 0x000000000091a30a in workerStart (task=0x7e9984000b70) at rts/Task.c:444 #12 0x00007f99937fa6db in start_thread (arg=0x7f9994e6a700) at pthread_create.c:463 #13 0x000061654d59f88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 1 (Thread 32573.32573): #0 checkFreeListSanity () at rts/sm/BlockAlloc.c:887 #1 0x0000000000928979 in freeGroup (p=0x7e998d303540) at rts/sm/BlockAlloc.c:721 #2 0x0000000000926f23 in todo_block_full (size=513, ws=0x1aa8ce0) at rts/sm/GCUtils.c:264 #3 0x00000000009583b9 in alloc_for_copy (size=513, gen_no=0) at rts/sm/Evac.c:80 #4 0x000000000095850d in copy_tag_nolock (p=0x7e998c675f28, info=0x421d98 , src=0x7e998d075d80, size=513, gen_no=0, tag=1) at rts/sm/Evac.c:153 #5 0x0000000000959177 in evacuate (p=0x7e998c675f28) at rts/sm/Evac.c:715 #6 0x0000000000932388 in scavenge_small_bitmap (p=0x7e998c675f28, size=1, bitmap=0) at rts/sm/Scav.c:271 #7 0x0000000000934aaf in scavenge_stack (p=0x7e998c675f28, stack_end=0x7e998c676000) at rts/sm/Scav.c:1908 #8 0x0000000000934295 in scavenge_one (p=0x7e998c66e000) at rts/sm/Scav.c:1466 #9 0x0000000000934662 in scavenge_mutable_list (bd=0x7e998d300440, gen=0x1b1d880) at rts/sm/Scav.c:1643 #10 0x0000000000934700 in scavenge_capability_mut_lists (cap=0x1aaa340) at rts/sm/Scav.c:1664 #11 0x00000000009299b6 in GarbageCollect (collect_gen=0, do_heap_census=false, gc_type=2, cap=0x1aaa340, idle_cap=0x1b38aa0) at rts/sm/GC.c:378 #12 0x0000000000907a4a in scheduleDoGC (pcap=0x7ffdec5b5310, task=0x1b36650, force_major=false) at rts/Schedule.c:1798 #13 0x0000000000905de7 in schedule (initialCapability=0x1aaa340, task=0x1b36650) at rts/Schedule.c:546 #14 0x0000000000908bc4 in scheduleWaitThread (tso=0x7e998c0067c8, ret=0x0, pcap=0x7ffdec5b5430) at rts/Schedule.c:2537 #15 0x000000000091b5a0 in rts_evalLazyIO (cap=0x7ffdec5b5430, p=0x9c11f0, ret=0x0) at rts/RtsAPI.c:530 #16 0x000000000091ca56 in hs_main (argc=1, argv=0x7ffdec5b5628, main_closure=0x9c11f0, rts_config=...) at rts/RtsMain.c:72 #17 0x0000000000421ea0 in main () In particular, dbl_link_onto() which is used to add a freed block to a doubly-linked free list is not thread safe and corrupts the list when called concurrently. Note that thread 1 is to blame here as thread 2 is properly taking the spinlock. With this patch we now take the spinlock when freeing a todo block in GC, avoiding this race. Test Plan: - Tried slow validate locally: this patch does not introduce new failures. - circleci: https://circleci.com/gh/ghc/ghc-diffs/283 The test got killed because it took 5 hours but T7919 (which was previously failing on circleci) passed. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15285 Differential Revision: https://phabricator.haskell.org/D5115 >--------------------------------------------------------------- c6fbac6a6a69a2f4be89701b2c386ae53214f9a3 rts/sm/GCUtils.c | 10 +++++++++- rts/sm/GCUtils.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c index 24f7b5e..31b2913 100644 --- a/rts/sm/GCUtils.c +++ b/rts/sm/GCUtils.c @@ -81,6 +81,14 @@ freeChain_sync(bdescr *bd) RELEASE_SPIN_LOCK(&gc_alloc_block_sync); } +void +freeGroup_sync(bdescr *bd) +{ + ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync); + freeGroup(bd); + RELEASE_SPIN_LOCK(&gc_alloc_block_sync); +} + /* ----------------------------------------------------------------------------- Workspace utilities -------------------------------------------------------------------------- */ @@ -261,7 +269,7 @@ todo_block_full (uint32_t size, gen_workspace *ws) // object. However, if the object we're copying is // larger than a block, then we might have an empty // block here. - freeGroup(bd); + freeGroup_sync(bd); } else { push_scanned_block(bd, ws); } diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h index 3c17449..8b60407 100644 --- a/rts/sm/GCUtils.h +++ b/rts/sm/GCUtils.h @@ -31,6 +31,7 @@ INLINE_HEADER bdescr *allocBlockOnNode_sync(uint32_t node) } void freeChain_sync(bdescr *bd); +void freeGroup_sync(bdescr *bd); void push_scanned_block (bdescr *bd, gen_workspace *ws); StgPtr todo_block_full (uint32_t size, gen_workspace *ws); From git at git.haskell.org Thu Sep 6 16:21:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 6 Sep 2018 16:21:30 +0000 (UTC) Subject: [commit: ghc] wip/T14880-reengineered: Literally use Simon's code for tcvs_of_... (057dfdc) Message-ID: <20180906162130.9542A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-reengineered Link : http://ghc.haskell.org/trac/ghc/changeset/057dfdcb01935911dddf6a2d47b3ffd16e4d548b/ghc >--------------------------------------------------------------- commit 057dfdcb01935911dddf6a2d47b3ffd16e4d548b Author: Tobias Dammers Date: Thu Sep 6 18:20:57 2018 +0200 Literally use Simon's code for tcvs_of_... >--------------------------------------------------------------- 057dfdcb01935911dddf6a2d47b3ffd16e4d548b compiler/types/TyCoRep.hs | 111 ++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 62 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index cfd50b5..a467cd7 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1528,85 +1528,72 @@ closeOverKinds tcvs = mapUnionVarSetSet (tyCoVarsOfType . tyVarKind) tcvs `union -- Explicitly note that these sets are not closed over kinds type TyCoVarSetNotClosed = TyCoVarSet -type TCFV = TyCoVarSet -> TyCoVarSet -> TyCoVarSet - -mapUnionTCFV :: (a -> TCFV) -> [a] -> TCFV -mapUnionTCFV f xs is acc = go xs acc - where - go [] acc = acc - go (x:xs) acc = f x is $ go xs acc -{-#INLINE mapUnionTCFV #-} - -unionTCFV :: TCFV -> TCFV -> TCFV -unionTCFV f g is acc = g is $ f is acc -{-#INLINE unionTCFV #-} - -emptyTCFV :: TCFV -emptyTCFV _ acc = acc -{-#INLINE emptyTCFV #-} - --- These functions produce a non-deterministic set. No point in going via FV (which maintains --- determinism info) and then drop the determinism. This is boring boiler plate code, but this --- is measurably faster than going via FV. --- TODO: Add Note to explain why accumulator style is needed here, and why --- we won't use FV itself. -tcvs_of_type :: Type -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -tcvs_of_type (TyVarTy v) is acc - | v `elemVarSet` is = acc +tcvs_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet +tcvs_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = tcvs_of_type (tyVarKind v) is (extendVarSet acc v) -tcvs_of_type (TyConApp _ tys) is acc = tcvs_of_types tys is acc -tcvs_of_type (LitTy {}) _ acc = acc -tcvs_of_type (AppTy fun arg) is acc = tcvs_of_type fun is $ tcvs_of_type arg is acc -tcvs_of_type (FunTy arg res) is acc = tcvs_of_type arg is $ tcvs_of_type res is acc + | otherwise = tcvs_of_type (tyVarKind v) is (extendVarSet acc v) +tcvs_of_type (TyConApp _ tys) is acc = tcvs_of_types tys is acc +tcvs_of_type (LitTy {}) _ acc = acc +tcvs_of_type (AppTy fun arg) is acc = tcvs_of_type fun is (tcvs_of_type arg is acc) +tcvs_of_type (FunTy arg res) is acc = tcvs_of_type arg is (tcvs_of_type res is acc) tcvs_of_type (ForAllTy (TvBndr tv _) ty) is acc = tcvs_of_type (tyVarKind tv) is $ - tcvs_of_type ty (extendVarSet is tv) acc -tcvs_of_type (CastTy ty co) is acc = tcvs_of_type ty is (tcvs_of_co co is acc) -tcvs_of_type (CoercionTy co) is acc = tcvs_of_co co is acc - -tcvs_of_types :: [Type] -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -tcvs_of_types = mapUnionTCFV tcvs_of_type --- tcvs_of_types [] _ acc = acc --- tcvs_of_types (ty:tys) is acc = tcvs_of_type ty is $ tcvs_of_types tys is acc - -tcvs_of_co :: Coercion -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -tcvs_of_co (Refl _ ty) is acc = tcvs_of_type ty is acc -tcvs_of_co (TyConAppCo _ _ cos) is acc = tcvs_of_cos cos is acc -tcvs_of_co (AppCo co arg) is acc = tcvs_of_co co is $ tcvs_of_co arg is acc -tcvs_of_co (ForAllCo tv kind_co co) is acc = tcvs_of_co kind_co is $ tcvs_of_co co (extendVarSet is tv) acc -tcvs_of_co (FunCo _ co1 co2) is acc = tcvs_of_co co1 is $ tcvs_of_co co2 is acc -tcvs_of_co (CoVarCo v) is acc = tcvs_of_co_var v is acc -tcvs_of_co (HoleCo h) is acc = tcvs_of_co_var (coHoleCoVar h) is acc + tcvs_of_type ty (extendVarSet is tv) acc +tcvs_of_type (CastTy ty co) is acc = tcvs_of_type ty is (tcvs_of_co co is acc) +tcvs_of_type (CoercionTy co) is acc = tcvs_of_co co is acc + +tcvs_of_types :: [Type] -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet +tcvs_of_types [] _ acc = acc +tcvs_of_types (ty:tys) is acc = tcvs_of_type ty is (tcvs_of_types tys is acc) + +tcvs_of_co :: Coercion -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet +tcvs_of_co (Refl _ ty) is acc = tcvs_of_type ty is acc +tcvs_of_co (TyConAppCo _ _ cos) is acc = tcvs_of_cos cos is acc +tcvs_of_co (AppCo co arg) is acc = tcvs_of_co co is $ + tcvs_of_co arg is acc +tcvs_of_co (ForAllCo tv kind_co co) is acc = tcvs_of_co kind_co is $ + tcvs_of_co co (extendVarSet is tv) acc +tcvs_of_co (FunCo _ co1 co2) is acc = tcvs_of_co co1 is $ + tcvs_of_co co2 is acc +tcvs_of_co (CoVarCo v) is acc = tcvs_of_co_var v is acc +tcvs_of_co (HoleCo h) is acc = tcvs_of_co_var (coHoleCoVar h) is acc -- See Note [CoercionHoles and coercion free variables] -tcvs_of_co (AxiomInstCo _ _ cos) is acc = tcvs_of_cos cos is acc -tcvs_of_co (UnivCo p _ t1 t2) is acc = (tcvs_of_prov p - `unionTCFV` tcvs_of_type t1 - `unionTCFV` tcvs_of_type t2) - is acc +tcvs_of_co (AxiomInstCo _ _ cos) is acc = tcvs_of_cos cos is acc +tcvs_of_co (UnivCo p _ t1 t2) is acc = tcvs_of_prov p is $ + tcvs_of_type t1 is $ + tcvs_of_type t2 is acc tcvs_of_co (SymCo co) is acc = tcvs_of_co co is acc -tcvs_of_co (TransCo co1 co2) is acc = (tcvs_of_co co1 `unionTCFV` tcvs_of_co co2) is acc +tcvs_of_co (TransCo co1 co2) is acc = tcvs_of_co co1 is $ + tcvs_of_co co2 is acc tcvs_of_co (NthCo _ _ co) is acc = tcvs_of_co co is acc tcvs_of_co (LRCo _ co) is acc = tcvs_of_co co is acc -tcvs_of_co (InstCo co arg) is acc = (tcvs_of_co co `unionTCFV` tcvs_of_co arg) is acc -tcvs_of_co (CoherenceCo c1 c2) is acc = (tcvs_of_co c1 `unionTCFV` tcvs_of_co c2) is acc +tcvs_of_co (InstCo co arg) is acc = tcvs_of_co co is $ + tcvs_of_co arg is acc +tcvs_of_co (CoherenceCo c1 c2) is acc = tcvs_of_co c1 is $ + tcvs_of_co c2 is acc tcvs_of_co (KindCo co) is acc = tcvs_of_co co is acc tcvs_of_co (SubCo co) is acc = tcvs_of_co co is acc tcvs_of_co (AxiomRuleCo _ cs) is acc = tcvs_of_cos cs is acc -tcvs_of_co_var :: CoVar -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed +tcvs_of_co_var :: CoVar -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet tcvs_of_co_var v is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = tcvs_of_type (varType v) is (extendVarSet acc v) + | otherwise = tcvs_of_type (varType v) is (extendVarSet acc v) -tcvs_of_cos :: [Coercion] -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -tcvs_of_cos = mapUnionTCFV tcvs_of_co +tcvs_of_cos :: [Coercion] -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet +tcvs_of_cos [] _ acc = acc +tcvs_of_cos (co:cos) is acc = tcvs_of_co co is (tcvs_of_cos cos is acc) -tcvs_of_prov :: UnivCoProvenance -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -> TyCoVarSetNotClosed -tcvs_of_prov UnsafeCoerceProv is acc = emptyTCFV is acc +-- tyCoVarsOfProv :: UnivCoProvenance -> TyCoVarSet +-- tyCoVarsOfProv prov = tcvs_of_prov prov emptyVarSet emptyVarSet + +tcvs_of_prov :: UnivCoProvenance -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet tcvs_of_prov (PhantomProv co) is acc = tcvs_of_co co is acc tcvs_of_prov (ProofIrrelProv co) is acc = tcvs_of_co co is acc -tcvs_of_prov (PluginProv _) is acc = emptyTCFV is acc +tcvs_of_prov UnsafeCoerceProv _ acc = acc +tcvs_of_prov (PluginProv _) _ acc = acc + -- | `tyCoFVsOfType` that returns free variables of a type in a deterministic -- set. For explanation of why using `VarSet` is not deterministic see From git at git.haskell.org Fri Sep 7 06:59:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 06:59:14 +0000 (UTC) Subject: [commit: ghc] master: Various RTS bug fixes: (d9a26c7) Message-ID: <20180907065914.E9E513A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d9a26c7e8d9bb96ccb676d6a23da21b64559c7c2/ghc >--------------------------------------------------------------- commit d9a26c7e8d9bb96ccb676d6a23da21b64559c7c2 Author: Ömer Sinan Ağacan Date: Fri Sep 7 09:28:36 2018 +0300 Various RTS bug fixes: - Retainer profiler: init_srt_thunk() should mark the stack entry as SRT - Retainer profiler: Remove an incorrect assertion about FUN_STATIC. FUN_STATIC does not have to have an SRT. - Fix nptrs of BCO Test Plan: validate Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5134 >--------------------------------------------------------------- d9a26c7e8d9bb96ccb676d6a23da21b64559c7c2 rts/RetainerProfile.c | 3 +-- rts/StgMiscClosures.cmm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index d67eeb4..23f46e0 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -337,6 +337,7 @@ init_srt_fun( stackPos *info, const StgFunInfoTable *infoTable ) static INLINE void init_srt_thunk( stackPos *info, const StgThunkInfoTable *infoTable ) { + info->type = posTypeSRT; if (infoTable->i.srt) { info->next.srt.srt = (StgClosure*)GET_SRT(infoTable); } else { @@ -489,8 +490,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) // layout.payload.ptrs, SRT case FUN_STATIC: - ASSERT(get_itbl(c)->srt != 0); - /* fallthrough */ case FUN: // *c is a heap object. case FUN_2_0: init_ptrs(&se.info, get_itbl(c)->layout.payload.ptrs, (StgPtr)c->payload); diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index e645442..36fd669 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -211,7 +211,7 @@ INFO_TABLE_RET( stg_apply_interp, RET_BCO ) Entry code for a BCO ------------------------------------------------------------------------- */ -INFO_TABLE_FUN( stg_BCO, 4, 0, BCO, "BCO", "BCO", ARG_BCO ) +INFO_TABLE_FUN( stg_BCO, 3, 0, BCO, "BCO", "BCO", ARG_BCO ) /* explicit stack */ { /* entering a BCO means "apply it", same as a function */ From git at git.haskell.org Fri Sep 7 11:05:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:05:56 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T15578' created Message-ID: <20180907110556.2E9EC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T15578 Referencing: 15be2e969f0f91c99f99ce14d9269ca950caf079 From git at git.haskell.org Fri Sep 7 11:05:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:05:59 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Honor INLINE on 0-arity bindings (#15578) (2d416cd) Message-ID: <20180907110559.68C5C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/2d416cd8c3d1a0657bf444a248b6082cfb7c9e32/ghc >--------------------------------------------------------------- commit 2d416cd8c3d1a0657bf444a248b6082cfb7c9e32 Author: Tobias Dammers Date: Wed Sep 5 09:34:38 2018 +0200 Honor INLINE on 0-arity bindings (#15578) >--------------------------------------------------------------- 2d416cd8c3d1a0657bf444a248b6082cfb7c9e32 compiler/coreSyn/CoreUnfold.hs | 3 ++- compiler/simplCore/.Simplify.hs.swp | Bin 0 -> 172032 bytes compiler/simplCore/Simplify.hs | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 68e7290..fe2ae62 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,7 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } - boring_ok = inlineBoringOk expr' + boring_ok | arity == 0 = True + | otherwise = inlineBoringOk expr' mkInlinableUnfolding :: DynFlags -> CoreExpr -> Unfolding mkInlinableUnfolding dflags expr diff --git a/compiler/simplCore/.Simplify.hs.swp b/compiler/simplCore/.Simplify.hs.swp new file mode 100644 index 0000000..91b3394 Binary files /dev/null and b/compiler/simplCore/.Simplify.hs.swp differ diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index c8870c9..f2defcd 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -3402,14 +3402,24 @@ simplStableUnfolding env top_lvl mb_cont id unf rhs_ty Just cont -> simplJoinRhs unf_env id expr cont Nothing -> simplExprC unf_env expr (mkBoringStop rhs_ty) ; case guide of - UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok } -- Happens for INLINE things - -> let guide' = UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok - , ug_boring_ok = inlineBoringOk expr' } + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = boring_ok + } + -- Happens for INLINE things + -> let guide' = + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = + boring_ok || inlineBoringOk expr' + } -- Refresh the boring-ok flag, in case expr' -- has got small. This happens, notably in the inlinings -- for dfuns for single-method classes; see -- Note [Single-method classes] in TcInstDcls. -- A test case is Trac #4138 + -- But retain a previous boring_ok of True; e.g. see + -- the way it is set in calcUnfoldingGuidanceWithArity in return (mkCoreUnfolding src is_top_lvl expr' guide') -- See Note [Top-level flag on inline rules] in CoreUnfold From git at git.haskell.org Fri Sep 7 11:06:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:06:02 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Fix test for #15578 (15be2e9) Message-ID: <20180907110602.3737D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/15be2e969f0f91c99f99ce14d9269ca950caf079/ghc >--------------------------------------------------------------- commit 15be2e969f0f91c99f99ce14d9269ca950caf079 Author: Tobias Dammers Date: Fri Sep 7 13:02:49 2018 +0200 Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. >--------------------------------------------------------------- 15be2e969f0f91c99f99ce14d9269ca950caf079 testsuite/tests/simplCore/should_compile/T7360.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index f310e8f..5332a3e 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -26,7 +26,7 @@ fun1 [InlPrag=NOINLINE] :: Foo -> () Str=, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) Tmpl= \ (x [Occ=Once] :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() }}] fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() } From git at git.haskell.org Fri Sep 7 11:15:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:15:50 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Fix test for #15578 (848a7e9) Message-ID: <20180907111550.BEADB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/848a7e971179f376c11890c83a51f56f6754ac52/ghc >--------------------------------------------------------------- commit 848a7e971179f376c11890c83a51f56f6754ac52 Author: Tobias Dammers Date: Fri Sep 7 13:02:49 2018 +0200 Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. >--------------------------------------------------------------- 848a7e971179f376c11890c83a51f56f6754ac52 testsuite/tests/simplCore/should_compile/T7360.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index f310e8f..5332a3e 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -26,7 +26,7 @@ fun1 [InlPrag=NOINLINE] :: Foo -> () Str=, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) Tmpl= \ (x [Occ=Once] :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() }}] fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() } From git at git.haskell.org Fri Sep 7 11:15:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:15:54 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Honor INLINE on 0-arity bindings (#15578) (762a097) Message-ID: <20180907111554.084283A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/762a09795b58623aefdbde926046899a1064d36c/ghc >--------------------------------------------------------------- commit 762a09795b58623aefdbde926046899a1064d36c Author: Tobias Dammers Date: Wed Sep 5 09:34:38 2018 +0200 Honor INLINE on 0-arity bindings (#15578) >--------------------------------------------------------------- 762a09795b58623aefdbde926046899a1064d36c compiler/coreSyn/CoreUnfold.hs | 3 ++- compiler/simplCore/.Simplify.hs.swp | Bin 0 -> 172032 bytes compiler/simplCore/Simplify.hs | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 68e7290..fe2ae62 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,7 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } - boring_ok = inlineBoringOk expr' + boring_ok | arity == 0 = True + | otherwise = inlineBoringOk expr' mkInlinableUnfolding :: DynFlags -> CoreExpr -> Unfolding mkInlinableUnfolding dflags expr diff --git a/compiler/simplCore/.Simplify.hs.swp b/compiler/simplCore/.Simplify.hs.swp new file mode 100644 index 0000000..91b3394 Binary files /dev/null and b/compiler/simplCore/.Simplify.hs.swp differ diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index c8870c9..f2defcd 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -3402,14 +3402,24 @@ simplStableUnfolding env top_lvl mb_cont id unf rhs_ty Just cont -> simplJoinRhs unf_env id expr cont Nothing -> simplExprC unf_env expr (mkBoringStop rhs_ty) ; case guide of - UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok } -- Happens for INLINE things - -> let guide' = UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok - , ug_boring_ok = inlineBoringOk expr' } + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = boring_ok + } + -- Happens for INLINE things + -> let guide' = + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = + boring_ok || inlineBoringOk expr' + } -- Refresh the boring-ok flag, in case expr' -- has got small. This happens, notably in the inlinings -- for dfuns for single-method classes; see -- Note [Single-method classes] in TcInstDcls. -- A test case is Trac #4138 + -- But retain a previous boring_ok of True; e.g. see + -- the way it is set in calcUnfoldingGuidanceWithArity in return (mkCoreUnfolding src is_top_lvl expr' guide') -- See Note [Top-level flag on inline rules] in CoreUnfold From git at git.haskell.org Fri Sep 7 11:15:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:15:56 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add Notes for #15578 (ca34519) Message-ID: <20180907111556.CC8683A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/ca345199baf19818c0da36a5f7209738b7b92df2/ghc >--------------------------------------------------------------- commit ca345199baf19818c0da36a5f7209738b7b92df2 Author: Tobias Dammers Date: Fri Sep 7 13:14:50 2018 +0200 Add Notes for #15578 >--------------------------------------------------------------- ca345199baf19818c0da36a5f7209738b7b92df2 compiler/coreSyn/CoreUnfold.hs | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index fe2ae62..4ec32a3 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,6 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } + -- See Note [Honour INLINE on 0-ary bindings] as to why we need to look at + -- the arity here. boring_ok | arity == 0 = True | otherwise = inlineBoringOk expr' @@ -237,6 +239,72 @@ specUnfolding to specialise its unfolding. Some important points: we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs (which arises from INLINABLE), we discard it + +Note [Honour INLINE on 0-ary bindings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + x = + {-# INLINE x #-} + + f y = ...x... + +The semantics of an INLINE pragma is + + inline x at every call site, provided it is saturated; + that is, applied to at least as many arguments as appear + on the LHS of the Haskell source definition. + +(This soure-code-derived arity is stored in the `ug_arity` field of +the `UnfoldingGuidance`.) + +In the example, x's ug_arity is 0, so we should inline it at every use +site. It's rare to have such an INLINE pragma (usually INLINE Is on +functions), but it's occasionally very important (Trac #15578, #15519). +In #15519 we had something like + x = case (g a b) of I# r -> T r + {-# INLINE x #-} + f y = ...(h x).... + +where h is strict. So we got + f y = ...(case g a b of I# r -> h (T r))... + +and that in turn allowed SpecConstr to ramp up performance. + +How do we deliver on this? By adjusting the ug_boring_ok +flag in mkInlineUnfoldingWithArity; see +Note [INLINE pragmas and boring contexts] + +NB: there is a real risk that full laziness will float it right back +out again. Consider again + x = factorial 200 + {-# INLINE x #-} + f y = ...x... + +After inlining we get + f y = ...(factorial 200)... + +but it's entirely possible that full laziness will do + lvl23 = factorial 200 + f y = ...lvl23... + +That's a problem for another day. + +Note [INLINE pragmas and boring contexts] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +An INLNE pragma uses mkInlineUnfoldingWithArity to build the +unfolding. That sets the ug_boring_ok flag to False if the function +is not tiny (inlineBorkingOK), so that even INLINE functions are not +inlined in an utterly boring context. E.g. + \x y. Just (f y x) +Nothing is gained by inlining f here, even if it has an INLINE +pragma. + +But for 0-ary bindings, we want to inline regardless; see +Note [Honour INLINE on 0-ary bindings]. + +I'm a bit worried that it's possible for the same kind of problem +to arise for non-0-ary functions too, but let's wait and see. -} mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr @@ -1450,6 +1518,8 @@ This kind of thing can occur if you have foo = let x = e in (x,x) which Roman did. + + -} computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt From git at git.haskell.org Fri Sep 7 11:15:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:15:59 +0000 (UTC) Subject: [commit: ghc] wip/T15578's head updated: Add Notes for #15578 (ca34519) Message-ID: <20180907111559.5E8A03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/T15578' now includes: 97826e3 Fix the __GLASGOW_HASKELL__ comparison 12e6e19 A few typos [ci skip] 140563f fix -ddump-asm description 5d3eb64 Minor improvements to comments [skip ci] 5851885 Comments only fda2ea5 Commets on flatten_args_tc 565ef4c Remove knot-tying bug in TcHsSyn.zonkTyVarOcc 6dea7c1 Reject class instances with type families in kinds ed78951 make iToBase62's inner loop stricter in one of its arguments 2e226a4 canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) d1514e8 Remove duplicate "since" field in glasgow_exts.rst fa3143c Fix typos in -Wsimplifiable-class-constraints flag docs df363a6 Compiler panic on invalid syntax (unterminated pragma) a3a1a17 Add a test for Trac #15586 2254912 testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridable 24d610a Fix tests ghci057 and T9293. (#15071) c0e5087 Skip eventlog tests in GHCi way 49d50b2 testsuite: Add test for #15368 a811d93 base: Add references to Notes for certain special imports ecde954 testsuite: Use bools for booleans, not ints e29ac2d Expose 'moduleToPkgConfAll' from 'PackageState' 1152a3b Define activeAfterInitial, activeDuringFinal 3addf72 Preserve specialisations despite CSE 16bc7ae Remove an incorrect assertion in threadPaused: c6fbac6 Fix a race between GC threads in concurrent scavenging d9a26c7 Various RTS bug fixes: 762a097 Honor INLINE on 0-arity bindings (#15578) 848a7e9 Fix test for #15578 ca34519 Add Notes for #15578 From git at git.haskell.org Fri Sep 7 11:18:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:18:23 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Honor INLINE on 0-arity bindings (#15578) (036c82a) Message-ID: <20180907111823.3423C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/036c82a5acb3c7dfea928e0c75423d1a60dee158/ghc >--------------------------------------------------------------- commit 036c82a5acb3c7dfea928e0c75423d1a60dee158 Author: Tobias Dammers Date: Wed Sep 5 09:34:38 2018 +0200 Honor INLINE on 0-arity bindings (#15578) >--------------------------------------------------------------- 036c82a5acb3c7dfea928e0c75423d1a60dee158 compiler/coreSyn/CoreUnfold.hs | 3 ++- compiler/simplCore/Simplify.hs | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 68e7290..fe2ae62 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,7 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } - boring_ok = inlineBoringOk expr' + boring_ok | arity == 0 = True + | otherwise = inlineBoringOk expr' mkInlinableUnfolding :: DynFlags -> CoreExpr -> Unfolding mkInlinableUnfolding dflags expr diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index c8870c9..f2defcd 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -3402,14 +3402,24 @@ simplStableUnfolding env top_lvl mb_cont id unf rhs_ty Just cont -> simplJoinRhs unf_env id expr cont Nothing -> simplExprC unf_env expr (mkBoringStop rhs_ty) ; case guide of - UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok } -- Happens for INLINE things - -> let guide' = UnfWhen { ug_arity = arity, ug_unsat_ok = sat_ok - , ug_boring_ok = inlineBoringOk expr' } + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = boring_ok + } + -- Happens for INLINE things + -> let guide' = + UnfWhen { ug_arity = arity + , ug_unsat_ok = sat_ok + , ug_boring_ok = + boring_ok || inlineBoringOk expr' + } -- Refresh the boring-ok flag, in case expr' -- has got small. This happens, notably in the inlinings -- for dfuns for single-method classes; see -- Note [Single-method classes] in TcInstDcls. -- A test case is Trac #4138 + -- But retain a previous boring_ok of True; e.g. see + -- the way it is set in calcUnfoldingGuidanceWithArity in return (mkCoreUnfolding src is_top_lvl expr' guide') -- See Note [Top-level flag on inline rules] in CoreUnfold From git at git.haskell.org Fri Sep 7 11:18:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:18:26 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add Notes for #15578 (4b24555) Message-ID: <20180907111826.044683A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/4b2455549da511521c81bf396f2988a5af9f588f/ghc >--------------------------------------------------------------- commit 4b2455549da511521c81bf396f2988a5af9f588f Author: Tobias Dammers Date: Fri Sep 7 13:14:50 2018 +0200 Add Notes for #15578 >--------------------------------------------------------------- 4b2455549da511521c81bf396f2988a5af9f588f compiler/coreSyn/CoreUnfold.hs | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index fe2ae62..4ec32a3 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,6 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } + -- See Note [Honour INLINE on 0-ary bindings] as to why we need to look at + -- the arity here. boring_ok | arity == 0 = True | otherwise = inlineBoringOk expr' @@ -237,6 +239,72 @@ specUnfolding to specialise its unfolding. Some important points: we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs (which arises from INLINABLE), we discard it + +Note [Honour INLINE on 0-ary bindings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + x = + {-# INLINE x #-} + + f y = ...x... + +The semantics of an INLINE pragma is + + inline x at every call site, provided it is saturated; + that is, applied to at least as many arguments as appear + on the LHS of the Haskell source definition. + +(This soure-code-derived arity is stored in the `ug_arity` field of +the `UnfoldingGuidance`.) + +In the example, x's ug_arity is 0, so we should inline it at every use +site. It's rare to have such an INLINE pragma (usually INLINE Is on +functions), but it's occasionally very important (Trac #15578, #15519). +In #15519 we had something like + x = case (g a b) of I# r -> T r + {-# INLINE x #-} + f y = ...(h x).... + +where h is strict. So we got + f y = ...(case g a b of I# r -> h (T r))... + +and that in turn allowed SpecConstr to ramp up performance. + +How do we deliver on this? By adjusting the ug_boring_ok +flag in mkInlineUnfoldingWithArity; see +Note [INLINE pragmas and boring contexts] + +NB: there is a real risk that full laziness will float it right back +out again. Consider again + x = factorial 200 + {-# INLINE x #-} + f y = ...x... + +After inlining we get + f y = ...(factorial 200)... + +but it's entirely possible that full laziness will do + lvl23 = factorial 200 + f y = ...lvl23... + +That's a problem for another day. + +Note [INLINE pragmas and boring contexts] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +An INLNE pragma uses mkInlineUnfoldingWithArity to build the +unfolding. That sets the ug_boring_ok flag to False if the function +is not tiny (inlineBorkingOK), so that even INLINE functions are not +inlined in an utterly boring context. E.g. + \x y. Just (f y x) +Nothing is gained by inlining f here, even if it has an INLINE +pragma. + +But for 0-ary bindings, we want to inline regardless; see +Note [Honour INLINE on 0-ary bindings]. + +I'm a bit worried that it's possible for the same kind of problem +to arise for non-0-ary functions too, but let's wait and see. -} mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr @@ -1450,6 +1518,8 @@ This kind of thing can occur if you have foo = let x = e in (x,x) which Roman did. + + -} computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt From git at git.haskell.org Fri Sep 7 11:18:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:18:28 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Fix test for #15578 (0540854) Message-ID: <20180907111828.C88153A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/05408545992751d37b8a9f61ebb4ffc348dc081f/ghc >--------------------------------------------------------------- commit 05408545992751d37b8a9f61ebb4ffc348dc081f Author: Tobias Dammers Date: Fri Sep 7 13:02:49 2018 +0200 Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. >--------------------------------------------------------------- 05408545992751d37b8a9f61ebb4ffc348dc081f testsuite/tests/simplCore/should_compile/T7360.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index f310e8f..5332a3e 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -26,7 +26,7 @@ fun1 [InlPrag=NOINLINE] :: Foo -> () Str=, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) Tmpl= \ (x [Occ=Once] :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() }}] fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() } From git at git.haskell.org Fri Sep 7 11:21:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:21:45 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add Notes for #15578 (5a5dd5f) Message-ID: <20180907112145.BD9183A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/5a5dd5fd9eb832c95e2a89b446a7f18ee00433a2/ghc >--------------------------------------------------------------- commit 5a5dd5fd9eb832c95e2a89b446a7f18ee00433a2 Author: Tobias Dammers Date: Fri Sep 7 13:14:50 2018 +0200 Add Notes for #15578 >--------------------------------------------------------------- 5a5dd5fd9eb832c95e2a89b446a7f18ee00433a2 compiler/coreSyn/CoreUnfold.hs | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index fe2ae62..7d734af 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,6 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } + -- See Note [Honour INLINE on 0-ary bindings] as to why we need to look at + -- the arity here. boring_ok | arity == 0 = True | otherwise = inlineBoringOk expr' @@ -237,6 +239,72 @@ specUnfolding to specialise its unfolding. Some important points: we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs (which arises from INLINABLE), we discard it + +Note [Honour INLINE on 0-ary bindings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + x = + {-# INLINE x #-} + + f y = ...x... + +The semantics of an INLINE pragma is + + inline x at every call site, provided it is saturated; + that is, applied to at least as many arguments as appear + on the LHS of the Haskell source definition. + +(This soure-code-derived arity is stored in the `ug_arity` field of +the `UnfoldingGuidance`.) + +In the example, x's ug_arity is 0, so we should inline it at every use +site. It's rare to have such an INLINE pragma (usually INLINE Is on +functions), but it's occasionally very important (Trac #15578, #15519). +In #15519 we had something like + x = case (g a b) of I# r -> T r + {-# INLINE x #-} + f y = ...(h x).... + +where h is strict. So we got + f y = ...(case g a b of I# r -> h (T r))... + +and that in turn allowed SpecConstr to ramp up performance. + +How do we deliver on this? By adjusting the ug_boring_ok +flag in mkInlineUnfoldingWithArity; see +Note [INLINE pragmas and boring contexts] + +NB: there is a real risk that full laziness will float it right back +out again. Consider again + x = factorial 200 + {-# INLINE x #-} + f y = ...x... + +After inlining we get + f y = ...(factorial 200)... + +but it's entirely possible that full laziness will do + lvl23 = factorial 200 + f y = ...lvl23... + +That's a problem for another day. + +Note [INLINE pragmas and boring contexts] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +An INLNE pragma uses mkInlineUnfoldingWithArity to build the +unfolding. That sets the ug_boring_ok flag to False if the function +is not tiny (inlineBorkingOK), so that even INLINE functions are not +inlined in an utterly boring context. E.g. + \x y. Just (f y x) +Nothing is gained by inlining f here, even if it has an INLINE +pragma. + +But for 0-ary bindings, we want to inline regardless; see +Note [Honour INLINE on 0-ary bindings]. + +I'm a bit worried that it's possible for the same kind of problem +to arise for non-0-ary functions too, but let's wait and see. -} mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr @@ -1450,6 +1518,8 @@ This kind of thing can occur if you have foo = let x = e in (x,x) which Roman did. + + -} computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt From git at git.haskell.org Fri Sep 7 11:53:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 11:53:40 +0000 (UTC) Subject: [commit: ghc] master: Documentation tweaks (4caad16) Message-ID: <20180907115340.CE86C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4caad1660a641995caee3ee6da6fee4a93ee99b5/ghc >--------------------------------------------------------------- commit 4caad1660a641995caee3ee6da6fee4a93ee99b5 Author: Krzysztof Gogolewski Date: Fri Sep 7 13:53:11 2018 +0200 Documentation tweaks Summary: - Mention static pointers in "stolen syntax" - Suggest importing Constraint and IsString from Data.* instead of GHC.* - Remove obsolete SPECIALISE syntax; it was removed in or before 1999 (d66d409bf6) - Fix link in pattern signatures Test Plan: build Reviewers: bgamari, takenobu Reviewed By: takenobu Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5132 >--------------------------------------------------------------- 4caad1660a641995caee3ee6da6fee4a93ee99b5 docs/users_guide/glasgow_exts.rst | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 4659351..ead020c 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2290,6 +2290,9 @@ The following syntax is stolen: ``pattern`` Stolen by: :extension:`PatternSynonyms` +``static`` + Stolen by: :extension:`StaticPointers` + .. _data-type-extensions: Extensions to data types and type synonyms @@ -7034,7 +7037,7 @@ usual: :: The class ``IsString`` is not in scope by default. If you want to mention it explicitly (for example, to give an instance declaration for -it), you can import it from module ``GHC.Exts``. +it), you can import it from module ``Data.String``. Haskell's defaulting mechanism (`Haskell Report, Section 4.3.4 `__) is @@ -7062,7 +7065,7 @@ A small example: module Main where - import GHC.Exts( IsString(..) ) + import Data.String( IsString(..) ) newtype MyString = MyString String deriving (Eq, Show) instance IsString MyString where @@ -9619,7 +9622,7 @@ The following things have kind ``Constraint``: - Anything whose form is not yet known, but the user has declared to have kind ``Constraint`` (for which they need to import it from - ``GHC.Exts``). So for example + ``Data.Kind``). So for example ``type Foo (f :: Type -> Constraint) = forall b. f b => b -> b`` is allowed, as well as examples involving type families: :: @@ -10205,8 +10208,7 @@ Lexically scoped type variables To trigger those forms of ``ScopedTypeVariables``, the ``forall`` must appear against the top-level signature (or outer expression) but *not* against nested signatures referring to the same type variables. - Explicit ``forall`` is not always required -- see :ref:`pattern signature equivalent pattern-equiv-form` for the example in this section, or :ref:`pattern-type-sigs` . - + Explicit ``forall`` is not always required -- see :ref:`pattern signature equivalent ` for the example in this section, or :ref:`pattern-type-sigs`. GHC supports *lexically scoped type variables*, without which some type signatures are simply impossible to write. For example: :: @@ -14810,19 +14812,6 @@ to be called at type ``T``: However, sometimes there are no such calls, in which case the pragma can be useful. -Obsolete ``SPECIALIZE`` syntax -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In earlier versions of GHC, it was possible to provide your own -specialised function for a given type: - -:: - - {-# SPECIALIZE hammeredLookup :: [(Int, value)] -> Int -> value = intLookup #-} - -This feature has been removed, as it is now subsumed by the ``RULES`` -pragma (see :ref:`rule-spec`). - .. _specialize-instance-pragma: ``SPECIALIZE`` instance pragma From git at git.haskell.org Fri Sep 7 13:34:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:34:52 +0000 (UTC) Subject: [commit: ghc] master: ghc: Remove warning of StaticPointers not being supported by GHCi (9400a5c) Message-ID: <20180907133452.47B923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9400a5c6b308fbb5b3a73690610736ca3b5eb0b3/ghc >--------------------------------------------------------------- commit 9400a5c6b308fbb5b3a73690610736ca3b5eb0b3 Author: Ben Gamari Date: Thu Sep 6 18:51:31 2018 -0400 ghc: Remove warning of StaticPointers not being supported by GHCi Support for StaticPointers was added in #12356 but I apparently neglected to remove the warning. >--------------------------------------------------------------- 9400a5c6b308fbb5b3a73690610736ca3b5eb0b3 compiler/main/GHC.hs | 13 +++---------- testsuite/tests/ghci/scripts/StaticPtr.stderr | 3 --- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 29921de..4059860 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -332,7 +332,7 @@ import Annotations import Module import Panic import Platform -import Bag ( listToBag, unitBag ) +import Bag ( unitBag ) import ErrUtils import MonadUtils import Util @@ -344,7 +344,6 @@ import FastString import qualified Parser import Lexer import ApiAnnotation -import qualified GHC.LanguageExtensions as LangExt import NameEnv import CoreFVs ( orphNamesOfFamInst ) import FamInstEnv ( famInstEnvElts ) @@ -677,14 +676,8 @@ checkNewDynFlags dflags = do checkNewInteractiveDynFlags :: MonadIO m => DynFlags -> m DynFlags checkNewInteractiveDynFlags dflags0 = do - dflags1 <- - if xopt LangExt.StaticPointers dflags0 - then do liftIO $ printOrThrowWarnings dflags0 $ listToBag - [mkPlainWarnMsg dflags0 interactiveSrcSpan - $ text "StaticPointers is not supported in GHCi interactive expressions."] - return $ xopt_unset dflags0 LangExt.StaticPointers - else return dflags0 - return dflags1 + -- Nothing to be done here + return dflags0 -- %************************************************************************ diff --git a/testsuite/tests/ghci/scripts/StaticPtr.stderr b/testsuite/tests/ghci/scripts/StaticPtr.stderr deleted file mode 100644 index b45f64e..0000000 --- a/testsuite/tests/ghci/scripts/StaticPtr.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -: warning: - StaticPointers is not supported in GHCi interactive expressions. From git at git.haskell.org Fri Sep 7 13:35:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:35:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Do a final pass over the changelogs (e8f79c9) Message-ID: <20180907133552.92A1D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/e8f79c952edaf5fcf3e944e45ec00a27a818ffa8/ghc >--------------------------------------------------------------- commit e8f79c952edaf5fcf3e944e45ec00a27a818ffa8 Author: Ben Gamari Date: Tue Aug 28 09:42:39 2018 -0400 Do a final pass over the changelogs >--------------------------------------------------------------- e8f79c952edaf5fcf3e944e45ec00a27a818ffa8 libraries/base/changelog.md | 12 ++++++------ libraries/ghc-boot-th/changelog.md | 5 ----- libraries/ghc-boot-th/ghc-boot-th.cabal.in | 1 - libraries/ghc-boot/changelog.md | 24 ++++++++++++++++++++++++ libraries/ghc-prim/changelog.md | 4 ++-- libraries/template-haskell/changelog.md | 2 +- 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 43bdf02..41c877b 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -1,7 +1,7 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) -## 4.12.0.0 *TBA* - * Bundled with GHC *TBA* +## 4.12.0.0 *August 2018* + * Bundled with GHC 8.6.1 * The STM invariant-checking mechanism (`always` and `alwaysSucceeds`), which was deprecated in GHC 8.4, has been removed (as proposed in @@ -28,8 +28,8 @@ * `asinh` for `Float` and `Double` is now numerically stable in the face of non-small negative arguments and enormous arguments of either sign. (#14927) - * `Numeric.showEFloat (Just 0)` now respects the user's requested precision. - (#15115) + * `Numeric.showEFloat (Just 0)` and `Numeric.showGFloat (Just 0)` + now respect the user's requested precision. (#15115) * `Data.Monoid.Alt` now has `Foldable` and `Traversable` instances. (#15099) @@ -42,13 +42,13 @@ `Read1`, `Show1`, `Generic`, `Generic1`. (#15098) -## 4.11.1.0 *TBA* +## 4.11.1.0 *April 2018* * Bundled with GHC 8.4.2 * Add the `readFieldHash` function to `GHC.Read` which behaves like `readField`, but for a field that ends with a `#` symbol (#14918). -## 4.11.0.0 *TBA* +## 4.11.0.0 *March 2018* * Bundled with GHC 8.4.1 * `System.IO.openTempFile` is now thread-safe on Windows. diff --git a/libraries/ghc-boot-th/changelog.md b/libraries/ghc-boot-th/changelog.md deleted file mode 100644 index 3ed5bbb..0000000 --- a/libraries/ghc-boot-th/changelog.md +++ /dev/null @@ -1,5 +0,0 @@ -## 8.0.1 *May 2016* - - * Bundled with GHC 8.0.1 - - * Initial version diff --git a/libraries/ghc-boot-th/ghc-boot-th.cabal.in b/libraries/ghc-boot-th/ghc-boot-th.cabal.in index 2e45e8e..7292096 100644 --- a/libraries/ghc-boot-th/ghc-boot-th.cabal.in +++ b/libraries/ghc-boot-th/ghc-boot-th.cabal.in @@ -19,7 +19,6 @@ description: This library contains various bits shared between the @ghc@ and be depended upon by user code. cabal-version: >=1.10 build-type: Simple -extra-source-files: changelog.md source-repository head type: git diff --git a/libraries/ghc-boot/changelog.md b/libraries/ghc-boot/changelog.md index 3ed5bbb..a294d80 100644 --- a/libraries/ghc-boot/changelog.md +++ b/libraries/ghc-boot/changelog.md @@ -1,3 +1,27 @@ +## 8.6.1 *August 2018* + + * Bundled with GHC 8.6.1 + +## 8.4.2 *April 2018* + + * Bundled with GHC 8.4.2 + +## 8.4.1 *March 2018* + + * Bundled with GHC 8.4.1 + +## 8.2.2 *November 2018* + + * Bundled with GHC 8.2.2 + +## 8.2.1 *July 2017* + + * Bundled with GHC 8.2.1 + +## 8.0.2 *January 2017* + + * Bundled with GHC 8.0.2 + ## 8.0.1 *May 2016* * Bundled with GHC 8.0.1 diff --git a/libraries/ghc-prim/changelog.md b/libraries/ghc-prim/changelog.md index 53e77a0..60bc351 100644 --- a/libraries/ghc-prim/changelog.md +++ b/libraries/ghc-prim/changelog.md @@ -1,4 +1,4 @@ -## 0.5.3 (edit as necessary) +## 0.5.3 *August 2018* - Shipped with GHC 8.6.1 @@ -9,7 +9,7 @@ Previously it returned empty pointer and non-pointer arrays for thunks. -## 0.5.2.0 +## 0.5.2.0 *March 2018* - Shipped with GHC 8.4.1 diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md index f60bb6e..c03da31 100644 --- a/libraries/template-haskell/changelog.md +++ b/libraries/template-haskell/changelog.md @@ -1,6 +1,6 @@ # Changelog for [`template-haskell` package](http://hackage.haskell.org/package/template-haskell) -## 2.14.0.0 *TBA* +## 2.14.0.0 *August 2018* * Introduce an `addForeignFilePath` function, as well as a corresponding `qAddForeignFile` class method to `Quasi`. Unlike `addForeingFile`, which From git at git.haskell.org Fri Sep 7 13:35:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:35:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump Cabal submodule to 2.4.0.0 (3b998a9) Message-ID: <20180907133555.5E23E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/3b998a9321e37f9484c0b6e02b1fbf609ff2ab94/ghc >--------------------------------------------------------------- commit 3b998a9321e37f9484c0b6e02b1fbf609ff2ab94 Author: Ben Gamari Date: Fri Sep 7 07:14:43 2018 -0400 Bump Cabal submodule to 2.4.0.0 >--------------------------------------------------------------- 3b998a9321e37f9484c0b6e02b1fbf609ff2ab94 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index fe10982..b00d215 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit fe10982db1f2fa7d828fc5f8ddaa5beedceaddec +Subproject commit b00d2150b3f2d216aa7458606c9c018f9beb75a2 From git at git.haskell.org Fri Sep 7 13:35:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:35:58 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fixed typo in exponent example (95b7b0a) Message-ID: <20180907133558.29A0C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/95b7b0a05368359746360bf4f33de52b43a97b37/ghc >--------------------------------------------------------------- commit 95b7b0a05368359746360bf4f33de52b43a97b37 Author: chris-bacon Date: Mon Aug 27 13:45:47 2018 +0100 Fixed typo in exponent example (cherry picked from commit 36c1431d9d2d06049190cc0888dbfaee8e2179d6) >--------------------------------------------------------------- 95b7b0a05368359746360bf4f33de52b43a97b37 libraries/base/GHC/Natural.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Natural.hs b/libraries/base/GHC/Natural.hs index a35688d..819ce5e 100644 --- a/libraries/base/GHC/Natural.hs +++ b/libraries/base/GHC/Natural.hs @@ -124,7 +124,7 @@ divZeroError = raise# divZeroException -- | Type representing arbitrary-precision non-negative integers. -- --- >>> 2^20 :: Natural +-- >>> 2^100 :: Natural -- 1267650600228229401496703205376 -- -- Operations whose result would be negative @'throw' ('Underflow' :: 'ArithException')@, From git at git.haskell.org Fri Sep 7 13:36:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:36:00 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Skip eventlog tests in GHCi way (aeb2470) Message-ID: <20180907133600.EB20A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/aeb247079f55b9279ae721baf5d93e01a5257351/ghc >--------------------------------------------------------------- commit aeb247079f55b9279ae721baf5d93e01a5257351 Author: Ömer Sinan Ağacan Date: Wed Sep 5 13:11:30 2018 +0200 Skip eventlog tests in GHCi way Summary: (GHCi doesn't generate event logs) Test Plan: These tests were failing in GHCi way, they're now skipped in GHCi way as GHCi doesn't generate eventlogs Reviewers: bgamari, simonmar, maoe, alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15587 Differential Revision: https://phabricator.haskell.org/D5119 (cherry picked from commit c0e5087d01e2912f00feede6c259a2ee87685c90) >--------------------------------------------------------------- aeb247079f55b9279ae721baf5d93e01a5257351 testsuite/tests/rts/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index dd4d9a1..a180491 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -135,7 +135,7 @@ test('T2615', # omit dyn and profiling ways, because we don't build dyn_l or p_l # variants of the RTS by default -test('traceEvent', [ omit_ways(['dyn'] + prof_ways), +test('traceEvent', [ omit_ways(['dyn', 'ghci'] + prof_ways), extra_run_opts('+RTS -ls -RTS') ], compile_and_run, ['-eventlog']) From git at git.haskell.org Fri Sep 7 13:36:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:36:03 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix a constant folding rule (f659577) Message-ID: <20180907133603.B90C43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/f659577377c02616c8cf9078c2e89cd51c3e8bdd/ghc >--------------------------------------------------------------- commit f659577377c02616c8cf9078c2e89cd51c3e8bdd Author: Andrey Mokhov Date: Wed Aug 29 15:16:51 2018 +0200 Fix a constant folding rule Summary: One of the constant folding rules introduced in D2858 is: ``` (L y :-: v) :-: (L x :-: w) -> return $ mkL (y-x) `add` (w `add` v) ``` Or, after removing syntactic noise: `(y - v) - (x - w) ==> (y - x) + (w + v)`. This is incorrect, since the sign of `v` is changed from negative to positive. As a consequence, the following program prints `3` when compiled with `-O`: ``` -- This is just subtraction in disguise minus :: Int -> Int -> Int minus x y = (8 - y) - (8 - x) {-# NOINLINE minus #-} main :: IO () main = print (2 `minus` 1) ``` The correct rule is: `(y - v) - (x - w) ==> (y - x) + (w - v)`. This commit does the fix. I haven't found any other issues with the constant folding code, but it's difficult to be certain without some automated checking. Reviewers: bgamari, tdammers Subscribers: hsyl20, tdammers, rwbarton, carter GHC Trac Issues: #15569 Differential Revision: https://phabricator.haskell.org/D5109 (cherry picked from commit 65eec9cfd4410c0e30b0ed06116c15f8ce3de49d) >--------------------------------------------------------------- f659577377c02616c8cf9078c2e89cd51c3e8bdd compiler/prelude/PrelRules.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 78d7535..ecf372e 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -1783,7 +1783,7 @@ numFoldingRules op dict = do (v :-: L y) :-: (w :-: L x) -> return $ mkL (x-y) `add` (v `sub` w) (v :-: L y) :-: (L x :-: w) -> return $ mkL (0-x-y) `add` (v `add` w) (L y :-: v) :-: (w :-: L x) -> return $ mkL (x+y) `sub` (v `add` w) - (L y :-: v) :-: (L x :-: w) -> return $ mkL (y-x) `add` (w `add` v) + (L y :-: v) :-: (L x :-: w) -> return $ mkL (y-x) `add` (w `sub` v) (x :++: w) :-: (y :++: v) -> return $ mkL (x-y) `add` (w `sub` v) (w :-: L x) :-: (y :++: v) -> return $ mkL (0-y-x) `add` (w `sub` v) (L x :-: w) :-: (y :++: v) -> return $ mkL (x-y) `sub` (v `add` w) From git at git.haskell.org Fri Sep 7 13:36:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:36:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix typo in 8.6.1 notes (2154566) Message-ID: <20180907133606.850513A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/21545666256104f6b6b8b3cfd2eda48d99ece07c/ghc >--------------------------------------------------------------- commit 21545666256104f6b6b8b3cfd2eda48d99ece07c Author: Krzysztof Gogolewski Date: Tue Aug 28 22:31:22 2018 +0200 Fix typo in 8.6.1 notes (cherry picked from commit 34b8e613606653187f1ffae36a83e33f0c673720) >--------------------------------------------------------------- 21545666256104f6b6b8b3cfd2eda48d99ece07c docs/users_guide/8.6.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst index fccc0d1..13fd354 100644 --- a/docs/users_guide/8.6.1-notes.rst +++ b/docs/users_guide/8.6.1-notes.rst @@ -35,7 +35,7 @@ Language the common ``MonadTrans`` typeclass could now make the expectation that an applied transformer is must be a ``Monad`` :: - class (forall a. Monad m => Monad (t m)) => MonadTrans t where {- ... -} + class (forall m. Monad m => Monad (t m)) => MonadTrans t where {- ... -} Additionally, quantification can enable terminating instance resolution where this previously was not possible. See :ref:`quantified-constraints` for From git at git.haskell.org Fri Sep 7 13:36:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:36:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: rts: Handle SMALL_MUT_ARR_PTRS in retainer profilter (76a2331) Message-ID: <20180907133609.51DAC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/76a233143f1ec940f342ce3ce3afaf306923b392/ghc >--------------------------------------------------------------- commit 76a233143f1ec940f342ce3ce3afaf306923b392 Author: Ben Gamari Date: Tue Aug 28 00:59:17 2018 +0200 rts: Handle SMALL_MUT_ARR_PTRS in retainer profilter Summary: These can be treated similarly to MUT_ARRY_PTRS. Fixes #15529. Reviewers: erikd, simonmar Reviewed By: simonmar Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #15529 Differential Revision: https://phabricator.haskell.org/D5075 (cherry picked from commit 2cf98e2207421200fc73c25a08f6435859cdff92) >--------------------------------------------------------------- 76a233143f1ec940f342ce3ce3afaf306923b392 rts/RetainerProfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index 6a0af21..d260f19 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -811,6 +811,10 @@ pop( StgClosure **c, StgClosure **cp, retainer *r ) case MUT_ARR_PTRS_DIRTY: case MUT_ARR_PTRS_FROZEN_CLEAN: case MUT_ARR_PTRS_FROZEN_DIRTY: + case SMALL_MUT_ARR_PTRS_CLEAN: + case SMALL_MUT_ARR_PTRS_DIRTY: + case SMALL_MUT_ARR_PTRS_FROZEN_CLEAN: + case SMALL_MUT_ARR_PTRS_FROZEN_DIRTY: *c = find_ptrs(&se->info); if (*c == NULL) { popOff(); From git at git.haskell.org Fri Sep 7 13:36:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 13:36:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix a race between GC threads in concurrent scavenging (d46dd45) Message-ID: <20180907133612.21F733A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/d46dd4528753f5b1e13540691f936cf45c127621/ghc >--------------------------------------------------------------- commit d46dd4528753f5b1e13540691f936cf45c127621 Author: Ömer Sinan Ağacan Date: Thu Sep 6 15:52:53 2018 +0300 Fix a race between GC threads in concurrent scavenging While debugging #15285 I realized that free block lists (free_list in BlockAlloc.c) get corrupted when multiple scavenge threads allocate and release blocks concurrently. Here's a picture of one such race: Thread 2 (Thread 32573.32601): #0 check_tail (bd=0x940d40 ) at rts/sm/BlockAlloc.c:860 #1 0x0000000000928ef7 in checkFreeListSanity () at rts/sm/BlockAlloc.c:896 #2 0x0000000000928979 in freeGroup (p=0x7e998ce02880) at rts/sm/BlockAlloc.c:721 #3 0x0000000000928a17 in freeChain (bd=0x7e998ce02880) at rts/sm/BlockAlloc.c:738 #4 0x0000000000926911 in freeChain_sync (bd=0x7e998ce02880) at rts/sm/GCUtils.c:80 #5 0x0000000000934720 in scavenge_capability_mut_lists (cap=0x1acae80) at rts/sm/Scav.c:1665 #6 0x000000000092b411 in gcWorkerThread (cap=0x1acae80) at rts/sm/GC.c:1157 #7 0x000000000090be9a in yieldCapability (pCap=0x7f9994e69e20, task=0x7e9984000b70, gcAllowed=true) at rts/Capability.c:861 #8 0x0000000000906120 in scheduleYield (pcap=0x7f9994e69e50, task=0x7e9984000b70) at rts/Schedule.c:673 #9 0x0000000000905500 in schedule (initialCapability=0x1acae80, task=0x7e9984000b70) at rts/Schedule.c:293 #10 0x0000000000908d4f in scheduleWorker (cap=0x1acae80, task=0x7e9984000b70) at rts/Schedule.c:2554 #11 0x000000000091a30a in workerStart (task=0x7e9984000b70) at rts/Task.c:444 #12 0x00007f99937fa6db in start_thread (arg=0x7f9994e6a700) at pthread_create.c:463 #13 0x000061654d59f88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 1 (Thread 32573.32573): #0 checkFreeListSanity () at rts/sm/BlockAlloc.c:887 #1 0x0000000000928979 in freeGroup (p=0x7e998d303540) at rts/sm/BlockAlloc.c:721 #2 0x0000000000926f23 in todo_block_full (size=513, ws=0x1aa8ce0) at rts/sm/GCUtils.c:264 #3 0x00000000009583b9 in alloc_for_copy (size=513, gen_no=0) at rts/sm/Evac.c:80 #4 0x000000000095850d in copy_tag_nolock (p=0x7e998c675f28, info=0x421d98 , src=0x7e998d075d80, size=513, gen_no=0, tag=1) at rts/sm/Evac.c:153 #5 0x0000000000959177 in evacuate (p=0x7e998c675f28) at rts/sm/Evac.c:715 #6 0x0000000000932388 in scavenge_small_bitmap (p=0x7e998c675f28, size=1, bitmap=0) at rts/sm/Scav.c:271 #7 0x0000000000934aaf in scavenge_stack (p=0x7e998c675f28, stack_end=0x7e998c676000) at rts/sm/Scav.c:1908 #8 0x0000000000934295 in scavenge_one (p=0x7e998c66e000) at rts/sm/Scav.c:1466 #9 0x0000000000934662 in scavenge_mutable_list (bd=0x7e998d300440, gen=0x1b1d880) at rts/sm/Scav.c:1643 #10 0x0000000000934700 in scavenge_capability_mut_lists (cap=0x1aaa340) at rts/sm/Scav.c:1664 #11 0x00000000009299b6 in GarbageCollect (collect_gen=0, do_heap_census=false, gc_type=2, cap=0x1aaa340, idle_cap=0x1b38aa0) at rts/sm/GC.c:378 #12 0x0000000000907a4a in scheduleDoGC (pcap=0x7ffdec5b5310, task=0x1b36650, force_major=false) at rts/Schedule.c:1798 #13 0x0000000000905de7 in schedule (initialCapability=0x1aaa340, task=0x1b36650) at rts/Schedule.c:546 #14 0x0000000000908bc4 in scheduleWaitThread (tso=0x7e998c0067c8, ret=0x0, pcap=0x7ffdec5b5430) at rts/Schedule.c:2537 #15 0x000000000091b5a0 in rts_evalLazyIO (cap=0x7ffdec5b5430, p=0x9c11f0, ret=0x0) at rts/RtsAPI.c:530 #16 0x000000000091ca56 in hs_main (argc=1, argv=0x7ffdec5b5628, main_closure=0x9c11f0, rts_config=...) at rts/RtsMain.c:72 #17 0x0000000000421ea0 in main () In particular, dbl_link_onto() which is used to add a freed block to a doubly-linked free list is not thread safe and corrupts the list when called concurrently. Note that thread 1 is to blame here as thread 2 is properly taking the spinlock. With this patch we now take the spinlock when freeing a todo block in GC, avoiding this race. Test Plan: - Tried slow validate locally: this patch does not introduce new failures. - circleci: https://circleci.com/gh/ghc/ghc-diffs/283 The test got killed because it took 5 hours but T7919 (which was previously failing on circleci) passed. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15285 Differential Revision: https://phabricator.haskell.org/D5115 (cherry picked from commit c6fbac6a6a69a2f4be89701b2c386ae53214f9a3) >--------------------------------------------------------------- d46dd4528753f5b1e13540691f936cf45c127621 rts/sm/GCUtils.c | 10 +++++++++- rts/sm/GCUtils.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rts/sm/GCUtils.c b/rts/sm/GCUtils.c index 24f7b5e..31b2913 100644 --- a/rts/sm/GCUtils.c +++ b/rts/sm/GCUtils.c @@ -81,6 +81,14 @@ freeChain_sync(bdescr *bd) RELEASE_SPIN_LOCK(&gc_alloc_block_sync); } +void +freeGroup_sync(bdescr *bd) +{ + ACQUIRE_SPIN_LOCK(&gc_alloc_block_sync); + freeGroup(bd); + RELEASE_SPIN_LOCK(&gc_alloc_block_sync); +} + /* ----------------------------------------------------------------------------- Workspace utilities -------------------------------------------------------------------------- */ @@ -261,7 +269,7 @@ todo_block_full (uint32_t size, gen_workspace *ws) // object. However, if the object we're copying is // larger than a block, then we might have an empty // block here. - freeGroup(bd); + freeGroup_sync(bd); } else { push_scanned_block(bd, ws); } diff --git a/rts/sm/GCUtils.h b/rts/sm/GCUtils.h index 3c17449..8b60407 100644 --- a/rts/sm/GCUtils.h +++ b/rts/sm/GCUtils.h @@ -31,6 +31,7 @@ INLINE_HEADER bdescr *allocBlockOnNode_sync(uint32_t node) } void freeChain_sync(bdescr *bd); +void freeGroup_sync(bdescr *bd); void push_scanned_block (bdescr *bd, gen_workspace *ws); StgPtr todo_block_full (uint32_t size, gen_workspace *ws); From git at git.haskell.org Fri Sep 7 14:10:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 14:10:15 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Disable syntax highlighting (2b6694a) Message-ID: <20180907141015.21B413A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2b6694a5368297c1c0c254eee3721f329ec69fc6/ghc >--------------------------------------------------------------- commit 2b6694a5368297c1c0c254eee3721f329ec69fc6 Author: Takenobu Tani Date: Fri Sep 7 16:02:39 2018 +0200 users-guide: Disable syntax highlighting Summary: I disabled syntax highlighting for NumericUnderscores extension. Because pygments does not yet correspond to syntax rule for NumericUnderscores. (Sphinx uses pygments as the syntax highlighting.) I've sent a pull-request to pygments project[1]. But development of pygments has been suspended since 2017 March. [1]: https://bitbucket.org/birkenfeld/pygments-main/pull-requests/ 745/fix-haskell-lexer-for-numeric-literals/diff [ci skip] Test Plan: build Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5120 >--------------------------------------------------------------- 2b6694a5368297c1c0c254eee3721f329ec69fc6 docs/users_guide/glasgow_exts.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index ead020c..a1a5b1f 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -585,7 +585,9 @@ That is, underscores in numeric literals are ignored when :extension:`NumericUnderscores` is enabled. See also :ghc-ticket:`14473`. -For example: :: +For example: + +.. code-block:: none -- decimal million = 1_000_000 @@ -617,7 +619,9 @@ For example: :: test8bit x = (0b01_0000_0000 .&. x) /= 0 -About validity: :: +About validity: + +.. code-block:: none x0 = 1_000_000 -- valid x1 = 1__000000 -- valid From git at git.haskell.org Fri Sep 7 18:54:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 18:54:20 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Honor INLINE on 0-arity bindings (#15578) (5a56aea) Message-ID: <20180907185420.CD7AA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/5a56aea17dda9dea706739733472906f5fb6fb2b/ghc >--------------------------------------------------------------- commit 5a56aea17dda9dea706739733472906f5fb6fb2b Author: Tobias Dammers Date: Fri Sep 7 13:14:50 2018 +0200 Honor INLINE on 0-arity bindings (#15578) Summary: Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. Add Notes for #15578 Test Plan: ./validate Reviewers: simonpj, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15578 Differential Revision: https://phabricator.haskell.org/D5137 >--------------------------------------------------------------- 5a56aea17dda9dea706739733472906f5fb6fb2b compiler/coreSyn/CoreUnfold.hs | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index fe2ae62..7d734af 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,6 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } + -- See Note [Honour INLINE on 0-ary bindings] as to why we need to look at + -- the arity here. boring_ok | arity == 0 = True | otherwise = inlineBoringOk expr' @@ -237,6 +239,72 @@ specUnfolding to specialise its unfolding. Some important points: we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs (which arises from INLINABLE), we discard it + +Note [Honour INLINE on 0-ary bindings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + x = + {-# INLINE x #-} + + f y = ...x... + +The semantics of an INLINE pragma is + + inline x at every call site, provided it is saturated; + that is, applied to at least as many arguments as appear + on the LHS of the Haskell source definition. + +(This soure-code-derived arity is stored in the `ug_arity` field of +the `UnfoldingGuidance`.) + +In the example, x's ug_arity is 0, so we should inline it at every use +site. It's rare to have such an INLINE pragma (usually INLINE Is on +functions), but it's occasionally very important (Trac #15578, #15519). +In #15519 we had something like + x = case (g a b) of I# r -> T r + {-# INLINE x #-} + f y = ...(h x).... + +where h is strict. So we got + f y = ...(case g a b of I# r -> h (T r))... + +and that in turn allowed SpecConstr to ramp up performance. + +How do we deliver on this? By adjusting the ug_boring_ok +flag in mkInlineUnfoldingWithArity; see +Note [INLINE pragmas and boring contexts] + +NB: there is a real risk that full laziness will float it right back +out again. Consider again + x = factorial 200 + {-# INLINE x #-} + f y = ...x... + +After inlining we get + f y = ...(factorial 200)... + +but it's entirely possible that full laziness will do + lvl23 = factorial 200 + f y = ...lvl23... + +That's a problem for another day. + +Note [INLINE pragmas and boring contexts] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +An INLNE pragma uses mkInlineUnfoldingWithArity to build the +unfolding. That sets the ug_boring_ok flag to False if the function +is not tiny (inlineBorkingOK), so that even INLINE functions are not +inlined in an utterly boring context. E.g. + \x y. Just (f y x) +Nothing is gained by inlining f here, even if it has an INLINE +pragma. + +But for 0-ary bindings, we want to inline regardless; see +Note [Honour INLINE on 0-ary bindings]. + +I'm a bit worried that it's possible for the same kind of problem +to arise for non-0-ary functions too, but let's wait and see. -} mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr @@ -1450,6 +1518,8 @@ This kind of thing can occur if you have foo = let x = e in (x,x) which Roman did. + + -} computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt From git at git.haskell.org Fri Sep 7 18:54:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 18:54:23 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add regression test for #15578 (c29b91b) Message-ID: <20180907185423.F08F33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/c29b91b2e1ed0238747a22c6c7385fd6036d3d16/ghc >--------------------------------------------------------------- commit c29b91b2e1ed0238747a22c6c7385fd6036d3d16 Author: Tobias Dammers Date: Fri Sep 7 20:53:15 2018 +0200 Add regression test for #15578 >--------------------------------------------------------------- c29b91b2e1ed0238747a22c6c7385fd6036d3d16 testsuite/tests/perf/should_run/T15578.hs | 80 +++++++++++++++++++++++++++++++ testsuite/tests/perf/should_run/all.T | 9 ++++ 2 files changed, 89 insertions(+) diff --git a/testsuite/tests/perf/should_run/T15578.hs b/testsuite/tests/perf/should_run/T15578.hs new file mode 100644 index 0000000..be056e2 --- /dev/null +++ b/testsuite/tests/perf/should_run/T15578.hs @@ -0,0 +1,80 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE Strict #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE DeriveGeneric #-} + +module Main where + +import qualified Data.Set as Set +import qualified Data.Text as Text + +import Data.Set (Set) +import Data.Text (Text) +import System.IO (BufferMode (NoBuffering), hSetBuffering, stdout) +import GHC.Generics (Generic) +import Control.DeepSeq (force, NFData) +import Control.Exception (evaluate) + + +-------------------------------- +-- === Running benchmarks === -- +-------------------------------- + +iters :: Int +iters = 100000000 + +src1 :: Text +src1 = Text.replicate iters "tttt" + +data Grammar a + = Tokens !(Set a) !(a -> Bool) + | Many !(Grammar a) + | X !(Grammar a) + +instance Ord a => Semigroup (Grammar a) where + Tokens s f <> Tokens s' g = Tokens (s <> s') $ \c -> f c || g c + {-# INLINE (<>) #-} + +token :: Eq a => a -> Grammar a +token = \a -> Tokens (Set.singleton a) (a ==) +{-# INLINE token #-} + +many :: Grammar a -> Grammar a +many = Many +{-# INLINE many #-} + +data Result + = Success Text Text + | Fail + deriving (Show, Generic) + +instance NFData Result + +runTokenParser :: Grammar Char -> Text -> Result +runTokenParser = \grammar stream -> case grammar of + Tokens _ tst -> let + head = Text.head stream + in if tst head + then Success (Text.tail stream) (Text.singleton head) + else Fail + Many (Tokens _ tst) -> let + (!consumed, !rest) = Text.span tst stream + in Success rest consumed + X !grammar -> runTokenParser grammar stream + +testGrammar1 :: Grammar Char +testGrammar1 = let + s1 = token 't' + in many s1 +{-# INLINE testGrammar1 #-} + +test3 :: Text -> Result +test3 src = + runTokenParser testGrammar1 src +{-# NOINLINE test3 #-} + +main :: IO () +main = do + srcx <- evaluate $ force src1 + evaluate $ force $ test3 srcx + pure () diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 6a7bcf0..1a85e70 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -604,3 +604,12 @@ test('T15426', only_ways(['normal'])], compile_and_run, ['-O2']) + +test('T15578', + [stats_num_field('bytes allocated', + [ (wordsize(64), 800041456, 5) ]), + # 2018-09-07 800041456 Improvements from #15578 + # initial 42400041456 + only_ways(['normal'])], + compile_and_run, + ['-O2']) From git at git.haskell.org Fri Sep 7 22:20:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 22:20:32 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add Notes for #15578 (88aecf9) Message-ID: <20180907222032.5D1103A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/88aecf9b55c46073f8dda7f18e19883240ea1a8d/ghc >--------------------------------------------------------------- commit 88aecf9b55c46073f8dda7f18e19883240ea1a8d Author: Tobias Dammers Date: Fri Sep 7 13:14:50 2018 +0200 Add Notes for #15578 >--------------------------------------------------------------- 88aecf9b55c46073f8dda7f18e19883240ea1a8d compiler/coreSyn/CoreUnfold.hs | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index fe2ae62..adb399e 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -159,6 +159,8 @@ mkInlineUnfoldingWithArity arity expr guide = UnfWhen { ug_arity = arity , ug_unsat_ok = needSaturated , ug_boring_ok = boring_ok } + -- See Note [INLINE pragmas and boring contexts] as to why we need to look + -- at the arity here. boring_ok | arity == 0 = True | otherwise = inlineBoringOk expr' @@ -237,6 +239,72 @@ specUnfolding to specialise its unfolding. Some important points: we keep it (so the specialised thing too will always inline) if a stable unfolding has UnfoldingGuidance of UnfIfGoodArgs (which arises from INLINABLE), we discard it + +Note [Honour INLINE on 0-ary bindings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + x = + {-# INLINE x #-} + + f y = ...x... + +The semantics of an INLINE pragma is + + inline x at every call site, provided it is saturated; + that is, applied to at least as many arguments as appear + on the LHS of the Haskell source definition. + +(This soure-code-derived arity is stored in the `ug_arity` field of +the `UnfoldingGuidance`.) + +In the example, x's ug_arity is 0, so we should inline it at every use +site. It's rare to have such an INLINE pragma (usually INLINE Is on +functions), but it's occasionally very important (Trac #15578, #15519). +In #15519 we had something like + x = case (g a b) of I# r -> T r + {-# INLINE x #-} + f y = ...(h x).... + +where h is strict. So we got + f y = ...(case g a b of I# r -> h (T r))... + +and that in turn allowed SpecConstr to ramp up performance. + +How do we deliver on this? By adjusting the ug_boring_ok +flag in mkInlineUnfoldingWithArity; see +Note [INLINE pragmas and boring contexts] + +NB: there is a real risk that full laziness will float it right back +out again. Consider again + x = factorial 200 + {-# INLINE x #-} + f y = ...x... + +After inlining we get + f y = ...(factorial 200)... + +but it's entirely possible that full laziness will do + lvl23 = factorial 200 + f y = ...lvl23... + +That's a problem for another day. + +Note [INLINE pragmas and boring contexts] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +An INLINE pragma uses mkInlineUnfoldingWithArity to build the +unfolding. That sets the ug_boring_ok flag to False if the function +is not tiny (inlineBorkingOK), so that even INLINE functions are not +inlined in an utterly boring context. E.g. + \x y. Just (f y x) +Nothing is gained by inlining f here, even if it has an INLINE +pragma. + +But for 0-ary bindings, we want to inline regardless; see +Note [Honour INLINE on 0-ary bindings]. + +I'm a bit worried that it's possible for the same kind of problem +to arise for non-0-ary functions too, but let's wait and see. -} mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr @@ -1450,6 +1518,8 @@ This kind of thing can occur if you have foo = let x = e in (x,x) which Roman did. + + -} computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt From git at git.haskell.org Fri Sep 7 22:20:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 22:20:35 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Add regression test for #15578 (6855d92) Message-ID: <20180907222035.825823A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/6855d926f7ebeaed9fdf16333c9ca5402c490cca/ghc >--------------------------------------------------------------- commit 6855d926f7ebeaed9fdf16333c9ca5402c490cca Author: Tobias Dammers Date: Fri Sep 7 20:53:15 2018 +0200 Add regression test for #15578 >--------------------------------------------------------------- 6855d926f7ebeaed9fdf16333c9ca5402c490cca testsuite/tests/perf/should_run/T15578.hs | 80 +++++++++++++++++++++++++++++++ testsuite/tests/perf/should_run/all.T | 9 ++++ 2 files changed, 89 insertions(+) diff --git a/testsuite/tests/perf/should_run/T15578.hs b/testsuite/tests/perf/should_run/T15578.hs new file mode 100644 index 0000000..be056e2 --- /dev/null +++ b/testsuite/tests/perf/should_run/T15578.hs @@ -0,0 +1,80 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE Strict #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE DeriveGeneric #-} + +module Main where + +import qualified Data.Set as Set +import qualified Data.Text as Text + +import Data.Set (Set) +import Data.Text (Text) +import System.IO (BufferMode (NoBuffering), hSetBuffering, stdout) +import GHC.Generics (Generic) +import Control.DeepSeq (force, NFData) +import Control.Exception (evaluate) + + +-------------------------------- +-- === Running benchmarks === -- +-------------------------------- + +iters :: Int +iters = 100000000 + +src1 :: Text +src1 = Text.replicate iters "tttt" + +data Grammar a + = Tokens !(Set a) !(a -> Bool) + | Many !(Grammar a) + | X !(Grammar a) + +instance Ord a => Semigroup (Grammar a) where + Tokens s f <> Tokens s' g = Tokens (s <> s') $ \c -> f c || g c + {-# INLINE (<>) #-} + +token :: Eq a => a -> Grammar a +token = \a -> Tokens (Set.singleton a) (a ==) +{-# INLINE token #-} + +many :: Grammar a -> Grammar a +many = Many +{-# INLINE many #-} + +data Result + = Success Text Text + | Fail + deriving (Show, Generic) + +instance NFData Result + +runTokenParser :: Grammar Char -> Text -> Result +runTokenParser = \grammar stream -> case grammar of + Tokens _ tst -> let + head = Text.head stream + in if tst head + then Success (Text.tail stream) (Text.singleton head) + else Fail + Many (Tokens _ tst) -> let + (!consumed, !rest) = Text.span tst stream + in Success rest consumed + X !grammar -> runTokenParser grammar stream + +testGrammar1 :: Grammar Char +testGrammar1 = let + s1 = token 't' + in many s1 +{-# INLINE testGrammar1 #-} + +test3 :: Text -> Result +test3 src = + runTokenParser testGrammar1 src +{-# NOINLINE test3 #-} + +main :: IO () +main = do + srcx <- evaluate $ force src1 + evaluate $ force $ test3 srcx + pure () diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 6a7bcf0..1a85e70 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -604,3 +604,12 @@ test('T15426', only_ways(['normal'])], compile_and_run, ['-O2']) + +test('T15578', + [stats_num_field('bytes allocated', + [ (wordsize(64), 800041456, 5) ]), + # 2018-09-07 800041456 Improvements from #15578 + # initial 42400041456 + only_ways(['normal'])], + compile_and_run, + ['-O2']) From git at git.haskell.org Fri Sep 7 22:20:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 7 Sep 2018 22:20:38 +0000 (UTC) Subject: [commit: ghc] wip/T15578: Fix test for #15578 (2ccd538) Message-ID: <20180907222038.555933A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15578 Link : http://ghc.haskell.org/trac/ghc/changeset/2ccd53846befca50e0d4c40b959232d93110b081/ghc >--------------------------------------------------------------- commit 2ccd53846befca50e0d4c40b959232d93110b081 Author: Tobias Dammers Date: Fri Sep 7 13:02:49 2018 +0200 Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. >--------------------------------------------------------------- 2ccd53846befca50e0d4c40b959232d93110b081 testsuite/tests/simplCore/should_compile/T7360.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index f310e8f..5332a3e 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -26,7 +26,7 @@ fun1 [InlPrag=NOINLINE] :: Foo -> () Str=, Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=True) Tmpl= \ (x [Occ=Once] :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() }}] fun1 = \ (x :: Foo) -> case x of { __DEFAULT -> GHC.Tuple.() } From git at git.haskell.org Sat Sep 8 06:56:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 8 Sep 2018 06:56:29 +0000 (UTC) Subject: [commit: ghc] master: Refactor Foreign.Marshal modules for more modern style (62cd440) Message-ID: <20180908065629.97D663A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/62cd44013eaa6f366d4130492a9d6c50b0765d54/ghc >--------------------------------------------------------------- commit 62cd44013eaa6f366d4130492a9d6c50b0765d54 Author: Ömer Sinan Ağacan Date: Sat Sep 8 09:55:45 2018 +0300 Refactor Foreign.Marshal modules for more modern style (use ScopedTypeVariables to remove dummy arguments) Reviewers: bgamari, RyanGlScott, dfeuer, hvr, monoidal Reviewed By: monoidal Subscribers: monoidal, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5124 >--------------------------------------------------------------- 62cd44013eaa6f366d4130492a9d6c50b0765d54 libraries/base/Foreign/Marshal/Array.hs | 54 ++++++++++----------------------- libraries/base/Foreign/Marshal/Pool.hs | 33 +++++++------------- 2 files changed, 27 insertions(+), 60 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 62cd44013eaa6f366d4130492a9d6c50b0765d54 From git at git.haskell.org Sat Sep 8 09:17:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 8 Sep 2018 09:17:55 +0000 (UTC) Subject: [commit: ghc] master: Avoid creating unevaluated Int thunks when iterating in GHC.Foreign (510c5f4) Message-ID: <20180908091755.0CF833A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/510c5f4f22aca29a9c36fd993ac79e9077b28173/ghc >--------------------------------------------------------------- commit 510c5f4f22aca29a9c36fd993ac79e9077b28173 Author: Neil Mitchell Date: Fri Sep 7 19:02:18 2018 +0100 Avoid creating unevaluated Int thunks when iterating in GHC.Foreign >--------------------------------------------------------------- 510c5f4f22aca29a9c36fd993ac79e9077b28173 libraries/base/GHC/Foreign.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/base/GHC/Foreign.hs b/libraries/base/GHC/Foreign.hs index cc985ed..196005d 100644 --- a/libraries/base/GHC/Foreign.hs +++ b/libraries/base/GHC/Foreign.hs @@ -201,7 +201,7 @@ peekEncodedCString (TextEncoding { mkTextDecoder = mk_decoder }) (p, sz_bytes) from0 <- fmap (\fp -> bufferAdd sz_bytes (emptyBuffer fp sz_bytes ReadBuffer)) $ newForeignPtr_ (castPtr p) to <- newCharBuffer chunk_size WriteBuffer - let go iteration from = do + let go !iteration from = do (why, from', to') <- encode decoder from to if isEmptyBuffer from' then @@ -230,7 +230,7 @@ withEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate = bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p - let go iteration to_sz_bytes = do + let go !iteration to_sz_bytes = do putDebugMsg ("withEncodedCString: " ++ show iteration) allocaBytes to_sz_bytes $ \to_p -> do mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes act @@ -250,7 +250,7 @@ newEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate s = bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p - let go iteration to_p to_sz_bytes = do + let go !iteration to_p to_sz_bytes = do putDebugMsg ("newEncodedCString: " ++ show iteration) mb_res <- tryFillBufferAndCall encoder null_terminate from to_p to_sz_bytes return case mb_res of @@ -272,7 +272,7 @@ tryFillBufferAndCall encoder null_terminate from0 to_p to_sz_bytes act = do to_fp <- newForeignPtr_ to_p go (0 :: Int) (from0, emptyBuffer to_fp to_sz_bytes WriteBuffer) where - go iteration (from, to) = do + go !iteration (from, to) = do (why, from', to') <- encode encoder from to putDebugMsg ("tryFillBufferAndCall: " ++ show iteration ++ " " ++ show why ++ " " ++ summaryBuffer from ++ " " ++ summaryBuffer from') if isEmptyBuffer from' From git at git.haskell.org Mon Sep 10 08:15:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 08:15:29 +0000 (UTC) Subject: [commit: ghc] master: Update UnsafeReenter test (3cc3edf) Message-ID: <20180910081529.C715E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3cc3edf30f37b11940d1f9c4afca8c5e9ccaa8f6/ghc >--------------------------------------------------------------- commit 3cc3edf30f37b11940d1f9c4afca8c5e9ccaa8f6 Author: Ömer Sinan Ağacan Date: Mon Sep 10 11:14:46 2018 +0300 Update UnsafeReenter test Only run the test in non-threaded, compiled mode. It hangs with threaded runtime (which stage 2 compiler uses, so disable it for ghci too). Reviewers: simonmar, alpmestan, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #14912 Differential Revision: https://phabricator.haskell.org/D5136 >--------------------------------------------------------------- 3cc3edf30f37b11940d1f9c4afca8c5e9ccaa8f6 testsuite/tests/ffi/should_fail/all.T | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/testsuite/tests/ffi/should_fail/all.T b/testsuite/tests/ffi/should_fail/all.T index ce72f17..3bd7b5d 100644 --- a/testsuite/tests/ffi/should_fail/all.T +++ b/testsuite/tests/ffi/should_fail/all.T @@ -15,15 +15,10 @@ test('T7506', normal, compile_fail, ['']) test('T7243', normal, compile_fail, ['']) test('T10461', normal, compile_fail, ['']) -# UnsafeReenter seems to just hang instead of erroring out -# with the threaded1, threaded2 and profthreaded ways, -# see #14912. +# UnsafeReenter tests implementation of an undefined behavior (calling Haskell +# from an unsafe foreign function) and only makes sense in non-threaded way +# (threaded runtime will hang). See #14912. test('UnsafeReenter', - [omit_ways(['ghciext', 'ghci']), - exit_code(1), - expect_broken_for(14912, ['threaded1', 'threaded2', 'profthreaded']) - ], compile_and_run, ['-v0 UnsafeReenterC.c']) -test('UnsafeReenterGhci', - [exit_code(1), extra_files(['UnsafeReenter.hs', 'UnsafeReenterC.c']), expect_broken(13730)], - run_command, - ['$MAKE -s --no-print-directory UnsafeReenterGhci']) + [omit_ways(threaded_ways), exit_code(1)], + compile_and_run, + ['UnsafeReenterC.c']) From git at git.haskell.org Mon Sep 10 10:54:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 10:54:30 +0000 (UTC) Subject: [commit: ghc] master: Build debugged prof runtimes (d36b1ff) Message-ID: <20180910105430.4E7023A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d36b1ffac9960db70043aaab43c931ce217912ba/ghc >--------------------------------------------------------------- commit d36b1ffac9960db70043aaab43c931ce217912ba Author: Ömer Sinan Ağacan Date: Mon Sep 10 13:53:59 2018 +0300 Build debugged prof runtimes For some reason these were disabled. I find these quite useful when debugging profiling issues, so enable them again. Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5140 >--------------------------------------------------------------- d36b1ffac9960db70043aaab43c931ce217912ba mk/config.mk.in | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/config.mk.in b/mk/config.mk.in index e4a79a1..7fa0f77 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -303,6 +303,7 @@ GhcRTSWays += debug GhcRTSWays += thr thr_debug thr_l GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),thr_p,) GhcRTSWays += $(if $(findstring dyn, $(GhcLibWays)),dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn,) +GhcRTSWays += $(if $(findstring p, $(GhcLibWays)),thr_debug_p debug_p,) # We can only build GHCi threaded if we have a threaded RTS: GhcThreaded = $(if $(findstring thr,$(GhcRTSWays)),YES,NO) From git at git.haskell.org Mon Sep 10 11:37:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 11:37:55 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-2' created Message-ID: <20180910113755.EF2133A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-2 Referencing: c8a1f9c42a37eb0c3514aef1a716fdbcb912da31 From git at git.haskell.org Mon Sep 10 11:37:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 11:37:58 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2: 14880, part 0: insertion order (c8a1f9c) Message-ID: <20180910113758.C88CF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2 Link : http://ghc.haskell.org/trac/ghc/changeset/c8a1f9c42a37eb0c3514aef1a716fdbcb912da31/ghc >--------------------------------------------------------------- commit c8a1f9c42a37eb0c3514aef1a716fdbcb912da31 Author: Tobias Dammers Date: Mon Sep 10 11:13:36 2018 +0200 14880, part 0: insertion order >--------------------------------------------------------------- c8a1f9c42a37eb0c3514aef1a716fdbcb912da31 compiler/utils/FV.hs | 3 ++- compiler/utils/UniqDFM.hs | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/compiler/utils/FV.hs b/compiler/utils/FV.hs index 6d0dc2b..f4b6e28 100644 --- a/compiler/utils/FV.hs +++ b/compiler/utils/FV.hs @@ -185,7 +185,8 @@ filterFV fv_cand2 fv fv_cand1 in_scope acc = mapUnionFV :: (a -> FV) -> [a] -> FV mapUnionFV _f [] _fv_cand _in_scope acc = acc mapUnionFV f (a:as) fv_cand in_scope acc = - mapUnionFV f as fv_cand in_scope $! f a fv_cand in_scope $! acc + -- NB: preserve ordering of the input list by treating a before as + f a fv_cand in_scope $! mapUnionFV f as fv_cand in_scope $! acc {-# INLINABLE mapUnionFV #-} -- | Union many free variable computations. diff --git a/compiler/utils/UniqDFM.hs b/compiler/utils/UniqDFM.hs index 38bf79d..a7a0ef8 100644 --- a/compiler/utils/UniqDFM.hs +++ b/compiler/utils/UniqDFM.hs @@ -81,7 +81,7 @@ import UniqFM (UniqFM, listToUFM_Directly, nonDetUFMToList, ufmToIntMap) -- order then `udfmToList` returns them in deterministic order. -- -- There is an implementation cost: each element is given a serial number --- as it is added, and `udfmToList` sorts it's result by this serial +-- as it is added, and `udfmToList` sorts its result by this serial -- number. So you should only use `UniqDFM` if you need the deterministic -- property. -- @@ -193,9 +193,10 @@ delFromUDFM (UDFM m i) k = UDFM (M.delete (getKey $ getUnique k) m) i plusUDFM_C :: (elt -> elt -> elt) -> UniqDFM elt -> UniqDFM elt -> UniqDFM elt plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) - -- we will use the upper bound on the tag as a proxy for the set size, - -- to insert the smaller one into the bigger one - | i > j = insertUDFMIntoLeft_C f udfml udfmr + -- We will use the upper bound on the tag as a proxy for the set size, + -- to insert the smaller one into the bigger one. + -- See Note [Order of insertion]. + | i >= j = insertUDFMIntoLeft_C f udfml udfmr | otherwise = insertUDFMIntoLeft_C f udfmr udfml -- Note [Overflow on plusUDFM] @@ -230,12 +231,20 @@ plusUDFM_C f udfml@(UDFM _ i) udfmr@(UDFM _ j) -- O(m log m) for extracting the elements from the smaller set in the -- insertion order and O(m * min(n+m, W)) to insert them into the bigger -- set. +-- +-- Note [Order of insertion] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~ +-- When two UDFMs have the same maximum tag, we choose to insert the right +-- argument into the left. This preserves left-to-right ordering when unioning +-- a bunch of one-element sets, for example - if we inserted the left argument +-- into the right one, then the two elements would be transposed. plusUDFM :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt plusUDFM udfml@(UDFM _ i) udfmr@(UDFM _ j) -- we will use the upper bound on the tag as a proxy for the set size, -- to insert the smaller one into the bigger one - | i > j = insertUDFMIntoLeft udfml udfmr + -- See Note [Order of insertion]. + | i >= j = insertUDFMIntoLeft udfml udfmr | otherwise = insertUDFMIntoLeft udfmr udfml insertUDFMIntoLeft :: UniqDFM elt -> UniqDFM elt -> UniqDFM elt From git at git.haskell.org Mon Sep 10 13:56:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 13:56:59 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-2-step1' created Message-ID: <20180910135659.DAE173A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-2-step1 Referencing: 1a69d3668bfb05153e87582abf83d727f2269129 From git at git.haskell.org Mon Sep 10 13:57:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 10 Sep 2018 13:57:02 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step1: Use an accumulator version of tyCoVarsOfType (1a69d36) Message-ID: <20180910135702.BF3333A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step1 Link : http://ghc.haskell.org/trac/ghc/changeset/1a69d3668bfb05153e87582abf83d727f2269129/ghc >--------------------------------------------------------------- commit 1a69d3668bfb05153e87582abf83d727f2269129 Author: Simon Peyton Jones Date: Fri Aug 31 14:18:55 2018 +0100 Use an accumulator version of tyCoVarsOfType In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! >--------------------------------------------------------------- 1a69d3668bfb05153e87582abf83d727f2269129 compiler/types/TyCoRep.hs | 379 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 283 insertions(+), 96 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1a69d3668bfb05153e87582abf83d727f2269129 From git at git.haskell.org Tue Sep 11 11:05:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 11:05:05 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-2-step2' created Message-ID: <20180911110505.4F4763A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-2-step2 Referencing: 2728d63f0a42251d24d5fc4f044633f981891131 From git at git.haskell.org Tue Sep 11 11:05:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 11:05:08 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2: Use an accumulator version of tyCoVarsOfType (65d38e6) Message-ID: <20180911110508.32D483A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2 Link : http://ghc.haskell.org/trac/ghc/changeset/65d38e683cbcf63e5b8445aa98d8267af7607323/ghc >--------------------------------------------------------------- commit 65d38e683cbcf63e5b8445aa98d8267af7607323 Author: Simon Peyton Jones Date: Fri Aug 31 14:18:55 2018 +0100 Use an accumulator version of tyCoVarsOfType Summary: This is part 1 from #14880: factor out a worker for the tyCoVarsOf... family of function, implementing them in terms of VarSet, but with accumulator-style (like in `FV`) built in, and with the same kind of pre-insert lookup; this has shown to perform better than either FV or plain VarSet in this particular scenario. Original notes from simonpj: In TyCoRep we now have tyCoVarsOfType implemented 1) Using FV -- this is the baseline version in GHC today 2) Using VarSets via unionVarSet 3) Using VarSets in accumulator-style In this patch (3) is enabled. When compiling perf/compiler/T5631 we get Compiler allocs (1) 1,144M (2) 1,175M (3) 1,142M The key new insight in (3) is this: ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc <---- NB! | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) Notice the second line! If the variable is already in the accumulator, don't re-add it. This makes big difference. Without it, allocation is 1,169M or so. One cause is that we only take the free vars of its kind once; that problem will go away when we do the main part of #14088 and close over kinds /afterwards/. But still, another cause is perhaps that every insert into a set overwrites the previous item, and so allocates a new path to the item; it's not a no-op even if the item is there already. Why use (3) rather than (1)? Becuase it just /has/ to be better; * FV carries around an InterestingVarFun, which does nothing useful here, but is tested at every variable * FV carries around a [Var] for the deterministic version. For this very hot operation (finding free vars) I think it makes sense to have speical purpose code. On the way I also simplified the (less used) coVarsOfType/Co family to use FV, by making serious use of the InterestingVarFun! Test Plan: validate, nofib Reviewers: simonpj, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5141 >--------------------------------------------------------------- 65d38e683cbcf63e5b8445aa98d8267af7607323 compiler/types/TyCoRep.hs | 379 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 283 insertions(+), 96 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 65d38e683cbcf63e5b8445aa98d8267af7607323 From git at git.haskell.org Tue Sep 11 11:05:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 11:05:11 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2: Bugfix (ad577f6) Message-ID: <20180911110511.0523A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2 Link : http://ghc.haskell.org/trac/ghc/changeset/ad577f65076166a453e465dac0082466d1bcb41c/ghc >--------------------------------------------------------------- commit ad577f65076166a453e465dac0082466d1bcb41c Author: Tobias Dammers Date: Mon Sep 10 22:46:31 2018 +0200 Bugfix >--------------------------------------------------------------- ad577f65076166a453e465dac0082466d1bcb41c compiler/types/TyCoRep.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 5d6492f..7f470ea 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1707,8 +1707,8 @@ ty_co_vars_of_mco (MCo co) is acc = ty_co_vars_of_co co is acc ty_co_vars_of_co_var :: CoVar -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_co_var v is acc - | v `elemVarSet` is = acc | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc | otherwise = ty_co_vars_of_type (varType v) is (extendVarSet acc v) ty_co_vars_of_cos :: [Coercion] -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet From git at git.haskell.org Tue Sep 11 11:05:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 11:05:13 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2: Close over kinds at the end (#14880, step 2) (2728d63) Message-ID: <20180911110513.DB0E23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2 Link : http://ghc.haskell.org/trac/ghc/changeset/2728d63f0a42251d24d5fc4f044633f981891131/ghc >--------------------------------------------------------------- commit 2728d63f0a42251d24d5fc4f044633f981891131 Author: Tobias Dammers Date: Tue Sep 11 13:04:40 2018 +0200 Close over kinds at the end (#14880, step 2) >--------------------------------------------------------------- 2728d63f0a42251d24d5fc4f044633f981891131 compiler/typecheck/TcTyDecls.hs | 3 +- compiler/types/Coercion.hs | 2 +- compiler/types/TyCoRep.hs | 188 ++++++++++++++++++---------------------- compiler/types/Type.hs | 2 +- 4 files changed, 87 insertions(+), 108 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2728d63f0a42251d24d5fc4f044633f981891131 From git at git.haskell.org Tue Sep 11 19:59:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 19:59:33 +0000 (UTC) Subject: [commit: ghc] master: Revert incorrect STM wakeup optimisation (36740b4) Message-ID: <20180911195933.6EEBD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/36740b4c346c619e31d24d6672caa6f4f7fea123/ghc >--------------------------------------------------------------- commit 36740b4c346c619e31d24d6672caa6f4f7fea123 Author: Ömer Sinan Ağacan Date: Tue Sep 11 20:43:50 2018 +0200 Revert incorrect STM wakeup optimisation Summary: (see the comments) Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5144 >--------------------------------------------------------------- 36740b4c346c619e31d24d6672caa6f4f7fea123 rts/STM.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/rts/STM.c b/rts/STM.c index 976ad87..dc0b0eb 100644 --- a/rts/STM.c +++ b/rts/STM.c @@ -337,11 +337,11 @@ static void unpark_tso(Capability *cap, StgTSO *tso) { // it belongs to this cap, or send a message to the owning cap // otherwise. - // But we don't really want to send multiple messages if we write - // to the same TVar multiple times, and the owning cap hasn't yet - // woken up the thread and removed it from the TVar's watch list. - // So, we use the tso->block_info as a flag to indicate whether - // we've already done tryWakeupThread() for this thread. + // TODO: This sends multiple messages if we write to the same TVar multiple + // times and the owning cap hasn't yet woken up the thread and removed it + // from the TVar's watch list. We tried to optimise this in D4961, but that + // patch was incorrect and broke other things, see #15544 comment:17. See + // #15626 for the tracking ticket. // Safety Note: we hold the TVar lock at this point, so we know // that this thread is definitely still blocked, since the first @@ -349,12 +349,7 @@ static void unpark_tso(Capability *cap, StgTSO *tso) { // TVar watch queues, and to do that it would need to lock the // TVar. - if (tso->block_info.closure != &stg_STM_AWOKEN_closure) { - // safe to do a non-atomic test-and-set here, because it's - // fine if we do multiple tryWakeupThread()s. - tso->block_info.closure = &stg_STM_AWOKEN_closure; - tryWakeupThread(cap,tso); - } + tryWakeupThread(cap,tso); } static void unpark_waiters_on(Capability *cap, StgTVar *s) { From git at git.haskell.org Tue Sep 11 19:59:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 19:59:36 +0000 (UTC) Subject: [commit: ghc] master: rts.cabal.in: advertise new default profiling ways for hadrian (5d67d06) Message-ID: <20180911195936.429E93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5d67d069608f04b4c5eeee73b44bf27562adc5a3/ghc >--------------------------------------------------------------- commit 5d67d069608f04b4c5eeee73b44bf27562adc5a3 Author: Alp Mestanogullari Date: Tue Sep 11 20:45:43 2018 +0200 rts.cabal.in: advertise new default profiling ways for hadrian Summary: D5140 makes us build some new profiling ways by default, but since it is not advertised in rts.cabal, hadrian doesn't know about that. This patch fixes this and successfully lets hadrian build those flavours of libHSrts. Test Plan: hadrian/build.sh --flavour=perf Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5142 >--------------------------------------------------------------- 5d67d069608f04b4c5eeee73b44bf27562adc5a3 rts/rts.cabal.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in index d509953..e09c054 100644 --- a/rts/rts.cabal.in +++ b/rts/rts.cabal.in @@ -51,14 +51,14 @@ library -- libCffi_thr libCffi_thr_debug libCffi_thr_l libCffi_thr_p extra-library-flavours: _debug _l _thr _thr_debug _thr_l - -- The make build system seems to be doing something "magic"/special + -- The make build system does something special in config.mk.in -- for generating profiled builds of those libraries, but we need to -- be transparent for hadrian which gets information about the rts -- "package" through Cabal and this cabal file. We therefore declare - -- two profiling-enabled flavours to be available when passing the + -- several profiling-enabled flavours to be available when passing the -- 'profiling' flag when configuring the RTS from hadrian, using Cabal. if flag(profiling) - extra-library-flavours: _p _thr_p + extra-library-flavours: _p _thr_p _debug_p _thr_debug_p exposed: True exposed-modules: From git at git.haskell.org Tue Sep 11 19:59:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 11 Sep 2018 19:59:39 +0000 (UTC) Subject: [commit: ghc] master: Make CoreMonad independent of TcEnv (#14391) (03b779f) Message-ID: <20180911195939.129BD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/03b779f2444c438204789c7ced0ed23556f7b105/ghc >--------------------------------------------------------------- commit 03b779f2444c438204789c7ced0ed23556f7b105 Author: Krzysztof Gogolewski Date: Tue Sep 11 20:46:04 2018 +0200 Make CoreMonad independent of TcEnv (#14391) Summary: This removes the last direct import from simplCore/ to typechecker/. Test Plan: validate Reviewers: nomeata, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14391 Differential Revision: https://phabricator.haskell.org/D5139 >--------------------------------------------------------------- 03b779f2444c438204789c7ced0ed23556f7b105 compiler/main/GhcPlugins.hs | 52 +++++++++++++++++++++++++++++++++++++-- compiler/simplCore/CoreMonad.hs | 54 +---------------------------------------- 2 files changed, 51 insertions(+), 55 deletions(-) diff --git a/compiler/main/GhcPlugins.hs b/compiler/main/GhcPlugins.hs index c064c0e..3e0facf 100644 --- a/compiler/main/GhcPlugins.hs +++ b/compiler/main/GhcPlugins.hs @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -fno-warn-duplicate-exports #-} +{-# OPTIONS_GHC -fno-warn-duplicate-exports -fno-warn-orphans #-} -- | This module is not used by GHC itself. Rather, it exports all of -- the functions and types you are likely to need when writing a @@ -19,7 +19,10 @@ module GhcPlugins( module VarSet, module VarEnv, module NameSet, module NameEnv, module UniqSet, module UniqFM, module FiniteMap, module Util, module GHC.Serialized, module SrcLoc, module Outputable, - module UniqSupply, module Unique, module FastString + module UniqSupply, module Unique, module FastString, + + -- * Getting 'Name's + thNameToGhcName ) where -- Plugin stuff itself @@ -82,3 +85,48 @@ import Outputable import UniqSupply import Unique ( Unique, Uniquable(..) ) import FastString +import Data.Maybe + +import NameCache (lookupOrigNameCache) +import GhcPrelude +import MonadUtils ( mapMaybeM ) +import Convert ( thRdrNameGuesses ) +import TcEnv ( lookupGlobal ) + +import qualified Language.Haskell.TH as TH + +{- This instance is defined outside CoreMonad.hs so that + CoreMonad does not depend on TcEnv -} +instance MonadThings CoreM where + lookupThing name = do { hsc_env <- getHscEnv + ; liftIO $ lookupGlobal hsc_env name } + +{- +************************************************************************ +* * + Template Haskell interoperability +* * +************************************************************************ +-} + +-- | Attempt to convert a Template Haskell name to one that GHC can +-- understand. Original TH names such as those you get when you use +-- the @'foo@ syntax will be translated to their equivalent GHC name +-- exactly. Qualified or unqualified TH names will be dynamically bound +-- to names in the module being compiled, if possible. Exact TH names +-- will be bound to the name they represent, exactly. +thNameToGhcName :: TH.Name -> CoreM (Maybe Name) +thNameToGhcName th_name + = do { names <- mapMaybeM lookup (thRdrNameGuesses th_name) + -- Pick the first that works + -- E.g. reify (mkName "A") will pick the class A in preference + -- to the data constructor A + ; return (listToMaybe names) } + where + lookup rdr_name + | Just n <- isExact_maybe rdr_name -- This happens in derived code + = return $ if isExternalName n then Just n else Nothing + | Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name + = do { cache <- getOrigNameCache + ; return $ lookupOrigNameCache cache rdr_mod rdr_occ } + | otherwise = return Nothing diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs index 6b7393c..0c5d8d9 100644 --- a/compiler/simplCore/CoreMonad.hs +++ b/compiler/simplCore/CoreMonad.hs @@ -47,17 +47,11 @@ module CoreMonad ( putMsg, putMsgS, errorMsg, errorMsgS, warnMsg, fatalErrorMsg, fatalErrorMsgS, debugTraceMsg, debugTraceMsgS, - dumpIfSet_dyn, - - -- * Getting 'Name's - thNameToGhcName + dumpIfSet_dyn ) where import GhcPrelude hiding ( read ) -import Convert -import RdrName -import Name import CoreSyn import HscTypes import Module @@ -67,7 +61,6 @@ import Annotations import IOEnv hiding ( liftIO, failM, failWithM ) import qualified IOEnv ( liftIO ) -import TcEnv ( lookupGlobal ) import Var import Outputable import FastString @@ -82,7 +75,6 @@ import Data.List import Data.Ord import Data.Dynamic import Data.IORef -import Data.Maybe import Data.Map (Map) import qualified Data.Map as Map import qualified Data.Map.Strict as MapStrict @@ -90,8 +82,6 @@ import Data.Word import Control.Monad import Control.Applicative ( Alternative(..) ) -import qualified Language.Haskell.TH as TH - {- ************************************************************************ * * @@ -852,45 +842,3 @@ dumpIfSet_dyn flag str doc ; unqual <- getPrintUnqualified ; when (dopt flag dflags) $ liftIO $ Err.dumpSDoc dflags unqual flag str doc } - -{- -************************************************************************ -* * - Finding TyThings -* * -************************************************************************ --} - -instance MonadThings CoreM where - lookupThing name = do { hsc_env <- getHscEnv - ; liftIO $ lookupGlobal hsc_env name } - -{- -************************************************************************ -* * - Template Haskell interoperability -* * -************************************************************************ --} - --- | Attempt to convert a Template Haskell name to one that GHC can --- understand. Original TH names such as those you get when you use --- the @'foo@ syntax will be translated to their equivalent GHC name --- exactly. Qualified or unqualified TH names will be dynamically bound --- to names in the module being compiled, if possible. Exact TH names --- will be bound to the name they represent, exactly. -thNameToGhcName :: TH.Name -> CoreM (Maybe Name) -thNameToGhcName th_name - = do { names <- mapMaybeM lookup (thRdrNameGuesses th_name) - -- Pick the first that works - -- E.g. reify (mkName "A") will pick the class A in preference - -- to the data constructor A - ; return (listToMaybe names) } - where - lookup rdr_name - | Just n <- isExact_maybe rdr_name -- This happens in derived code - = return $ if isExternalName n then Just n else Nothing - | Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name - = do { cache <- getOrigNameCache - ; return $ lookupOrigNameCache cache rdr_mod rdr_occ } - | otherwise = return Nothing From git at git.haskell.org Wed Sep 12 06:12:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 06:12:06 +0000 (UTC) Subject: [commit: ghc] master: Refactor info table entry error messages (ce23451) Message-ID: <20180912061206.2821D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ce23451c2c771bfbbac27ce63c5fdccc7ed02b3b/ghc >--------------------------------------------------------------- commit ce23451c2c771bfbbac27ce63c5fdccc7ed02b3b Author: Ömer Sinan Ağacan Date: Wed Sep 12 09:11:18 2018 +0300 Refactor info table entry error messages We now show address of the entered object in error messages. Example: foo: internal error: Evaluated a CAF (0xe4c518) that was GC'd! (GHC version 8.6.0.20180907 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Helpful when debugging. Test Plan: This validates Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5143 >--------------------------------------------------------------- ce23451c2c771bfbbac27ce63c5fdccc7ed02b3b rts/StgMiscClosures.cmm | 114 ++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 57 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ce23451c2c771bfbbac27ce63c5fdccc7ed02b3b From git at git.haskell.org Wed Sep 12 14:08:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 14:08:44 +0000 (UTC) Subject: [commit: ghc] master: Be a bit more aggressive about let-to-case (0e6d42f) Message-ID: <20180912140844.3201F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0e6d42fe76958648243f99c49e648769c1ea658c/ghc >--------------------------------------------------------------- commit 0e6d42fe76958648243f99c49e648769c1ea658c Author: Simon Peyton Jones Date: Wed Sep 12 13:06:53 2018 +0100 Be a bit more aggressive about let-to-case This patch takes up the missed opportunity described in Trac #15631, by convering a case into a let slightly more agressively. See Simplify.hs Note [Case-to-let for strictly-used binders] There is no measurable perf impact for good or ill. But the code is simpler and easier to explain. >--------------------------------------------------------------- 0e6d42fe76958648243f99c49e648769c1ea658c compiler/simplCore/Simplify.hs | 52 +++++++++++++++------- testsuite/tests/simplCore/should_compile/Makefile | 5 +++ testsuite/tests/simplCore/should_compile/T15631.hs | 11 +++++ .../tests/simplCore/should_compile/T15631.stdout | 7 +++ testsuite/tests/simplCore/should_compile/all.T | 5 ++- 5 files changed, 62 insertions(+), 18 deletions(-) diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index c8870c9..e359c43 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -2247,7 +2247,7 @@ We treat the unlifted and lifted cases separately: However, we can turn the case into a /strict/ let if the 'r' is used strictly in the body. Then we won't lose divergence; and we won't build a thunk because the let is strict. - See also Note [Eliminating redundant seqs] + See also Note [Case-to-let for strictly-used binders] NB: absentError satisfies exprIsHNF: see Note [aBSENT_ERROR_ID] in MkCore. We want to turn @@ -2256,13 +2256,18 @@ We treat the unlifted and lifted cases separately: let r = absentError "foo" in ...MkT r... -Note [Eliminating redundant seqs] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Note [Case-to-let for strictly-used binders] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have this: - case x of r { _ -> ..r.. } -where 'r' is used strictly in (..r..), the case is effectively a 'seq' -on 'x', but since 'r' is used strictly anyway, we can safely transform to - (...x...) + case of r { _ -> ..r.. } + +where 'r' is used strictly in (..r..), we can safely transform to + let r = in ...r... + +This is a Good Thing, because 'r' might be dead (if the body just +calls error), or might be used just once (in which case it can be +inlined); or we might be able to float the let-binding up or down. +E.g. Trac #15631 has an example. Note that this can change the error behaviour. For example, we might transform @@ -2278,7 +2283,24 @@ transformation bit us in practice. See also Note [Empty case alternatives] in CoreSyn. -Just for reference, the original code (added Jan 13) looked like this: +Historical notes + +There have been various earlier versions of this patch: + +* By Sept 18 the code looked like this: + || scrut_is_demanded_var scrut + + scrut_is_demanded_var :: CoreExpr -> Bool + scrut_is_demanded_var (Cast s _) = scrut_is_demanded_var s + scrut_is_demanded_var (Var _) = isStrictDmd (idDemandInfo case_bndr) + scrut_is_demanded_var _ = False + + This only fired if the scrutinee was a /variable/, which seems + an unnecessary restriction. So in Trac #15631 I relaxed it to allow + arbitrary scrutinees. Less code, less to explain -- but the change + had 0.00% effect on nofib. + +* Previously, in Jan 13 the code looked like this: || case_bndr_evald_next rhs case_bndr_evald_next :: CoreExpr -> Bool @@ -2289,8 +2311,8 @@ Just for reference, the original code (added Jan 13) looked like this: case_bndr_evald_next (Case e _ _ _) = case_bndr_evald_next e case_bndr_evald_next _ = False -(This came up when fixing Trac #7542. See also Note [Eta reduction of -an eval'd function] in CoreUtils.) + This patch was part of fixing Trac #7542. See also + Note [Eta reduction of an eval'd function] in CoreUtils.) Further notes about case elimination @@ -2405,7 +2427,7 @@ rebuildCase env scrut case_bndr alts@[(_, bndrs, rhs)] cont | all_dead_bndrs , if isUnliftedType (idType case_bndr) then exprOkForSpeculation scrut - else exprIsHNF scrut || scrut_is_demanded_var scrut + else exprIsHNF scrut || case_bndr_is_demanded = do { tick (CaseElim case_bndr) ; (floats1, env') <- simplNonRecX env case_bndr scrut ; (floats2, expr') <- simplExprF env' rhs cont @@ -2424,12 +2446,8 @@ rebuildCase env scrut case_bndr alts@[(_, bndrs, rhs)] cont all_dead_bndrs = all isDeadBinder bndrs -- bndrs are [InId] is_plain_seq = all_dead_bndrs && isDeadBinder case_bndr -- Evaluation *only* for effect - scrut_is_demanded_var :: CoreExpr -> Bool - -- See Note [Eliminating redundant seqs] - scrut_is_demanded_var (Cast s _) = scrut_is_demanded_var s - scrut_is_demanded_var (Var _) = isStrictDmd (idDemandInfo case_bndr) - scrut_is_demanded_var _ = False - + case_bndr_is_demanded = isStrictDmd (idDemandInfo case_bndr) + -- See Note [Case-to-let for strictly-used binders] rebuildCase env scrut case_bndr alts cont = reallyRebuildCase env scrut case_bndr alts cont diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile index 1233b8c..277a5a6 100644 --- a/testsuite/tests/simplCore/should_compile/Makefile +++ b/testsuite/tests/simplCore/should_compile/Makefile @@ -246,3 +246,8 @@ T14140: $(RM) -f T14140.o T14140.hi -'$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T14140.hs | grep '[2-9]# *->' # Expecting no output from the grep, hence "-" + +T15631: + $(RM) -f T15631.o T15631.hi + '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl -dsuppress-uniques T15631.hs | grep 'case' +# Expecting one fewwer case expressions after fixing Trac #15631 diff --git a/testsuite/tests/simplCore/should_compile/T15631.hs b/testsuite/tests/simplCore/should_compile/T15631.hs new file mode 100644 index 0000000..55f6758 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T15631.hs @@ -0,0 +1,11 @@ +{-# Language PartialTypeSignatures, RankNTypes #-} + +module Foo where + +f xs = let ys = reverse xs + in ys `seq` + let w = length xs + in w + length (reverse (case ys of { a:as -> as; [] -> [] })) + + + diff --git a/testsuite/tests/simplCore/should_compile/T15631.stdout b/testsuite/tests/simplCore/should_compile/T15631.stdout new file mode 100644 index 0000000..5a096f2 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T15631.stdout @@ -0,0 +1,7 @@ + case GHC.List.$wlenAcc + case GHC.List.$wlenAcc @ a w 0# of ww2 { __DEFAULT -> + case GHC.List.reverse1 @ a w (GHC.Types.[] @ a) of { + [] -> case Foo.f1 @ a of { GHC.Types.I# v1 -> GHC.Prim.+# ww2 v1 }; + case GHC.List.$wlenAcc + case Foo.$wf @ a w of ww [Occ=Once] { __DEFAULT -> + case Foo.$wf @ a w of ww { __DEFAULT -> GHC.Types.I# ww } diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 1284b7c..d572d04 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -322,4 +322,7 @@ test('T15517', normal, compile, ['-O0']) test('T15517a', normal, compile, ['-O0']) test('T15453', normal, compile, ['-dcore-lint -O1']) test('T15445', normal, multimod_compile, ['T15445', '-v0 -O -ddump-rule-firings']) - +test('T15631', + normal, + run_command, + ['$MAKE -s --no-print-directory T15631']) From git at git.haskell.org Wed Sep 12 20:48:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 20:48:28 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2: Avoid going through FV when closing over kinds (#14880) (17732b4) Message-ID: <20180912204828.2A5B93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2 Link : http://ghc.haskell.org/trac/ghc/changeset/17732b472bebbe0341f6992dce6bd259e176725c/ghc >--------------------------------------------------------------- commit 17732b472bebbe0341f6992dce6bd259e176725c Author: Tobias Dammers Date: Wed Sep 12 22:47:56 2018 +0200 Avoid going through FV when closing over kinds (#14880) >--------------------------------------------------------------- 17732b472bebbe0341f6992dce6bd259e176725c compiler/basicTypes/VarSet.hs | 8 +++++++- compiler/types/TyCoRep.hs | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/basicTypes/VarSet.hs b/compiler/basicTypes/VarSet.hs index ac3c545..1c82b38 100644 --- a/compiler/basicTypes/VarSet.hs +++ b/compiler/basicTypes/VarSet.hs @@ -13,7 +13,7 @@ module VarSet ( emptyVarSet, unitVarSet, mkVarSet, extendVarSet, extendVarSetList, elemVarSet, subVarSet, - unionVarSet, unionVarSets, mapUnionVarSet, + unionVarSet, unionVarSets, mapUnionVarSet, mapUnionVarSetSet, intersectVarSet, intersectsVarSet, disjointVarSet, isEmptyVarSet, delVarSet, delVarSetList, delVarSetByKey, minusVarSet, filterVarSet, mapVarSet, @@ -85,6 +85,9 @@ unionVarSets :: [VarSet] -> VarSet mapUnionVarSet :: (a -> VarSet) -> [a] -> VarSet -- ^ map the function over the list, and union the results +mapUnionVarSetSet :: (Var -> VarSet) -> VarSet -> VarSet +-- ^ map the function over the set, and union the results + unitVarSet :: Var -> VarSet extendVarSet :: VarSet -> Var -> VarSet extendVarSetList:: VarSet -> [Var] -> VarSet @@ -137,6 +140,9 @@ partitionVarSet = partitionUniqSet mapUnionVarSet get_set xs = foldr (unionVarSet . get_set) emptyVarSet xs +mapUnionVarSetSet get_set = + nonDetFoldUniqSet (\var acc -> get_set var `unionVarSet` acc) emptyVarSet + -- See comments with type signatures intersectsVarSet s1 s2 = not (s1 `disjointVarSet` s2) disjointVarSet s1 s2 = disjointUFM (getUniqSet s1) (getUniqSet s2) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index d2cb070..2823280 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1898,9 +1898,8 @@ coVarsOfCos = mapUnionVarSet coVarsOfCo -- | Add the kind variables free in the kinds of the tyvars in the given set. -- Returns a non-deterministic set. closeOverKinds :: TyVarSet -> TyVarSet -closeOverKinds = fvVarSet . closeOverKindsFV . nonDetEltsUniqSet - -- It's OK to use nonDetEltsUniqSet here because we immediately forget - -- about the ordering by returning a set. +closeOverKinds tvs = + mapUnionVarSetSet (tyCoVarsOfType . tyVarKind) tvs `unionVarSet` tvs -- | Given a list of tyvars returns a deterministic FV computation that -- returns the given tyvars with the kind variables free in the kinds of the From git at git.haskell.org Wed Sep 12 22:06:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 22:06:58 +0000 (UTC) Subject: [commit: ghc] master: Revert "ghc: Remove warning of StaticPointers not being supported by GHCi" (7ab8007) Message-ID: <20180912220658.E067F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7ab80072ad63fa9eb1d77bd579af720bf24b25a4/ghc >--------------------------------------------------------------- commit 7ab80072ad63fa9eb1d77bd579af720bf24b25a4 Author: Ben Gamari Date: Fri Sep 7 10:48:43 2018 -0400 Revert "ghc: Remove warning of StaticPointers not being supported by GHCi" While we now support use of StaticPointers in modules loaded via the REPL (e.g. via `:load`), we currently do not support use of StaticPointers on the REPL itself. This reverts commit 9400a5c6b308fbb5b3a73690610736ca3b5eb0b3. >--------------------------------------------------------------- 7ab80072ad63fa9eb1d77bd579af720bf24b25a4 compiler/main/GHC.hs | 15 ++++++++++++--- testsuite/tests/ghci/scripts/StaticPtr.stderr | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 4059860..cf9c74f 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -332,7 +332,7 @@ import Annotations import Module import Panic import Platform -import Bag ( unitBag ) +import Bag ( listToBag, unitBag ) import ErrUtils import MonadUtils import Util @@ -344,6 +344,7 @@ import FastString import qualified Parser import Lexer import ApiAnnotation +import qualified GHC.LanguageExtensions as LangExt import NameEnv import CoreFVs ( orphNamesOfFamInst ) import FamInstEnv ( famInstEnvElts ) @@ -676,8 +677,16 @@ checkNewDynFlags dflags = do checkNewInteractiveDynFlags :: MonadIO m => DynFlags -> m DynFlags checkNewInteractiveDynFlags dflags0 = do - -- Nothing to be done here - return dflags0 + -- We currently don't support use of StaticPointers in expressions entered on + -- the REPL. See #12356. + dflags1 <- + if xopt LangExt.StaticPointers dflags0 + then do liftIO $ printOrThrowWarnings dflags0 $ listToBag + [mkPlainWarnMsg dflags0 interactiveSrcSpan + $ text "StaticPointers is not supported in GHCi interactive expressions."] + return $ xopt_unset dflags0 LangExt.StaticPointers + else return dflags0 + return dflags1 -- %************************************************************************ diff --git a/testsuite/tests/ghci/scripts/StaticPtr.stderr b/testsuite/tests/ghci/scripts/StaticPtr.stderr new file mode 100644 index 0000000..b45f64e --- /dev/null +++ b/testsuite/tests/ghci/scripts/StaticPtr.stderr @@ -0,0 +1,3 @@ + +: warning: + StaticPointers is not supported in GHCi interactive expressions. From git at git.haskell.org Wed Sep 12 22:07:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 22:07:15 +0000 (UTC) Subject: [commit: ghc] master: template-haskell: Fix typo in changelog (5c48c41) Message-ID: <20180912220715.22EFC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c48c41239ee2a6228ff469cab8e06763d485c77/ghc >--------------------------------------------------------------- commit 5c48c41239ee2a6228ff469cab8e06763d485c77 Author: Ben Gamari Date: Sun Sep 9 22:23:16 2018 -0400 template-haskell: Fix typo in changelog >--------------------------------------------------------------- 5c48c41239ee2a6228ff469cab8e06763d485c77 libraries/template-haskell/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md index f60bb6e..53b5b56 100644 --- a/libraries/template-haskell/changelog.md +++ b/libraries/template-haskell/changelog.md @@ -3,7 +3,7 @@ ## 2.14.0.0 *TBA* * Introduce an `addForeignFilePath` function, as well as a corresponding - `qAddForeignFile` class method to `Quasi`. Unlike `addForeingFile`, which + `qAddForeignFile` class method to `Quasi`. Unlike `addForeignFile`, which takes the contents of the file as an argument, `addForeignFilePath` takes as an argument a path pointing to a foreign file. A new `addForeignSource` function has also been added which takes a file's contents as an argument. From git at git.haskell.org Wed Sep 12 22:07:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 12 Sep 2018 22:07:29 +0000 (UTC) Subject: [commit: ghc] master: rts/Printer.c: always define the findPtr symbol (900c47f) Message-ID: <20180912220729.E7E8E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/900c47f88784b91517c00be3e1087322e62f698e/ghc >--------------------------------------------------------------- commit 900c47f88784b91517c00be3e1087322e62f698e Author: Alp Mestanogullari Date: Wed Sep 12 18:06:02 2018 -0400 rts/Printer.c: always define the findPtr symbol It was previously only defined (and therefore shipped) when DEBUG is defined. This patch defines it regardless of DEBUG. This will help fix hadrian on OS X [1]. [1]: https://github.com/snowleopard/hadrian/issues/614 Test Plan: The error from hadrian#614 is gone Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5138 >--------------------------------------------------------------- 900c47f88784b91517c00be3e1087322e62f698e rts/Printer.c | 11 ++++++++--- rts/package.conf.in | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/rts/Printer.c b/rts/Printer.c index 291f529..7f7e83c 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -24,6 +24,8 @@ #include +void findPtr(P_ p, int follow); + #if defined(DEBUG) #include "Disassembler.h" @@ -775,8 +777,6 @@ extern void DEBUG_LoadSymbols( const char *name STG_UNUSED ) #endif /* USING_LIBBFD */ -void findPtr(P_ p, int); /* keep gcc -Wall happy */ - int searched = 0; static int @@ -876,7 +876,12 @@ void printObj( StgClosure *obj ) debugBelch("obj 0x%p (enable -DDEBUG for more info) " , obj ); } - +void findPtr(P_ p, int follow) +{ + // we're printing the arguments just to silence the unused parameter warning + debugBelch("recompile your program with -debug in order to run "); + debugBelch("findPtr(0x%p, %d)\n", p, follow); +} #endif /* DEBUG */ /* ----------------------------------------------------------------------------- diff --git a/rts/package.conf.in b/rts/package.conf.in index b5ed26d..b6dac76 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -174,11 +174,9 @@ ld-options: #if WORD_SIZE_IN_BITS == 64 , "-Wl,-u,_hs_atomicwrite64" #endif -#if defined(DEBUG) /* This symbol is useful in gdb, but not referred to anywhere, * so we need to force it to be included in the binary. */ , "-Wl,-u,_findPtr" -#endif #else "-Wl,-u,base_GHCziTopHandler_runIO_closure" , "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" @@ -277,12 +275,10 @@ ld-options: #if WORD_SIZE_IN_BITS == 64 , "-Wl,-u,hs_atomicwrite64" #endif -#if defined(DEBUG) /* This symbol is useful in gdb, but not referred to anywhere, * so we need to force it to be included in the binary. */ , "-Wl,-u,findPtr" #endif -#endif /* Pick up static libraries in preference over dynamic if in earlier search * path. This is important to use the static gmp in preference on Mac OS. From git at git.haskell.org Thu Sep 13 07:56:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 07:56:43 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-2-step2-c123' created Message-ID: <20180913075643.7C1593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-2-step2-c123 Referencing: 813aab757c400c10fe4927c23edbc6533cdf69ad From git at git.haskell.org Thu Sep 13 07:56:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 07:56:46 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Close over kinds exactly once per var (#14880) (813aab7) Message-ID: <20180913075646.527B33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/813aab757c400c10fe4927c23edbc6533cdf69ad/ghc >--------------------------------------------------------------- commit 813aab757c400c10fe4927c23edbc6533cdf69ad Author: Tobias Dammers Date: Thu Sep 13 09:56:02 2018 +0200 Close over kinds exactly once per var (#14880) >--------------------------------------------------------------- 813aab757c400c10fe4927c23edbc6533cdf69ad compiler/types/TyCoRep.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 7f470ea..10f9374 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1650,7 +1650,7 @@ ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) ty_co_vars_of_type (TyConApp _ tys) is acc = ty_co_vars_of_types tys is acc ty_co_vars_of_type (LitTy {}) _ acc = acc ty_co_vars_of_type (AppTy fun arg) is acc = ty_co_vars_of_type fun is (ty_co_vars_of_type arg is acc) From git at git.haskell.org Thu Sep 13 08:39:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 08:39:32 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Close over kinds exactly once per var (#14880) (3226841) Message-ID: <20180913083932.AA4A93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/322684195bd382828c4f2c3531671c0762f1ce83/ghc >--------------------------------------------------------------- commit 322684195bd382828c4f2c3531671c0762f1ce83 Author: Tobias Dammers Date: Thu Sep 13 09:56:02 2018 +0200 Close over kinds exactly once per var (#14880) >--------------------------------------------------------------- 322684195bd382828c4f2c3531671c0762f1ce83 compiler/types/TyCoRep.hs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 7f470ea..87c5aa8 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1650,7 +1650,7 @@ ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) ty_co_vars_of_type (TyConApp _ tys) is acc = ty_co_vars_of_types tys is acc ty_co_vars_of_type (LitTy {}) _ acc = acc ty_co_vars_of_type (AppTy fun arg) is acc = ty_co_vars_of_type fun is (ty_co_vars_of_type arg is acc) @@ -1782,14 +1782,17 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- See Note [FV eta expansion] in FV for explanation. tyCoFVsOfType :: Type -> FV -- See Note [Free variables of types] -tyCoFVsOfType (TyVarTy v) a b c = (unitFV v `unionFV` tyCoFVsOfType (tyVarKind v)) a b c -tyCoFVsOfType (TyConApp _ tys) a b c = tyCoFVsOfTypes tys a b c -tyCoFVsOfType (LitTy {}) a b c = emptyFV a b c -tyCoFVsOfType (AppTy fun arg) a b c = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) a b c -tyCoFVsOfType (FunTy arg res) a b c = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) a b c -tyCoFVsOfType (ForAllTy bndr ty) a b c = tyCoFVsBndr bndr (tyCoFVsOfType ty) a b c -tyCoFVsOfType (CastTy ty co) a b c = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) a b c -tyCoFVsOfType (CoercionTy co) a b c = tyCoFVsOfCo co a b c +tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) + | v `elemVarSet` bound_vars = (acc_list, acc_set) + | v `elemVarSet` acc_set = (acc_list, acc_set) + | otherwise = (unitFV v `unionFV` tyCoFVsOfType (tyVarKind v)) f emptyVarSet (acc_list, acc_set) +tyCoFVsOfType (TyConApp _ tys) f bound_vars acc = tyCoFVsOfTypes tys f bound_vars acc +tyCoFVsOfType (LitTy {}) f bound_vars acc = emptyFV f bound_vars acc +tyCoFVsOfType (AppTy fun arg) f bound_vars acc = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) f bound_vars acc +tyCoFVsOfType (FunTy arg res) f bound_vars acc = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) f bound_vars acc +tyCoFVsOfType (ForAllTy bndr ty) f bound_vars acc = tyCoFVsBndr bndr (tyCoFVsOfType ty) f bound_vars acc +tyCoFVsOfType (CastTy ty co) f bound_vars acc = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) f bound_vars acc +tyCoFVsOfType (CoercionTy co) f bound_vars acc = tyCoFVsOfCo co f bound_vars acc tyCoFVsBndr :: TyVarBinder -> FV -> FV -- Free vars of (forall b. ) From git at git.haskell.org Thu Sep 13 09:38:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 09:38:16 +0000 (UTC) Subject: [commit: ghc] master: Honor INLINE on 0-arity bindings (#15578) (b9b1f99) Message-ID: <20180913093816.7424D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b9b1f99954e69f23e9647d00e048938d5509ec14/ghc >--------------------------------------------------------------- commit b9b1f99954e69f23e9647d00e048938d5509ec14 Author: Tobias Dammers Date: Thu Sep 13 10:21:49 2018 +0200 Honor INLINE on 0-arity bindings (#15578) Summary: Fix test for #15578 By allowing 0-arity values to be inlined, we end up changing boringness annotations, and this gets reflected in the Core output for this particular test. Add Notes for #15578 Test Plan: ./validate Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15578 Differential Revision: https://phabricator.haskell.org/D5137 >--------------------------------------------------------------- b9b1f99954e69f23e9647d00e048938d5509ec14 compiler/coreSyn/CoreUnfold.hs | 73 +++++++++++++++++++- compiler/simplCore/Simplify.hs | 16 ++++- testsuite/tests/perf/should_run/T15578.hs | 80 ++++++++++++++++++++++ testsuite/tests/perf/should_run/all.T | 9 +++ .../tests/simplCore/should_compile/T7360.stderr | 2 +- 5 files changed, 175 insertions(+), 5 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b9b1f99954e69f23e9647d00e048938d5509ec14 From git at git.haskell.org Thu Sep 13 10:23:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 10:23:25 +0000 (UTC) Subject: [commit: ghc] master: Typo in user guide wrongly claims DeriveLift was added in 7.2 (1ad3c82) Message-ID: <20180913102325.5E3DF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1ad3c8245cc114c3f862633d027361700fba3e50/ghc >--------------------------------------------------------------- commit 1ad3c8245cc114c3f862633d027361700fba3e50 Author: Merijn Verstraaten Date: Mon Sep 10 16:38:16 2018 +0200 Typo in user guide wrongly claims DeriveLift was added in 7.2 >--------------------------------------------------------------- 1ad3c8245cc114c3f862633d027361700fba3e50 docs/users_guide/glasgow_exts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index a1a5b1f..0c977d0 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -4512,7 +4512,7 @@ Deriving ``Lift`` instances .. extension:: DeriveLift :shortdesc: Enable deriving for the Lift class - :since: 7.2.1 + :since: 8.0.1 Enable automatic deriving of instances for the ``Lift`` typeclass for Template Haskell. From git at git.haskell.org Thu Sep 13 13:01:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:15 +0000 (UTC) Subject: [commit: ghc] master: Comments about join-point return types (0c07208) Message-ID: <20180913130115.8AFDF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0c0720874868f2a53d3411831b7faa2c03f3a393/ghc >--------------------------------------------------------------- commit 0c0720874868f2a53d3411831b7faa2c03f3a393 Author: Simon Peyton Jones Date: Wed Sep 12 13:21:02 2018 +0100 Comments about join-point return types >--------------------------------------------------------------- 0c0720874868f2a53d3411831b7faa2c03f3a393 compiler/simplCore/SimplEnv.hs | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/compiler/simplCore/SimplEnv.hs b/compiler/simplCore/SimplEnv.hs index 18d9f57..1d55f35 100644 --- a/compiler/simplCore/SimplEnv.hs +++ b/compiler/simplCore/SimplEnv.hs @@ -694,6 +694,34 @@ lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v These functions are in the monad only so that they can be made strict via seq. + +Note [Return type for join points] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider + + (join j :: Char -> Int -> Int) 77 + ( j x = \y. y + ord x ) + (in case v of ) + ( A -> j 'x' ) + ( B -> j 'y' ) + ( C -> ) + +The simplifier pushes the "apply to 77" continuation inwards to give + + join j :: Char -> Int + j x = (\y. y + ord x) 77 + in case v of + A -> j 'x' + B -> j 'y' + C -> 77 + +Notice that the "apply to 77" continuation went into the RHS of the +join point. And that meant that the return type of the join point +changed!! + +That's why we pass res_ty into simplNonRecJoinBndr, and substIdBndr +takes a (Just res_ty) argument so that it knows to do the type-changing +thing. -} simplBinders :: SimplEnv -> [InBndr] -> SimplM (SimplEnv, [OutBndr]) @@ -722,8 +750,9 @@ simplNonRecBndr env id --------------- simplNonRecJoinBndr :: SimplEnv -> OutType -> InBndr -> SimplM (SimplEnv, OutBndr) --- A non-recursive let binder for a join point; context being pushed inward may --- change the type +-- A non-recursive let binder for a join point; +-- context being pushed inward may change the type +-- See Note [Return type for join points] simplNonRecJoinBndr env res_ty id = do { let (env1, id1) = substIdBndr (Just res_ty) env id ; seqId id1 `seq` return (env1, id1) } @@ -738,8 +767,9 @@ simplRecBndrs env@(SimplEnv {}) ids --------------- simplRecJoinBndrs :: SimplEnv -> OutType -> [InBndr] -> SimplM SimplEnv --- Recursive let binders for join points; context being pushed inward may --- change types +-- Recursive let binders for join points; +-- context being pushed inward may change types +-- See Note [Return type for join points] simplRecJoinBndrs env@(SimplEnv {}) res_ty ids = ASSERT(all isJoinId ids) do { let (env1, ids1) = mapAccumL (substIdBndr (Just res_ty)) env ids @@ -755,6 +785,7 @@ substIdBndr new_res_ty env bndr --------------- substNonCoVarIdBndr :: Maybe OutType -- New result type, if a join binder + -- See Note [Return type for join points] -> SimplEnv -> InBndr -- Env and binder to transform -> (SimplEnv, OutBndr) @@ -785,10 +816,13 @@ substNonCoVarIdBndr new_res_ty where id1 = uniqAway in_scope old_id id2 = substIdType env id1 + id3 | Just res_ty <- new_res_ty = id2 `setIdType` setJoinResTy (idJoinArity id2) res_ty (idType id2) + -- See Note [Return type for join points] | otherwise = id2 + new_id = zapFragileIdInfo id3 -- Zaps rules, worker-info, unfolding -- and fragile OccInfo From git at git.haskell.org Thu Sep 13 13:01:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:18 +0000 (UTC) Subject: [commit: ghc] master: Delete duplicated comment line (6bf11e6) Message-ID: <20180913130118.624F63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6bf11e67f6be3db67b73bec08f437a784688bca0/ghc >--------------------------------------------------------------- commit 6bf11e67f6be3db67b73bec08f437a784688bca0 Author: Simon Peyton Jones Date: Wed Sep 12 13:21:19 2018 +0100 Delete duplicated comment line >--------------------------------------------------------------- 6bf11e67f6be3db67b73bec08f437a784688bca0 compiler/typecheck/TcCanonical.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index 201504d..b9b59d1 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -672,7 +672,6 @@ Here are the moving parts * TcCanonical.canForAll deals with solving a forall-constraint. See Note [Solving a Wanted forall-constraint] - Note [Solving a Wanted forall-constraint] * We augment the kick-out code to kick out an inert forall constraint if it can be rewritten by a new From git at git.haskell.org Thu Sep 13 13:01:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:21 +0000 (UTC) Subject: [commit: ghc] master: Comments only (on IfDataInstance) (291b0f8) Message-ID: <20180913130121.3399A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/291b0f89703f28631a381549e1838aa06195d011/ghc >--------------------------------------------------------------- commit 291b0f89703f28631a381549e1838aa06195d011 Author: Simon Peyton Jones Date: Thu Sep 13 09:18:25 2018 +0100 Comments only (on IfDataInstance) >--------------------------------------------------------------- 291b0f89703f28631a381549e1838aa06195d011 compiler/iface/IfaceSyn.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs index 9fcf5dc..2784dda 100644 --- a/compiler/iface/IfaceSyn.hs +++ b/compiler/iface/IfaceSyn.hs @@ -182,9 +182,11 @@ data IfaceClassBody data IfaceTyConParent = IfNoParent - | IfDataInstance IfExtName - IfaceTyCon - IfaceAppArgs + | IfDataInstance + IfExtName -- Axiom name + IfaceTyCon -- Family TyCon (pretty-printing only, not used in TcIface) + -- see Note [Pretty printing via IfaceSyn] in PprTyThing + IfaceAppArgs -- Arguments of the family TyCon data IfaceFamTyConFlav = IfaceDataFamilyTyCon -- Data family @@ -192,7 +194,7 @@ data IfaceFamTyConFlav | IfaceClosedSynFamilyTyCon (Maybe (IfExtName, [IfaceAxBranch])) -- ^ Name of associated axiom and branches for pretty printing purposes, -- or 'Nothing' for an empty closed family without an axiom - -- See Note [Pretty-printing via IfaceSyn] in PprTyThing + -- See Note [Pretty printing via IfaceSyn] in PprTyThing | IfaceAbstractClosedSynFamilyTyCon | IfaceBuiltInSynFamTyCon -- for pretty printing purposes only From git at git.haskell.org Thu Sep 13 13:01:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:25 +0000 (UTC) Subject: [commit: ghc] master: Allow (~) in the head of a quantified constraints (bd76875) Message-ID: <20180913130125.3AB403A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bd76875ae6ad0cdd734564dddfb9ab88a6de9579/ghc >--------------------------------------------------------------- commit bd76875ae6ad0cdd734564dddfb9ab88a6de9579 Author: Simon Peyton Jones Date: Thu Sep 13 11:23:53 2018 +0100 Allow (~) in the head of a quantified constraints Since the introduction of quantified constraints, GHC has rejected a quantified constraint with (~) in the head, thus f :: (forall a. blah => a ~ ty) => stuff I am frankly dubious that this is ever useful. But /is/ necessary for Coercible (representation equality version of (~)) and it does no harm to allow it for (~) as well. Plus, our users are asking for it (Trac #15359, #15625). It was really only excluded by accident, so this patch lifts the restriction. See TcCanonical Note [Equality superclasses in quantified constraints] There are a number of wrinkles: * If the context of the quantified constraint is empty, we can get trouble when we get down to unboxed equality (a ~# b) or (a ~R# b), as Trac #15625 showed. This is even more of a corner case, but it produced an outright crash, so I elaborated the superclass machinery in TcCanonical.makeStrictSuperClasses to add a void argument in this case. See Note [Equality superclasses in quantified constraints] * The restriction on (~) was in TcValidity.checkValidInstHead. In lifting the restriction I discovered an old special case for (~), namely | clas_nm `elem` [ heqTyConName, eqTyConName] , nameModule clas_nm /= this_mod This was (solely) to support the strange instance instance a ~~ b => a ~ b in Data.Type.Equality. But happily that is no longer with us, since commit f265008fb6f70830e7e92ce563f6d83833cef071 Refactor (~) to reduce the suerpclass stack So I removed the special case. * I found that the Core invariants on when we could have co = were entirely not written down. (Getting this wrong ws the proximate source of the crash in Trac #15625. So - Documented them better in CoreSyn Note [CoreSyn type and coercion invariant], - Modified CoreOpt and CoreLint to match - Modified CoreUtils.bindNonRec to match - Made MkCore.mkCoreLet use bindNonRec, rather than duplicate its logic - Made Simplify.rebuildCase case-to-let respect Note [CoreSyn type and coercion invariant], >--------------------------------------------------------------- bd76875ae6ad0cdd734564dddfb9ab88a6de9579 compiler/coreSyn/CoreLint.hs | 6 ++ compiler/coreSyn/CoreOpt.hs | 35 ++++++----- compiler/coreSyn/CoreSyn.hs | 71 ++++++++++++++-------- compiler/coreSyn/CoreUtils.hs | 18 +++++- compiler/coreSyn/MkCore.hs | 4 +- compiler/simplCore/Simplify.hs | 26 ++++++-- compiler/typecheck/TcCanonical.hs | 74 ++++++++++++++++++++--- compiler/typecheck/TcInteract.hs | 9 ++- compiler/typecheck/TcValidity.hs | 13 +--- testsuite/tests/quantified-constraints/T15359.hs | 12 ++++ testsuite/tests/quantified-constraints/T15359a.hs | 14 +++++ testsuite/tests/quantified-constraints/T15625.hs | 16 +++++ testsuite/tests/quantified-constraints/T15625a.hs | 20 ++++++ testsuite/tests/quantified-constraints/all.T | 4 ++ 14 files changed, 249 insertions(+), 73 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bd76875ae6ad0cdd734564dddfb9ab88a6de9579 From git at git.haskell.org Thu Sep 13 13:01:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:28 +0000 (UTC) Subject: [commit: ghc] master: Add regression test for Trac #15629 (0d4f394) Message-ID: <20180913130128.9F3083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0d4f394810e13b4643f9361b6d2b3b29cb2d5003/ghc >--------------------------------------------------------------- commit 0d4f394810e13b4643f9361b6d2b3b29cb2d5003 Author: Simon Peyton Jones Date: Thu Sep 13 12:56:09 2018 +0100 Add regression test for Trac #15629 >--------------------------------------------------------------- 0d4f394810e13b4643f9361b6d2b3b29cb2d5003 testsuite/tests/typecheck/should_fail/T15629.hs | 27 +++++++++++++++ .../tests/typecheck/should_fail/T15629.stderr | 39 ++++++++++++++++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 67 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T15629.hs b/testsuite/tests/typecheck/should_fail/T15629.hs new file mode 100644 index 0000000..fdbba60 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15629.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +{-# LANGUAGE TypeOperators #-} +module Bug (f) where + +import Data.Kind +import Data.Proxy + +data TyFun :: Type -> Type -> Type +type a ~> b = TyFun a b -> Type +infixr 0 ~> + +type family F x :: Type -> Type +data F1Sym :: forall x a. x ~> F x a +data F2Sym :: forall x a. F x a ~> x +data Comp :: forall b c a. (b ~> c) -> (a ~> b) -> (a ~> c) + +sg :: forall a b c (f :: b ~> c) (g :: a ~> b) (x :: a). + Proxy f -> Proxy g -> Proxy (Comp f g) +sg _ _ = Proxy + +f :: forall (x :: Type). Proxy x -> () +f _ = () + where + g :: forall ab. Proxy ((Comp (F1Sym :: x ~> F x z) F2Sym) :: F x ab ~> F x ab) + g = sg Proxy Proxy diff --git a/testsuite/tests/typecheck/should_fail/T15629.stderr b/testsuite/tests/typecheck/should_fail/T15629.stderr new file mode 100644 index 0000000..d3f0978 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T15629.stderr @@ -0,0 +1,39 @@ + +T15629.hs:26:34: error: + • Expected kind ‘x1 ~> F x1 ab1’, + but ‘(F1Sym :: x ~> F x z)’ has kind ‘x1 ~> F x1 z’ + • In the first argument of ‘Comp’, namely ‘(F1Sym :: x ~> F x z)’ + In the first argument of ‘Proxy’, namely + ‘((Comp (F1Sym :: x ~> F x z) F2Sym) :: F x ab ~> F x ab)’ + In the type signature: + g :: forall ab. + Proxy ((Comp (F1Sym :: x ~> F x z) F2Sym) :: F x ab ~> F x ab) + +T15629.hs:27:9: error: + • Couldn't match kind ‘ab1’ with ‘z’ + ‘ab1’ is a rigid type variable bound by + the type signature for: + g :: forall z1 ab1. Proxy (Comp F1Sym F2Sym) + at T15629.hs:26:5-82 + ‘z’ is a rigid type variable bound by + the type signature for: + g :: forall z1 ab1. Proxy (Comp F1Sym F2Sym) + at T15629.hs:26:5-82 + When matching types + f0 :: x ~> F x ab + F1Sym :: TyFun x1 (F x1 z) -> * + Expected type: Proxy (Comp F1Sym F2Sym) + Actual type: Proxy (Comp f0 F2Sym) + • In the expression: sg Proxy Proxy + In an equation for ‘g’: g = sg Proxy Proxy + In an equation for ‘f’: + f _ + = () + where + g :: + forall ab. + Proxy ((Comp (F1Sym :: x ~> F x z) F2Sym) :: F x ab ~> F x ab) + g = sg Proxy Proxy + • Relevant bindings include + g :: Proxy (Comp F1Sym F2Sym) (bound at T15629.hs:27:5) + f :: Proxy x1 -> () (bound at T15629.hs:24:1) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 64bc8cf..274dcc6 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -482,3 +482,4 @@ test('T15523', normal, compile_fail, ['-O']) test('T15527', normal, compile_fail, ['']) test('T15552', normal, compile, ['']) test('T15552a', normal, compile_fail, ['']) +test('T15629', normal, compile_fail, ['']) From git at git.haskell.org Thu Sep 13 13:01:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 13:01:31 +0000 (UTC) Subject: [commit: ghc] master: More info for Implication with -dppr-debug (02edb8f) Message-ID: <20180913130131.7299D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02edb8f2f973a8df26cfb6dfab0ef99a832f711f/ghc >--------------------------------------------------------------- commit 02edb8f2f973a8df26cfb6dfab0ef99a832f711f Author: Simon Peyton Jones Date: Thu Sep 13 12:56:29 2018 +0100 More info for Implication with -dppr-debug >--------------------------------------------------------------- 02edb8f2f973a8df26cfb6dfab0ef99a832f711f compiler/typecheck/TcRnTypes.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 41defc7..bdcb5b1 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -2598,7 +2598,7 @@ instance Outputable Implication where , ic_given = given, ic_no_eqs = no_eqs , ic_wanted = wanted, ic_status = status , ic_binds = binds --- , ic_need_inner = need_in, ic_need_outer = need_out + , ic_need_inner = need_in, ic_need_outer = need_out , ic_info = info }) = hang (text "Implic" <+> lbrace) 2 (sep [ text "TcLevel =" <+> ppr tclvl @@ -2608,8 +2608,8 @@ instance Outputable Implication where , hang (text "Given =") 2 (pprEvVars given) , hang (text "Wanted =") 2 (ppr wanted) , text "Binds =" <+> ppr binds --- , text "Needed inner =" <+> ppr need_in --- , text "Needed outer =" <+> ppr need_out + , whenPprDebug (text "Needed inner =" <+> ppr need_in) + , whenPprDebug (text "Needed outer =" <+> ppr need_out) , pprSkolInfo info ] <+> rbrace) instance Outputable ImplicStatus where From git at git.haskell.org Thu Sep 13 14:50:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:38 +0000 (UTC) Subject: [commit: packages/filepath] branch 'RyanGlScott-patch-1' created Message-ID: <20180913145038.A601F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath New branch : RyanGlScott-patch-1 Referencing: 4e42eb37222aa0047a2a1338353bd70b76e55c1f From git at git.haskell.org Thu Sep 13 14:50:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:40 +0000 (UTC) Subject: [commit: packages/filepath] tag 'v1.4.2.1' created Message-ID: <20180913145040.A5C0F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath New tag : v1.4.2.1 Referencing: 896d6e1afa40127828361c756eeed6fdbf885561 From git at git.haskell.org Thu Sep 13 14:50:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:42 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Ignore HLint hints in the generated tests (d32355a) Message-ID: <20180913145042.AD8ED3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/d32355a94c84b4cfeda0e65cdb13d5a988249fbc >--------------------------------------------------------------- commit d32355a94c84b4cfeda0e65cdb13d5a988249fbc Author: Neil Mitchell Date: Tue May 2 16:50:12 2017 +0100 Ignore HLint hints in the generated tests >--------------------------------------------------------------- d32355a94c84b4cfeda0e65cdb13d5a988249fbc Generate.hs | 1 + tests/TestGen.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/Generate.hs b/Generate.hs index 36e055c..7fb218e 100755 --- a/Generate.hs +++ b/Generate.hs @@ -20,6 +20,7 @@ main = do ,"import TestUtil" ,"import qualified System.FilePath.Windows as W" ,"import qualified System.FilePath.Posix as P" + ,"{-# ANN module \"HLint: ignore\" #-}" ,"tests :: [(String, Property)]" ,"tests ="] ++ [" " ++ c ++ "(" ++ show t1 ++ ", " ++ t2 ++ ")" | (c,(t1,t2)) <- zip ("[":repeat ",") tests] ++ diff --git a/tests/TestGen.hs b/tests/TestGen.hs index 848ae5b..7bc914e 100755 --- a/tests/TestGen.hs +++ b/tests/TestGen.hs @@ -3,6 +3,7 @@ module TestGen(tests) where import TestUtil import qualified System.FilePath.Windows as W import qualified System.FilePath.Posix as P +{-# ANN module "HLint: ignore" #-} tests :: [(String, Property)] tests = [("W.pathSeparator == '\\\\'", property $ W.pathSeparator == '\\') From git at git.haskell.org Thu Sep 13 14:50:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:44 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: HLint inspired cleanups (cfa3db3) Message-ID: <20180913145044.B3AE13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/cfa3db3bd8effc797a7c1d59f340bae53b96e961 >--------------------------------------------------------------- commit cfa3db3bd8effc797a7c1d59f340bae53b96e961 Author: Neil Mitchell Date: Tue May 2 16:55:39 2017 +0100 HLint inspired cleanups >--------------------------------------------------------------- cfa3db3bd8effc797a7c1d59f340bae53b96e961 Generate.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Generate.hs b/Generate.hs index 7fb218e..4bf94d2 100755 --- a/Generate.hs +++ b/Generate.hs @@ -49,7 +49,9 @@ parseTest (stripPrefix "-- > " -> Just x) = platform $ toLexemes x free p val x = Test p [(ctor v, v) | v <- vars] x where vars = nub $ sort [v | v@[c] <- x, isAlpha c] - ctor v = if v < "x" then "" else if v `elem` val then "QFilePathValid" ++ show p else "QFilePath" + ctor v | v < "x" = "" + | v `elem` val = "QFilePathValid" ++ show p + | otherwise = "QFilePath" parseTest _ = [] @@ -80,7 +82,7 @@ renderTest Test{..} = (body, code) qualify :: PW -> String -> String qualify pw str - | str `elem` fpops || (all isAlpha str && length str > 1 && not (str `elem` prelude)) = show pw ++ "." ++ str + | str `elem` fpops || (all isAlpha str && length str > 1 && str `notElem` prelude) = show pw ++ "." ++ str | otherwise = str where prelude = ["elem","uncurry","snd","fst","not","null","if","then","else" From git at git.haskell.org Thu Sep 13 14:50:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:46 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Add a .hlint.yaml file (d51bebe) Message-ID: <20180913145046.BB23A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/d51bebe1525be99d5da21ea455e164c61874a407 >--------------------------------------------------------------- commit d51bebe1525be99d5da21ea455e164c61874a407 Author: Neil Mitchell Date: Tue May 2 16:56:23 2017 +0100 Add a .hlint.yaml file >--------------------------------------------------------------- d51bebe1525be99d5da21ea455e164c61874a407 .hlint.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.hlint.yaml b/.hlint.yaml new file mode 100644 index 0000000..4d77db2 --- /dev/null +++ b/.hlint.yaml @@ -0,0 +1,9 @@ +# HLint configuration file +# https://github.com/ndmitchell/hlint +########################## + +# Use fmap instead of <$> to make cross-version compatibility easier +- ignore: {name: "Use <$>"} + +# We use [Char] because sometimes we really are talking about a set of Char. +- ignore: {name: "Use String"} From git at git.haskell.org Thu Sep 13 14:50:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:48 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Update the Travis file (41868a8) Message-ID: <20180913145048.C15AF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/41868a8061050a8819af17fb8dfe9b02f4898f83 >--------------------------------------------------------------- commit 41868a8061050a8819af17fb8dfe9b02f4898f83 Author: Neil Mitchell Date: Wed May 10 12:51:15 2017 +0100 Update the Travis file >--------------------------------------------------------------- 41868a8061050a8819af17fb8dfe9b02f4898f83 .travis.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 02bdaf0..463dcd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,15 @@ +sudo: required env: - - GHCVER=7.4.2 - - GHCVER=7.6.3 - - GHCVER=7.8.4 - - GHCVER=7.10.3 - - GHCVER=8.0.2 - - GHCVER=head +- GHCVER=7.4.2 +- GHCVER=7.6.3 +- GHCVER=7.8.4 +- GHCVER=7.10.3 +- GHCVER=8.0.2 +- GHCVER=head matrix: allow_failures: - - env: GHCVER=head + - env: GHCVER=head script: - - wget https://raw.github.com/ndmitchell/neil/master/travis.sh -O - --no-check-certificate --quiet | sh +- wget https://raw.github.com/ndmitchell/neil/master/travis.sh -O - --quiet | sh From git at git.haskell.org Thu Sep 13 14:50:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:50 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Now works with GHC HEAD (a79843b) Message-ID: <20180913145050.C6F6F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/a79843b446214122f9af526ad898cf5d6ad22f6c >--------------------------------------------------------------- commit a79843b446214122f9af526ad898cf5d6ad22f6c Author: Neil Mitchell Date: Wed May 10 12:51:55 2017 +0100 Now works with GHC HEAD >--------------------------------------------------------------- a79843b446214122f9af526ad898cf5d6ad22f6c .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 463dcd1..79a086a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,5 @@ env: - GHCVER=8.0.2 - GHCVER=head -matrix: - allow_failures: - - env: GHCVER=head - script: - wget https://raw.github.com/ndmitchell/neil/master/travis.sh -O - --quiet | sh From git at git.haskell.org Thu Sep 13 14:50:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:52 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Try testing with GHC 8.2 (04ce6bc) Message-ID: <20180913145052.CD9203A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/04ce6bc0844e34b487718d3246c6424984bd734d >--------------------------------------------------------------- commit 04ce6bc0844e34b487718d3246c6424984bd734d Author: Neil Mitchell Date: Wed May 10 12:52:10 2017 +0100 Try testing with GHC 8.2 >--------------------------------------------------------------- 04ce6bc0844e34b487718d3246c6424984bd734d .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 79a086a..e972be0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ env: - GHCVER=7.8.4 - GHCVER=7.10.3 - GHCVER=8.0.2 +- GHCVER=8.2.1 - GHCVER=head script: From git at git.haskell.org Thu Sep 13 14:50:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:54 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Update to use curl to fetch the initial script (7f407ea) Message-ID: <20180913145054.D3A333A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/7f407ea06140cff86d766499a894a6abc2fdf8b9 >--------------------------------------------------------------- commit 7f407ea06140cff86d766499a894a6abc2fdf8b9 Author: Neil Mitchell Date: Wed May 10 22:22:09 2017 +0100 Update to use curl to fetch the initial script >--------------------------------------------------------------- 7f407ea06140cff86d766499a894a6abc2fdf8b9 .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e972be0..a91d3ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ env: - GHCVER=head script: -- wget https://raw.github.com/ndmitchell/neil/master/travis.sh -O - --quiet | sh +- curl -sL https://raw.github.com/ndmitchell/neil/master/travis.sh | sh From git at git.haskell.org Thu Sep 13 14:50:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:56 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Update appveyor.yml (eb4e429) Message-ID: <20180913145056.D9F503A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/eb4e4296b5453419cfd861a6e6a7d943b3b81a25 >--------------------------------------------------------------- commit eb4e4296b5453419cfd861a6e6a7d943b3b81a25 Author: Neil Mitchell Date: Sat May 27 13:31:53 2017 +0100 Update appveyor.yml >--------------------------------------------------------------- eb4e4296b5453419cfd861a6e6a7d943b3b81a25 appveyor.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7108552..e2422e6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,20 +1,6 @@ -cache: -- "c:\\sr -> appveyor.yml" # stack root, short paths == less problems - build: off - -before_test: -- set PATH=C:\Program Files\Git\mingw64\bin;%PATH% # for curl -- curl -ostack.zip -L --insecure http://www.stackage.org/stack/windows-i386 -- 7z x stack.zip stack.exe - -clone_folder: "c:\\project" -environment: - global: - STACK_ROOT: "c:\\sr" +cache: "c:\\sr -> appveyor.yml" test_script: -- stack init -- stack setup > nul -- echo "" | stack --no-terminal build +- ps: Invoke-Expression (Invoke-WebRequest 'https://raw.githubusercontent.com/ndmitchell/neil/master/appveyor.ps1') - stack runghc Generate.hs From git at git.haskell.org Thu Sep 13 14:50:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:50:58 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Allow QuickCheck 2.10 (8c5e11c) Message-ID: <20180913145058.E02B43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/8c5e11ca9094fa2649020b9483786e952734f198 >--------------------------------------------------------------- commit 8c5e11ca9094fa2649020b9483786e952734f198 Author: Neil Mitchell Date: Sun Jun 18 22:15:31 2017 +0100 Allow QuickCheck 2.10 >--------------------------------------------------------------- 8c5e11ca9094fa2649020b9483786e952734f198 filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index 93d6405..a47635b 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -64,4 +64,4 @@ test-suite filepath-tests build-depends: filepath, base, - QuickCheck >= 2.7 && < 2.10 + QuickCheck >= 2.7 && < 2.11 From git at git.haskell.org Thu Sep 13 14:51:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:00 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Add that I test on GHC 8.2 (ae0be14) Message-ID: <20180913145100.E56D93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/ae0be14d2e1559564b07e3620e315fb83009c502 >--------------------------------------------------------------- commit ae0be14d2e1559564b07e3620e315fb83009c502 Author: Neil Mitchell Date: Tue Aug 1 16:11:12 2017 +0100 Add that I test on GHC 8.2 >--------------------------------------------------------------- ae0be14d2e1559564b07e3620e315fb83009c502 filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index a47635b..443a759 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -12,7 +12,7 @@ homepage: https://github.com/haskell/filepath#readme category: System build-type: Simple synopsis: Library for manipulating FilePaths in a cross platform way. -tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: . From git at git.haskell.org Thu Sep 13 14:51:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:02 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: The long lost cousin of takeExtension has found its way home (64f23c5) Message-ID: <20180913145102.EEBE83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/64f23c5a5b8518bc8517f80b46e0d0b20de1b96d >--------------------------------------------------------------- commit 64f23c5a5b8518bc8517f80b46e0d0b20de1b96d Author: Jonatan H Sundqvist Date: Tue Aug 15 08:45:09 2017 +0200 The long lost cousin of takeExtension has found its way home >--------------------------------------------------------------- 64f23c5a5b8518bc8517f80b46e0d0b20de1b96d System/FilePath/Internal.hs | 11 ++++++++++- tests/TestGen.hs | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs index 4a376b3..1ad7e31 100644 --- a/System/FilePath/Internal.hs +++ b/System/FilePath/Internal.hs @@ -75,7 +75,7 @@ module System.FilePath.MODULE_NAME -- * Extension functions splitExtension, takeExtension, replaceExtension, (-<.>), dropExtension, addExtension, hasExtension, (<.>), - splitExtensions, dropExtensions, takeExtensions, replaceExtensions, + splitExtensions, dropExtensions, takeExtensions, replaceExtensions, isExtensionOf, stripExtension, -- * Filename\/directory functions @@ -313,6 +313,15 @@ hasExtension :: FilePath -> Bool hasExtension = any isExtSeparator . takeFileName +-- | Is the given string the final extension of the filename? +-- The extension should not include the separator. +-- +-- > "png" `isExtensionOf` "/directory/file.png" == True +-- > "png" `isExtensionOf` "/directory/file.png.jpg" == False +-- > "csv" `isExtensionOf` "/directory/data.csv" == True +isExtensionOf :: String -> FilePath -> Bool +isExtensionOf ext = (== ext) . drop 1 . takeExtension + -- | Drop the given extension from a FilePath, and the @\".\"@ preceding it. -- Returns 'Nothing' if the FilePath does not have the given extension, or -- 'Just' and the part before the extension if it does. diff --git a/tests/TestGen.hs b/tests/TestGen.hs index 7bc914e..cdff89c 100755 --- a/tests/TestGen.hs +++ b/tests/TestGen.hs @@ -106,6 +106,12 @@ tests = ,("W.hasExtension \"/directory/path.ext\" == True", property $ W.hasExtension "/directory/path.ext" == True) ,("P.hasExtension \"/directory/path\" == False", property $ P.hasExtension "/directory/path" == False) ,("W.hasExtension \"/directory/path\" == False", property $ W.hasExtension "/directory/path" == False) + ,("W.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) + ,("P.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ P.isExtensionOf "png" "/directory/file.png" == True) + ,("W.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) + ,("P.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ P.isExtensionOf "png" "/directory/file.png.jpg" == False) + ,("W.isExtensionOf \"csv\" \"/directory/data.csv\" == True", property $ W.isExtensionOf "csv" "/directory/data.csv" == True) + ,("P.isExtensionOf \"csv\" \"/directory/data.csv\" == True", property $ P.isExtensionOf "csv" "/directory/data.csv" == True) ,("null (P.takeExtension x) == not (P.hasExtension x)", property $ \(QFilePath x) -> null (P.takeExtension x) == not (P.hasExtension x)) ,("null (W.takeExtension x) == not (W.hasExtension x)", property $ \(QFilePath x) -> null (W.takeExtension x) == not (W.hasExtension x)) ,("P.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ P.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x") From git at git.haskell.org Thu Sep 13 14:51:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:05 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: createDirectoryIfMissing moved to System.Directory (c6d5fff) Message-ID: <20180913145105.202F53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/c6d5fffb6df754efd53f900e2fd8f4a0d1878a2a >--------------------------------------------------------------- commit c6d5fffb6df754efd53f900e2fd8f4a0d1878a2a Author: Simon Hafner Date: Wed Aug 16 21:31:04 2017 +0200 createDirectoryIfMissing moved to System.Directory >--------------------------------------------------------------- c6d5fffb6df754efd53f900e2fd8f4a0d1878a2a System/FilePath/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs index 4a376b3..ace87cc 100644 --- a/System/FilePath/Internal.hs +++ b/System/FilePath/Internal.hs @@ -53,7 +53,7 @@ -- /Example 2:/ Download a file from @url@ and save it to disk: -- -- @do let file = 'makeValid' url --- System.IO.createDirectoryIfMissing True ('takeDirectory' file)@ +-- System.Directory.createDirectoryIfMissing True ('takeDirectory' file)@ -- -- /Example 3:/ Compile a Haskell file, putting the @.hi@ file under @interface@: -- From git at git.haskell.org Thu Sep 13 14:51:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:07 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Merge pull request #62 from reactormonk/master (b67ec85) Message-ID: <20180913145107.2353C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/b67ec8514cd93a9407346bcb9de1f2155e3a9c82 >--------------------------------------------------------------- commit b67ec8514cd93a9407346bcb9de1f2155e3a9c82 Merge: ae0be14 c6d5fff Author: Neil Mitchell Date: Wed Aug 16 22:11:18 2017 +0100 Merge pull request #62 from reactormonk/master createDirectoryIfMissing moved to System.Directory >--------------------------------------------------------------- b67ec8514cd93a9407346bcb9de1f2155e3a9c82 System/FilePath/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Thu Sep 13 14:51:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:09 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Amended isExtensionOf and its haddock, updated tests (f7b03a6) Message-ID: <20180913145109.2B1683A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/f7b03a6fe168da2d57f9282898f3de375431e854 >--------------------------------------------------------------- commit f7b03a6fe168da2d57f9282898f3de375431e854 Author: Jonatan H Sundqvist Date: Fri Aug 18 19:08:07 2017 +0200 Amended isExtensionOf and its haddock, updated tests >--------------------------------------------------------------- f7b03a6fe168da2d57f9282898f3de375431e854 System/FilePath/Internal.hs | 26 ++++++++++++++++++++------ tests/TestGen.hs | 20 ++++++++++++++------ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs index 1ad7e31..8840555 100644 --- a/System/FilePath/Internal.hs +++ b/System/FilePath/Internal.hs @@ -105,7 +105,7 @@ module System.FilePath.MODULE_NAME import Data.Char(toLower, toUpper, isAsciiLower, isAsciiUpper) import Data.Maybe(isJust) -import Data.List(stripPrefix) +import Data.List(stripPrefix, isSuffixOf) import System.Environment(getEnv) @@ -313,14 +313,28 @@ hasExtension :: FilePath -> Bool hasExtension = any isExtSeparator . takeFileName --- | Is the given string the final extension of the filename? --- The extension should not include the separator. +-- | Does the given filename have the specified extension? -- --- > "png" `isExtensionOf` "/directory/file.png" == True +-- The extension may exclude the separator +-- > "png" `isExtensionOf` "/directory/file.png" == True +-- +-- And it may include it +-- > ".png" `isExtensionOf` "/directory/file.png" == True +-- +-- Multiple extensions are allowed +-- > ".tar.gz" `isExtensionOf` "bar/foo.tar.gz" == True +-- +-- But partial matches are not +-- > "ar.gz" `isExtensionOf` "bar/foo.tar.gz" == False +-- +-- Extensions are matched from the end, so the following yields @False@ -- > "png" `isExtensionOf` "/directory/file.png.jpg" == False --- > "csv" `isExtensionOf` "/directory/data.csv" == True + +-- The argument cannot simply be a suffix, it has to be to a valid extension +-- > "csv/table.csv" `isExtensionOf` "/data/csv/table.csv" == False isExtensionOf :: String -> FilePath -> Bool -isExtensionOf ext = (== ext) . drop 1 . takeExtension +isExtensionOf ext@('.':_) = isSuffixOf ext . takeExtensions +isExtensionOf ext = isSuffixOf ('.':ext) . takeExtensions -- | Drop the given extension from a FilePath, and the @\".\"@ preceding it. -- Returns 'Nothing' if the FilePath does not have the given extension, or diff --git a/tests/TestGen.hs b/tests/TestGen.hs index cdff89c..7342871 100755 --- a/tests/TestGen.hs +++ b/tests/TestGen.hs @@ -106,12 +106,20 @@ tests = ,("W.hasExtension \"/directory/path.ext\" == True", property $ W.hasExtension "/directory/path.ext" == True) ,("P.hasExtension \"/directory/path\" == False", property $ P.hasExtension "/directory/path" == False) ,("W.hasExtension \"/directory/path\" == False", property $ W.hasExtension "/directory/path" == False) - ,("W.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) - ,("P.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ P.isExtensionOf "png" "/directory/file.png" == True) - ,("W.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) - ,("P.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ P.isExtensionOf "png" "/directory/file.png.jpg" == False) - ,("W.isExtensionOf \"csv\" \"/directory/data.csv\" == True", property $ W.isExtensionOf "csv" "/directory/data.csv" == True) - ,("P.isExtensionOf \"csv\" \"/directory/data.csv\" == True", property $ P.isExtensionOf "csv" "/directory/data.csv" == True) + + ,("W.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) + ,("P.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) + ,("W.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True) + ,("P.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True) + ,("W.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True) + ,("P.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True) + ,("W.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False) + ,("P.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False) + ,("W.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) + ,("P.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) + ,("W.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False) + ,("P.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False) + ,("null (P.takeExtension x) == not (P.hasExtension x)", property $ \(QFilePath x) -> null (P.takeExtension x) == not (P.hasExtension x)) ,("null (W.takeExtension x) == not (W.hasExtension x)", property $ \(QFilePath x) -> null (W.takeExtension x) == not (W.hasExtension x)) ,("P.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ P.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x") From git at git.haskell.org Thu Sep 13 14:51:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:11 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Removed manual tests and haddock explanations (2145c08) Message-ID: <20180913145111.321D73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/2145c082222435c73d432ed1ff5f3ef86465d013 >--------------------------------------------------------------- commit 2145c082222435c73d432ed1ff5f3ef86465d013 Author: Jonatan H Sundqvist Date: Fri Aug 18 22:12:10 2017 +0200 Removed manual tests and haddock explanations >--------------------------------------------------------------- 2145c082222435c73d432ed1ff5f3ef86465d013 System/FilePath/Internal.hs | 11 ----------- tests/TestGen.hs | 14 -------------- 2 files changed, 25 deletions(-) diff --git a/System/FilePath/Internal.hs b/System/FilePath/Internal.hs index 8840555..12f1fb4 100644 --- a/System/FilePath/Internal.hs +++ b/System/FilePath/Internal.hs @@ -315,22 +315,11 @@ hasExtension = any isExtSeparator . takeFileName -- | Does the given filename have the specified extension? -- --- The extension may exclude the separator -- > "png" `isExtensionOf` "/directory/file.png" == True --- --- And it may include it -- > ".png" `isExtensionOf` "/directory/file.png" == True --- --- Multiple extensions are allowed -- > ".tar.gz" `isExtensionOf` "bar/foo.tar.gz" == True --- --- But partial matches are not -- > "ar.gz" `isExtensionOf` "bar/foo.tar.gz" == False --- --- Extensions are matched from the end, so the following yields @False@ -- > "png" `isExtensionOf` "/directory/file.png.jpg" == False - --- The argument cannot simply be a suffix, it has to be to a valid extension -- > "csv/table.csv" `isExtensionOf` "/data/csv/table.csv" == False isExtensionOf :: String -> FilePath -> Bool isExtensionOf ext@('.':_) = isSuffixOf ext . takeExtensions diff --git a/tests/TestGen.hs b/tests/TestGen.hs index 7342871..7bc914e 100755 --- a/tests/TestGen.hs +++ b/tests/TestGen.hs @@ -106,20 +106,6 @@ tests = ,("W.hasExtension \"/directory/path.ext\" == True", property $ W.hasExtension "/directory/path.ext" == True) ,("P.hasExtension \"/directory/path\" == False", property $ P.hasExtension "/directory/path" == False) ,("W.hasExtension \"/directory/path\" == False", property $ W.hasExtension "/directory/path" == False) - - ,("W.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) - ,("P.isExtensionOf \"png\" \"/directory/file.png\" == True", property $ W.isExtensionOf "png" "/directory/file.png" == True) - ,("W.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True) - ,("P.isExtensionOf \".png\" \"/directory/file.png\" == True", property $ W.isExtensionOf ".png" "/directory/file.png" == True) - ,("W.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True) - ,("P.isExtensionOf \".tar.gz\" \"bar/foo.tar.gz\" == True", property $ W.isExtensionOf ".tar.gz" "bar/foo.tar.gz" == True) - ,("W.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False) - ,("P.isExtensionOf \"ar.gz\" \"bar/foo.tar.gz\" == False", property $ W.isExtensionOf "ar.gz" "bar/foo.tar.gz" == False) - ,("W.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) - ,("P.isExtensionOf \"png\" \"/directory/file.png.jpg\" == False", property $ W.isExtensionOf "png" "/directory/file.png.jpg" == False) - ,("W.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False) - ,("P.isExtensionOf \"csv/table.csv\" \"/data/csv/table.csv\" == False", property $ W.isExtensionOf "csv/table.csv" "/data/csv/table.csv" == False) - ,("null (P.takeExtension x) == not (P.hasExtension x)", property $ \(QFilePath x) -> null (P.takeExtension x) == not (P.hasExtension x)) ,("null (W.takeExtension x) == not (W.hasExtension x)", property $ \(QFilePath x) -> null (W.takeExtension x) == not (W.hasExtension x)) ,("P.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ P.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x") From git at git.haskell.org Thu Sep 13 14:51:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:13 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Merge pull request #61 from SwiftsNamesake/master (1230614) Message-ID: <20180913145113.3967C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/1230614e6138f9d86ebd7dcfc8de2366733cd4b1 >--------------------------------------------------------------- commit 1230614e6138f9d86ebd7dcfc8de2366733cd4b1 Merge: b67ec85 2145c08 Author: Neil Mitchell Date: Sat Aug 19 08:34:29 2017 +0100 Merge pull request #61 from SwiftsNamesake/master The long lost cousin of takeExtension has found its way home >--------------------------------------------------------------- 1230614e6138f9d86ebd7dcfc8de2366733cd4b1 System/FilePath/Internal.hs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) From git at git.haskell.org Thu Sep 13 14:51:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:15 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: #61, add the generated tests (014cc3d) Message-ID: <20180913145115.535C03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/014cc3df0cd19c1935bcf5e94667faa7544f3087 >--------------------------------------------------------------- commit 014cc3df0cd19c1935bcf5e94667faa7544f3087 Author: Neil Mitchell Date: Sat Aug 19 08:38:24 2017 +0100 #61, add the generated tests >--------------------------------------------------------------- 014cc3df0cd19c1935bcf5e94667faa7544f3087 tests/TestGen.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/TestGen.hs b/tests/TestGen.hs index 7bc914e..0d78ac0 100755 --- a/tests/TestGen.hs +++ b/tests/TestGen.hs @@ -108,6 +108,18 @@ tests = ,("W.hasExtension \"/directory/path\" == False", property $ W.hasExtension "/directory/path" == False) ,("null (P.takeExtension x) == not (P.hasExtension x)", property $ \(QFilePath x) -> null (P.takeExtension x) == not (P.hasExtension x)) ,("null (W.takeExtension x) == not (W.hasExtension x)", property $ \(QFilePath x) -> null (W.takeExtension x) == not (W.hasExtension x)) + ,("\"png\" `P.isExtensionOf` \"/directory/file.png\" == True", property $ "png" `P.isExtensionOf` "/directory/file.png" == True) + ,("\"png\" `W.isExtensionOf` \"/directory/file.png\" == True", property $ "png" `W.isExtensionOf` "/directory/file.png" == True) + ,("\".png\" `P.isExtensionOf` \"/directory/file.png\" == True", property $ ".png" `P.isExtensionOf` "/directory/file.png" == True) + ,("\".png\" `W.isExtensionOf` \"/directory/file.png\" == True", property $ ".png" `W.isExtensionOf` "/directory/file.png" == True) + ,("\".tar.gz\" `P.isExtensionOf` \"bar/foo.tar.gz\" == True", property $ ".tar.gz" `P.isExtensionOf` "bar/foo.tar.gz" == True) + ,("\".tar.gz\" `W.isExtensionOf` \"bar/foo.tar.gz\" == True", property $ ".tar.gz" `W.isExtensionOf` "bar/foo.tar.gz" == True) + ,("\"ar.gz\" `P.isExtensionOf` \"bar/foo.tar.gz\" == False", property $ "ar.gz" `P.isExtensionOf` "bar/foo.tar.gz" == False) + ,("\"ar.gz\" `W.isExtensionOf` \"bar/foo.tar.gz\" == False", property $ "ar.gz" `W.isExtensionOf` "bar/foo.tar.gz" == False) + ,("\"png\" `P.isExtensionOf` \"/directory/file.png.jpg\" == False", property $ "png" `P.isExtensionOf` "/directory/file.png.jpg" == False) + ,("\"png\" `W.isExtensionOf` \"/directory/file.png.jpg\" == False", property $ "png" `W.isExtensionOf` "/directory/file.png.jpg" == False) + ,("\"csv/table.csv\" `P.isExtensionOf` \"/data/csv/table.csv\" == False", property $ "csv/table.csv" `P.isExtensionOf` "/data/csv/table.csv" == False) + ,("\"csv/table.csv\" `W.isExtensionOf` \"/data/csv/table.csv\" == False", property $ "csv/table.csv" `W.isExtensionOf` "/data/csv/table.csv" == False) ,("P.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ P.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x") ,("W.stripExtension \"hs.o\" \"foo.x.hs.o\" == Just \"foo.x\"", property $ W.stripExtension "hs.o" "foo.x.hs.o" == Just "foo.x") ,("P.stripExtension \"hi.o\" \"foo.x.hs.o\" == Nothing", property $ P.stripExtension "hi.o" "foo.x.hs.o" == Nothing) From git at git.haskell.org Thu Sep 13 14:51:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:17 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Add developer notes (ffa89a6) Message-ID: <20180913145117.5970F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/ffa89a641797dffcb1586d5ce1c01835c0f6a441 >--------------------------------------------------------------- commit ffa89a641797dffcb1586d5ce1c01835c0f6a441 Author: Neil Mitchell Date: Sat Aug 19 22:45:15 2017 +0100 Add developer notes >--------------------------------------------------------------- ffa89a641797dffcb1586d5ce1c01835c0f6a441 README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index f059998..0b1c442 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,17 @@ The answer for this library is "no". While an abstract `FilePath` has some advan * Often it is useful to represent invalid files, e.g. `/foo/*.txt` probably isn't an actual file, but a glob pattern. Other programs use `foo//bar` for globs, which is definitely not a file, but might want to be stored as a `FilePath`. * Some programs use syntactic non-semantic details of the `FilePath` to change their behaviour. For example, `foo`, `foo/` and `foo/.` are all similar, and refer to the same location on disk, but may behave differently when passed to command-line tools. * A useful step to introducing an abstract `FilePath` is to reduce the amount of manipulating `FilePath` values like lists. This library hopes to help in that effort. + +### Developer notes + +Most of the code is in `System/FilePath/Internal.hs` which is `#include`'d into both `System/FilePath/Posix.hs` and `System/FilePath/Windows.hs` with the `IS_WINDOWS` CPP define set to either `True` or `False`. This Internal module is a bit weird in that it isn't really a Haskell module, but is more an include file. + +The library has extensive doc tests. Anything starting with `-- >` is transformed into a doc test as a predicate that must evaluate to `True`. These tests follow a few rules: + +* Tests prefixed with `Windows:` or `Posix:` are only tested against that specific implementation - otherwise tests are run against both implementations. +* Any single letter variable, e.g. `x`, is considered universal quantification, and is checked with `QuickCheck`. +* If `Valid x =>` appears at the start of a doc test, that means the property will only be tested with `x` passing the `isValid` predicate. + +The tests can be generated by `Generate.hs` in the root of the repo, and will be placed in `tests/TestGen.hs`. The `TestGen.hs` file is checked into the repo, and the CI scripts check that `TestGen.hs` is in sync with what would be generated a fresh - if you don't regenerate `TestGen.hs` the CI will fail. + +The `.ghci` file is set up to allow you to type `ghci` to open the library, then `:go` will regenerate the tests and run them. From git at git.haskell.org Thu Sep 13 14:51:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:19 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: #61, add changelog and version bumps (3d4e69f) Message-ID: <20180913145119.5F4933A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/3d4e69fa398951d2ce1eb836adde1966f48a14f8 >--------------------------------------------------------------- commit 3d4e69fa398951d2ce1eb836adde1966f48a14f8 Author: Neil Mitchell Date: Sat Aug 19 22:47:47 2017 +0100 #61, add changelog and version bumps >--------------------------------------------------------------- 3d4e69fa398951d2ce1eb836adde1966f48a14f8 changelog.md | 4 ++++ filepath.cabal | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index edecd17..97f3955 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._ +## Unreleased + + * Add `isExtensionOf` function. + ## 1.4.1.2 *Feb 2017* * Bundled with GHC 8.2.1 diff --git a/filepath.cabal b/filepath.cabal index 443a759..e724cde 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -1,6 +1,6 @@ cabal-version: >= 1.18 name: filepath -version: 1.4.1.2 +version: 1.4.2 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Thu Sep 13 14:51:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:21 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Bump upper bound on base (9c64a63) Message-ID: <20180913145121.648603A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/9c64a634c144392f36cdad5c8c067824093a64d6 >--------------------------------------------------------------- commit 9c64a634c144392f36cdad5c8c067824093a64d6 Author: Ben Gamari Date: Fri Sep 15 12:10:09 2017 -0400 Bump upper bound on base >--------------------------------------------------------------- 9c64a634c144392f36cdad5c8c067824093a64d6 filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index a47635b..436880d 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -48,7 +48,7 @@ library System.FilePath.Windows build-depends: - base >= 4 && < 4.11 + base >= 4 && < 4.12 ghc-options: -Wall From git at git.haskell.org Thu Sep 13 14:51:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:23 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Merge pull request #64 from bgamari/master (664ee5c) Message-ID: <20180913145123.6ACD83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/664ee5cc9d4501dc8fc18b34fe646dd3f8cd287b >--------------------------------------------------------------- commit 664ee5cc9d4501dc8fc18b34fe646dd3f8cd287b Merge: 3d4e69f 9c64a63 Author: Neil Mitchell Date: Sat Sep 16 09:42:03 2017 +0100 Merge pull request #64 from bgamari/master Bump base upper bound >--------------------------------------------------------------- 664ee5cc9d4501dc8fc18b34fe646dd3f8cd287b filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Thu Sep 13 14:51:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:25 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Add extra .ghci warning (7bc0be8) Message-ID: <20180913145125.705103A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/7bc0be8b39436645e752091c1ca3d3c9a3f18b5b >--------------------------------------------------------------- commit 7bc0be8b39436645e752091c1ca3d3c9a3f18b5b Author: Neil Mitchell Date: Sun Nov 26 21:18:32 2017 +0000 Add extra .ghci warning >--------------------------------------------------------------- 7bc0be8b39436645e752091c1ca3d3c9a3f18b5b .ghci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ghci b/.ghci index 6e8b1b3..04cd2bf 100644 --- a/.ghci +++ b/.ghci @@ -1,4 +1,4 @@ -:set -fwarn-unused-binds -fwarn-unused-imports +:set -fwarn-unused-binds -fwarn-unused-imports -fwarn-orphans :set -isrc -itests :load System.FilePath System.FilePath.Windows System.FilePath.Posix Generate Test import qualified System.FilePath.Windows as W From git at git.haskell.org Thu Sep 13 14:51:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:27 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Test with 8.4.1 (5783c84) Message-ID: <20180913145127.75A263A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/5783c84f411693ff936cc1756f8f4d443ae074fc >--------------------------------------------------------------- commit 5783c84f411693ff936cc1756f8f4d443ae074fc Author: Neil Mitchell Date: Sun Dec 24 17:58:26 2017 +0000 Test with 8.4.1 >--------------------------------------------------------------- 5783c84f411693ff936cc1756f8f4d443ae074fc .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a91d3ff..fc68675 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - GHCVER=7.10.3 - GHCVER=8.0.2 - GHCVER=8.2.1 +- GHCVER=8.4.1 - GHCVER=head script: From git at git.haskell.org Thu Sep 13 14:51:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:29 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: GHC 8.2.2 (5c4c3e2) Message-ID: <20180913145129.7C01F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/5c4c3e2c18b123f76289f03aba1cb10a68ad87e3 >--------------------------------------------------------------- commit 5c4c3e2c18b123f76289f03aba1cb10a68ad87e3 Author: Neil Mitchell Date: Sun Jan 21 16:04:47 2018 +0000 GHC 8.2.2 >--------------------------------------------------------------- 5c4c3e2c18b123f76289f03aba1cb10a68ad87e3 .travis.yml | 2 +- filepath.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc68675..8931df5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: - GHCVER=7.8.4 - GHCVER=7.10.3 - GHCVER=8.0.2 -- GHCVER=8.2.1 +- GHCVER=8.2.2 - GHCVER=8.4.1 - GHCVER=head diff --git a/filepath.cabal b/filepath.cabal index 1c8cd14..6439a7d 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -12,7 +12,7 @@ homepage: https://github.com/haskell/filepath#readme category: System build-type: Simple synopsis: Library for manipulating FilePaths in a cross platform way. -tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: . From git at git.haskell.org Thu Sep 13 14:51:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:31 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Allow QuickCheck 2.12 (dbdb9ca) Message-ID: <20180913145131.8231F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/dbdb9caae30b57940ac16225923024e7172ab277 >--------------------------------------------------------------- commit dbdb9caae30b57940ac16225923024e7172ab277 Author: Neil Mitchell Date: Sun Jan 21 16:04:59 2018 +0000 Allow QuickCheck 2.12 >--------------------------------------------------------------- dbdb9caae30b57940ac16225923024e7172ab277 filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index 6439a7d..90fda73 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -64,4 +64,4 @@ test-suite filepath-tests build-depends: filepath, base, - QuickCheck >= 2.7 && < 2.11 + QuickCheck >= 2.7 && < 2.12 From git at git.haskell.org Thu Sep 13 14:51:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:33 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Copyright year to 2018 (3bba75c) Message-ID: <20180913145133.87E5B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/3bba75c2968af8c07673b2c939eaed51690b1af3 >--------------------------------------------------------------- commit 3bba75c2968af8c07673b2c939eaed51690b1af3 Author: Neil Mitchell Date: Sun Jan 21 16:06:41 2018 +0000 Copyright year to 2018 >--------------------------------------------------------------- 3bba75c2968af8c07673b2c939eaed51690b1af3 LICENSE | 2 +- filepath.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index e385554..6b4cfee 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright Neil Mitchell 2005-2017. +Copyright Neil Mitchell 2005-2018. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/filepath.cabal b/filepath.cabal index 90fda73..21527c4 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -6,7 +6,7 @@ license: BSD3 license-file: LICENSE author: Neil Mitchell maintainer: Neil Mitchell -copyright: Neil Mitchell 2005-2017 +copyright: Neil Mitchell 2005-2018 bug-reports: https://github.com/haskell/filepath/issues homepage: https://github.com/haskell/filepath#readme category: System From git at git.haskell.org Thu Sep 13 14:51:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:35 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Remove note on allowing new QuickCheck - it happens regularly (upper bounds, useful for increasing your commit count) (bf34b2e) Message-ID: <20180913145135.8E2C13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/bf34b2eb73c1229b211fb48508ca8eea2999e3ca >--------------------------------------------------------------- commit bf34b2eb73c1229b211fb48508ca8eea2999e3ca Author: Neil Mitchell Date: Mon Jan 22 20:53:50 2018 +0000 Remove note on allowing new QuickCheck - it happens regularly (upper bounds, useful for increasing your commit count) >--------------------------------------------------------------- bf34b2eb73c1229b211fb48508ca8eea2999e3ca changelog.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/changelog.md b/changelog.md index 97f3955..1d683ac 100644 --- a/changelog.md +++ b/changelog.md @@ -16,8 +16,6 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backsl * Documentation improvements - * Allow QuickCheck-2.9 - ## 1.4.1.0 *Dec 2015* * Bundled with GHC 8.0.1 From git at git.haskell.org Thu Sep 13 14:51:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:37 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Update the changelog (0991bf3) Message-ID: <20180913145137.93DBC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/0991bf392dbd56b5db9f155ee64fb122ca55017c >--------------------------------------------------------------- commit 0991bf392dbd56b5db9f155ee64fb122ca55017c Author: Neil Mitchell Date: Mon Jan 22 20:54:35 2018 +0000 Update the changelog >--------------------------------------------------------------- 0991bf392dbd56b5db9f155ee64fb122ca55017c changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 1d683ac..398bc77 100644 --- a/changelog.md +++ b/changelog.md @@ -2,7 +2,9 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._ -## Unreleased +## 1.4.2 *Jan 2018* + + * Bundled with GHC 8.4.1 * Add `isExtensionOf` function. From git at git.haskell.org Thu Sep 13 14:51:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:39 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Add 8.4.1 to the tested example (cd941fb) Message-ID: <20180913145139.A05403A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/cd941fb62fae2f8e43dffa01fc44d9fd3f778a5f >--------------------------------------------------------------- commit cd941fb62fae2f8e43dffa01fc44d9fd3f778a5f Author: Neil Mitchell Date: Fri Mar 16 14:24:44 2018 +0000 Add 8.4.1 to the tested example >--------------------------------------------------------------- cd941fb62fae2f8e43dffa01fc44d9fd3f778a5f filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index 21527c4..a4610dd 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -12,7 +12,7 @@ homepage: https://github.com/haskell/filepath#readme category: System build-type: Simple synopsis: Library for manipulating FilePaths in a cross platform way. -tested-with: GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: . From git at git.haskell.org Thu Sep 13 14:51:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:41 +0000 (UTC) Subject: [commit: packages/filepath] RyanGlScott-patch-1, master: Bump upper bound on base to < 4.13 (4e42eb3) Message-ID: <20180913145141.A61E63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branches: RyanGlScott-patch-1,master Link : http://git.haskell.org/packages/filepath.git/commitdiff/4e42eb37222aa0047a2a1338353bd70b76e55c1f >--------------------------------------------------------------- commit 4e42eb37222aa0047a2a1338353bd70b76e55c1f Author: Ryan Scott Date: Tue Apr 10 07:36:45 2018 -0400 Bump upper bound on base to < 4.13 See https://ghc.haskell.org/trac/ghc/ticket/15018. >--------------------------------------------------------------- 4e42eb37222aa0047a2a1338353bd70b76e55c1f filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index a4610dd..084053f 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -48,7 +48,7 @@ library System.FilePath.Windows build-depends: - base >= 4 && < 4.12 + base >= 4 && < 4.13 ghc-options: -Wall From git at git.haskell.org Thu Sep 13 14:51:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:43 +0000 (UTC) Subject: [commit: packages/filepath] master: Merge pull request #67 from haskell/RyanGlScott-patch-1 (1be834e) Message-ID: <20180913145143.AC5F33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/1be834e1b3a3f8c5a14a58d73ce30133b4c69679 >--------------------------------------------------------------- commit 1be834e1b3a3f8c5a14a58d73ce30133b4c69679 Merge: cd941fb 4e42eb3 Author: Neil Mitchell Date: Tue Apr 10 12:37:42 2018 +0100 Merge pull request #67 from haskell/RyanGlScott-patch-1 Bump upper bound on base to < 4.13 >--------------------------------------------------------------- 1be834e1b3a3f8c5a14a58d73ce30133b4c69679 filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Thu Sep 13 14:51:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:45 +0000 (UTC) Subject: [commit: packages/filepath] master: GHC version (3be9497) Message-ID: <20180913145145.B23A93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/3be9497b2d8eead4839fd5dc89541d0bc33923f5 >--------------------------------------------------------------- commit 3be9497b2d8eead4839fd5dc89541d0bc33923f5 Author: Neil Mitchell Date: Mon May 21 19:25:13 2018 +0100 GHC version >--------------------------------------------------------------- 3be9497b2d8eead4839fd5dc89541d0bc33923f5 .travis.yml | 2 +- filepath.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8931df5..af9288c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: - GHCVER=7.10.3 - GHCVER=8.0.2 - GHCVER=8.2.2 -- GHCVER=8.4.1 +- GHCVER=8.4.2 - GHCVER=head script: diff --git a/filepath.cabal b/filepath.cabal index a4610dd..87f8dd2 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -12,7 +12,7 @@ homepage: https://github.com/haskell/filepath#readme category: System build-type: Simple synopsis: Library for manipulating FilePaths in a cross platform way. -tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.4.2, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: . From git at git.haskell.org Thu Sep 13 14:51:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:47 +0000 (UTC) Subject: [commit: packages/filepath] master: Add .stack-work to gitignore (97e9aa0) Message-ID: <20180913145147.B80A13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/97e9aa0a6a466e8a8f7308c0484f6c7de0fc8915 >--------------------------------------------------------------- commit 97e9aa0a6a466e8a8f7308c0484f6c7de0fc8915 Author: Neil Mitchell Date: Mon May 21 19:25:34 2018 +0100 Add .stack-work to gitignore >--------------------------------------------------------------- 97e9aa0a6a466e8a8f7308c0484f6c7de0fc8915 .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 089a3e5..1f08f1c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ GNUmakefile dist-install/ dist/ ghc.mk +.stack-work/ From git at git.haskell.org Thu Sep 13 14:51:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:49 +0000 (UTC) Subject: [commit: packages/filepath] master: Fix the badges (9b63223) Message-ID: <20180913145149.BE0E13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/9b6322315e666f8d2da1bd0d6a757477338e91a1 >--------------------------------------------------------------- commit 9b6322315e666f8d2da1bd0d6a757477338e91a1 Author: Neil Mitchell Date: Mon May 21 19:25:39 2018 +0100 Fix the badges >--------------------------------------------------------------- 9b6322315e666f8d2da1bd0d6a757477338e91a1 README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b1c442..ea54613 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# FilePath [![Hackage version](https://img.shields.io/hackage/v/filepath.svg?label=Hackage)](https://hackage.haskell.org/package/filepath) [![Linux Build Status](https://img.shields.io/travis/haskell/filepath.svg?label=Linux%20build)](https://travis-ci.org/haskell/filepath) [![Windows Build Status](https://img.shields.io/appveyor/ci/ndmitchell/filepath.svg?label=Windows%20build)](https://ci.appveyor.com/project/ndmitchell/filepath) +# FilePath [![Hackage version](https://img.shields.io/hackage/v/filepath.svg?label=Hackage)](https://hackage.haskell.org/package/filepath) [![Linux Build Status](https://img.shields.io/travis/haskell/filepath/master.svg?label=Linux%20build)](https://travis-ci.org/haskell/filepath) [![Windows Build Status](https://img.shields.io/appveyor/ci/ndmitchell/filepath/master.svg?label=Windows%20build)](https://ci.appveyor.com/project/ndmitchell/filepath) The `filepath` package provides functionality for manipulating `FilePath` values, and is shipped with both [GHC](https://www.haskell.org/ghc/) and the [Haskell Platform](https://www.haskell.org/platform/). It provides three modules: From git at git.haskell.org Thu Sep 13 14:51:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:51 +0000 (UTC) Subject: [commit: packages/filepath] master: Merge branch 'master' of https://github.com/haskell/filepath (568ee85) Message-ID: <20180913145151.C40AD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/568ee85658b6da0502a2c6e772eb37f244aa697d >--------------------------------------------------------------- commit 568ee85658b6da0502a2c6e772eb37f244aa697d Merge: 9b63223 1be834e Author: Neil Mitchell Date: Mon May 21 19:25:55 2018 +0100 Merge branch 'master' of https://github.com/haskell/filepath >--------------------------------------------------------------- 568ee85658b6da0502a2c6e772eb37f244aa697d filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Thu Sep 13 14:51:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:53 +0000 (UTC) Subject: [commit: packages/filepath] master: GHC 8.4.3 tested-with (6c11507) Message-ID: <20180913145153.C9A383A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/6c11507fa7449d8d2ad1d0286d225bbe169b5816 >--------------------------------------------------------------- commit 6c11507fa7449d8d2ad1d0286d225bbe169b5816 Author: Neil Mitchell Date: Tue May 29 22:34:45 2018 +0100 GHC 8.4.3 tested-with >--------------------------------------------------------------- 6c11507fa7449d8d2ad1d0286d225bbe169b5816 .travis.yml | 2 +- filepath.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index af9288c..731e6e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: - GHCVER=7.10.3 - GHCVER=8.0.2 - GHCVER=8.2.2 -- GHCVER=8.4.2 +- GHCVER=8.4.3 - GHCVER=head script: diff --git a/filepath.cabal b/filepath.cabal index 95cf8f1..98d6f73 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -12,7 +12,7 @@ homepage: https://github.com/haskell/filepath#readme category: System build-type: Simple synopsis: Library for manipulating FilePaths in a cross platform way. -tested-with: GHC==8.4.2, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 +tested-with: GHC==8.4.3, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 description: This package provides functionality for manipulating @FilePath@ values, and is shipped with both and the . It provides three modules: . From git at git.haskell.org Thu Sep 13 14:51:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:55 +0000 (UTC) Subject: [commit: packages/filepath] master: Update .travis.yml (7c2def1) Message-ID: <20180913145155.CFF723A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/7c2def1974e126f8bff6f1c994a33cc945b53f0d >--------------------------------------------------------------- commit 7c2def1974e126f8bff6f1c994a33cc945b53f0d Author: Neil Mitchell Date: Sun Jul 1 18:09:43 2018 +0100 Update .travis.yml >--------------------------------------------------------------- 7c2def1974e126f8bff6f1c994a33cc945b53f0d .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 731e6e1..34ae866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ env: - GHCVER=8.0.2 - GHCVER=8.2.2 - GHCVER=8.4.3 +- GHCVER=8.6.1 - GHCVER=head script: From git at git.haskell.org Thu Sep 13 14:51:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:57 +0000 (UTC) Subject: [commit: packages/filepath] master: Version 1.4.2.1 (b10724b) Message-ID: <20180913145157.D623A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/b10724be8a907e191d153ad6674415be0c1325fd >--------------------------------------------------------------- commit b10724be8a907e191d153ad6674415be0c1325fd Author: Neil Mitchell Date: Sun Jul 15 22:42:07 2018 +0100 Version 1.4.2.1 >--------------------------------------------------------------- b10724be8a907e191d153ad6674415be0c1325fd changelog.md | 4 ++++ filepath.cabal | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 398bc77..0ef9259 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,10 @@ _Note: below all `FilePath` values are unquoted, so `\\` really means two backslashes._ +## 1.4.2.1 *Jul 2018* + + * Bundled with GHC 8.6.1 + ## 1.4.2 *Jan 2018* * Bundled with GHC 8.4.1 diff --git a/filepath.cabal b/filepath.cabal index 98d6f73..b35223c 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -1,6 +1,6 @@ cabal-version: >= 1.18 name: filepath -version: 1.4.2 +version: 1.4.2.1 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Thu Sep 13 14:51:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:51:59 +0000 (UTC) Subject: [commit: packages/filepath] master: Update .travis.yml (0dce5ba) Message-ID: <20180913145159.DB3B83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/0dce5ba657a0d3ff86251746efda3cc25c71a4f5 >--------------------------------------------------------------- commit 0dce5ba657a0d3ff86251746efda3cc25c71a4f5 Author: Neil Mitchell Date: Fri Aug 24 12:49:56 2018 +0100 Update .travis.yml >--------------------------------------------------------------- 0dce5ba657a0d3ff86251746efda3cc25c71a4f5 .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34ae866..07f53fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ env: - GHCVER=head script: -- curl -sL https://raw.github.com/ndmitchell/neil/master/travis.sh | sh +- curl -sSL https://raw.github.com/ndmitchell/neil/master/travis.sh | sh From git at git.haskell.org Thu Sep 13 14:52:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:52:01 +0000 (UTC) Subject: [commit: packages/filepath] master: Add pull request template (30d2de5) Message-ID: <20180913145201.E1D4B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/30d2de5a8c1ab5654d7020b25ab9eca9b17e2e4d >--------------------------------------------------------------- commit 30d2de5a8c1ab5654d7020b25ab9eca9b17e2e4d Author: Neil Mitchell Date: Mon Sep 3 00:25:17 2018 +0100 Add pull request template >--------------------------------------------------------------- 30d2de5a8c1ab5654d7020b25ab9eca9b17e2e4d PULL_REQUEST_TEMPLATE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fd079e3 --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +Thanks for the pull request! + +By raising this pull request you confirm you are licensing your contributions under the project license (see LICENSE) and that you have no patents covering your contribution. + +If you care, my PR preferences are at https://github.com/ndmitchell/neil#contributions, but they're all guidelines, and I'm not too fussy - you don't have to read them. From git at git.haskell.org Thu Sep 13 14:52:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:52:03 +0000 (UTC) Subject: [commit: packages/filepath] master: Allow QuickCheck 2.12 (efff50b) Message-ID: <20180913145203.E827E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/efff50b6eec676208c54b0f08b8056fc8723f0ea >--------------------------------------------------------------- commit efff50b6eec676208c54b0f08b8056fc8723f0ea Author: Neil Mitchell Date: Fri Sep 7 12:30:35 2018 +0100 Allow QuickCheck 2.12 >--------------------------------------------------------------- efff50b6eec676208c54b0f08b8056fc8723f0ea filepath.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filepath.cabal b/filepath.cabal index b35223c..358a197 100644 --- a/filepath.cabal +++ b/filepath.cabal @@ -64,4 +64,4 @@ test-suite filepath-tests build-depends: filepath, base, - QuickCheck >= 2.7 && < 2.12 + QuickCheck >= 2.7 && < 2.13 From git at git.haskell.org Thu Sep 13 14:52:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 14:52:05 +0000 (UTC) Subject: [commit: packages/filepath] master: Update PULL_REQUEST_TEMPLATE.md (020ee4e) Message-ID: <20180913145205.ECE1A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/filepath On branch : master Link : http://git.haskell.org/packages/filepath.git/commitdiff/020ee4ed255bc1b0cb4274d8a0d8ed6aded64283 >--------------------------------------------------------------- commit 020ee4ed255bc1b0cb4274d8a0d8ed6aded64283 Author: Neil Mitchell Date: Fri Sep 7 15:16:21 2018 +0100 Update PULL_REQUEST_TEMPLATE.md >--------------------------------------------------------------- 020ee4ed255bc1b0cb4274d8a0d8ed6aded64283 PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index fd079e3..aa8fbc9 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ Thanks for the pull request! -By raising this pull request you confirm you are licensing your contributions under the project license (see LICENSE) and that you have no patents covering your contribution. +By raising this pull request you confirm you are licensing your contribution under all licenses that apply to this project (see LICENSE) and that you have no patents covering your contribution. If you care, my PR preferences are at https://github.com/ndmitchell/neil#contributions, but they're all guidelines, and I'm not too fussy - you don't have to read them. From git at git.haskell.org Thu Sep 13 16:48:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 16:48:43 +0000 (UTC) Subject: [commit: ghc] master: Remove dead variable binding (8533428) Message-ID: <20180913164843.5380C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8533428b1734eb6f249d350ed8fe7882d212792a/ghc >--------------------------------------------------------------- commit 8533428b1734eb6f249d350ed8fe7882d212792a Author: Simon Peyton Jones Date: Thu Sep 13 17:47:50 2018 +0100 Remove dead variable binding Fallout from earlier commit, sorry. >--------------------------------------------------------------- 8533428b1734eb6f249d350ed8fe7882d212792a compiler/typecheck/TcValidity.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index b58c1ba..351d0e1 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1115,14 +1115,13 @@ We can also have instances for functions: @instance Foo (a -> b) ... at . checkValidInstHead :: UserTypeCtxt -> Class -> [Type] -> TcM () checkValidInstHead ctxt clas cls_args = do { dflags <- getDynFlags - ; this_mod <- getModule ; is_boot <- tcIsHsBootOrSig - ; check_valid_inst_head dflags this_mod is_boot ctxt clas cls_args } + ; check_valid_inst_head dflags is_boot ctxt clas cls_args } -check_valid_inst_head :: DynFlags -> Module -> Bool +check_valid_inst_head :: DynFlags -> Bool -> UserTypeCtxt -> Class -> [Type] -> TcM () -- Wow! There are a surprising number of ad-hoc special cases here. -check_valid_inst_head dflags this_mod is_boot ctxt clas cls_args +check_valid_inst_head dflags is_boot ctxt clas cls_args -- If not in an hs-boot file, abstract classes cannot have instances | isAbstractClass clas From git at git.haskell.org Thu Sep 13 20:06:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 20:06:55 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Close over kinds exactly once per var (#14880) (0c994c4) Message-ID: <20180913200655.9D2783A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/0c994c47a7cbf30e5ec7a46f955117b2ea360067/ghc >--------------------------------------------------------------- commit 0c994c47a7cbf30e5ec7a46f955117b2ea360067 Author: Tobias Dammers Date: Thu Sep 13 09:56:02 2018 +0200 Close over kinds exactly once per var (#14880) Summary: As discussed in Trac:14880, comment:123, we have the issue that we want to avoid processing the same var more than once. The original plan was to move closing over kinds to the very end of the `tyCoVarsOfType` function, however, this turns out to be inefficient and unnecessary. Instead, we simply change the code in `ty_co_vars_of_type` such that closing over kinds doesn't happen if we've already seen the var in question. Test Plan: ./validate, nofib Reviewers: simonpj, goldfire, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14880 Differential Revision: https://phabricator.haskell.org/D5147 >--------------------------------------------------------------- 0c994c47a7cbf30e5ec7a46f955117b2ea360067 compiler/types/TyCoRep.hs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 7f470ea..7d08fd0 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1650,7 +1650,7 @@ ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc | v `elemVarSet` is = acc | v `elemVarSet` acc = acc - | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) ty_co_vars_of_type (TyConApp _ tys) is acc = ty_co_vars_of_types tys is acc ty_co_vars_of_type (LitTy {}) _ acc = acc ty_co_vars_of_type (AppTy fun arg) is acc = ty_co_vars_of_type fun is (ty_co_vars_of_type arg is acc) @@ -1782,14 +1782,18 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- See Note [FV eta expansion] in FV for explanation. tyCoFVsOfType :: Type -> FV -- See Note [Free variables of types] -tyCoFVsOfType (TyVarTy v) a b c = (unitFV v `unionFV` tyCoFVsOfType (tyVarKind v)) a b c -tyCoFVsOfType (TyConApp _ tys) a b c = tyCoFVsOfTypes tys a b c -tyCoFVsOfType (LitTy {}) a b c = emptyFV a b c -tyCoFVsOfType (AppTy fun arg) a b c = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) a b c -tyCoFVsOfType (FunTy arg res) a b c = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) a b c -tyCoFVsOfType (ForAllTy bndr ty) a b c = tyCoFVsBndr bndr (tyCoFVsOfType ty) a b c -tyCoFVsOfType (CastTy ty co) a b c = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) a b c -tyCoFVsOfType (CoercionTy co) a b c = tyCoFVsOfCo co a b c +tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) + | not (f v) = (acc_list, acc_set) + | v `elemVarSet` bound_vars = (acc_list, acc_set) + | v `elemVarSet` acc_set = (acc_list, acc_set) + | otherwise = tyCoFVsOfType (tyVarKind v) f emptyVarSet (v:acc_list, extendVarSet acc_set v) +tyCoFVsOfType (TyConApp _ tys) f bound_vars acc = tyCoFVsOfTypes tys f bound_vars acc +tyCoFVsOfType (LitTy {}) f bound_vars acc = emptyFV f bound_vars acc +tyCoFVsOfType (AppTy fun arg) f bound_vars acc = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) f bound_vars acc +tyCoFVsOfType (FunTy arg res) f bound_vars acc = (tyCoFVsOfType arg `unionFV` tyCoFVsOfType res) f bound_vars acc +tyCoFVsOfType (ForAllTy bndr ty) f bound_vars acc = tyCoFVsBndr bndr (tyCoFVsOfType ty) f bound_vars acc +tyCoFVsOfType (CastTy ty co) f bound_vars acc = (tyCoFVsOfType ty `unionFV` tyCoFVsOfCo co) f bound_vars acc +tyCoFVsOfType (CoercionTy co) f bound_vars acc = tyCoFVsOfCo co f bound_vars acc tyCoFVsBndr :: TyVarBinder -> FV -> FV -- Free vars of (forall b. ) From git at git.haskell.org Thu Sep 13 20:06:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 20:06:58 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Add Note [Closing over free variable kinds] (186097e) Message-ID: <20180913200658.79CFB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/186097e2eeb29e879e6768b0c0a2f946bc66f84e/ghc >--------------------------------------------------------------- commit 186097e2eeb29e879e6768b0c0a2f946bc66f84e Author: Tobias Dammers Date: Thu Sep 13 22:06:22 2018 +0200 Add Note [Closing over free variable kinds] >--------------------------------------------------------------- 186097e2eeb29e879e6768b0c0a2f946bc66f84e compiler/types/TyCoRep.hs | 79 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 7d08fd0..61a031b 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1648,6 +1648,7 @@ tyCoVarsOfTypes tys = ty_co_vars_of_types tys emptyVarSet emptyVarSet ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc + -- See Note [Closing over free variable kinds] | v `elemVarSet` is = acc | v `elemVarSet` acc = acc | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) @@ -1781,7 +1782,7 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- Eta-expanded because that makes it run faster (apparently) -- See Note [FV eta expansion] in FV for explanation. tyCoFVsOfType :: Type -> FV --- See Note [Free variables of types] +-- See Note [Free variables of types] and Note [Closing over free variable kinds] tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) | not (f v) = (acc_list, acc_set) | v `elemVarSet` bound_vars = (acc_list, acc_set) @@ -1869,6 +1870,82 @@ tyCoFVsOfCos :: [Coercion] -> FV tyCoFVsOfCos [] fv_cand in_scope acc = emptyFV fv_cand in_scope acc tyCoFVsOfCos (co:cos) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOfCos cos) fv_cand in_scope acc +{- + +Note [Closing over free variable kinds] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +tyCoVarsOfType and tyCoFVsOfType, while traversing a type, will also close over +free variable kinds. In previous GHC versions, this happened naively: whenever +we would encounter an occurrence of a free type variable, we would close over +its kind. This, however is wrong for two reasons: + +1. Efficiency. If we have Proxy (a::k) -> Proxy (a::k) -> Proxy (a::k), then + we don't want to have to traverse k more than once. + +2. Correctness. Imagine we have forall k. b -> k, where b has + kind k, for some k bound in an outer scope. If we look at b's kind inside + the forall, we'll collect that k is free and then remove k from the set of + free variables. This is plain wrong. We must instead compute that b is free + and then conclude that b's kind is free. + +An obvious first approach is to move the closing-over-kinds from the +occurrences of a type variable to after finding the free vars - however, this +turns out to introduce performance regressions, and isn't even entirely +correct. + +In fact, it isn't even important *when* we close over kinds; what matters is +that we handle each type var exactly once, and that we do it in the right +context. + +So the next approach we tried was to use the "in-scope set" part of FV or the +equivalent argument in the accumulator-style `ty_co_vars_of_type` function, to +say "don't bother with variables we have already closed over". This should work +fine in theory, but the code is complicated and doesn't perform well. + +But there is a simpler way, which is implemented here. Consider the two points +above: + +1. Efficiency: we now have an accumulator, so the second time we encounter 'a', + we'll ignore it, certainly not looking at its kind - this is why + pre-checking set membership before inserting ends up not only being faster, + but also being correct. + +2. Correctness: we have an "in-scope set" (I think we should call it it a + "bound-var set"), specifying variables that are bound by a forall in the type + we are traversing; we simply ignore these variables, certainly not looking at + their kind. + +So consider: + + forall k. b -> k + +where b :: k->Type is free; but of course, it's a different k! When looking at +b -> k we'll have k in the bound-var set. So we'll ignore the k. But suppose +this is our first encounter with b; we want the free vars of its kind. But we +want to behave as if we took the free vars of its kind at the end; that is, +with no bound vars in scope. + +So the solution is easy. The old code was this: + + ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + +Now all we need to do is take the free vars of tyVarKind v *with an empty +bound-var set*, thus: + +ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) + ^^^^^^^^^^^ + +And that's it. + +-} + ------------- Extracting the CoVars of a type or coercion ----------- getCoVarSet :: FV -> CoVarSet From git at git.haskell.org Thu Sep 13 20:12:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 20:12:04 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2-c123: Add Note [Closing over free variable kinds] (fef945d) Message-ID: <20180913201204.763893A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2-c123 Link : http://ghc.haskell.org/trac/ghc/changeset/fef945d28fadeaeeb01783e314eec70ef19ad38e/ghc >--------------------------------------------------------------- commit fef945d28fadeaeeb01783e314eec70ef19ad38e Author: Tobias Dammers Date: Thu Sep 13 22:06:22 2018 +0200 Add Note [Closing over free variable kinds] >--------------------------------------------------------------- fef945d28fadeaeeb01783e314eec70ef19ad38e compiler/types/TyCoRep.hs | 79 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 7d08fd0..277e8bc 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1648,6 +1648,7 @@ tyCoVarsOfTypes tys = ty_co_vars_of_types tys emptyVarSet emptyVarSet ty_co_vars_of_type :: Type -> TyCoVarSet -> TyCoVarSet -> TyCoVarSet ty_co_vars_of_type (TyVarTy v) is acc + -- See Note [Closing over free variable kinds] | v `elemVarSet` is = acc | v `elemVarSet` acc = acc | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) @@ -1781,7 +1782,7 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- Eta-expanded because that makes it run faster (apparently) -- See Note [FV eta expansion] in FV for explanation. tyCoFVsOfType :: Type -> FV --- See Note [Free variables of types] +-- See Note [Free variables of types] and Note [Closing over free variable kinds] tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) | not (f v) = (acc_list, acc_set) | v `elemVarSet` bound_vars = (acc_list, acc_set) @@ -1869,6 +1870,82 @@ tyCoFVsOfCos :: [Coercion] -> FV tyCoFVsOfCos [] fv_cand in_scope acc = emptyFV fv_cand in_scope acc tyCoFVsOfCos (co:cos) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOfCos cos) fv_cand in_scope acc +{- + +Note [Closing over free variable kinds] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +tyCoVarsOfType and tyCoFVsOfType, while traversing a type, will also close over +free variable kinds. In previous GHC versions, this happened naively: whenever +we would encounter an occurrence of a free type variable, we would close over +its kind. This, however is wrong for two reasons (see Trac #14880): + +1. Efficiency. If we have Proxy (a::k) -> Proxy (a::k) -> Proxy (a::k), then + we don't want to have to traverse k more than once. + +2. Correctness. Imagine we have forall k. b -> k, where b has + kind k, for some k bound in an outer scope. If we look at b's kind inside + the forall, we'll collect that k is free and then remove k from the set of + free variables. This is plain wrong. We must instead compute that b is free + and then conclude that b's kind is free. + +An obvious first approach is to move the closing-over-kinds from the +occurrences of a type variable to after finding the free vars - however, this +turns out to introduce performance regressions, and isn't even entirely +correct. + +In fact, it isn't even important *when* we close over kinds; what matters is +that we handle each type var exactly once, and that we do it in the right +context. + +So the next approach we tried was to use the "in-scope set" part of FV or the +equivalent argument in the accumulator-style `ty_co_vars_of_type` function, to +say "don't bother with variables we have already closed over". This should work +fine in theory, but the code is complicated and doesn't perform well. + +But there is a simpler way, which is implemented here. Consider the two points +above: + +1. Efficiency: we now have an accumulator, so the second time we encounter 'a', + we'll ignore it, certainly not looking at its kind - this is why + pre-checking set membership before inserting ends up not only being faster, + but also being correct. + +2. Correctness: we have an "in-scope set" (I think we should call it it a + "bound-var set"), specifying variables that are bound by a forall in the type + we are traversing; we simply ignore these variables, certainly not looking at + their kind. + +So consider: + + forall k. b -> k + +where b :: k->Type is free; but of course, it's a different k! When looking at +b -> k we'll have k in the bound-var set. So we'll ignore the k. But suppose +this is our first encounter with b; we want the free vars of its kind. But we +want to behave as if we took the free vars of its kind at the end; that is, +with no bound vars in scope. + +So the solution is easy. The old code was this: + + ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v) + +Now all we need to do is take the free vars of tyVarKind v *with an empty +bound-var set*, thus: + +ty_co_vars_of_type (TyVarTy v) is acc + | v `elemVarSet` is = acc + | v `elemVarSet` acc = acc + | otherwise = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v) + ^^^^^^^^^^^ + +And that's it. + +-} + ------------- Extracting the CoVars of a type or coercion ----------- getCoVarSet :: FV -> CoVarSet From git at git.haskell.org Thu Sep 13 21:00:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix gcCAFs() (75d3415) Message-ID: <20180913210029.C08823A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/75d3415bf063ec5ea4eedba3c56d6871bc0b25a3/ghc >--------------------------------------------------------------- commit 75d3415bf063ec5ea4eedba3c56d6871bc0b25a3 Author: Simon Marlow Date: Thu Jul 26 17:19:54 2018 -0400 Fix gcCAFs() The test here should have been changed after D1106. It was harmless but we caught fewer GC'd CAFs than we should have. Test Plan: Using `nofib/imaginary/primes` compiled with `-debug`. Before: ``` > ./primes 100 +RTS -G1 -A32k -DG CAF gc'd at 0x0x7b0960 CAF gc'd at 0x0x788728 CAF gc'd at 0x0x790db0 CAF gc'd at 0x0x790de0 12 CAFs live CAF gc'd at 0x0x788880 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 547 CAF gc'd at 0x0x7995c8 13 CAFs live ``` After: ``` > ./primes 100 +RTS -G1 -A32k -DG CAF gc'd at 0x0x7b0960 CAF gc'd at 0x0x788728 CAF gc'd at 0x0x790db0 CAF gc'd at 0x0x790de0 12 CAFs live CAF gc'd at 0x0x788880 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 12 CAFs live 547 CAF gc'd at 0x0x7995c8 CAF gc'd at 0x0x790ea0 12 CAFs live ``` Reviewers: bgamari, osa1, erikd, noamz Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4963 (cherry picked from commit e431d75f8350f25159f9aaa49fe9a504e94bc0a4) >--------------------------------------------------------------- 75d3415bf063ec5ea4eedba3c56d6871bc0b25a3 rts/sm/GC.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rts/sm/GC.c b/rts/sm/GC.c index aeb0c8a..90857ab 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -1848,7 +1848,10 @@ static void gcCAFs(void) info = get_itbl((StgClosure*)p); ASSERT(info->type == IND_STATIC); - if (p->static_link == NULL) { + // See Note [STATIC_LINK fields] in Storage.h + // This condition identifies CAFs that have just been GC'd and + // don't have static_link==3 which means they should be ignored. + if ((((StgWord)(p->static_link)&STATIC_BITS) | prev_static_flag) != 3) { debugTrace(DEBUG_gccafs, "CAF gc'd at 0x%p", p); SET_INFO((StgClosure*)p,&stg_GCD_CAF_info); // stub it if (prev == NULL) { From git at git.haskell.org Thu Sep 13 21:00:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: template-haskell: Fix typo in changelog (d2ac6e9) Message-ID: <20180913210032.ABD093A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/d2ac6e95deff6740e9adbf9aa1a66eb7f3417c56/ghc >--------------------------------------------------------------- commit d2ac6e95deff6740e9adbf9aa1a66eb7f3417c56 Author: Ben Gamari Date: Sun Sep 9 22:23:16 2018 -0400 template-haskell: Fix typo in changelog >--------------------------------------------------------------- d2ac6e95deff6740e9adbf9aa1a66eb7f3417c56 libraries/template-haskell/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md index c03da31..5e1f944 100644 --- a/libraries/template-haskell/changelog.md +++ b/libraries/template-haskell/changelog.md @@ -3,7 +3,7 @@ ## 2.14.0.0 *August 2018* * Introduce an `addForeignFilePath` function, as well as a corresponding - `qAddForeignFile` class method to `Quasi`. Unlike `addForeingFile`, which + `qAddForeignFile` class method to `Quasi`. Unlike `addForeignFile`, which takes the contents of the file as an argument, `addForeignFilePath` takes as an argument a path pointing to a foreign file. A new `addForeignSource` function has also been added which takes a file's contents as an argument. From git at git.haskell.org Thu Sep 13 21:00:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:35 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Fix a bug in SRT generation" (d82e8af) Message-ID: <20180913210035.7ECF73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/d82e8af82d4be11252294290564044ef956ec2a4/ghc >--------------------------------------------------------------- commit d82e8af82d4be11252294290564044ef956ec2a4 Author: Ben Gamari Date: Wed Sep 12 15:06:18 2018 -0400 Revert "Fix a bug in SRT generation" This reverts commit d424d4a46a729f8530e9273282d22b6b8f34daaa. >--------------------------------------------------------------- d82e8af82d4be11252294290564044ef956ec2a4 compiler/cmm/CmmBuildInfoTables.hs | 99 ++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index ecbe89d..bef4d98 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -30,7 +30,6 @@ import CostCentre import StgCmmHeap import PprCmm() -import Control.Monad import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) @@ -446,44 +445,20 @@ getLabelledBlocks (CmmProc top_info _ _ _) = ] --- | Put the labelled blocks that we will be annotating with SRTs into --- dependency order. This is so that we can process them one at a --- time, resolving references to earlier blocks to point to their --- SRTs. CAFs themselves are not included here; see getCAFs below. -depAnalSRTs - :: CAFEnv - -> [CmmDecl] - -> [SCC (Label, CAFLabel, Set CAFLabel)] -depAnalSRTs cafEnv decls = - srtTrace "depAnalSRTs" (ppr graph) graph - where - labelledBlocks = concatMap getLabelledBlocks decls - labelToBlock = Map.fromList (map swap labelledBlocks) - graph = stronglyConnCompFromEdgedVerticesOrd - [ let cafs' = Set.delete lbl cafs in - DigraphNode (l,lbl,cafs') l - (mapMaybe (flip Map.lookup labelToBlock) (Set.toList cafs')) - | (l, lbl) <- labelledBlocks - , Just cafs <- [mapLookup l cafEnv] ] - - --- | Get (Label, CAFLabel, Set CAFLabel) for each block that represents a CAF. +-- | Get (Label,CLabel) pairs for each block that represents a CAF. -- These are treated differently from other labelled blocks: --- - we never [Shortcut] a reference to a CAF to the contents of its --- SRT, since the point of SRTs is to keep CAFs alive. +-- - we never resolve a reference to a CAF to the contents of its SRT, since +-- the point of SRTs is to keep CAFs alive. -- - CAFs therefore don't take part in the dependency analysis in depAnalSRTs. -- instead we generate their SRTs after everything else, so that we can --- [Shortcut] references from the CAF's SRT. -getCAFs :: CAFEnv -> [CmmDecl] -> [(Label, CAFLabel, Set CAFLabel)] -getCAFs cafEnv decls = - [ (g_entry g, mkCAFLabel topLbl, cafs) - | CmmProc top_info topLbl _ g <- decls - , Just info <- [mapLookup (g_entry g) (info_tbls top_info)] +-- resolve references in the CAF's SRT. +getCAFs :: CmmDecl -> [(Label, CAFLabel)] +getCAFs (CmmData _ _) = [] +getCAFs (CmmProc top_info topLbl _ g) + | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info - , isStaticRep rep && isThunkRep rep - , Just cafs <- [mapLookup (g_entry g) cafEnv] - ] - + , isStaticRep rep && isThunkRep rep = [(g_entry g, mkCAFLabel topLbl)] + | otherwise = [] -- | Get the list of blocks that correspond to the entry points for -- FUN_STATIC closures. These are the blocks for which if we have an @@ -500,6 +475,35 @@ getStaticFuns decls = ] +-- | Put the labelled blocks that we will be annotating with SRTs into +-- dependency order. This is so that we can process them one at a +-- time, resolving references to earlier blocks to point to their +-- SRTs. +depAnalSRTs + :: CAFEnv + -> [CmmDecl] + -> [SCC (Label, CAFLabel, Set CAFLabel)] + +depAnalSRTs cafEnv decls = + srtTrace "depAnalSRTs" (ppr blockToLabel $$ ppr (graph ++ cafSCCs)) $ + (graph ++ cafSCCs) + where + cafs = concatMap getCAFs decls + cafSCCs = [ AcyclicSCC (blockid, lbl, cafs) + | (blockid, lbl) <- cafs + , Just cafs <- [mapLookup blockid cafEnv] ] + labelledBlocks = concatMap getLabelledBlocks decls + blockToLabel :: LabelMap CAFLabel + blockToLabel = mapFromList (cafs ++ labelledBlocks) + labelToBlock = Map.fromList (map swap labelledBlocks) + graph = stronglyConnCompFromEdgedVerticesOrd + [ let cafs' = Set.delete lbl cafs in + DigraphNode (l,lbl,cafs') l + (mapMaybe (flip Map.lookup labelToBlock) (Set.toList cafs')) + | (l, lbl) <- labelledBlocks + , Just cafs <- [mapLookup l cafEnv] ] + + -- | Maps labels from 'cafAnal' to the final CLabel that will appear -- in the SRT. -- - closures with singleton SRTs resolve to their single entry @@ -540,9 +544,7 @@ doSRTs dflags moduleSRTInfo tops = do -- don't need to generate the singleton SRT in the first place. But -- to do this we need to process blocks before things that depend on -- them. - let - sccs = depAnalSRTs cafEnv decls - cafsWithSRTs = getCAFs cafEnv decls + let sccs = depAnalSRTs cafEnv decls -- On each strongly-connected group of decls, construct the SRT -- closures and the SRT fields for info tables. @@ -554,11 +556,8 @@ doSRTs dflags moduleSRTInfo tops = do ((result, _srtMap), moduleSRTInfo') = initUs_ us $ flip runStateT moduleSRTInfo $ - flip runStateT Map.empty $ do - nonCAFs <- mapM (doSCC dflags staticFuns) sccs - cAFs <- forM cafsWithSRTs $ \(l, cafLbl, cafs) -> - oneSRT dflags staticFuns [l] [cafLbl] True{-is a CAF-} cafs - return (nonCAFs ++ cAFs) + flip runStateT Map.empty $ + mapM (doSCC dflags staticFuns) sccs (declss, pairs, funSRTs) = unzip3 result @@ -584,13 +583,13 @@ doSCC ) doSCC dflags staticFuns (AcyclicSCC (l, cafLbl, cafs)) = - oneSRT dflags staticFuns [l] [cafLbl] False cafs + oneSRT dflags staticFuns [l] [cafLbl] cafs doSCC dflags staticFuns (CyclicSCC nodes) = do -- build a single SRT for the whole cycle let (blockids, lbls, cafsets) = unzip3 nodes cafs = Set.unions cafsets `Set.difference` Set.fromList lbls - oneSRT dflags staticFuns blockids lbls False cafs + oneSRT dflags staticFuns blockids lbls cafs -- | Build an SRT for a set of blocks @@ -599,7 +598,6 @@ oneSRT -> LabelMap CLabel -- which blocks are static function entry points -> [Label] -- blocks in this set -> [CAFLabel] -- labels for those blocks - -> Bool -- True <=> this SRT is for a CAF -> Set CAFLabel -- SRT for this set -> StateT SRTMap (StateT ModuleSRTInfo UniqSM) @@ -608,7 +606,7 @@ oneSRT , [(Label, [SRTEntry])] -- SRTs to attach to static functions ) -oneSRT dflags staticFuns blockids lbls isCAF cafs = do +oneSRT dflags staticFuns blockids lbls cafs = do srtMap <- get topSRT <- lift get let @@ -631,10 +629,9 @@ oneSRT dflags staticFuns blockids lbls isCAF cafs = do (ppr cafs <+> ppr resolved <+> ppr allBelow <+> ppr filtered) $ return () let - updateSRTMap srtEntry = - when (not isCAF) $ do -- NB. no [Shortcut] for CAFs - let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] - put (Map.union newSRTMap srtMap) + updateSRTMap srtEntry = do + let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] + put (Map.union newSRTMap srtMap) case Set.toList filtered of [] -> do From git at git.haskell.org Thu Sep 13 21:00:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:38 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Disable the SRT offset optimisation on MachO platforms" (c15d44f) Message-ID: <20180913210038.4F8B13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/c15d44f8b3f00bfe152c2f9d3c6f60efd204fb23/ghc >--------------------------------------------------------------- commit c15d44f8b3f00bfe152c2f9d3c6f60efd204fb23 Author: Simon Marlow Date: Thu Jul 26 17:19:54 2018 -0400 Revert "Disable the SRT offset optimisation on MachO platforms" This reverts commit bf10456edaa03dc010821cd4c3d9f49cb11d89da. >--------------------------------------------------------------- c15d44f8b3f00bfe152c2f9d3c6f60efd204fb23 compiler/cmm/CLabel.hs | 22 ++-------------------- compiler/cmm/CmmBuildInfoTables.hs | 18 ++---------------- compiler/cmm/CmmInfo.hs | 5 +---- includes/rts/storage/InfoTables.h | 3 --- 4 files changed, 5 insertions(+), 43 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 1a9bc73..472bd3c 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -94,12 +94,10 @@ module CLabel ( mkHpcTicksLabel, - -- * Predicates hasCAF, needsCDecl, maybeLocalBlockLabel, externallyVisibleCLabel, isMathFun, isCFunctionLabel, isGcPtrLabel, labelDynamic, - isLocalCLabel, -- * Conversions toClosureLbl, toSlowEntryLbl, toEntryLbl, toInfoLbl, hasHaskellName, @@ -976,29 +974,13 @@ idInfoLabelType info = -- ----------------------------------------------------------------------------- +-- Does a CLabel need dynamic linkage? --- | Is a 'CLabel' defined in the current module being compiled? --- --- Sometimes we can optimise references within a compilation unit in ways that --- we couldn't for inter-module references. This provides a conservative --- estimate of whether a 'CLabel' lives in the current module. -isLocalCLabel :: Module -> CLabel -> Bool -isLocalCLabel this_mod lbl = - case lbl of - IdLabel name _ _ - | isInternalName name -> True - | otherwise -> nameModule name == this_mod - LocalBlockLabel _ -> True - _ -> False - --- ----------------------------------------------------------------------------- - --- | Does a 'CLabel' need dynamic linkage? --- -- When referring to data in code, we need to know whether -- that data resides in a DLL or not. [Win32 only.] -- @labelDynamic@ returns @True@ if the label is located -- in a DLL, be it a data reference or not. + labelDynamic :: DynFlags -> Module -> CLabel -> Bool labelDynamic dflags this_mod lbl = case lbl of diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index 3d13fc7..ecbe89d 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -16,7 +16,6 @@ import Hoopl.Label import Hoopl.Collections import Hoopl.Dataflow import Module -import Platform import Digraph import CLabel import PprCmmDecl () @@ -121,7 +120,7 @@ offset to the SRT can be stored in 32 bits (all code lives within a the info table by storing the srt_offset in the srt field, which is half a word. -On x86_64 with TABLES_NEXT_TO_CODE (except on MachO, due to #15169): +On x86_64 with TABLES_NEXT_TO_CODE: - info->srt is zero if there's no SRT, otherwise: - info->srt is an offset from the info pointer to the SRT object @@ -637,27 +636,14 @@ oneSRT dflags staticFuns blockids lbls isCAF cafs = do let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] put (Map.union newSRTMap srtMap) - this_mod = thisModule topSRT - case Set.toList filtered of [] -> do srtTrace "oneSRT: empty" (ppr lbls) $ return () updateSRTMap Nothing return ([], [], []) - -- When we have only one entry there is no need to build a new SRT at all. [one@(SRTEntry lbl)] - | -- Info tables refer to SRTs by offset (as noted in the section - -- "Referring to an SRT from the info table" of Note [SRTs]). However, - -- when dynamic linking is used we cannot guarantee that the offset - -- between the SRT and the info table will fit in the offset field. - -- Consequently we build a singleton SRT in in this case. - not (labelDynamic dflags this_mod lbl) - - -- MachO relocations can't express offsets between compilation units at - -- all, so we are always forced to build a singleton SRT in this case. - && (not (osMachOTarget $ platformOS $ targetPlatform dflags) - || isLocalCLabel this_mod lbl) -> do + | not (labelDynamic dflags (thisModule topSRT) lbl) -> do updateSRTMap (Just one) return ([], map (,lbl) blockids, []) diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs index 43cba25..3b2eea1 100644 --- a/compiler/cmm/CmmInfo.hs +++ b/compiler/cmm/CmmInfo.hs @@ -271,10 +271,7 @@ mkSRTLit dflags _ Nothing = ([], CmmInt 0 (halfWordWidth dflags)) mkSRTLit dflags _ (Just lbl) = ([CmmLabel lbl], CmmInt 1 (halfWordWidth dflags)) --- | Is the SRT offset field inline in the info table on this platform? --- --- See the section "Referring to an SRT from the info table" in --- Note [SRTs] in CmmBuildInfoTables.hs +-- | is the SRT offset field inline in the info table on this platform? inlineSRT :: DynFlags -> Bool inlineSRT dflags = platformArch (targetPlatform dflags) == ArchX86_64 && tablesNextToCode dflags diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index db50d16..137cfe2 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -156,9 +156,6 @@ typedef union { #if defined(x86_64_TARGET_ARCH) && defined(TABLES_NEXT_TO_CODE) // On x86_64 we can fit a pointer offset in half a word, so put the SRT offset // in the info->srt field directly. -// -// See the section "Referring to an SRT from the info table" in -// Note [SRTs] in CmmBuildInfoTables.hs #define USE_INLINE_SRT_FIELD #endif From git at git.haskell.org Thu Sep 13 21:00:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:41 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Comments and refactoring only" (b0f06f5) Message-ID: <20180913210041.23C003A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b0f06f53761820167e8b2cda61bc8c3137a83f92/ghc >--------------------------------------------------------------- commit b0f06f53761820167e8b2cda61bc8c3137a83f92 Author: Ben Gamari Date: Wed Sep 12 15:07:44 2018 -0400 Revert "Comments and refactoring only" This reverts commit f2d27c1ad69321872a87a37144fe41e815301f5b. >--------------------------------------------------------------- b0f06f53761820167e8b2cda61bc8c3137a83f92 compiler/cmm/Cmm.hs | 12 ------------ compiler/cmm/CmmBuildInfoTables.hs | 30 ++++++++++++------------------ compiler/codeGen/StgCmmClosure.hs | 2 +- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index eb34618..4c8e528 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -143,18 +143,6 @@ data CmmInfoTable cit_clo :: Maybe (Id, CostCentreStack) -- Just (id,ccs) <=> build a static closure later -- Nothing <=> don't build a static closure - -- - -- Static closures for FUNs and THUNKs are *not* generated by - -- the code generator, because we might want to add SRT - -- entries to them later (for FUNs at least; THUNKs are - -- treated the same for consistency). See Note [SRTs] in - -- CmmBuildInfoTables, in particular the [FUN] optimisation. - -- - -- This is strictly speaking not a part of the info table that - -- will be finally generated, but it's the only convenient - -- place to convey this information from the code generator to - -- where we build the static closures in - -- CmmBuildInfoTables.doSRTs. } data ProfilingInfo diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index bef4d98..d9408df 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -463,16 +463,15 @@ getCAFs (CmmProc top_info topLbl _ g) -- | Get the list of blocks that correspond to the entry points for -- FUN_STATIC closures. These are the blocks for which if we have an -- SRT we can merge it with the static closure. [FUN] -getStaticFuns :: [CmmDecl] -> [(BlockId, CLabel)] -getStaticFuns decls = - [ (g_entry g, lbl) - | CmmProc top_info _ _ g <- decls - , Just info <- [mapLookup (g_entry g) (info_tbls top_info)] - , Just (id, _) <- [cit_clo info] +getStaticFuns :: CmmDecl -> [(BlockId, CLabel)] +getStaticFuns (CmmData _ _) = [] +getStaticFuns (CmmProc top_info _ _ g) + | Just info <- mapLookup (g_entry g) (info_tbls top_info) , let rep = cit_rep info - , isStaticRep rep && isFunRep rep + , Just (id, _) <- cit_clo info , let lbl = mkLocalClosureLabel (idName id) (idCafInfo id) - ] + , isStaticRep rep && isFunRep rep = [(g_entry g, lbl)] + | otherwise = [] -- | Put the labelled blocks that we will be annotating with SRTs into @@ -528,7 +527,7 @@ doSRTs -> [(CAFEnv, [CmmDecl])] -> IO (ModuleSRTInfo, [CmmDecl]) -doSRTs dflags moduleSRTInfo tops = do +doSRTs dflags topSRT tops = do us <- mkSplitUniqSupply 'u' -- Ignore the original grouping of decls, and combine all the @@ -536,7 +535,7 @@ doSRTs dflags moduleSRTInfo tops = do let (cafEnvs, declss) = unzip tops cafEnv = mapUnions cafEnvs decls = concat declss - staticFuns = mapFromList (getStaticFuns decls) + staticFuns = mapFromList (concatMap getStaticFuns decls) -- Put the decls in dependency order. Why? So that we can implement -- [Shortcut] and [Filter]. If we need to refer to an SRT that has @@ -548,14 +547,9 @@ doSRTs dflags moduleSRTInfo tops = do -- On each strongly-connected group of decls, construct the SRT -- closures and the SRT fields for info tables. - let result :: - [ ( [CmmDecl] -- generated SRTs - , [(Label, CLabel)] -- SRT fields for info tables - , [(Label, [SRTEntry])] -- SRTs to attach to static functions - ) ] - ((result, _srtMap), moduleSRTInfo') = + let ((result, _srtMap), topSRT') = initUs_ us $ - flip runStateT moduleSRTInfo $ + flip runStateT topSRT $ flip runStateT Map.empty $ mapM (doSCC dflags staticFuns) sccs @@ -567,7 +561,7 @@ doSRTs dflags moduleSRTInfo tops = do funSRTMap = mapFromList (concat funSRTs) decls' = concatMap (updInfoSRTs dflags srtFieldMap funSRTMap) decls - return (moduleSRTInfo', concat declss ++ decls') + return (topSRT', concat declss ++ decls') -- | Build the SRT for a strongly-connected component of blocks diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 6f0feaa..b598059 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -1040,7 +1040,7 @@ mkDataConInfoTable dflags data_con is_static ptr_wds nonptr_wds , cit_rep = sm_rep , cit_prof = prof , cit_srt = Nothing - , cit_clo = Nothing } + , cit_clo = Nothing } where name = dataConName data_con info_lbl = mkConInfoTableLabel name NoCafRefs From git at git.haskell.org Thu Sep 13 21:00:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:43 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Fix retainer profiling after SRT overhaul" (2576546) Message-ID: <20180913210043.F20973A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/25765469b312aa21422c635aa5852a69e29f24f1/ghc >--------------------------------------------------------------- commit 25765469b312aa21422c635aa5852a69e29f24f1 Author: Ben Gamari Date: Wed Sep 12 15:06:29 2018 -0400 Revert "Fix retainer profiling after SRT overhaul" This reverts commit d78dde9ff685830bc9d6bb24a158eb31bb8a7028. >--------------------------------------------------------------- 25765469b312aa21422c635aa5852a69e29f24f1 rts/RetainerProfile.c | 175 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 147 insertions(+), 28 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 25765469b312aa21422c635aa5852a69e29f24f1 From git at git.haskell.org Thu Sep 13 21:00:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:46 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Merge FUN_STATIC closure with its SRT" (6f2596b) Message-ID: <20180913210046.D07193A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/6f2596b432a9915d648286195b48c48ccdd14a2c/ghc >--------------------------------------------------------------- commit 6f2596b432a9915d648286195b48c48ccdd14a2c Author: Ben Gamari Date: Wed Sep 12 15:09:20 2018 -0400 Revert "Merge FUN_STATIC closure with its SRT" This reverts commit 838b69032566ce6ab3918d70e8d5e098d0bcee02. >--------------------------------------------------------------- 6f2596b432a9915d648286195b48c48ccdd14a2c compiler/cmm/Cmm.hs | 7 +- compiler/cmm/CmmBuildInfoTables.hs | 224 ++++++++++++++--------------------- compiler/cmm/CmmInfo.hs | 3 +- compiler/cmm/CmmParse.y | 12 +- compiler/codeGen/StgCmmBind.hs | 22 ++-- compiler/codeGen/StgCmmClosure.hs | 19 +-- includes/rts/storage/ClosureMacros.h | 3 + rts/RetainerProfile.c | 2 +- rts/sm/Compact.c | 2 +- rts/sm/Evac.c | 4 +- rts/sm/Sanity.c | 2 +- rts/sm/Scav.c | 6 +- 12 files changed, 122 insertions(+), 184 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6f2596b432a9915d648286195b48c48ccdd14a2c From git at git.haskell.org Thu Sep 13 21:00:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:49 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert incorrect STM wakeup optimisation (279d69d) Message-ID: <20180913210049.9F7B83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/279d69d31f9ca3c36237f0fe6b415090cf21f52a/ghc >--------------------------------------------------------------- commit 279d69d31f9ca3c36237f0fe6b415090cf21f52a Author: Ömer Sinan Ağacan Date: Tue Sep 11 20:43:50 2018 +0200 Revert incorrect STM wakeup optimisation Summary: (see the comments) Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5144 (cherry picked from commit 36740b4c346c619e31d24d6672caa6f4f7fea123) >--------------------------------------------------------------- 279d69d31f9ca3c36237f0fe6b415090cf21f52a rts/STM.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/rts/STM.c b/rts/STM.c index 976ad87..dc0b0eb 100644 --- a/rts/STM.c +++ b/rts/STM.c @@ -337,11 +337,11 @@ static void unpark_tso(Capability *cap, StgTSO *tso) { // it belongs to this cap, or send a message to the owning cap // otherwise. - // But we don't really want to send multiple messages if we write - // to the same TVar multiple times, and the owning cap hasn't yet - // woken up the thread and removed it from the TVar's watch list. - // So, we use the tso->block_info as a flag to indicate whether - // we've already done tryWakeupThread() for this thread. + // TODO: This sends multiple messages if we write to the same TVar multiple + // times and the owning cap hasn't yet woken up the thread and removed it + // from the TVar's watch list. We tried to optimise this in D4961, but that + // patch was incorrect and broke other things, see #15544 comment:17. See + // #15626 for the tracking ticket. // Safety Note: we hold the TVar lock at this point, so we know // that this thread is definitely still blocked, since the first @@ -349,12 +349,7 @@ static void unpark_tso(Capability *cap, StgTSO *tso) { // TVar watch queues, and to do that it would need to lock the // TVar. - if (tso->block_info.closure != &stg_STM_AWOKEN_closure) { - // safe to do a non-atomic test-and-set here, because it's - // fine if we do multiple tryWakeupThread()s. - tso->block_info.closure = &stg_STM_AWOKEN_closure; - tryWakeupThread(cap,tso); - } + tryWakeupThread(cap,tso); } static void unpark_waiters_on(Capability *cap, StgTVar *s) { From git at git.haskell.org Thu Sep 13 21:00:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Save a word in the info table on x86_64" (dee2294) Message-ID: <20180913210052.782EA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/dee229487fccc6a994d4bb9c4ceda0903bec707b/ghc >--------------------------------------------------------------- commit dee229487fccc6a994d4bb9c4ceda0903bec707b Author: Ben Gamari Date: Wed Sep 12 15:14:08 2018 -0400 Revert "Save a word in the info table on x86_64" This reverts commit 2b0918c9834be1873728176e4944bec26271234a. >--------------------------------------------------------------- dee229487fccc6a994d4bb9c4ceda0903bec707b compiler/cmm/CmmBuildInfoTables.hs | 23 +++-------- compiler/cmm/CmmExpr.hs | 10 ++--- compiler/cmm/CmmInfo.hs | 44 +++++++------------- includes/rts/storage/ClosureMacros.h | 2 +- includes/rts/storage/InfoTables.h | 48 ++++------------------ libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 4 +- libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc | 4 +- libraries/ghci/GHCi/InfoTable.hsc | 1 + rts/RtsAPI.c | 2 +- rts/sm/Evac.c | 4 +- rts/sm/Scav.c | 6 +-- 11 files changed, 45 insertions(+), 103 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc dee229487fccc6a994d4bb9c4ceda0903bec707b From git at git.haskell.org Thu Sep 13 21:00:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:00:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "An overhaul of the SRT representation" (ceffd7f) Message-ID: <20180913210055.570703A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/ceffd7fe3f310cb30fec870f768e8047af309d99/ghc >--------------------------------------------------------------- commit ceffd7fe3f310cb30fec870f768e8047af309d99 Author: Ben Gamari Date: Wed Sep 12 15:17:15 2018 -0400 Revert "An overhaul of the SRT representation" This reverts commit eb8e692cab7970c495681e14721d05ecadd21581. >--------------------------------------------------------------- ceffd7fe3f310cb30fec870f768e8047af309d99 compiler/cmm/CLabel.hs | 57 +- compiler/cmm/Cmm.hs | 14 +- compiler/cmm/CmmBuildInfoTables.hs | 913 +++++++-------------- compiler/cmm/CmmInfo.hs | 9 +- compiler/cmm/CmmParse.y | 12 +- compiler/cmm/CmmPipeline.hs | 21 +- compiler/cmm/Hoopl/Dataflow.hs | 6 - compiler/cmm/PprCmm.hs | 2 +- compiler/cmm/PprCmmDecl.hs | 17 +- compiler/codeGen/StgCmmClosure.hs | 10 +- compiler/main/HscMain.hs | 20 +- compiler/stgSyn/CoreToStg.hs | 9 + includes/rts/storage/ClosureMacros.h | 2 +- includes/rts/storage/InfoTables.h | 53 +- includes/stg/MiscClosures.h | 16 - libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 8 - libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc | 8 - rts/RtsAPI.c | 2 +- rts/RtsSymbols.c | 16 - rts/StgMiscClosures.cmm | 55 +- rts/sm/Evac.c | 4 +- rts/sm/Scav.c | 109 ++- testsuite/tests/regalloc/regalloc_unit_tests.hs | 2 +- 23 files changed, 540 insertions(+), 825 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ceffd7fe3f310cb30fec870f768e8047af309d99 From git at git.haskell.org Thu Sep 13 21:03:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 21:03:45 +0000 (UTC) Subject: [commit: ghc] master: Fix build (9912cdf) Message-ID: <20180913210345.274BB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9912cdf6dbb24a9d0188edc722ed6d9d8a3e0a1b/ghc >--------------------------------------------------------------- commit 9912cdf6dbb24a9d0188edc722ed6d9d8a3e0a1b Author: Krzysztof Gogolewski Date: Thu Sep 13 22:52:05 2018 +0200 Fix build >--------------------------------------------------------------- 9912cdf6dbb24a9d0188edc722ed6d9d8a3e0a1b compiler/typecheck/TcValidity.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 351d0e1..df54dc2 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -57,7 +57,6 @@ import Util import ListSetOps import SrcLoc import Outputable -import Module import Bag ( emptyBag ) import Unique ( mkAlphaTyVarUnique ) import qualified GHC.LanguageExtensions as LangExt From git at git.haskell.org Thu Sep 13 23:07:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 23:07:28 +0000 (UTC) Subject: [commit: ghc] master: eventlog: Factor out eventlog header generation into separate function (5f5898a) Message-ID: <20180913230728.BDFE93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5f5898a523358a3ddb588d7ee50a2eecccfe8edf/ghc >--------------------------------------------------------------- commit 5f5898a523358a3ddb588d7ee50a2eecccfe8edf Author: Ben Gamari Date: Thu Sep 13 11:31:08 2018 -0400 eventlog: Factor out eventlog header generation into separate function >--------------------------------------------------------------- 5f5898a523358a3ddb588d7ee50a2eecccfe8edf rts/eventlog/EventLog.c | 75 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c index ee4504e..ff79425 100644 --- a/rts/eventlog/EventLog.c +++ b/rts/eventlog/EventLog.c @@ -265,38 +265,9 @@ flushEventLog(void) } } -void -initEventLogging(const EventLogWriter *ev_writer) +static void +postHeaderEvents(void) { - uint32_t n_caps; - - event_log_writer = ev_writer; - initEventLogWriter(); - - if (sizeof(EventDesc) / sizeof(char*) != NUM_GHC_EVENT_TAGS) { - barf("EventDesc array has the wrong number of elements"); - } - - /* - * Allocate buffer(s) to store events. - * Create buffer large enough for the header begin marker, all event - * types, and header end marker to prevent checking if buffer has room - * for each of these steps, and remove the need to flush the buffer to - * disk during initialization. - * - * Use a single buffer to store the header with event types, then flush - * the buffer so all buffers are empty for writing events. - */ -#if defined(THREADED_RTS) - // XXX n_capabilities hasn't been initialized yet - n_caps = RtsFlags.ParFlags.nCapabilities; -#else - n_caps = 1; -#endif - moreCapEventBufs(0, n_caps); - - initEventsBuf(&eventBuf, EVENT_LOG_SIZE, (EventCapNo)(-1)); - // Write in buffer: the header begin marker. postInt32(&eventBuf, EVENT_HEADER_BEGIN); @@ -487,6 +458,44 @@ initEventLogging(const EventLogWriter *ev_writer) // Prepare event buffer for events (data). postInt32(&eventBuf, EVENT_DATA_BEGIN); +} + +void +initEventLogging(const EventLogWriter *ev_writer) +{ + uint32_t n_caps; + + event_log_writer = ev_writer; + initEventLogWriter(); + + if (sizeof(EventDesc) / sizeof(char*) != NUM_GHC_EVENT_TAGS) { + barf("EventDesc array has the wrong number of elements"); + } + + /* + * Allocate buffer(s) to store events. + * Create buffer large enough for the header begin marker, all event + * types, and header end marker to prevent checking if buffer has room + * for each of these steps, and remove the need to flush the buffer to + * disk during initialization. + * + * Use a single buffer to store the header with event types, then flush + * the buffer so all buffers are empty for writing events. + */ +#if defined(THREADED_RTS) + // XXX n_capabilities hasn't been initialized yet + n_caps = RtsFlags.ParFlags.nCapabilities; +#else + n_caps = 1; +#endif + moreCapEventBufs(0, n_caps); + + initEventsBuf(&eventBuf, EVENT_LOG_SIZE, (EventCapNo)(-1)); +#if defined(THREADED_RTS) + initMutex(&eventBufMutex); +#endif + + postHeaderEvents(); // Flush capEventBuf with header. /* @@ -498,10 +507,6 @@ initEventLogging(const EventLogWriter *ev_writer) for (uint32_t c = 0; c < n_caps; ++c) { postBlockMarker(&capEventBuf[c]); } - -#if defined(THREADED_RTS) - initMutex(&eventBufMutex); -#endif } void From git at git.haskell.org Thu Sep 13 23:07:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 23:07:44 +0000 (UTC) Subject: [commit: ghc] master: base: showEFloat: Handle negative precisions the same of zero precision (e71e341) Message-ID: <20180913230744.4CA2C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e71e341f87c055ecc01f85ddd8d7a2094dfa8e9a/ghc >--------------------------------------------------------------- commit e71e341f87c055ecc01f85ddd8d7a2094dfa8e9a Author: Ben Gamari Date: Thu Sep 13 17:09:56 2018 -0400 base: showEFloat: Handle negative precisions the same of zero precision Test Plan: Validate Reviewers: hvr, alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15509 Differential Revision: https://phabricator.haskell.org/D5083 >--------------------------------------------------------------- e71e341f87c055ecc01f85ddd8d7a2094dfa8e9a libraries/base/GHC/Float.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/base/GHC/Float.hs b/libraries/base/GHC/Float.hs index 693a209..9296978 100644 --- a/libraries/base/GHC/Float.hs +++ b/libraries/base/GHC/Float.hs @@ -721,16 +721,18 @@ formatRealFloatAlt fmt decs alt x [d] -> d : ".0e" ++ show_e' (d:ds') -> d : '.' : ds' ++ "e" ++ show_e' [] -> errorWithoutStackTrace "formatRealFloat/doFmt/FFExponent: []" - Just 0 -> + Just d | d <= 0 -> -- handle this case specifically since we need to omit the - -- decimal point as well (#15115) + -- decimal point as well (#15115). + -- Note that this handles negative precisions as well for consistency + -- (see #15509). case is of [0] -> "0e0" _ -> let (ei,is') = roundTo base 1 is - d:_ = map intToDigit (if ei > 0 then init is' else is') - in d : 'e' : show (e-1+ei) + n:_ = map intToDigit (if ei > 0 then init is' else is') + in n : 'e' : show (e-1+ei) Just dec -> let dec' = max dec 1 in case is of From git at git.haskell.org Thu Sep 13 23:07:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 13 Sep 2018 23:07:59 +0000 (UTC) Subject: [commit: ghc] master: Update hsc2hs submodule (ce240b3) Message-ID: <20180913230759.3A8CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ce240b3f998b68853c47ab131126eb9a245256c5/ghc >--------------------------------------------------------------- commit ce240b3f998b68853c47ab131126eb9a245256c5 Author: Chaitanya Koparkar Date: Thu Sep 13 18:15:18 2018 -0400 Update hsc2hs submodule Test Plan: ./validate Reviewers: bgamari, hvr, RyanGlScott Reviewed By: RyanGlScott Subscribers: monoidal, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5114 >--------------------------------------------------------------- ce240b3f998b68853c47ab131126eb9a245256c5 utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 6b6938d..769ac3c 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 6b6938db11a33904bb6ba90d70d89df4b72a7f90 +Subproject commit 769ac3cda8bd766e9a41a74eb681e2de1bac6795 From git at git.haskell.org Fri Sep 14 11:30:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 11:30:15 +0000 (UTC) Subject: [commit: ghc] master: Add support for ImplicitParams and RecursiveDo in TH (9c6b749) Message-ID: <20180914113015.2AFD43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9c6b7493db24977595b17046e15baf76638b5317/ghc >--------------------------------------------------------------- commit 9c6b7493db24977595b17046e15baf76638b5317 Author: Michael Sloan Date: Fri Sep 14 12:17:13 2018 +0200 Add support for ImplicitParams and RecursiveDo in TH Summary: This adds TH support for the ImplicitParams and RecursiveDo extensions. I'm submitting this as one review because I cannot cleanly make the two commits independent. Initially, my goal was just to add ImplicitParams support, and I found that reasonably straightforward, so figured I might as well use my newfound knowledge to address some other TH omissions. Test Plan: Validate Reviewers: goldfire, austin, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: carter, RyanGlScott, thomie GHC Trac Issues: #1262 Differential Revision: https://phabricator.haskell.org/D1979 >--------------------------------------------------------------- 9c6b7493db24977595b17046e15baf76638b5317 compiler/deSugar/DsMeta.hs | 63 ++++- compiler/hsSyn/Convert.hs | 49 +++- compiler/prelude/THNames.hs | 297 +++++++++++---------- compiler/typecheck/TcSplice.hs | 9 +- docs/users_guide/8.8.1-notes.rst | 2 + .../template-haskell/Language/Haskell/TH/Lib.hs | 13 +- .../Language/Haskell/TH/Lib/Internal.hs | 23 ++ .../template-haskell/Language/Haskell/TH/Ppr.hs | 11 + .../template-haskell/Language/Haskell/TH/Syntax.hs | 20 +- libraries/template-haskell/changelog.md | 5 + testsuite/tests/th/TH_implicitParams.hs | 20 ++ testsuite/tests/th/TH_implicitParams.stdout | 8 + testsuite/tests/th/TH_implicitParamsErr1.hs | 5 + testsuite/tests/th/TH_implicitParamsErr1.stderr | 4 + testsuite/tests/th/TH_implicitParamsErr2.hs | 8 + testsuite/tests/th/TH_implicitParamsErr2.stderr | 10 + testsuite/tests/th/TH_implicitParamsErr3.hs | 6 + testsuite/tests/th/TH_implicitParamsErr3.stderr | 10 + testsuite/tests/th/TH_recursiveDo.hs | 18 ++ testsuite/tests/th/TH_recursiveDo.stdout | 7 + testsuite/tests/th/TH_recursiveDoImport.hs | 23 ++ testsuite/tests/th/all.T | 5 + 22 files changed, 444 insertions(+), 172 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9c6b7493db24977595b17046e15baf76638b5317 From git at git.haskell.org Fri Sep 14 11:36:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 11:36:14 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14880-2-step3' created Message-ID: <20180914113614.14FC63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T14880-2-step3 Referencing: 62ca12fb5e097d123d916495f1511af98cba173d From git at git.haskell.org Fri Sep 14 11:36:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 11:36:17 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step3: Fix #14880. (62ca12f) Message-ID: <20180914113617.D18723A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step3 Link : http://ghc.haskell.org/trac/ghc/changeset/62ca12fb5e097d123d916495f1511af98cba173d/ghc >--------------------------------------------------------------- commit 62ca12fb5e097d123d916495f1511af98cba173d Author: Richard Eisenberg Date: Mon Apr 23 12:18:26 2018 -0400 Fix #14880. This fix is described in Note [Removing variables with bound kinds] in TcType. This commit also changes split_dvs to close over kinds at the end, which seems more performant than walking over the kind of every tyvar occurrence. >--------------------------------------------------------------- 62ca12fb5e097d123d916495f1511af98cba173d compiler/typecheck/TcType.hs | 84 +++++++++++++++++----- testsuite/tests/dependent/should_compile/T14880.hs | 15 ++++ testsuite/tests/dependent/should_compile/all.T | 2 + testsuite/tests/ghci/should_run/T12549.stdout | 2 +- 4 files changed, 83 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 62ca12fb5e097d123d916495f1511af98cba173d From git at git.haskell.org Fri Sep 14 12:03:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 12:03:39 +0000 (UTC) Subject: [commit: ghc] master: tests: increase (compile) timeout multiplier for T13701 and MultiLayerModules (3040444) Message-ID: <20180914120339.16EBF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3040444d3a00a3088a67e82d7f81af47f8653609/ghc >--------------------------------------------------------------- commit 3040444d3a00a3088a67e82d7f81af47f8653609 Author: Alp Mestanogullari Date: Fri Sep 14 14:01:09 2018 +0200 tests: increase (compile) timeout multiplier for T13701 and MultiLayerModules Summary: Those tests are currently making our i386 validation fail on CircleCI: https://circleci.com/gh/ghc/ghc/8827 Test Plan: Using my Phab<->CircleCI bridge to run i386 validation for this diff. Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter GHC Trac Issues: #15484, #15383 Differential Revision: https://phabricator.haskell.org/D5103 >--------------------------------------------------------------- 3040444d3a00a3088a67e82d7f81af47f8653609 testsuite/tests/backpack/cabal/bkpcabal01/all.T | 3 ++- testsuite/tests/perf/compiler/all.T | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/backpack/cabal/bkpcabal01/all.T b/testsuite/tests/backpack/cabal/bkpcabal01/all.T index e470708..1b72bd2 100644 --- a/testsuite/tests/backpack/cabal/bkpcabal01/all.T +++ b/testsuite/tests/backpack/cabal/bkpcabal01/all.T @@ -4,6 +4,7 @@ else: cleanup = 'CLEANUP=0' test('bkpcabal01', - extra_files(['p', 'q', 'impl', 'bkpcabal01.cabal', 'Setup.hs', 'Main.hs']), + [extra_files(['p', 'q', 'impl', 'bkpcabal01.cabal', 'Setup.hs', 'Main.hs']), + run_timeout_multiplier(2)], run_command, ['$MAKE -s --no-print-directory bkpcabal01 ' + cleanup]) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 3e724ec..e7c04ae 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1186,8 +1186,8 @@ test('MultiLayerModules', ]), pre_cmd('./genMultiLayerModules'), extra_files(['genMultiLayerModules']), - compile_timeout_multiplier(2) - # 2 is _a lot_ (timeout after 600s, to build 600 modules), + compile_timeout_multiplier(5) + # this is _a lot_ # but this test has been failing every now and then, # especially on i386. Let's just give it some room # to complete successfully reliably everywhere. @@ -1234,8 +1234,8 @@ test('T13701', ]), pre_cmd('./genT13701'), extra_files(['genT13701']), - compile_timeout_multiplier(2) - # 2 is _a lot_ (timeout after 600s, to build 600 modules), + compile_timeout_multiplier(4) + # 4 is _a lot_ (timeout after 1200s), # but this test has been failing every now and then, # especially on i386. Let's just give it some room # to complete successfully reliably everywhere. From git at git.haskell.org Fri Sep 14 12:39:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 12:39:47 +0000 (UTC) Subject: [commit: ghc] master: Fix T15502 on 32-bit (ecbe26b) Message-ID: <20180914123947.11BA03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ecbe26b6966a3a64f4e22e862370536b1dd4440f/ghc >--------------------------------------------------------------- commit ecbe26b6966a3a64f4e22e862370536b1dd4440f Author: Krzysztof Gogolewski Date: Fri Sep 14 14:38:42 2018 +0200 Fix T15502 on 32-bit Summary: The expected output uses a hardcoded value for maxBound :: Int. This should fix one of circleci failures on i386. Test Plan: make test TEST=T15502 Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15502 Differential Revision: https://phabricator.haskell.org/D5151 >--------------------------------------------------------------- ecbe26b6966a3a64f4e22e862370536b1dd4440f testsuite/tests/th/T15502.stderr-ws-32 | 4 ++++ testsuite/tests/th/{T15502.stderr => T15502.stderr-ws-64} | 0 2 files changed, 4 insertions(+) diff --git a/testsuite/tests/th/T15502.stderr-ws-32 b/testsuite/tests/th/T15502.stderr-ws-32 new file mode 100644 index 0000000..ba7b91c --- /dev/null +++ b/testsuite/tests/th/T15502.stderr-ws-32 @@ -0,0 +1,4 @@ +T15502.hs:7:19-56: Splicing expression + lift (toInteger (maxBound :: Int) + 1) ======> 2147483648 +T15502.hs:8:19-40: Splicing expression + lift (minBound :: Int) ======> (-2147483648) diff --git a/testsuite/tests/th/T15502.stderr b/testsuite/tests/th/T15502.stderr-ws-64 similarity index 100% rename from testsuite/tests/th/T15502.stderr rename to testsuite/tests/th/T15502.stderr-ws-64 From git at git.haskell.org Fri Sep 14 14:09:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 14:09:22 +0000 (UTC) Subject: [commit: ghc] master: Mark system and internal symbols as private symbols in asm (64c54ff) Message-ID: <20180914140922.B91183A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/64c54fff2d6534e1229359a8d357ec1dc6c21b73/ghc >--------------------------------------------------------------- commit 64c54fff2d6534e1229359a8d357ec1dc6c21b73 Author: Sergei Azovskov Date: Fri Sep 14 14:56:37 2018 +0100 Mark system and internal symbols as private symbols in asm Summary: This marks system and internal symbols as private in asm output so those random generated sysmbols won't appear in .symtab Reasoning: * internal symbols don't help to debug because names are just random * the symbols style breaks perf logic * internal symbols can take ~75% of the .symtab. In the same time .symtab can take about 20% of the binary file size Notice: This diff mostly makes sense on top of the D4713 (or similar) Test Plan: tests Perf from D4713 ``` 7.97% FibbSlow FibbSlow [.] c3rM_info 6.75% FibbSlow FibbSlow [.] 0x000000000032cfa8 6.63% FibbSlow FibbSlow [.] cifA_info 4.98% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqIntegerzh_info 4.55% FibbSlow FibbSlow [.] chXn_info 4.52% FibbSlow FibbSlow [.] c3rH_info 4.45% FibbSlow FibbSlow [.] chZB_info 4.04% FibbSlow FibbSlow [.] Main_fibbzuslow_info 4.03% FibbSlow FibbSlow [.] stg_ap_0_fast 3.76% FibbSlow FibbSlow [.] chXA_info 3.67% FibbSlow FibbSlow [.] cifu_info 3.25% FibbSlow FibbSlow [.] ci4r_info 2.64% FibbSlow FibbSlow [.] s3rf_info 2.42% FibbSlow FibbSlow [.] s3rg_info 2.39% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqInteger_info 2.25% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_minusInteger_info 2.17% FibbSlow FibbSlow [.] ghczmprim_GHCziClasses_zeze_info 2.09% FibbSlow FibbSlow [.] cicc_info 2.03% FibbSlow FibbSlow [.] 0x0000000000331e15 2.02% FibbSlow FibbSlow [.] s3ri_info 1.91% FibbSlow FibbSlow [.] 0x0000000000331bb8 1.89% FibbSlow FibbSlow [.] ci4N_info ... ``` Perf from this patch: ``` 15.37% FibbSlow FibbSlow [.] Main_fibbzuslow_info 15.33% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_minusInteger_info 13.34% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqIntegerzh_info 9.24% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_plusInteger_info 9.08% FibbSlow FibbSlow [.] frame_dummy 8.25% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqInteger_info 4.29% FibbSlow FibbSlow [.] 0x0000000000321ab0 3.84% FibbSlow FibbSlow [.] stg_ap_0_fast 3.07% FibbSlow FibbSlow [.] ghczmprim_GHCziClasses_zeze_info 2.39% FibbSlow FibbSlow [.] 0x0000000000321ab7 1.90% FibbSlow FibbSlow [.] 0x00000000003266b8 1.88% FibbSlow FibbSlow [.] base_GHCziNum_zm_info 1.83% FibbSlow FibbSlow [.] 0x0000000000326915 1.34% FibbSlow FibbSlow [.] 0x00000000003248cc 1.07% FibbSlow FibbSlow [.] base_GHCziNum_zp_info 0.98% FibbSlow FibbSlow [.] 0x00000000003247c8 0.80% FibbSlow FibbSlow [.] 0x0000000000121498 0.79% FibbSlow FibbSlow [.] stg_gc_noregs 0.75% FibbSlow FibbSlow [.] 0x0000000000321ad6 0.67% FibbSlow FibbSlow [.] 0x0000000000321aca 0.64% FibbSlow FibbSlow [.] 0x0000000000321b4a 0.61% FibbSlow FibbSlow [.] 0x00000000002ff633 ``` Reviewers: simonmar, niteria, bgamari Reviewed By: simonmar Subscribers: lelf, angerman, olsner, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4722 >--------------------------------------------------------------- 64c54fff2d6534e1229359a8d357ec1dc6c21b73 compiler/cmm/CLabel.hs | 55 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 1a9bc73..1ba0d89 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -1135,20 +1135,12 @@ instance Outputable CLabel where pprCLabel :: Platform -> CLabel -> SDoc -pprCLabel platform (LocalBlockLabel u) - = getPprStyle $ \ sty -> - if asmStyle sty then - ptext (asmTempLabelPrefix platform) <> pprUniqueAlways u - else - char '_' <> pprUniqueAlways u +pprCLabel _ (LocalBlockLabel u) + = tempLabelPrefixOrUnderscore <> pprUniqueAlways u pprCLabel platform (AsmTempLabel u) | not (platformUnregisterised platform) - = getPprStyle $ \ sty -> - if asmStyle sty then - ptext (asmTempLabelPrefix platform) <> pprUniqueAlways u - else - char '_' <> pprUniqueAlways u + = tempLabelPrefixOrUnderscore <> pprUniqueAlways u pprCLabel platform (AsmTempDerivedLabel l suf) | cGhcWithNativeCodeGen == "YES" @@ -1168,7 +1160,15 @@ pprCLabel _ PicBaseLabel pprCLabel platform (DeadStripPreventer lbl) | cGhcWithNativeCodeGen == "YES" - = pprCLabel platform lbl <> text "_dsp" + = + {- + `lbl` can be temp one but we need to ensure that dsp label will stay + in the final binary so we prepend non-temp prefix ("dsp_") and + optional `_` (underscore) because this is how you mark non-temp symbols + on some platforms (Darwin) + -} + maybe_underscore $ text "dsp_" + <> pprCLabel platform lbl <> text "_dsp" pprCLabel _ (StringLitLabel u) | cGhcWithNativeCodeGen == "YES" @@ -1199,9 +1199,11 @@ pprCLbl (StringLitLabel u) = pprUniqueAlways u <> text "_str" pprCLbl (SRTLabel u) - = pprUniqueAlways u <> pp_cSEP <> text "srt" + = tempLabelPrefixOrUnderscore <> pprUniqueAlways u <> pp_cSEP <> text "srt" -pprCLbl (LargeBitmapLabel u) = text "b" <> pprUniqueAlways u <> pp_cSEP <> text "btm" +pprCLbl (LargeBitmapLabel u) = + tempLabelPrefixOrUnderscore + <> char 'b' <> pprUniqueAlways u <> pp_cSEP <> text "btm" -- Some bitsmaps for tuple constructors have a numeric tag (e.g. '7') -- until that gets resolved we'll just force them to start -- with a letter so the label will be legal assembly code. @@ -1211,7 +1213,8 @@ pprCLbl (CmmLabel _ str CmmCode) = ftext str pprCLbl (CmmLabel _ str CmmData) = ftext str pprCLbl (CmmLabel _ str CmmPrimCall) = ftext str -pprCLbl (LocalBlockLabel u) = text "blk_" <> pprUniqueAlways u +pprCLbl (LocalBlockLabel u) = + tempLabelPrefixOrUnderscore <> text "blk_" <> pprUniqueAlways u pprCLbl (RtsLabel (RtsApFast str)) = ftext str <> text "_fast" @@ -1275,7 +1278,8 @@ pprCLbl (RtsLabel (RtsSlowFastTickyCtr pat)) pprCLbl (ForeignLabel str _ _ _) = ftext str -pprCLbl (IdLabel name _cafs flavor) = ppr name <> ppIdFlavor flavor +pprCLbl (IdLabel name _cafs flavor) = + internalNamePrefix name <> ppr name <> ppIdFlavor flavor pprCLbl (CC_Label cc) = ppr cc pprCLbl (CCS_Label ccs) = ppr ccs @@ -1318,6 +1322,24 @@ instance Outputable ForeignLabelSource where ForeignLabelInThisPackage -> parens $ text "this package" ForeignLabelInExternalPackage -> parens $ text "external package" +internalNamePrefix :: Name -> SDoc +internalNamePrefix name = getPprStyle $ \ sty -> + if codeStyle sty && isRandomGenerated then + sdocWithPlatform $ \platform -> + ptext (asmTempLabelPrefix platform) + else + empty + where + isRandomGenerated = not $ isExternalName name + +tempLabelPrefixOrUnderscore :: SDoc +tempLabelPrefixOrUnderscore = sdocWithPlatform $ \platform -> + getPprStyle $ \ sty -> + if asmStyle sty then + ptext (asmTempLabelPrefix platform) + else + char '_' + -- ----------------------------------------------------------------------------- -- Machine-dependent knowledge about labels. @@ -1390,4 +1412,3 @@ pprDynamicLinkerAsmLabel platform dllInfo lbl = SymbolPtr -> text ".LC_" <> ppr lbl GotSymbolPtr -> ppr lbl <> text "@got" GotSymbolOffset -> ppr lbl <> text "@gotoff" - From git at git.haskell.org Fri Sep 14 14:11:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 14 Sep 2018 14:11:22 +0000 (UTC) Subject: [commit: ghc] master: Mark code related symbols as @function not @object (c23f057) Message-ID: <20180914141122.41A0E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c23f057f1753634e2bc0612969470efea6443031/ghc >--------------------------------------------------------------- commit c23f057f1753634e2bc0612969470efea6443031 Author: Sergei Azovskov Date: Fri Sep 14 15:09:59 2018 +0100 Mark code related symbols as @function not @object Summary: This diff is a part of the bigger project which goal is to improve common profiling tools support (perf) for GHC binaries. A similar job was already done and reverted in the past: * https://phabricator.haskell.org/rGHCb1f453e16f0ce11a2ab18cc4c350bdcbd36299a6 * https://phabricator.haskell.org/rGHCf1f3c4f50650110ad0f700d6566a44c515b0548f Reasoning: `Perf` and similar tools build in memory symbol table from the .symtab section of the ELF file to display human-readable function names instead of the addresses in the output. `Perf` uses only two types of symbols: `@function` and `@notype` but GHC is not capable to produce any `@function` symbols so the `perf` output is pretty useless (All the haskell symbols that you can see in `perf` now are `@notype` internal symbols extracted by mistake/hack). The changes: * mark code related symbols as @function * small hack to mark InfoTable symbols as code if TABLES_NEXT_TO_CODE is true Limitations: * The perf symbolization support is not complete after this patch but I'm working on the second patch. * Constructor symbols are not supported. To fix that we can issue extra local symbols which mark code sections as code and will be only used for debug. Test Plan: tests any additional ideas? Perf output on stock ghc 8.4.1: ``` 9.78% FibbSlow FibbSlow [.] ckY_info 9.59% FibbSlow FibbSlow [.] cjqd_info 7.17% FibbSlow FibbSlow [.] c3sg_info 6.62% FibbSlow FibbSlow [.] c1X_info 5.32% FibbSlow FibbSlow [.] cjsX_info 4.18% FibbSlow FibbSlow [.] s3rN_info 3.82% FibbSlow FibbSlow [.] c2m_info 3.68% FibbSlow FibbSlow [.] cjlJ_info 3.26% FibbSlow FibbSlow [.] c3sb_info 3.19% FibbSlow FibbSlow [.] cjPQ_info 3.05% FibbSlow FibbSlow [.] cjQd_info 2.97% FibbSlow FibbSlow [.] cjAB_info 2.78% FibbSlow FibbSlow [.] cjzP_info 2.40% FibbSlow FibbSlow [.] cjOS_info 2.38% FibbSlow FibbSlow [.] s3rK_info 2.27% FibbSlow FibbSlow [.] cjq0_info 2.18% FibbSlow FibbSlow [.] cKQ_info 2.13% FibbSlow FibbSlow [.] cjSl_info 1.99% FibbSlow FibbSlow [.] s3rL_info 1.98% FibbSlow FibbSlow [.] c2cC_info 1.80% FibbSlow FibbSlow [.] s3rO_info 1.37% FibbSlow FibbSlow [.] c2f2_info ... ``` Perf output on patched ghc: ``` 7.97% FibbSlow FibbSlow [.] c3rM_info 6.75% FibbSlow FibbSlow [.] 0x000000000032cfa8 6.63% FibbSlow FibbSlow [.] cifA_info 4.98% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqIntegerzh_info 4.55% FibbSlow FibbSlow [.] chXn_info 4.52% FibbSlow FibbSlow [.] c3rH_info 4.45% FibbSlow FibbSlow [.] chZB_info 4.04% FibbSlow FibbSlow [.] Main_fibbzuslow_info 4.03% FibbSlow FibbSlow [.] stg_ap_0_fast 3.76% FibbSlow FibbSlow [.] chXA_info 3.67% FibbSlow FibbSlow [.] cifu_info 3.25% FibbSlow FibbSlow [.] ci4r_info 2.64% FibbSlow FibbSlow [.] s3rf_info 2.42% FibbSlow FibbSlow [.] s3rg_info 2.39% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_eqInteger_info 2.25% FibbSlow FibbSlow [.] integerzmgmp_GHCziIntegerziType_minusInteger_info 2.17% FibbSlow FibbSlow [.] ghczmprim_GHCziClasses_zeze_info 2.09% FibbSlow FibbSlow [.] cicc_info 2.03% FibbSlow FibbSlow [.] 0x0000000000331e15 2.02% FibbSlow FibbSlow [.] s3ri_info 1.91% FibbSlow FibbSlow [.] 0x0000000000331bb8 1.89% FibbSlow FibbSlow [.] ci4N_info ... ``` Reviewers: simonmar, niteria, bgamari, goldfire Reviewed By: simonmar, bgamari Subscribers: lelf, rwbarton, thomie, carter GHC Trac Issues: #15501 Differential Revision: https://phabricator.haskell.org/D4713 >--------------------------------------------------------------- c23f057f1753634e2bc0612969470efea6443031 compiler/cmm/CLabel.hs | 17 ++++++++++- compiler/nativeGen/X86/Ppr.hs | 69 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 1ba0d89..12c3357 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -104,7 +104,9 @@ module CLabel ( -- * Conversions toClosureLbl, toSlowEntryLbl, toEntryLbl, toInfoLbl, hasHaskellName, - pprCLabel + pprCLabel, + isInfoTableLabel, + isConInfoTableLabel ) where #include "HsVersions.h" @@ -621,6 +623,19 @@ isSomeRODataLabel (IdLabel _ _ BlockInfoTable) = True isSomeRODataLabel (CmmLabel _ _ CmmInfo) = True isSomeRODataLabel _lbl = False +-- | Whether label is points to some kind of info table +isInfoTableLabel :: CLabel -> Bool +isInfoTableLabel (IdLabel _ _ InfoTable) = True +isInfoTableLabel (IdLabel _ _ LocalInfoTable) = True +isInfoTableLabel (IdLabel _ _ ConInfoTable) = True +isInfoTableLabel (IdLabel _ _ BlockInfoTable) = True +isInfoTableLabel _ = False + +-- | Whether label is points to constructor info table +isConInfoTableLabel :: CLabel -> Bool +isConInfoTableLabel (IdLabel _ _ ConInfoTable) = True +isConInfoTableLabel _ = False + -- | Get the label size field from a ForeignLabel foreignLabelStdcallInfo :: CLabel -> Maybe Int foreignLabelStdcallInfo (ForeignLabel _ info _ _) = info diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index c5fbeb5..03d4fce 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -170,16 +170,76 @@ pprGloblDecl lbl | not (externallyVisibleCLabel lbl) = empty | otherwise = text ".globl " <> ppr lbl -pprTypeAndSizeDecl :: CLabel -> SDoc -pprTypeAndSizeDecl lbl +pprLabelType' :: DynFlags -> CLabel -> SDoc +pprLabelType' dflags lbl = + if isCFunctionLabel lbl || functionOkInfoTable then + text "@function" + else + text "@object" + where + {- + NOTE: This is a bit hacky. + + With the `tablesNextToCode` info tables look like this: + ``` + + label_info: + + ``` + So actually info table label points exactly to the code and we can mark + the label as @function. (This is required to make perf and potentially other + tools to work on Haskell binaries). + This usually works well but it can cause issues with a linker. + A linker uses different algorithms for the relocation depending on + the symbol type.For some reason, a linker will generate JUMP_SLOT relocation + when constructor info table is referenced from a data section. + This only happens with static constructor call so + we mark _con_info symbols as `@object` to avoid the issue with relocations. + + @SimonMarlow hack explanation: + "The reasoning goes like this: + + * The danger when we mark a symbol as `@function` is that the linker will + redirect it to point to the PLT and use a `JUMP_SLOT` relocation when + the symbol refers to something outside the current shared object. + A PLT / JUMP_SLOT reference only works for symbols that we jump to, not + for symbols representing data,, nor for info table symbol references which + we expect to point directly to the info table. + * GHC generates code that might refer to any info table symbol from the text + segment, but that's OK, because those will be explicit GOT references + generated by the code generator. + * When we refer to info tables from the data segment, it's either + * a FUN_STATIC/THUNK_STATIC local to this module + * a `con_info` that could be from anywhere + + So, the only info table symbols that we might refer to from the data segment + of another shared object are `con_info` symbols, so those are the ones we + need to exclude from getting the @function treatment. + " + + A good place to check for more + https://ghc.haskell.org/trac/ghc/wiki/Commentary/PositionIndependentCode + + Another possible hack is to create an extra local function symbol for + every code-like thing to give the needed information for to the tools + but mess up with the relocation. https://phabricator.haskell.org/D4730 + -} + functionOkInfoTable = tablesNextToCode dflags && + isInfoTableLabel lbl && not (isConInfoTableLabel lbl) + + +pprTypeDecl :: CLabel -> SDoc +pprTypeDecl lbl = sdocWithPlatform $ \platform -> if osElfTarget (platformOS platform) && externallyVisibleCLabel lbl - then text ".type " <> ppr lbl <> ptext (sLit ", @object") + then + sdocWithDynFlags $ \df -> + text ".type " <> ppr lbl <> ptext (sLit ", ") <> pprLabelType' df lbl else empty pprLabel :: CLabel -> SDoc pprLabel lbl = pprGloblDecl lbl - $$ pprTypeAndSizeDecl lbl + $$ pprTypeDecl lbl $$ (ppr lbl <> char ':') {- @@ -1346,4 +1406,3 @@ pprFormatOpOpCoerce name format1 format2 op1 op2 pprCondInstr :: LitString -> Cond -> SDoc -> SDoc pprCondInstr name cond arg = hcat [ char '\t', ptext name, pprCond cond, space, arg] - From git at git.haskell.org Sat Sep 15 14:29:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 15 Sep 2018 14:29:03 +0000 (UTC) Subject: [commit: ghc] master: Coercion Quantification (ea5ade3) Message-ID: <20180915142903.88B083ABB7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ea5ade34788f29f5902c5475e94fbac13110eea5/ghc >--------------------------------------------------------------- commit ea5ade34788f29f5902c5475e94fbac13110eea5 Author: ningning Date: Sat Sep 15 10:16:47 2018 -0400 Coercion Quantification This patch corresponds to #15497. According to https://ghc.haskell.org/trac/ghc/wiki/DependentHaskell/Phase2, we would like to have coercion quantifications back. This will allow us to migrate (~#) to be homogeneous, instead of its current heterogeneous definition. This patch is (lots of) plumbing only. There should be no user-visible effects. An overview of changes: - Both `ForAllTy` and `ForAllCo` can quantify over coercion variables, but only in *Core*. All relevant functions are updated accordingly. - Small changes that should be irrelevant to the main task: 1. removed dead code `mkTransAppCo` in Coercion 2. removed out-dated Note Computing a coercion kind and roles in Coercion 3. Added `Eq4` in Note Respecting definitional equality in TyCoRep, and updated `mkCastTy` accordingly. 4. Various updates and corrections of notes and typos. - Haddock submodule needs to be changed too. Acknowledgments: This work was completed mostly during Ningning Xie's Google Summer of Code, sponsored by Google. It was advised by Richard Eisenberg, supported by NSF grant 1704041. Test Plan: ./validate Reviewers: goldfire, simonpj, bgamari, hvr, erikd, simonmar Subscribers: RyanGlScott, monoidal, rwbarton, carter GHC Trac Issues: #15497 Differential Revision: https://phabricator.haskell.org/D5054 >--------------------------------------------------------------- ea5ade34788f29f5902c5475e94fbac13110eea5 compiler/backpack/RnModIface.hs | 10 +- compiler/basicTypes/ConLike.hs | 16 +- compiler/basicTypes/DataCon.hs | 262 ++++++++++++-------- compiler/basicTypes/DataCon.hs-boot | 6 +- compiler/basicTypes/MkId.hs | 23 +- compiler/basicTypes/PatSyn.hs | 10 +- compiler/basicTypes/Var.hs | 83 ++++--- compiler/coreSyn/CoreArity.hs | 19 +- compiler/coreSyn/CoreFVs.hs | 2 +- compiler/coreSyn/CoreLint.hs | 107 ++++++-- compiler/coreSyn/CoreMap.hs | 8 +- compiler/coreSyn/CoreOpt.hs | 24 +- compiler/coreSyn/CoreSubst.hs | 10 +- compiler/coreSyn/CoreTidy.hs | 4 +- compiler/coreSyn/CoreUtils.hs | 21 +- compiler/deSugar/DsForeign.hs | 2 +- compiler/deSugar/MatchCon.hs | 7 +- compiler/ghci/RtClosureInspect.hs | 7 +- compiler/iface/BuildTyCl.hs | 2 +- compiler/iface/IfaceSyn.hs | 43 ++-- compiler/iface/IfaceType.hs | 96 ++++--- compiler/iface/IfaceType.hs-boot | 9 +- compiler/iface/MkIface.hs | 28 +-- compiler/iface/TcIface.hs | 51 ++-- compiler/iface/ToIface.hs | 43 ++-- compiler/iface/ToIface.hs-boot | 4 +- compiler/prelude/TysPrim.hs | 8 +- compiler/prelude/TysWiredIn.hs | 10 +- compiler/specialise/SpecConstr.hs | 1 - compiler/typecheck/Inst.hs | 6 +- compiler/typecheck/TcCanonical.hs | 4 +- compiler/typecheck/TcErrors.hs | 4 +- compiler/typecheck/TcFlatten.hs | 42 ++-- compiler/typecheck/TcForeign.hs | 2 +- compiler/typecheck/TcGenFunctor.hs | 2 +- compiler/typecheck/TcHsSyn.hs | 18 +- compiler/typecheck/TcHsType.hs | 14 +- compiler/typecheck/TcMType.hs | 18 +- compiler/typecheck/TcPatSyn.hs | 6 +- compiler/typecheck/TcRnTypes.hs | 2 +- compiler/typecheck/TcSplice.hs | 4 +- compiler/typecheck/TcTyClsDecls.hs | 9 +- compiler/typecheck/TcType.hs | 77 +++--- compiler/typecheck/TcTypeable.hs | 6 +- compiler/typecheck/TcUnify.hs | 2 +- compiler/typecheck/TcValidity.hs | 10 +- compiler/types/Coercion.hs | 482 +++++++++++++++++++++++++----------- compiler/types/FamInstEnv.hs | 57 ++--- compiler/types/OptCoercion.hs | 193 +++++++++++++-- compiler/types/TyCoRep.hs | 472 ++++++++++++++++++++++++----------- compiler/types/TyCoRep.hs-boot | 2 +- compiler/types/TyCon.hs | 124 +++++----- compiler/types/Type.hs | 373 ++++++++++++++++++---------- compiler/types/Unify.hs | 34 ++- utils/haddock | 2 +- 55 files changed, 1884 insertions(+), 997 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ea5ade34788f29f5902c5475e94fbac13110eea5 From git at git.haskell.org Sat Sep 15 19:42:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 15 Sep 2018 19:42:27 +0000 (UTC) Subject: [commit: ghc] master: Correct submodule update for haddock (a3bce95) Message-ID: <20180915194227.BB6B53ABB7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a3bce956d7ee5f3951e3e93fd3946711c50ff07f/ghc >--------------------------------------------------------------- commit a3bce956d7ee5f3951e3e93fd3946711c50ff07f Author: Richard Eisenberg Date: Sat Sep 15 15:41:39 2018 -0400 Correct submodule update for haddock Previous commit (Coercion Quantification) was missing a commit on the haddock submodule. This (hopefully) corrects it. >--------------------------------------------------------------- a3bce956d7ee5f3951e3e93fd3946711c50ff07f utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index b66a830..b5372b7 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit b66a830b5b1c0166d17f695e7405058650d57ed0 +Subproject commit b5372b7d86e3058b419076641dd3048258c4ddf2 From git at git.haskell.org Sun Sep 16 16:25:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 16:25:23 +0000 (UTC) Subject: [commit: ghc] master: Fix for #13862: Optional "-v" not allowed with :load in GHCi (c6bff52) Message-ID: <20180916162523.D50143A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c6bff526123611d89ea4c92fbc26df221b7ecdd5/ghc >--------------------------------------------------------------- commit c6bff526123611d89ea4c92fbc26df221b7ecdd5 Author: roland Date: Sun Sep 16 19:06:13 2018 +0300 Fix for #13862: Optional "-v" not allowed with :load in GHCi Replace the error message `Use -v to see a list of the files searched for.` with `Use -v (or :set -v` in ghci) to see a list of the files searched for.` Reviewers: bgamari, monoidal, thomie, osa1 Subscribers: rwbarton, carter GHC Trac Issues: #13862 Differential Revision: https://phabricator.haskell.org/D5122 >--------------------------------------------------------------- c6bff526123611d89ea4c92fbc26df221b7ecdd5 compiler/main/Finder.hs | 37 ++++++++++------------ testsuite/tests/ghc-e/should_run/T2636.stderr | 2 +- testsuite/tests/module/mod1.stderr | 2 +- testsuite/tests/module/mod2.stderr | 2 +- testsuite/tests/package/T4806.stderr | 4 +-- testsuite/tests/package/T4806a.stderr | 4 +-- testsuite/tests/package/package01e.stderr | 8 ++--- testsuite/tests/package/package06e.stderr | 8 ++--- testsuite/tests/package/package07e.stderr | 16 +++++----- testsuite/tests/package/package08e.stderr | 16 +++++----- testsuite/tests/perf/compiler/parsing001.stderr | 2 +- testsuite/tests/plugins/T11244.stderr | 2 +- testsuite/tests/plugins/plugins03.stderr | 2 +- .../safeHaskell/safeLanguage/SafeLang07.stderr | 2 +- .../tests/typecheck/should_fail/tcfail082.stderr | 6 ++-- 15 files changed, 54 insertions(+), 59 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c6bff526123611d89ea4c92fbc26df221b7ecdd5 From git at git.haskell.org Sun Sep 16 17:10:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 17:10:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15502 by not casting to Int during TH conversion (8344588) Message-ID: <20180916171016.54B443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/8344588e23fc9bb3c1b15e81edd316134c9860ec/ghc >--------------------------------------------------------------- commit 8344588e23fc9bb3c1b15e81edd316134c9860ec Author: Ryan Scott Date: Mon Aug 27 14:02:49 2018 +0200 Fix #15502 by not casting to Int during TH conversion Summary: When turning an `IntegerL` to an `IntegralLit` during TH conversion, we were stupidly casting an `Integer` to an `Int` in order to determine how it should be pretty-printed. Unsurprisingly, this causes problems when the `Integer` doesn't lie within the bounds of an `Int`, as demonstrated in #15502. The fix is simple: don't cast to an `Int`. Test Plan: make test TEST=T15502 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15502 Differential Revision: https://phabricator.haskell.org/D5089 (cherry picked from commit 7a3cda534d1447c813aa37cdd86e20b8d782cb02) >--------------------------------------------------------------- 8344588e23fc9bb3c1b15e81edd316134c9860ec compiler/basicTypes/BasicTypes.hs | 14 ++++++++++++-- testsuite/tests/th/T15502.hs | 9 +++++++++ testsuite/tests/th/T15502.stderr | 4 ++++ testsuite/tests/th/all.T | 1 + 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 93010b7..ce46962 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -1436,9 +1436,12 @@ data IntegralLit deriving (Data, Show) mkIntegralLit :: Integral a => a -> IntegralLit -mkIntegralLit i = IL { il_text = SourceText (show (fromIntegral i :: Int)) +mkIntegralLit i = IL { il_text = SourceText (show i_integer) , il_neg = i < 0 - , il_value = toInteger i } + , il_value = i_integer } + where + i_integer :: Integer + i_integer = toInteger i negateIntegralLit :: IntegralLit -> IntegralLit negateIntegralLit (IL text neg value) @@ -1463,6 +1466,13 @@ data FractionalLit mkFractionalLit :: Real a => a -> FractionalLit mkFractionalLit r = FL { fl_text = SourceText (show (realToFrac r::Double)) + -- Converting to a Double here may technically lose + -- precision (see #15502). We could alternatively + -- convert to a Rational for the most accuracy, but + -- it would cause Floats and Doubles to be displayed + -- strangely, so we opt not to do this. (In contrast + -- to mkIntegralLit, where we always convert to an + -- Integer for the highest accuracy.) , fl_neg = r < 0 , fl_value = toRational r } diff --git a/testsuite/tests/th/T15502.hs b/testsuite/tests/th/T15502.hs new file mode 100644 index 0000000..96800f8 --- /dev/null +++ b/testsuite/tests/th/T15502.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T15502 where + +import Language.Haskell.TH.Syntax (Lift(lift)) + +main = print ( $( lift (toInteger (maxBound :: Int) + 1) ) + , $( lift (minBound :: Int) ) + ) diff --git a/testsuite/tests/th/T15502.stderr b/testsuite/tests/th/T15502.stderr new file mode 100644 index 0000000..1177799 --- /dev/null +++ b/testsuite/tests/th/T15502.stderr @@ -0,0 +1,4 @@ +T15502.hs:7:19-56: Splicing expression + lift (toInteger (maxBound :: Int) + 1) ======> 9223372036854775808 +T15502.hs:8:19-40: Splicing expression + lift (minBound :: Int) ======> (-9223372036854775808) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index ebdd2ce..fb62bd2 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -420,3 +420,4 @@ test('T15324', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15321', normal, compile_fail, ['']) test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15518', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15502', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sun Sep 16 17:10:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 17:10:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15572 by checking for promoted names in ConT (ebc8ebf) Message-ID: <20180916171019.C56DF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/ebc8ebf89332ddac3039ff87331c4c053ae516ea/ghc >--------------------------------------------------------------- commit ebc8ebf89332ddac3039ff87331c4c053ae516ea Author: Ryan Scott Date: Tue Aug 28 20:54:28 2018 +0200 Fix #15572 by checking for promoted names in ConT Summary: When converting `ConT`s to `HsTyVar`s in `Convert`, we were failing to account for the possibility of promoted data constructor names appearing in a `ConT`, which could result in improper pretty-printing results (as observed in #15572). The fix is straightforward: use `Promoted` instead of `NotPromoted` when the name of a `ConT` is a data constructor name. Test Plan: make test TEST=T15572 Reviewers: goldfire, bgamari, simonpj, monoidal Reviewed By: goldfire, simonpj Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15572 Differential Revision: https://phabricator.haskell.org/D5112 (cherry picked from commit c46a5f2002f6694ea58f79f505d57f3b7bd450e7) >--------------------------------------------------------------- ebc8ebf89332ddac3039ff87331c4c053ae516ea compiler/hsSyn/Convert.hs | 9 ++++++++- testsuite/tests/th/T15572.hs | 8 ++++++++ testsuite/tests/th/T15572.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 1e6611c..c44abf6 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1302,7 +1302,14 @@ cvtTypeKind ty_str ty VarT nm -> do { nm' <- tNameL nm ; mk_apps (HsTyVar noExt NotPromoted nm') tys' } ConT nm -> do { nm' <- tconName nm - ; mk_apps (HsTyVar noExt NotPromoted (noLoc nm')) tys'} + ; -- ConT can contain both data constructor (i.e., + -- promoted) names and other (i.e, unpromoted) + -- names, as opposed to PromotedT, which can only + -- contain data constructor names. See #15572. + let prom = if isRdrDataCon nm' + then Promoted + else NotPromoted + ; mk_apps (HsTyVar noExt prom (noLoc nm')) tys'} ForallT tvs cxt ty | null tys' diff --git a/testsuite/tests/th/T15572.hs b/testsuite/tests/th/T15572.hs new file mode 100644 index 0000000..7bbbcac --- /dev/null +++ b/testsuite/tests/th/T15572.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TemplateHaskell #-} +module T15572 where + +import Language.Haskell.TH + +$([d| type AbsoluteUnit1 = '() |]) +$(pure [TySynD (mkName "AbsoluteUnit2") [] (ConT '())]) diff --git a/testsuite/tests/th/T15572.stderr b/testsuite/tests/th/T15572.stderr new file mode 100644 index 0000000..27132d69 --- /dev/null +++ b/testsuite/tests/th/T15572.stderr @@ -0,0 +1,6 @@ +T15572.hs:7:3-33: Splicing declarations + [d| type AbsoluteUnit1 = '() |] ======> type AbsoluteUnit1 = '() +T15572.hs:8:3-54: Splicing declarations + pure [TySynD (mkName "AbsoluteUnit2") [] (ConT '())] + ======> + type AbsoluteUnit2 = '() diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 280200e..55452b5 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -422,3 +422,4 @@ test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15518', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15502', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15550', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15572', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sun Sep 16 17:10:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 17:10:23 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) (83ca9bb) Message-ID: <20180916171023.4EFA33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/83ca9bb257ff9e0b9ebfa37ba1449118d15543a2/ghc >--------------------------------------------------------------- commit 83ca9bb257ff9e0b9ebfa37ba1449118d15543a2 Author: Simon Peyton Jones Date: Mon Sep 3 09:00:49 2018 +0100 canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) As Trac #15577 showed, it was possible for a /homo-kinded/ constraint to trigger the /hetero-kinded/ branch of canCFunEqCan, and that triggered an infinite loop. The fix is easier, but there remains a deeper questions: why is the flattener producing giant refexive coercions? (cherry picked from commit 2e226a46c422c12f78dc3d3f62fe5a15e22bd986) >--------------------------------------------------------------- 83ca9bb257ff9e0b9ebfa37ba1449118d15543a2 compiler/typecheck/TcCanonical.hs | 20 ++++++++-- testsuite/tests/polykinds/T15577.hs | 21 ++++++++++ testsuite/tests/polykinds/T15577.stderr | 71 +++++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 1 + 4 files changed, 109 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index 188065f..8509de5 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1714,6 +1714,11 @@ the new one, so we use dischargeFmv. This also kicks out constraints from the inert set; this behavior is correct, as the kind-change may allow more constraints to be solved. +We use `isTcReflexiveCo`, to ensure that we only use the hetero-kinded case +if we really need to. Of course `flattenArgsNom` should return `Refl` +whenever possible, but Trac #15577 was an infinite loop because even +though the coercion was homo-kinded, `kind_co` was not `Refl`, so we +made a new (identical) CFunEqCan, and then the entire process repeated. -} canCFunEqCan :: CtEvidence @@ -1733,13 +1738,20 @@ canCFunEqCan ev fn tys fsk flav = ctEvFlavour ev ; (ev', fsk') - -- See Note [canCFunEqCan] - <- if isTcReflCo kind_co - then do { let fsk_ty = mkTyVarTy fsk + <- if isTcReflexiveCo kind_co -- See Note [canCFunEqCan] + then do { traceTcS "canCFunEqCan: refl" (ppr new_lhs $$ ppr lhs_co) + ; let fsk_ty = mkTyVarTy fsk ; ev' <- rewriteEqEvidence ev NotSwapped new_lhs fsk_ty lhs_co (mkTcNomReflCo fsk_ty) ; return (ev', fsk) } - else do { (ev', new_co, new_fsk) + else do { traceTcS "canCFunEqCan: non-refl" $ + vcat [ text "Kind co:" <+> ppr kind_co + , text "RHS:" <+> ppr fsk <+> dcolon <+> ppr (tyVarKind fsk) + , text "LHS:" <+> hang (ppr (mkTyConApp fn tys)) + 2 (dcolon <+> ppr (typeKind (mkTyConApp fn tys))) + , text "New LHS" <+> hang (ppr new_lhs) + 2 (dcolon <+> ppr (typeKind new_lhs)) ] + ; (ev', new_co, new_fsk) <- newFlattenSkolem flav (ctEvLoc ev) fn tys' ; let xi = mkTyVarTy new_fsk `mkCastTy` kind_co -- sym lhs_co :: F tys ~ F tys' diff --git a/testsuite/tests/polykinds/T15577.hs b/testsuite/tests/polykinds/T15577.hs new file mode 100644 index 0000000..18ebc42 --- /dev/null +++ b/testsuite/tests/polykinds/T15577.hs @@ -0,0 +1,21 @@ +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +{-# LANGUAGE TypeOperators #-} +module Bug where + +import Data.Kind +import Data.Proxy +import Data.Type.Equality + +type family F (x :: f (a :: k)) :: f a + +f :: forall k (f :: k -> Type) (a :: k) (r :: f a). Proxy r -> F r :~: r +f = undefined + +g :: forall (f :: Type -> Type) (a :: Type) (r :: f a). Proxy r -> F r :~: r +g r | Refl <- f -- Uncommenting the line below makes it work again + -- @Type + @f @a @r r + = Refl diff --git a/testsuite/tests/polykinds/T15577.stderr b/testsuite/tests/polykinds/T15577.stderr new file mode 100644 index 0000000..a098ad1 --- /dev/null +++ b/testsuite/tests/polykinds/T15577.stderr @@ -0,0 +1,71 @@ + +T15577.hs:20:18: error: + • Expecting one more argument to ‘f’ + Expected a type, but ‘f’ has kind ‘* -> *’ + • In the type ‘f’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + +T15577.hs:20:21: error: + • Expected kind ‘f1 -> *’, but ‘a’ has kind ‘*’ + • In the type ‘a’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:20:24: error: + • Couldn't match kind ‘* -> *’ with ‘*’ + When matching kinds + f1 :: * -> * + f1 a1 :: * + Expected kind ‘f1’, but ‘r’ has kind ‘f1 a1’ + • In the type ‘r’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:20:26: error: + • Couldn't match kind ‘*’ with ‘* -> *’ + When matching kinds + a1 :: * + f1 :: * -> * + • In the fourth argument of ‘f’, namely ‘r’ + In a stmt of a pattern guard for + an equation for ‘g’: + Refl <- f @f @a @r r + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) + +T15577.hs:21:7: error: + • Could not deduce: F r1 ~ r1 + from the context: r0 ~ F r0 + bound by a pattern with constructor: + Refl :: forall k (a :: k). a :~: a, + in a pattern binding in + a pattern guard for + an equation for ‘g’ + at T15577.hs:18:7-10 + ‘r1’ is a rigid type variable bound by + the type signature for: + g :: forall (f1 :: * -> *) a1 (r1 :: f1 a1). + Proxy r1 -> F r1 :~: r1 + at T15577.hs:17:1-76 + Expected type: F r1 :~: r1 + Actual type: r1 :~: r1 + • In the expression: Refl + In an equation for ‘g’: g r | Refl <- f @f @a @r r = Refl + • Relevant bindings include + r :: Proxy r1 (bound at T15577.hs:18:3) + g :: Proxy r1 -> F r1 :~: r1 (bound at T15577.hs:18:1) diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 425e57a..2d0f993 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -192,3 +192,4 @@ test('T15116', normal, compile_fail, ['']) test('T15116a', normal, compile_fail, ['']) test('T15170', normal, compile, ['']) test('T14939', normal, compile, ['-O']) +test('T15577', normal, compile_fail, ['-O']) From git at git.haskell.org Sun Sep 16 17:10:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 17:10:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #10859 by using foldr1 while deriving Eq instances (bc90726) Message-ID: <20180916171026.284263A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/bc907262b40d09b479d100875b26f1add352523a/ghc >--------------------------------------------------------------- commit bc907262b40d09b479d100875b26f1add352523a Author: Chaitanya Koparkar Date: Mon Aug 27 14:07:08 2018 +0200 Fix #10859 by using foldr1 while deriving Eq instances Summary: Previously, we were using foldl1 instead, which led to the derived code to be wrongly associated. Test Plan: ./validate Reviewers: RyanGlScott, nomeata, simonpj, bgamari Reviewed By: RyanGlScott, nomeata Subscribers: rwbarton, carter GHC Trac Issues: #10859 Differential Revision: https://phabricator.haskell.org/D5104 (cherry picked from commit 2d953a60489ba30433e5f2fe27c50aa9da75f802) >--------------------------------------------------------------- bc907262b40d09b479d100875b26f1add352523a compiler/typecheck/TcGenDeriv.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs index beaad98..bb7cd9a 100644 --- a/compiler/typecheck/TcGenDeriv.hs +++ b/compiler/typecheck/TcGenDeriv.hs @@ -214,7 +214,9 @@ gen_Eq_binds loc tycon = do where nested_eq_expr [] [] [] = true_Expr nested_eq_expr tys as bs - = foldl1 and_Expr (zipWith3Equal "nested_eq" nested_eq tys as bs) + = foldr1 and_Expr (zipWith3Equal "nested_eq" nested_eq tys as bs) + -- Using 'foldr1' here ensures that the derived code is correctly + -- associated. See Trac #10859. where nested_eq ty a b = nlHsPar (eq_Expr tycon ty (nlHsVar a) (nlHsVar b)) From git at git.haskell.org Sun Sep 16 17:10:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 17:10:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix #15550 by quoting RULE names during TH conversion (2cdb2de) Message-ID: <20180916171029.AB88B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/2cdb2de12ce4a96269cfa5fcd69dabfc4eb99786/ghc >--------------------------------------------------------------- commit 2cdb2de12ce4a96269cfa5fcd69dabfc4eb99786 Author: Ryan Scott Date: Mon Aug 27 14:02:42 2018 +0200 Fix #15550 by quoting RULE names during TH conversion Summary: When converting a `RuleP` to a GHC source `RuleD` during TH conversion, we were stupidly not double-quoting the name of the rule. Easily fixed. Test Plan: make test TEST=T15550 Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15550 Differential Revision: https://phabricator.haskell.org/D5090 (cherry picked from commit 5e6cf2a9301a5473ff9c5319b96de941b1ad72dd) >--------------------------------------------------------------- 2cdb2de12ce4a96269cfa5fcd69dabfc4eb99786 compiler/hsSyn/Convert.hs | 4 ++-- testsuite/tests/th/T15550.hs | 8 ++++++++ testsuite/tests/th/T15550.stderr | 11 +++++++++++ testsuite/tests/th/all.T | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index b637a3c..1e6611c 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -706,8 +706,8 @@ cvtPragmaD (RuleP nm bndrs lhs rhs phases) ; rhs' <- cvtl rhs ; returnJustL $ Hs.RuleD noExt $ HsRules noExt (SourceText "{-# RULES") - [noLoc $ HsRule noExt (noLoc (SourceText nm,nm')) act - bndrs' lhs' rhs'] + [noLoc $ HsRule noExt (noLoc (quotedSourceText nm,nm')) + act bndrs' lhs' rhs'] } cvtPragmaD (AnnP target exp) diff --git a/testsuite/tests/th/T15550.hs b/testsuite/tests/th/T15550.hs new file mode 100644 index 0000000..538064c --- /dev/null +++ b/testsuite/tests/th/T15550.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TemplateHaskell #-} +module T15550 where + +$([d| myId :: a -> a + myId x = x + {-# NOINLINE [1] myId #-} + {-# RULES "myId" forall x. myId x = x #-} + |]) diff --git a/testsuite/tests/th/T15550.stderr b/testsuite/tests/th/T15550.stderr new file mode 100644 index 0000000..8169d75 --- /dev/null +++ b/testsuite/tests/th/T15550.stderr @@ -0,0 +1,11 @@ +T15550.hs:(4,3)-(8,6): Splicing declarations + [d| {-# RULES "myId" forall x. myId x = x #-} + + myId :: a -> a + myId x = x + {-# NOINLINE [1] myId #-} |] + ======> + myId :: a -> a + myId x = x + {-# NOINLINE [1] myId #-} + {-# RULES "myId" forall x. myId x = x #-} diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index fb62bd2..280200e 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -421,3 +421,4 @@ test('T15321', normal, compile_fail, ['']) test('T15365', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15518', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T15502', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T15550', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sun Sep 16 20:26:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 20:26:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: base: showEFloat: Handle negative precisions the same of zero precision (2116932) Message-ID: <20180916202651.4DAE23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/2116932ef55fe2f11e04f9a9e593bc73a2e96680/ghc >--------------------------------------------------------------- commit 2116932ef55fe2f11e04f9a9e593bc73a2e96680 Author: Ben Gamari Date: Thu Sep 13 17:09:56 2018 -0400 base: showEFloat: Handle negative precisions the same of zero precision Test Plan: Validate Reviewers: hvr, alpmestan Reviewed By: alpmestan Subscribers: rwbarton, carter GHC Trac Issues: #15509 Differential Revision: https://phabricator.haskell.org/D5083 (cherry picked from commit e71e341f87c055ecc01f85ddd8d7a2094dfa8e9a) >--------------------------------------------------------------- 2116932ef55fe2f11e04f9a9e593bc73a2e96680 libraries/base/GHC/Float.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/base/GHC/Float.hs b/libraries/base/GHC/Float.hs index 26a5987..8790a92 100644 --- a/libraries/base/GHC/Float.hs +++ b/libraries/base/GHC/Float.hs @@ -729,16 +729,18 @@ formatRealFloatAlt fmt decs alt x [d] -> d : ".0e" ++ show_e' (d:ds') -> d : '.' : ds' ++ "e" ++ show_e' [] -> errorWithoutStackTrace "formatRealFloat/doFmt/FFExponent: []" - Just 0 -> + Just d | d <= 0 -> -- handle this case specifically since we need to omit the - -- decimal point as well (#15115) + -- decimal point as well (#15115). + -- Note that this handles negative precisions as well for consistency + -- (see #15509). case is of [0] -> "0e0" _ -> let (ei,is') = roundTo base 1 is - d:_ = map intToDigit (if ei > 0 then init is' else is') - in d : 'e' : show (e-1+ei) + n:_ = map intToDigit (if ei > 0 then init is' else is') + in n : 'e' : show (e-1+ei) Just dec -> let dec' = max dec 1 in case is of From git at git.haskell.org Sun Sep 16 20:26:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 20:26:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Update hsc2hs submodule (c5debde) Message-ID: <20180916202654.1BF5D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/c5debde59121f44f6f3e63ffabbf48954b23baac/ghc >--------------------------------------------------------------- commit c5debde59121f44f6f3e63ffabbf48954b23baac Author: Chaitanya Koparkar Date: Thu Sep 13 18:15:18 2018 -0400 Update hsc2hs submodule Test Plan: ./validate Reviewers: bgamari, hvr, RyanGlScott Reviewed By: RyanGlScott Subscribers: monoidal, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5114 (cherry picked from commit ce240b3f998b68853c47ab131126eb9a245256c5) >--------------------------------------------------------------- c5debde59121f44f6f3e63ffabbf48954b23baac utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 6b6938d..769ac3c 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 6b6938db11a33904bb6ba90d70d89df4b72a7f90 +Subproject commit 769ac3cda8bd766e9a41a74eb681e2de1bac6795 From git at git.haskell.org Sun Sep 16 22:30:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 22:30:02 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump stm submodule (f458bca) Message-ID: <20180916223002.F0BFA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/f458bca3a9667af95b8782747eab5b0e70cba4b4/ghc >--------------------------------------------------------------- commit f458bca3a9667af95b8782747eab5b0e70cba4b4 Author: Ben Gamari Date: Sun Sep 16 16:51:53 2018 -0400 Bump stm submodule >--------------------------------------------------------------- f458bca3a9667af95b8782747eab5b0e70cba4b4 libraries/stm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stm b/libraries/stm index 4a1deb9..5f4d7c6 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 4a1deb98fc95e55d8a6762a7dfec1a7dfa8b49b2 +Subproject commit 5f4d7c6d07a760d935c9d96e62999f1ad38a5e43 From git at git.haskell.org Sun Sep 16 22:30:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 22:30:05 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump Cabal submodule (4b094c6) Message-ID: <20180916223005.BEA0C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/4b094c6df6cbc5ead462b358ab6da8682fcb13bd/ghc >--------------------------------------------------------------- commit 4b094c6df6cbc5ead462b358ab6da8682fcb13bd Author: Ben Gamari Date: Sun Sep 16 16:55:49 2018 -0400 Bump Cabal submodule >--------------------------------------------------------------- 4b094c6df6cbc5ead462b358ab6da8682fcb13bd libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index b00d215..88738ba 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit b00d2150b3f2d216aa7458606c9c018f9beb75a2 +Subproject commit 88738ba53070de11052c6ba8df9d1807a92583d4 From git at git.haskell.org Sun Sep 16 22:30:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 22:30:08 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump deepseq submodule (c4209ba) Message-ID: <20180916223008.8ADD93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/c4209ba8a448b501a11d66640d280fe1e194f847/ghc >--------------------------------------------------------------- commit c4209ba8a448b501a11d66640d280fe1e194f847 Author: Ben Gamari Date: Sun Sep 16 16:56:16 2018 -0400 Bump deepseq submodule >--------------------------------------------------------------- c4209ba8a448b501a11d66640d280fe1e194f847 libraries/deepseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/deepseq b/libraries/deepseq index fe94780..4f03181 160000 --- a/libraries/deepseq +++ b/libraries/deepseq @@ -1 +1 @@ -Subproject commit fe94780b629b27969c5e8965e6e6ccde564ece61 +Subproject commit 4f031810fc0eaf5ba12d805ff8df7f15e561e407 From git at git.haskell.org Sun Sep 16 22:30:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 16 Sep 2018 22:30:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump text submodule (a512f1e) Message-ID: <20180916223011.592E63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/a512f1e32bd4d6079559e3172522591863321fe7/ghc >--------------------------------------------------------------- commit a512f1e32bd4d6079559e3172522591863321fe7 Author: Ben Gamari Date: Sun Sep 16 16:55:21 2018 -0400 Bump text submodule >--------------------------------------------------------------- a512f1e32bd4d6079559e3172522591863321fe7 libraries/text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/text b/libraries/text index a02c2da..44ec2ce 160000 --- a/libraries/text +++ b/libraries/text @@ -1 +1 @@ -Subproject commit a02c2dafafa425bd5f36c8629e98b98daf1cfa1e +Subproject commit 44ec2cee65e5326ed943370e424f60d4ae6206d1 From git at git.haskell.org Mon Sep 17 16:23:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 16:23:40 +0000 (UTC) Subject: [commit: ghc] master: Stable name comment wibbles (d1c2f29) Message-ID: <20180917162340.93D003A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1c2f298870dbce29758243da54d2e29dd83246b/ghc >--------------------------------------------------------------- commit d1c2f298870dbce29758243da54d2e29dd83246b Author: David Feuer Date: Mon Sep 17 16:46:05 2018 +0200 Stable name comment wibbles Summary: Some comments in the `StableName` code still referred to stable pointer details. Fix that. Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5152 >--------------------------------------------------------------- d1c2f298870dbce29758243da54d2e29dd83246b rts/StableName.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/rts/StableName.c b/rts/StableName.c index abe7b69..757eb59 100644 --- a/rts/StableName.c +++ b/rts/StableName.c @@ -106,21 +106,6 @@ enlargeStableNameTable(void) initSnEntryFreeList(stable_name_table + old_SNT_size, old_SNT_size, NULL); } -/* Note [Enlarging the stable pointer table] - * - * To enlarge the stable pointer table, we allocate a new table, copy the - * existing entries, and then store the old version of the table in old_SPTs - * until we free it during GC. By not immediately freeing the old version - * (or equivalently by not growing the table using realloc()), we ensure that - * another thread simultaneously dereferencing a stable pointer using the old - * version can safely access the table without causing a segfault (see Trac - * #10296). - * - * Note that because the stable pointer table is doubled in size each time it is - * enlarged, the total memory needed to store the old versions is always less - * than that required to hold the current version. - */ - /* ----------------------------------------------------------------------------- * Freeing entries and tables @@ -262,10 +247,10 @@ rememberOldStableNameAddresses(void) } /* ----------------------------------------------------------------------------- - * Thread the stable pointer table for compacting GC. + * Thread the stable name table for compacting GC. * * Here we must call the supplied evac function for each pointer into - * the heap from the stable tables, because the compacting + * the heap from the stable name table, because the compacting * collector may move the object it points to. * -------------------------------------------------------------------------- */ From git at git.haskell.org Mon Sep 17 16:23:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 16:23:43 +0000 (UTC) Subject: [commit: ghc] master: base: Add bangs to GHC.IO.Handle.Text hGet* functions (88130db) Message-ID: <20180917162343.637F23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/88130dbe948eaa7f76cf237d8aba17b41fac4904/ghc >--------------------------------------------------------------- commit 88130dbe948eaa7f76cf237d8aba17b41fac4904 Author: Ben Gamari Date: Mon Sep 17 16:46:26 2018 +0200 base: Add bangs to GHC.IO.Handle.Text hGet* functions Summary: I believe that demand analysis doesn't notice that these are morally strict in the pointer argument due to the `count == 0` special case. Fixes #15638. Test Plan: Validate Reviewers: andrewthad, hvr Reviewed By: andrewthad Subscribers: rwbarton, carter GHC Trac Issues: #15638 Differential Revision: https://phabricator.haskell.org/D5149 >--------------------------------------------------------------- 88130dbe948eaa7f76cf237d8aba17b41fac4904 libraries/base/GHC/IO/Handle/Text.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/IO/Handle/Text.hs b/libraries/base/GHC/IO/Handle/Text.hs index 943d769..dcf4b7c 100644 --- a/libraries/base/GHC/IO/Handle/Text.hs +++ b/libraries/base/GHC/IO/Handle/Text.hs @@ -808,7 +808,7 @@ writeChunkNonBlocking h_ at Handle__{..} ptr bytes -- on the 'Handle', and reads bytes directly. hGetBuf :: Handle -> Ptr a -> Int -> IO Int -hGetBuf h ptr count +hGetBuf h !ptr count | count == 0 = return 0 | count < 0 = illegalBufferSize h "hGetBuf" count | otherwise = @@ -890,7 +890,7 @@ bufReadEmpty h_ at Handle__{..} -- 'NewlineMode' on the 'Handle', and reads bytes directly. hGetBufSome :: Handle -> Ptr a -> Int -> IO Int -hGetBufSome h ptr count +hGetBufSome h !ptr count | count == 0 = return 0 | count < 0 = illegalBufferSize h "hGetBufSome" count | otherwise = @@ -935,7 +935,7 @@ haFD h_ at Handle__{..} = cast haDevice -- behaves identically to 'hGetBuf'. hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int -hGetBufNonBlocking h ptr count +hGetBufNonBlocking h !ptr count | count == 0 = return 0 | count < 0 = illegalBufferSize h "hGetBufNonBlocking" count | otherwise = From git at git.haskell.org Mon Sep 17 16:23:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 16:23:46 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Fix code-block layout for QuantifiedConstraints (43967c0) Message-ID: <20180917162346.420353A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/43967c0c7d2d0110cfc5f9d64a7dab3a3dda8953/ghc >--------------------------------------------------------------- commit 43967c0c7d2d0110cfc5f9d64a7dab3a3dda8953 Author: Takenobu Tani Date: Mon Sep 17 16:47:02 2018 +0200 users-guide: Fix code-block layout for QuantifiedConstraints Summary: Fix code-block layout for QuantifiedConstraints. [ci skip] Test Plan: build Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5121 >--------------------------------------------------------------- 43967c0c7d2d0110cfc5f9d64a7dab3a3dda8953 docs/users_guide/glasgow_exts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 0c977d0..6d960a6 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -9752,7 +9752,7 @@ This idea is very old; see Seciton 7 of `Derivable type classes `_ defines a ``context`` (the bit to the left of ``=>`` in a type) like this :: +`Haskell 2010 `_ defines a ``context`` (the bit to the left of ``=>`` in a type) like this .. code-block:: none @@ -9762,7 +9762,7 @@ Syntax changes class ::= qtycls tyvar | qtycls (tyvar atype1 ... atypen) -We to extend ``class`` (warning: this is a rather confusingly named non-terminal symbol) with two extra forms, namely precisely what can appear in an instance declaration :: +We to extend ``class`` (warning: this is a rather confusingly named non-terminal symbol) with two extra forms, namely precisely what can appear in an instance declaration .. code-block:: none @@ -9775,9 +9775,9 @@ The ``context =>`` part is optional. That is the only syntactic change to the l Notes: -- Where GHC allows extensions instance declarations we allow exactly the same extensions to this new form of ``class``. Specifically, with :extension:`ExplicitForAll` and :extension:`MultiParameterTypeClasses` the syntax becomes :: +- Where GHC allows extensions instance declarations we allow exactly the same extensions to this new form of ``class``. Specifically, with :extension:`ExplicitForAll` and :extension:`MultiParameterTypeClasses` the syntax becomes -.. code-block:: none + .. code-block:: none class ::= ... | [forall tyavrs .] [context =>] qtycls inst1 ... instn From git at git.haskell.org Mon Sep 17 20:25:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 20:25:47 +0000 (UTC) Subject: [commit: ghc] master: Make sure forM_ and related functions fuse cleanly (e655aac) Message-ID: <20180917202547.ED5743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e655aac18c5b240f27fcaf26317ad87be5ce8b96/ghc >--------------------------------------------------------------- commit e655aac18c5b240f27fcaf26317ad87be5ce8b96 Author: Sebastian Graf Date: Mon Sep 17 21:11:09 2018 +0200 Make sure forM_ and related functions fuse cleanly Summary: It was revealed in #8763 that it's hard to come up with a list fusion helper for `efdtIntFB` that doesn't duplicated occurrences of `c`, which is crucial in guaranteeing that it is inlined. Not inlining `c` led to spoiled join points, in turn leading to unnecessary heap allocation. This patch tackles the problem from a different angle: Fixing all consumers instead of the less often used producer `efdtIntFB` by inserting an INLINE pragma in the appropriate places. See https://ghc.haskell.org/trac/ghc/ticket/8763#comment:76 and the new Note [List fusion and continuations in 'c']. A quick run of NoFib revealed no regression or improvements whatsoever. Reviewers: hvr, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #8763 Differential Revision: https://phabricator.haskell.org/D5131 >--------------------------------------------------------------- e655aac18c5b240f27fcaf26317ad87be5ce8b96 libraries/base/Data/Foldable.hs | 110 ++++++++++++++++++++++++++--- testsuite/tests/perf/compiler/T4007.stdout | 4 +- testsuite/tests/perf/should_run/T8763.hs | 41 +++++++++++ testsuite/tests/perf/should_run/all.T | 7 ++ 4 files changed, 153 insertions(+), 9 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e655aac18c5b240f27fcaf26317ad87be5ce8b96 From git at git.haskell.org Mon Sep 17 20:34:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 20:34:25 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step2: Fix closeOverKinds to use unclosed sets internally (f3dd2ff) Message-ID: <20180917203425.B42983A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step2 Link : http://ghc.haskell.org/trac/ghc/changeset/f3dd2ff01cb2e5731cd5bcae00580754817508cd/ghc >--------------------------------------------------------------- commit f3dd2ff01cb2e5731cd5bcae00580754817508cd Author: Tobias Dammers Date: Thu Sep 13 08:50:41 2018 +0200 Fix closeOverKinds to use unclosed sets internally >--------------------------------------------------------------- f3dd2ff01cb2e5731cd5bcae00580754817508cd compiler/types/TyCoRep.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 2823280..1f33ca6 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1899,7 +1899,9 @@ coVarsOfCos = mapUnionVarSet coVarsOfCo -- Returns a non-deterministic set. closeOverKinds :: TyVarSet -> TyVarSet closeOverKinds tvs = - mapUnionVarSetSet (tyCoVarsOfType . tyVarKind) tvs `unionVarSet` tvs + mapUnionVarSetSet (tvs_of_type . tyVarKind) tvs `unionVarSet` tvs + where + tvs_of_type ts = ty_co_vars_of_type ts emptyVarSet emptyVarSet -- | Given a list of tyvars returns a deterministic FV computation that -- returns the given tyvars with the kind variables free in the kinds of the From git at git.haskell.org Mon Sep 17 20:37:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 20:37:31 +0000 (UTC) Subject: [commit: ghc] wip/T14880-2-step3: Add test for #14880 (a71f022) Message-ID: <20180917203731.747E03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T14880-2-step3 Link : http://ghc.haskell.org/trac/ghc/changeset/a71f02265c81c22965999ec2593cf4bec81301ff/ghc >--------------------------------------------------------------- commit a71f02265c81c22965999ec2593cf4bec81301ff Author: Tobias Dammers Date: Fri Sep 14 13:48:20 2018 +0200 Add test for #14880 >--------------------------------------------------------------- a71f02265c81c22965999ec2593cf4bec81301ff .../tests/dependent/should_compile/{T14880.hs => T14880-2.hs} | 8 +++----- testsuite/tests/dependent/should_compile/all.T | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/dependent/should_compile/T14880.hs b/testsuite/tests/dependent/should_compile/T14880-2.hs similarity index 52% copy from testsuite/tests/dependent/should_compile/T14880.hs copy to testsuite/tests/dependent/should_compile/T14880-2.hs index 91cfb20..e7057a3 100644 --- a/testsuite/tests/dependent/should_compile/T14880.hs +++ b/testsuite/tests/dependent/should_compile/T14880-2.hs @@ -1,6 +1,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeInType #-} +{-# LANGUAGE PartialTypeSignatures #-} module Bug where import Data.Kind @@ -8,8 +9,5 @@ import Data.Proxy data Foo (x :: Type) :: forall (a :: x). Proxy a -> Type -data Bar :: Type -> Type where - MkBar :: forall x arg. - -- Commenting out the line below makes the issue go away - Foo arg ~ Foo arg => - Bar x +quux :: forall arg. Proxy (Foo arg) -> () +quux (_ :: _) = () diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 5661807..dca19b9 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -56,3 +56,4 @@ test('T15419', normal, compile, ['']) test('T14066h', normal, compile, ['']) test('T14904', expect_broken(14904), compile, ['']) test('T14880', normal, compile, ['']) +test('T14880-2', normal, compile, ['']) From git at git.haskell.org Mon Sep 17 21:31:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 17 Sep 2018 21:31:09 +0000 (UTC) Subject: [commit: ghc] master: Updated PE linker, section alignment and cleanup. (5840734) Message-ID: <20180917213109.02A7E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5840734379da5d494a368d0b8a6edf1b1216a7f4/ghc >--------------------------------------------------------------- commit 5840734379da5d494a368d0b8a6edf1b1216a7f4 Author: Tamar Christina Date: Mon Sep 17 22:06:05 2018 +0100 Updated PE linker, section alignment and cleanup. Summary: This patch is to address a couple of short comings of the PE linker. The first thing it does is properly honor section alignments, so SSE code will work reliably. While doing this I've also changed how it reads and stores ObjectFile information. Previously the entire object file was read in and treated as one blob, including headers, symbol tables etc. Now the ObjectFile is read in but stored in chunks, tables go into a temporary info struct and code/data into a new private heap. This allows me to free all meta data once we're done relocating. Which means we can reclaim this memory. As I've mentioned above I've also moved from using VirtualAlloc to HeapAlloc. The reason is VirtualAlloc is meant to be used for more low level memory allocation, it's very fast because it can only allocate whole blocks, (64k) by default, and the memory must be paged (4k) aligned. So when you ask for e.g. 30k of memory, you're given a whole block where 34k will be wasted memory. Nothing else can ever access that untill you free the 30k. One downside of HeapAlloc is that you're not in control of how the heap grows, and heap memory is always committed. So it's harder to tell how much we're actually using now. Another big upside of splitting off the ObjectCode tables to info structs is that I can adjust them, so that later addressings can just use array subscripts to index into them. This simplifies the code a lot and a lot of complicated casts and indexing can be removed. Leaving less and more simple code. This patch doesn't fix the memprotection but it doesn't regress it either. It does however make the next changes smaller and fixes the alignments. Test Plan: ./validate , new test T13617 Reviewers: bgamari, erikd, simonmar, hvr, angerman Reviewed By: angerman Subscribers: nickkuk, carter, RyanGlScott, rwbarton, thomie GHC Trac Issues: #13617 Differential Revision: https://phabricator.haskell.org/D3915 >--------------------------------------------------------------- 5840734379da5d494a368d0b8a6edf1b1216a7f4 docs/users_guide/8.8.1-notes.rst | 5 + rts/Linker.c | 65 ++- rts/LinkerInternals.h | 31 +- rts/linker/LoadArchive.c | 9 +- rts/linker/PEi386.c | 1146 +++++++++++++++++++------------------ rts/linker/PEi386.h | 39 +- rts/linker/PEi386Types.h | 35 ++ testsuite/tests/rts/Makefile | 5 + testsuite/tests/rts/T13617.c | 8 + testsuite/tests/rts/T13617.hs | 15 + testsuite/tests/rts/T13617.stdout | 1 + testsuite/tests/rts/all.T | 3 + 12 files changed, 741 insertions(+), 621 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5840734379da5d494a368d0b8a6edf1b1216a7f4 From git at git.haskell.org Tue Sep 18 04:51:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 04:51:57 +0000 (UTC) Subject: [commit: ghc] master: Users guide: EmptyDataDecls on by default (4edc6d6) Message-ID: <20180918045157.4C8843A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4edc6d64d1bc1898c0974cf26c5713a3b2724a0b/ghc >--------------------------------------------------------------- commit 4edc6d64d1bc1898c0974cf26c5713a3b2724a0b Author: Chris Martin Date: Thu Aug 30 13:23:59 2018 -0400 Users guide: EmptyDataDecls on by default >--------------------------------------------------------------- 4edc6d64d1bc1898c0974cf26c5713a3b2724a0b docs/users_guide/glasgow_exts.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 6d960a6..3ce6a60 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2314,8 +2314,16 @@ Data types with no constructors Allow definition of empty ``data`` types. -With the :extension:`EmptyDataDecls` extension, GHC -lets you declare a data type with no constructors. For example: :: +With the :extension:`EmptyDataDecls` extension, GHC lets you declare a +data type with no constructors. + +You only need to enable this extension if the language you're using +is Haskell 98, in which a data type must have at least one constructor. +Haskell 2010 relaxed this rule to allow data types with no constructors, +and thus :extension:`EmptyDataDecls` is enabled by default when the +language is Haskell 2010. + +For example: :: data S -- S :: Type data T a -- T :: Type -> Type From git at git.haskell.org Tue Sep 18 14:19:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 14:19:24 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Fix T15502 on 32-bit (6cad8e3) Message-ID: <20180918141924.55F793A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/6cad8e31dc852594aad8512d01eb9730d3371249/ghc >--------------------------------------------------------------- commit 6cad8e31dc852594aad8512d01eb9730d3371249 Author: Krzysztof Gogolewski Date: Fri Sep 14 14:38:42 2018 +0200 Fix T15502 on 32-bit Summary: The expected output uses a hardcoded value for maxBound :: Int. This should fix one of circleci failures on i386. Test Plan: make test TEST=T15502 Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15502 Differential Revision: https://phabricator.haskell.org/D5151 (cherry picked from commit ecbe26b6966a3a64f4e22e862370536b1dd4440f) >--------------------------------------------------------------- 6cad8e31dc852594aad8512d01eb9730d3371249 testsuite/tests/th/T15502.stderr-ws-32 | 4 ++++ testsuite/tests/th/{T15502.stderr => T15502.stderr-ws-64} | 0 2 files changed, 4 insertions(+) diff --git a/testsuite/tests/th/T15502.stderr-ws-32 b/testsuite/tests/th/T15502.stderr-ws-32 new file mode 100644 index 0000000..ba7b91c --- /dev/null +++ b/testsuite/tests/th/T15502.stderr-ws-32 @@ -0,0 +1,4 @@ +T15502.hs:7:19-56: Splicing expression + lift (toInteger (maxBound :: Int) + 1) ======> 2147483648 +T15502.hs:8:19-40: Splicing expression + lift (minBound :: Int) ======> (-2147483648) diff --git a/testsuite/tests/th/T15502.stderr b/testsuite/tests/th/T15502.stderr-ws-64 similarity index 100% rename from testsuite/tests/th/T15502.stderr rename to testsuite/tests/th/T15502.stderr-ws-64 From git at git.haskell.org Tue Sep 18 17:06:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 17:06:50 +0000 (UTC) Subject: [commit: ghc] master: NoImplicitPrelude in ghc-boot-th, ghc-boot, ghc-heap, ghci (01f7cd7) Message-ID: <20180918170650.959133A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/01f7cd799c1c0eb3fa91e5e0c3ca1d08594121bd/ghc >--------------------------------------------------------------- commit 01f7cd799c1c0eb3fa91e5e0c3ca1d08594121bd Author: Shayne Fletcher Date: Tue Aug 21 07:58:16 2018 -0400 NoImplicitPrelude in ghc-boot-th, ghc-boot, ghc-heap, ghci PR: https://github.com/ghc/ghc/pull/184 >--------------------------------------------------------------- 01f7cd799c1c0eb3fa91e5e0c3ca1d08594121bd compiler/utils/GhcPrelude.hs | 13 +++++++++++++ libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs | 1 + libraries/ghc-boot-th/GHC/LanguageExtensions/Type.hs | 1 + libraries/ghc-boot-th/GHC/Lexeme.hs | 1 + libraries/ghc-boot-th/ghc-boot-th.cabal.in | 1 + libraries/ghc-boot/GHC/HandleEncoding.hs | 1 + libraries/ghc-boot/GHC/PackageDb.hs | 1 + libraries/ghc-boot/GHC/Serialized.hs | 1 + libraries/ghc-boot/ghc-boot.cabal.in | 1 + libraries/ghc-heap/GHC/Exts/Heap.hs | 1 + libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs | 1 + libraries/ghc-heap/GHC/Exts/Heap/Closures.hs | 1 + libraries/ghc-heap/GHC/Exts/Heap/Constants.hsc | 1 + libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 1 + libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc | 1 + libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc | 1 + libraries/ghc-heap/GHC/Exts/Heap/Utils.hsc | 1 + libraries/ghc-heap/ghc-heap.cabal.in | 3 +++ libraries/ghci/GHCi/BinaryArray.hs | 1 + libraries/ghci/GHCi/BreakArray.hs | 1 + libraries/ghci/GHCi/CreateBCO.hs | 1 + libraries/ghci/GHCi/FFI.hsc | 1 + libraries/ghci/GHCi/InfoTable.hsc | 1 + libraries/ghci/GHCi/Message.hs | 1 + libraries/ghci/GHCi/ObjLink.hs | 1 + libraries/ghci/GHCi/RemoteTypes.hs | 1 + libraries/ghci/GHCi/ResolvedBCO.hs | 1 + libraries/ghci/GHCi/Run.hs | 1 + libraries/ghci/GHCi/Signals.hs | 1 + libraries/ghci/GHCi/StaticPtrTable.hs | 1 + libraries/ghci/GHCi/TH.hs | 1 + libraries/ghci/GHCi/TH/Binary.hs | 1 + libraries/ghci/SizedSeq.hs | 1 + libraries/ghci/ghci.cabal.in | 1 + 34 files changed, 48 insertions(+) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 01f7cd799c1c0eb3fa91e5e0c3ca1d08594121bd From git at git.haskell.org Tue Sep 18 17:06:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 17:06:53 +0000 (UTC) Subject: [commit: ghc] master: Fix check whether GCC supports __atomic_ builtins (ce3897f) Message-ID: <20180918170653.6BB733A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae/ghc >--------------------------------------------------------------- commit ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae Author: Ilias Tsitsimpis Date: Tue Sep 18 17:45:17 2018 +0200 Fix check whether GCC supports __atomic_ builtins Summary: C11 atomics are never used because: * The program used for checking whether GCC supports __atomic_ builtins fails with the following error: ``` error: size mismatch in argument 2 of `__atomic_load` int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; } ``` * There is a typo when checking if CONF_GCC_SUPPORTS__ATOMICS equals YES, resulting in PRIM_CFLAGS and PRIM_EXTRA_LIBRARIES never being set. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5154 >--------------------------------------------------------------- ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae libraries/ghc-prim/aclocal.m4 | 2 +- libraries/ghc-prim/configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/ghc-prim/aclocal.m4 b/libraries/ghc-prim/aclocal.m4 index e569538..81fc44c 100644 --- a/libraries/ghc-prim/aclocal.m4 +++ b/libraries/ghc-prim/aclocal.m4 @@ -5,7 +5,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], [ AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) - echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c + echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c if $CC -c conftest.c > /dev/null 2>&1; then CONF_GCC_SUPPORTS__ATOMICS=YES AC_MSG_RESULT([yes]) diff --git a/libraries/ghc-prim/configure.ac b/libraries/ghc-prim/configure.ac index bacc89c..8249be3 100644 --- a/libraries/ghc-prim/configure.ac +++ b/libraries/ghc-prim/configure.ac @@ -8,7 +8,7 @@ dnl unregisterised, Sparc, and PPC backends. FP_GCC_SUPPORTS__ATOMICS AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?]) -if test "x$CONF_GCC_SUPPORTS__ATOMICS" = YES +if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES" then PRIM_CFLAGS=-DHAVE_C11_ATOMICS PRIM_EXTRA_LIBRARIES=atomic fi From git at git.haskell.org Tue Sep 18 17:06:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 17:06:56 +0000 (UTC) Subject: [commit: ghc] master: Invert FP conditions to eliminate the explicit NaN check. (6bb9bc7) Message-ID: <20180918170656.D06213A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6bb9bc7d3c935dcb77e0700cce28de2c9df646df/ghc >--------------------------------------------------------------- commit 6bb9bc7d3c935dcb77e0700cce28de2c9df646df Author: klebinger.andreas at gmx.at Date: Tue Sep 18 17:46:38 2018 +0200 Invert FP conditions to eliminate the explicit NaN check. Summary: Optimisation: we don't have to test the parity flag if we know the test has already excluded the unordered case: eg > and >= test for a zero carry flag, which can only occur for ordered operands. By reversing comparisons we can avoid testing the parity for < and <= as well. This works since: * If any of the arguments is an NaN CF gets set. Resulting in a false result. * Since this allows us to rule out NaN we can exchange the arguments and invert the direction of the arrows. Test Plan: ci/nofib Reviewers: carter, bgamari, alpmestan Reviewed By: alpmestan Subscribers: alpmestan, simonpj, jmct, rwbarton, thomie GHC Trac Issues: #15196 Differential Revision: https://phabricator.haskell.org/D4990 >--------------------------------------------------------------- 6bb9bc7d3c935dcb77e0700cce28de2c9df646df compiler/nativeGen/X86/CodeGen.hs | 100 ++++++++++++++++----- testsuite/tests/codeGen/should_compile/Makefile | 3 + testsuite/tests/codeGen/should_compile/T15196.hs | 4 + .../tests/codeGen/should_compile/T15196.stdout | 1 + testsuite/tests/codeGen/should_compile/all.T | 6 ++ 5 files changed, 92 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6bb9bc7d3c935dcb77e0700cce28de2c9df646df From git at git.haskell.org Tue Sep 18 18:16:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 18:16:34 +0000 (UTC) Subject: [commit: ghc] master: Bump stm submodule (e40b388) Message-ID: <20180918181634.97EA93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e40b3888d7b70bb5c95c377cac66b2839332673d/ghc >--------------------------------------------------------------- commit e40b3888d7b70bb5c95c377cac66b2839332673d Author: Ben Gamari Date: Sun Sep 16 16:51:53 2018 -0400 Bump stm submodule (cherry picked from commit f458bca3a9667af95b8782747eab5b0e70cba4b4) >--------------------------------------------------------------- e40b3888d7b70bb5c95c377cac66b2839332673d libraries/stm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stm b/libraries/stm index 4a1deb9..5f4d7c6 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 4a1deb98fc95e55d8a6762a7dfec1a7dfa8b49b2 +Subproject commit 5f4d7c6d07a760d935c9d96e62999f1ad38a5e43 From git at git.haskell.org Tue Sep 18 18:16:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 18:16:49 +0000 (UTC) Subject: [commit: ghc] master: Bump text submodule (989dca6) Message-ID: <20180918181649.BD3C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/989dca6cbd93205a72f12a0921ba1216559a9e1e/ghc >--------------------------------------------------------------- commit 989dca6cbd93205a72f12a0921ba1216559a9e1e Author: Ben Gamari Date: Sun Sep 16 16:55:21 2018 -0400 Bump text submodule (cherry picked from commit a512f1e32bd4d6079559e3172522591863321fe7) >--------------------------------------------------------------- 989dca6cbd93205a72f12a0921ba1216559a9e1e libraries/text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/text b/libraries/text index a02c2da..44ec2ce 160000 --- a/libraries/text +++ b/libraries/text @@ -1 +1 @@ -Subproject commit a02c2dafafa425bd5f36c8629e98b98daf1cfa1e +Subproject commit 44ec2cee65e5326ed943370e424f60d4ae6206d1 From git at git.haskell.org Tue Sep 18 18:17:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 18:17:04 +0000 (UTC) Subject: [commit: ghc] master: Bump deepseq submodule (2b763b5) Message-ID: <20180918181704.E37BB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2b763b5f26607fe1e9e062f9691f559058fdafa2/ghc >--------------------------------------------------------------- commit 2b763b5f26607fe1e9e062f9691f559058fdafa2 Author: Ben Gamari Date: Sun Sep 16 16:56:16 2018 -0400 Bump deepseq submodule (cherry picked from commit c4209ba8a448b501a11d66640d280fe1e194f847) >--------------------------------------------------------------- 2b763b5f26607fe1e9e062f9691f559058fdafa2 libraries/deepseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/deepseq b/libraries/deepseq index fe94780..4f03181 160000 --- a/libraries/deepseq +++ b/libraries/deepseq @@ -1 +1 @@ -Subproject commit fe94780b629b27969c5e8965e6e6ccde564ece61 +Subproject commit 4f031810fc0eaf5ba12d805ff8df7f15e561e407 From git at git.haskell.org Tue Sep 18 18:17:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 18 Sep 2018 18:17:20 +0000 (UTC) Subject: [commit: ghc] master: Don't shortcut SRTs for static functions (#15544) (1971e99) Message-ID: <20180918181720.3A4D53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1971e9995b7c4acf550093f15e17dfdad47caaf9/ghc >--------------------------------------------------------------- commit 1971e9995b7c4acf550093f15e17dfdad47caaf9 Author: Simon Marlow Date: Tue Sep 18 11:47:56 2018 -0400 Don't shortcut SRTs for static functions (#15544) Shortcutting the SRT for a static function can lead to resurrecting a static object at runtime, which violates assumptions in the GC. See comments for details. Test Plan: - manual testing (in progress) - validate Reviewers: osa1, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15544 Differential Revision: https://phabricator.haskell.org/D5145 >--------------------------------------------------------------- 1971e9995b7c4acf550093f15e17dfdad47caaf9 compiler/cmm/CmmBuildInfoTables.hs | 152 +++++++++++++++++++++++++++++++------ 1 file changed, 130 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1971e9995b7c4acf550093f15e17dfdad47caaf9 From git at git.haskell.org Wed Sep 19 07:02:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 07:02:48 +0000 (UTC) Subject: [commit: ghc] master: docs: fix example code (a4ae97e) Message-ID: <20180919070248.AE8403A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a4ae97ea631461ec1fd9d7aabab767eaa0bec185/ghc >--------------------------------------------------------------- commit a4ae97ea631461ec1fd9d7aabab767eaa0bec185 Author: john Date: Mon Sep 17 06:21:39 2018 +0000 docs: fix example code PR: https://github.com/ghc/ghc/pull/197/ >--------------------------------------------------------------- a4ae97ea631461ec1fd9d7aabab767eaa0bec185 docs/users_guide/extending_ghc.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 5b1a6cc..ef07f61 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -130,10 +130,10 @@ when invoked: import GHC import GHC.Paths ( libdir ) - import DynFlags ( defaultLogAction ) + import DynFlags ( defaultFatalMessager, defaultFlushOut ) main = - defaultErrorHandler defaultLogAction $ do + defaultErrorHandler defaultFatalMessager defaultFlushOut $ do runGhc (Just libdir) $ do dflags <- getSessionDynFlags setSessionDynFlags dflags From git at git.haskell.org Wed Sep 19 10:29:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 10:29:51 +0000 (UTC) Subject: [commit: ghc] master: Use predefined known-key names when possible (45befe2) Message-ID: <20180919102951.97F0C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45befe27495b1a7bca037b6a3eedf2474a0204c8/ghc >--------------------------------------------------------------- commit 45befe27495b1a7bca037b6a3eedf2474a0204c8 Author: Chaitanya Koparkar Date: Wed Sep 19 09:19:53 2018 +0200 Use predefined known-key names when possible Summary: For certain entities in 'PrelNames', we were creating new 'Name's instead of reusing the ones already defined. Easily fixed. Test Plan: ./validate Reviewers: dfeuer, RyanGlScott, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #13279 Differential Revision: https://phabricator.haskell.org/D5160 >--------------------------------------------------------------- 45befe27495b1a7bca037b6a3eedf2474a0204c8 compiler/prelude/PrelNames.hs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 90f1f44..d75ad47 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -630,9 +630,9 @@ le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=") lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<") gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">") compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare") -ltTag_RDR = dataQual_RDR gHC_TYPES (fsLit "LT") -eqTag_RDR = dataQual_RDR gHC_TYPES (fsLit "EQ") -gtTag_RDR = dataQual_RDR gHC_TYPES (fsLit "GT") +ltTag_RDR = nameRdrName ordLTDataConName +eqTag_RDR = nameRdrName ordEQDataConName +gtTag_RDR = nameRdrName ordGTDataConName eqClass_RDR, numClass_RDR, ordClass_RDR, enumClass_RDR, monadClass_RDR :: RdrName @@ -643,10 +643,11 @@ enumClass_RDR = nameRdrName enumClassName monadClass_RDR = nameRdrName monadClassName map_RDR, append_RDR :: RdrName -map_RDR = varQual_RDR gHC_BASE (fsLit "map") -append_RDR = varQual_RDR gHC_BASE (fsLit "++") +map_RDR = nameRdrName mapName +append_RDR = nameRdrName appendName -foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR_preMFP, failM_RDR:: RdrName +foldr_RDR, build_RDR, returnM_RDR, bindM_RDR, failM_RDR_preMFP, + failM_RDR :: RdrName foldr_RDR = nameRdrName foldrName build_RDR = nameRdrName buildName returnM_RDR = nameRdrName returnMName @@ -822,9 +823,9 @@ conIsRecord_RDR = varQual_RDR gHC_GENERICS (fsLit "conIsRecord") prefixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Prefix") infixDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "Infix") -leftAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "LeftAssociative") -rightAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "RightAssociative") -notAssocDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "NotAssociative") +leftAssocDataCon_RDR = nameRdrName leftAssociativeDataConName +rightAssocDataCon_RDR = nameRdrName rightAssociativeDataConName +notAssocDataCon_RDR = nameRdrName notAssociativeDataConName uAddrDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UAddr") uCharDataCon_RDR = dataQual_RDR gHC_GENERICS (fsLit "UChar") @@ -843,7 +844,7 @@ uWordHash_RDR = varQual_RDR gHC_GENERICS (fsLit "uWord#") fmap_RDR, replace_RDR, pure_RDR, ap_RDR, liftA2_RDR, foldable_foldr_RDR, foldMap_RDR, null_RDR, all_RDR, traverse_RDR, mempty_RDR, mappend_RDR :: RdrName -fmap_RDR = varQual_RDR gHC_BASE (fsLit "fmap") +fmap_RDR = nameRdrName fmapName replace_RDR = varQual_RDR gHC_BASE (fsLit "<$") pure_RDR = nameRdrName pureAName ap_RDR = nameRdrName apAName @@ -853,8 +854,8 @@ foldMap_RDR = varQual_RDR dATA_FOLDABLE (fsLit "foldMap") null_RDR = varQual_RDR dATA_FOLDABLE (fsLit "null") all_RDR = varQual_RDR dATA_FOLDABLE (fsLit "all") traverse_RDR = varQual_RDR dATA_TRAVERSABLE (fsLit "traverse") -mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty") -mappend_RDR = varQual_RDR gHC_BASE (fsLit "mappend") +mempty_RDR = nameRdrName memptyName +mappend_RDR = nameRdrName mappendName ---------------------- varQual_RDR, tcQual_RDR, clsQual_RDR, dataQual_RDR From git at git.haskell.org Wed Sep 19 18:24:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:24:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "An overhaul of the SRT representation"" (058e3b7) Message-ID: <20180919182456.B39733A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/058e3b7ddfed994c2fb4e7223c76d9e858748324/ghc >--------------------------------------------------------------- commit 058e3b7ddfed994c2fb4e7223c76d9e858748324 Author: Ben Gamari Date: Tue Sep 18 11:45:21 2018 -0400 Revert "Revert "An overhaul of the SRT representation"" This reverts commit ceffd7fe3f310cb30fec870f768e8047af309d99. >--------------------------------------------------------------- 058e3b7ddfed994c2fb4e7223c76d9e858748324 compiler/cmm/CLabel.hs | 57 +- compiler/cmm/Cmm.hs | 14 +- compiler/cmm/CmmBuildInfoTables.hs | 913 ++++++++++++++------- compiler/cmm/CmmInfo.hs | 9 +- compiler/cmm/CmmParse.y | 12 +- compiler/cmm/CmmPipeline.hs | 21 +- compiler/cmm/Hoopl/Dataflow.hs | 6 + compiler/cmm/PprCmm.hs | 2 +- compiler/cmm/PprCmmDecl.hs | 17 +- compiler/codeGen/StgCmmClosure.hs | 10 +- compiler/main/HscMain.hs | 20 +- compiler/stgSyn/CoreToStg.hs | 9 - includes/rts/storage/ClosureMacros.h | 2 +- includes/rts/storage/InfoTables.h | 53 +- includes/stg/MiscClosures.h | 16 + libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 8 + libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc | 8 + rts/RtsAPI.c | 2 +- rts/RtsSymbols.c | 16 + rts/StgMiscClosures.cmm | 55 +- rts/sm/Evac.c | 4 +- rts/sm/Scav.c | 109 +-- testsuite/tests/regalloc/regalloc_unit_tests.hs | 2 +- 23 files changed, 825 insertions(+), 540 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 058e3b7ddfed994c2fb4e7223c76d9e858748324 From git at git.haskell.org Wed Sep 19 18:25:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:25:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Save a word in the info table on x86_64"" (547ccb5) Message-ID: <20180919182511.1DE9D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/547ccb522b77ace23ad4d697f8ea7272718502fb/ghc >--------------------------------------------------------------- commit 547ccb522b77ace23ad4d697f8ea7272718502fb Author: Ben Gamari Date: Tue Sep 18 11:45:22 2018 -0400 Revert "Revert "Save a word in the info table on x86_64"" This reverts commit dee229487fccc6a994d4bb9c4ceda0903bec707b. >--------------------------------------------------------------- 547ccb522b77ace23ad4d697f8ea7272718502fb compiler/cmm/CmmBuildInfoTables.hs | 23 ++++++++--- compiler/cmm/CmmExpr.hs | 10 +++-- compiler/cmm/CmmInfo.hs | 44 +++++++++++++------- includes/rts/storage/ClosureMacros.h | 2 +- includes/rts/storage/InfoTables.h | 48 ++++++++++++++++++---- libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc | 4 +- libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc | 4 +- libraries/ghci/GHCi/InfoTable.hsc | 1 - rts/RtsAPI.c | 2 +- rts/sm/Evac.c | 4 +- rts/sm/Scav.c | 6 +-- 11 files changed, 103 insertions(+), 45 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 547ccb522b77ace23ad4d697f8ea7272718502fb From git at git.haskell.org Wed Sep 19 18:25:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:25:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Merge FUN_STATIC closure with its SRT"" (c0eb1ab) Message-ID: <20180919182522.5E5AD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/c0eb1abf20f88a8a7c32bf8cd6ef0bf6ab505c71/ghc >--------------------------------------------------------------- commit c0eb1abf20f88a8a7c32bf8cd6ef0bf6ab505c71 Author: Ben Gamari Date: Tue Sep 18 11:45:23 2018 -0400 Revert "Revert "Merge FUN_STATIC closure with its SRT"" This reverts commit 6f2596b432a9915d648286195b48c48ccdd14a2c. >--------------------------------------------------------------- c0eb1abf20f88a8a7c32bf8cd6ef0bf6ab505c71 compiler/cmm/Cmm.hs | 7 +- compiler/cmm/CmmBuildInfoTables.hs | 224 +++++++++++++++++++++-------------- compiler/cmm/CmmInfo.hs | 3 +- compiler/cmm/CmmParse.y | 12 +- compiler/codeGen/StgCmmBind.hs | 22 ++-- compiler/codeGen/StgCmmClosure.hs | 19 ++- includes/rts/storage/ClosureMacros.h | 3 - rts/RetainerProfile.c | 2 +- rts/sm/Compact.c | 2 +- rts/sm/Evac.c | 4 +- rts/sm/Sanity.c | 2 +- rts/sm/Scav.c | 6 +- 12 files changed, 184 insertions(+), 122 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c0eb1abf20f88a8a7c32bf8cd6ef0bf6ab505c71 From git at git.haskell.org Wed Sep 19 18:25:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:25:33 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Comments and refactoring only"" (5e6c217) Message-ID: <20180919182533.478233A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/5e6c217d0b8786b4bd9c39e0da13e70a18166175/ghc >--------------------------------------------------------------- commit 5e6c217d0b8786b4bd9c39e0da13e70a18166175 Author: Ben Gamari Date: Tue Sep 18 11:45:25 2018 -0400 Revert "Revert "Comments and refactoring only"" This reverts commit b0f06f53761820167e8b2cda61bc8c3137a83f92. >--------------------------------------------------------------- 5e6c217d0b8786b4bd9c39e0da13e70a18166175 compiler/cmm/Cmm.hs | 12 ++++++++++++ compiler/cmm/CmmBuildInfoTables.hs | 30 ++++++++++++++++++------------ compiler/codeGen/StgCmmClosure.hs | 2 +- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index 4c8e528..eb34618 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -143,6 +143,18 @@ data CmmInfoTable cit_clo :: Maybe (Id, CostCentreStack) -- Just (id,ccs) <=> build a static closure later -- Nothing <=> don't build a static closure + -- + -- Static closures for FUNs and THUNKs are *not* generated by + -- the code generator, because we might want to add SRT + -- entries to them later (for FUNs at least; THUNKs are + -- treated the same for consistency). See Note [SRTs] in + -- CmmBuildInfoTables, in particular the [FUN] optimisation. + -- + -- This is strictly speaking not a part of the info table that + -- will be finally generated, but it's the only convenient + -- place to convey this information from the code generator to + -- where we build the static closures in + -- CmmBuildInfoTables.doSRTs. } data ProfilingInfo diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index d9408df..bef4d98 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -463,15 +463,16 @@ getCAFs (CmmProc top_info topLbl _ g) -- | Get the list of blocks that correspond to the entry points for -- FUN_STATIC closures. These are the blocks for which if we have an -- SRT we can merge it with the static closure. [FUN] -getStaticFuns :: CmmDecl -> [(BlockId, CLabel)] -getStaticFuns (CmmData _ _) = [] -getStaticFuns (CmmProc top_info _ _ g) - | Just info <- mapLookup (g_entry g) (info_tbls top_info) +getStaticFuns :: [CmmDecl] -> [(BlockId, CLabel)] +getStaticFuns decls = + [ (g_entry g, lbl) + | CmmProc top_info _ _ g <- decls + , Just info <- [mapLookup (g_entry g) (info_tbls top_info)] + , Just (id, _) <- [cit_clo info] , let rep = cit_rep info - , Just (id, _) <- cit_clo info + , isStaticRep rep && isFunRep rep , let lbl = mkLocalClosureLabel (idName id) (idCafInfo id) - , isStaticRep rep && isFunRep rep = [(g_entry g, lbl)] - | otherwise = [] + ] -- | Put the labelled blocks that we will be annotating with SRTs into @@ -527,7 +528,7 @@ doSRTs -> [(CAFEnv, [CmmDecl])] -> IO (ModuleSRTInfo, [CmmDecl]) -doSRTs dflags topSRT tops = do +doSRTs dflags moduleSRTInfo tops = do us <- mkSplitUniqSupply 'u' -- Ignore the original grouping of decls, and combine all the @@ -535,7 +536,7 @@ doSRTs dflags topSRT tops = do let (cafEnvs, declss) = unzip tops cafEnv = mapUnions cafEnvs decls = concat declss - staticFuns = mapFromList (concatMap getStaticFuns decls) + staticFuns = mapFromList (getStaticFuns decls) -- Put the decls in dependency order. Why? So that we can implement -- [Shortcut] and [Filter]. If we need to refer to an SRT that has @@ -547,9 +548,14 @@ doSRTs dflags topSRT tops = do -- On each strongly-connected group of decls, construct the SRT -- closures and the SRT fields for info tables. - let ((result, _srtMap), topSRT') = + let result :: + [ ( [CmmDecl] -- generated SRTs + , [(Label, CLabel)] -- SRT fields for info tables + , [(Label, [SRTEntry])] -- SRTs to attach to static functions + ) ] + ((result, _srtMap), moduleSRTInfo') = initUs_ us $ - flip runStateT topSRT $ + flip runStateT moduleSRTInfo $ flip runStateT Map.empty $ mapM (doSCC dflags staticFuns) sccs @@ -561,7 +567,7 @@ doSRTs dflags topSRT tops = do funSRTMap = mapFromList (concat funSRTs) decls' = concatMap (updInfoSRTs dflags srtFieldMap funSRTMap) decls - return (topSRT', concat declss ++ decls') + return (moduleSRTInfo', concat declss ++ decls') -- | Build the SRT for a strongly-connected component of blocks diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index b598059..6f0feaa 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -1040,7 +1040,7 @@ mkDataConInfoTable dflags data_con is_static ptr_wds nonptr_wds , cit_rep = sm_rep , cit_prof = prof , cit_srt = Nothing - , cit_clo = Nothing } + , cit_clo = Nothing } where name = dataConName data_con info_lbl = mkConInfoTableLabel name NoCafRefs From git at git.haskell.org Wed Sep 19 18:25:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:25:44 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Fix retainer profiling after SRT overhaul"" (b97867c) Message-ID: <20180919182544.45AB83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/b97867cd448d771e277dd8720a02ef000e3c47c2/ghc >--------------------------------------------------------------- commit b97867cd448d771e277dd8720a02ef000e3c47c2 Author: Ben Gamari Date: Tue Sep 18 11:45:25 2018 -0400 Revert "Revert "Fix retainer profiling after SRT overhaul"" This reverts commit 25765469b312aa21422c635aa5852a69e29f24f1. >--------------------------------------------------------------- b97867cd448d771e277dd8720a02ef000e3c47c2 rts/RetainerProfile.c | 175 ++++++++------------------------------------------ 1 file changed, 28 insertions(+), 147 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b97867cd448d771e277dd8720a02ef000e3c47c2 From git at git.haskell.org Wed Sep 19 18:25:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:25:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Fix a bug in SRT generation"" (aef4753) Message-ID: <20180919182555.289F13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/aef4753734733d608d6a374744859175854bc4c4/ghc >--------------------------------------------------------------- commit aef4753734733d608d6a374744859175854bc4c4 Author: Ben Gamari Date: Tue Sep 18 11:45:26 2018 -0400 Revert "Revert "Fix a bug in SRT generation"" This reverts commit d82e8af82d4be11252294290564044ef956ec2a4. >--------------------------------------------------------------- aef4753734733d608d6a374744859175854bc4c4 compiler/cmm/CmmBuildInfoTables.hs | 99 ++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index bef4d98..ecbe89d 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -30,6 +30,7 @@ import CostCentre import StgCmmHeap import PprCmm() +import Control.Monad import Data.Map (Map) import qualified Data.Map as Map import Data.Set (Set) @@ -445,20 +446,44 @@ getLabelledBlocks (CmmProc top_info _ _ _) = ] --- | Get (Label,CLabel) pairs for each block that represents a CAF. +-- | Put the labelled blocks that we will be annotating with SRTs into +-- dependency order. This is so that we can process them one at a +-- time, resolving references to earlier blocks to point to their +-- SRTs. CAFs themselves are not included here; see getCAFs below. +depAnalSRTs + :: CAFEnv + -> [CmmDecl] + -> [SCC (Label, CAFLabel, Set CAFLabel)] +depAnalSRTs cafEnv decls = + srtTrace "depAnalSRTs" (ppr graph) graph + where + labelledBlocks = concatMap getLabelledBlocks decls + labelToBlock = Map.fromList (map swap labelledBlocks) + graph = stronglyConnCompFromEdgedVerticesOrd + [ let cafs' = Set.delete lbl cafs in + DigraphNode (l,lbl,cafs') l + (mapMaybe (flip Map.lookup labelToBlock) (Set.toList cafs')) + | (l, lbl) <- labelledBlocks + , Just cafs <- [mapLookup l cafEnv] ] + + +-- | Get (Label, CAFLabel, Set CAFLabel) for each block that represents a CAF. -- These are treated differently from other labelled blocks: --- - we never resolve a reference to a CAF to the contents of its SRT, since --- the point of SRTs is to keep CAFs alive. +-- - we never [Shortcut] a reference to a CAF to the contents of its +-- SRT, since the point of SRTs is to keep CAFs alive. -- - CAFs therefore don't take part in the dependency analysis in depAnalSRTs. -- instead we generate their SRTs after everything else, so that we can --- resolve references in the CAF's SRT. -getCAFs :: CmmDecl -> [(Label, CAFLabel)] -getCAFs (CmmData _ _) = [] -getCAFs (CmmProc top_info topLbl _ g) - | Just info <- mapLookup (g_entry g) (info_tbls top_info) +-- [Shortcut] references from the CAF's SRT. +getCAFs :: CAFEnv -> [CmmDecl] -> [(Label, CAFLabel, Set CAFLabel)] +getCAFs cafEnv decls = + [ (g_entry g, mkCAFLabel topLbl, cafs) + | CmmProc top_info topLbl _ g <- decls + , Just info <- [mapLookup (g_entry g) (info_tbls top_info)] , let rep = cit_rep info - , isStaticRep rep && isThunkRep rep = [(g_entry g, mkCAFLabel topLbl)] - | otherwise = [] + , isStaticRep rep && isThunkRep rep + , Just cafs <- [mapLookup (g_entry g) cafEnv] + ] + -- | Get the list of blocks that correspond to the entry points for -- FUN_STATIC closures. These are the blocks for which if we have an @@ -475,35 +500,6 @@ getStaticFuns decls = ] --- | Put the labelled blocks that we will be annotating with SRTs into --- dependency order. This is so that we can process them one at a --- time, resolving references to earlier blocks to point to their --- SRTs. -depAnalSRTs - :: CAFEnv - -> [CmmDecl] - -> [SCC (Label, CAFLabel, Set CAFLabel)] - -depAnalSRTs cafEnv decls = - srtTrace "depAnalSRTs" (ppr blockToLabel $$ ppr (graph ++ cafSCCs)) $ - (graph ++ cafSCCs) - where - cafs = concatMap getCAFs decls - cafSCCs = [ AcyclicSCC (blockid, lbl, cafs) - | (blockid, lbl) <- cafs - , Just cafs <- [mapLookup blockid cafEnv] ] - labelledBlocks = concatMap getLabelledBlocks decls - blockToLabel :: LabelMap CAFLabel - blockToLabel = mapFromList (cafs ++ labelledBlocks) - labelToBlock = Map.fromList (map swap labelledBlocks) - graph = stronglyConnCompFromEdgedVerticesOrd - [ let cafs' = Set.delete lbl cafs in - DigraphNode (l,lbl,cafs') l - (mapMaybe (flip Map.lookup labelToBlock) (Set.toList cafs')) - | (l, lbl) <- labelledBlocks - , Just cafs <- [mapLookup l cafEnv] ] - - -- | Maps labels from 'cafAnal' to the final CLabel that will appear -- in the SRT. -- - closures with singleton SRTs resolve to their single entry @@ -544,7 +540,9 @@ doSRTs dflags moduleSRTInfo tops = do -- don't need to generate the singleton SRT in the first place. But -- to do this we need to process blocks before things that depend on -- them. - let sccs = depAnalSRTs cafEnv decls + let + sccs = depAnalSRTs cafEnv decls + cafsWithSRTs = getCAFs cafEnv decls -- On each strongly-connected group of decls, construct the SRT -- closures and the SRT fields for info tables. @@ -556,8 +554,11 @@ doSRTs dflags moduleSRTInfo tops = do ((result, _srtMap), moduleSRTInfo') = initUs_ us $ flip runStateT moduleSRTInfo $ - flip runStateT Map.empty $ - mapM (doSCC dflags staticFuns) sccs + flip runStateT Map.empty $ do + nonCAFs <- mapM (doSCC dflags staticFuns) sccs + cAFs <- forM cafsWithSRTs $ \(l, cafLbl, cafs) -> + oneSRT dflags staticFuns [l] [cafLbl] True{-is a CAF-} cafs + return (nonCAFs ++ cAFs) (declss, pairs, funSRTs) = unzip3 result @@ -583,13 +584,13 @@ doSCC ) doSCC dflags staticFuns (AcyclicSCC (l, cafLbl, cafs)) = - oneSRT dflags staticFuns [l] [cafLbl] cafs + oneSRT dflags staticFuns [l] [cafLbl] False cafs doSCC dflags staticFuns (CyclicSCC nodes) = do -- build a single SRT for the whole cycle let (blockids, lbls, cafsets) = unzip3 nodes cafs = Set.unions cafsets `Set.difference` Set.fromList lbls - oneSRT dflags staticFuns blockids lbls cafs + oneSRT dflags staticFuns blockids lbls False cafs -- | Build an SRT for a set of blocks @@ -598,6 +599,7 @@ oneSRT -> LabelMap CLabel -- which blocks are static function entry points -> [Label] -- blocks in this set -> [CAFLabel] -- labels for those blocks + -> Bool -- True <=> this SRT is for a CAF -> Set CAFLabel -- SRT for this set -> StateT SRTMap (StateT ModuleSRTInfo UniqSM) @@ -606,7 +608,7 @@ oneSRT , [(Label, [SRTEntry])] -- SRTs to attach to static functions ) -oneSRT dflags staticFuns blockids lbls cafs = do +oneSRT dflags staticFuns blockids lbls isCAF cafs = do srtMap <- get topSRT <- lift get let @@ -629,9 +631,10 @@ oneSRT dflags staticFuns blockids lbls cafs = do (ppr cafs <+> ppr resolved <+> ppr allBelow <+> ppr filtered) $ return () let - updateSRTMap srtEntry = do - let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] - put (Map.union newSRTMap srtMap) + updateSRTMap srtEntry = + when (not isCAF) $ do -- NB. no [Shortcut] for CAFs + let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] + put (Map.union newSRTMap srtMap) case Set.toList filtered of [] -> do From git at git.haskell.org Wed Sep 19 18:26:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:26:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Revert "Revert "Disable the SRT offset optimisation on MachO platforms"" (f442bc6) Message-ID: <20180919182606.724153A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/f442bc6c966e85f845a8167ab97ab71d73cd8520/ghc >--------------------------------------------------------------- commit f442bc6c966e85f845a8167ab97ab71d73cd8520 Author: Ben Gamari Date: Tue Sep 18 11:45:27 2018 -0400 Revert "Revert "Disable the SRT offset optimisation on MachO platforms"" This reverts commit c15d44f8b3f00bfe152c2f9d3c6f60efd204fb23. >--------------------------------------------------------------- f442bc6c966e85f845a8167ab97ab71d73cd8520 compiler/cmm/CLabel.hs | 22 ++++++++++++++++++++-- compiler/cmm/CmmBuildInfoTables.hs | 18 ++++++++++++++++-- compiler/cmm/CmmInfo.hs | 5 ++++- includes/rts/storage/InfoTables.h | 3 +++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 472bd3c..1a9bc73 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -94,10 +94,12 @@ module CLabel ( mkHpcTicksLabel, + -- * Predicates hasCAF, needsCDecl, maybeLocalBlockLabel, externallyVisibleCLabel, isMathFun, isCFunctionLabel, isGcPtrLabel, labelDynamic, + isLocalCLabel, -- * Conversions toClosureLbl, toSlowEntryLbl, toEntryLbl, toInfoLbl, hasHaskellName, @@ -974,13 +976,29 @@ idInfoLabelType info = -- ----------------------------------------------------------------------------- --- Does a CLabel need dynamic linkage? +-- | Is a 'CLabel' defined in the current module being compiled? +-- +-- Sometimes we can optimise references within a compilation unit in ways that +-- we couldn't for inter-module references. This provides a conservative +-- estimate of whether a 'CLabel' lives in the current module. +isLocalCLabel :: Module -> CLabel -> Bool +isLocalCLabel this_mod lbl = + case lbl of + IdLabel name _ _ + | isInternalName name -> True + | otherwise -> nameModule name == this_mod + LocalBlockLabel _ -> True + _ -> False + +-- ----------------------------------------------------------------------------- + +-- | Does a 'CLabel' need dynamic linkage? +-- -- When referring to data in code, we need to know whether -- that data resides in a DLL or not. [Win32 only.] -- @labelDynamic@ returns @True@ if the label is located -- in a DLL, be it a data reference or not. - labelDynamic :: DynFlags -> Module -> CLabel -> Bool labelDynamic dflags this_mod lbl = case lbl of diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index ecbe89d..3d13fc7 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -16,6 +16,7 @@ import Hoopl.Label import Hoopl.Collections import Hoopl.Dataflow import Module +import Platform import Digraph import CLabel import PprCmmDecl () @@ -120,7 +121,7 @@ offset to the SRT can be stored in 32 bits (all code lives within a the info table by storing the srt_offset in the srt field, which is half a word. -On x86_64 with TABLES_NEXT_TO_CODE: +On x86_64 with TABLES_NEXT_TO_CODE (except on MachO, due to #15169): - info->srt is zero if there's no SRT, otherwise: - info->srt is an offset from the info pointer to the SRT object @@ -636,14 +637,27 @@ oneSRT dflags staticFuns blockids lbls isCAF cafs = do let newSRTMap = Map.fromList [(cafLbl, srtEntry) | cafLbl <- lbls] put (Map.union newSRTMap srtMap) + this_mod = thisModule topSRT + case Set.toList filtered of [] -> do srtTrace "oneSRT: empty" (ppr lbls) $ return () updateSRTMap Nothing return ([], [], []) + -- When we have only one entry there is no need to build a new SRT at all. [one@(SRTEntry lbl)] - | not (labelDynamic dflags (thisModule topSRT) lbl) -> do + | -- Info tables refer to SRTs by offset (as noted in the section + -- "Referring to an SRT from the info table" of Note [SRTs]). However, + -- when dynamic linking is used we cannot guarantee that the offset + -- between the SRT and the info table will fit in the offset field. + -- Consequently we build a singleton SRT in in this case. + not (labelDynamic dflags this_mod lbl) + + -- MachO relocations can't express offsets between compilation units at + -- all, so we are always forced to build a singleton SRT in this case. + && (not (osMachOTarget $ platformOS $ targetPlatform dflags) + || isLocalCLabel this_mod lbl) -> do updateSRTMap (Just one) return ([], map (,lbl) blockids, []) diff --git a/compiler/cmm/CmmInfo.hs b/compiler/cmm/CmmInfo.hs index 3b2eea1..43cba25 100644 --- a/compiler/cmm/CmmInfo.hs +++ b/compiler/cmm/CmmInfo.hs @@ -271,7 +271,10 @@ mkSRTLit dflags _ Nothing = ([], CmmInt 0 (halfWordWidth dflags)) mkSRTLit dflags _ (Just lbl) = ([CmmLabel lbl], CmmInt 1 (halfWordWidth dflags)) --- | is the SRT offset field inline in the info table on this platform? +-- | Is the SRT offset field inline in the info table on this platform? +-- +-- See the section "Referring to an SRT from the info table" in +-- Note [SRTs] in CmmBuildInfoTables.hs inlineSRT :: DynFlags -> Bool inlineSRT dflags = platformArch (targetPlatform dflags) == ArchX86_64 && tablesNextToCode dflags diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index 137cfe2..db50d16 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -156,6 +156,9 @@ typedef union { #if defined(x86_64_TARGET_ARCH) && defined(TABLES_NEXT_TO_CODE) // On x86_64 we can fit a pointer offset in half a word, so put the SRT offset // in the info->srt field directly. +// +// See the section "Referring to an SRT from the info table" in +// Note [SRTs] in CmmBuildInfoTables.hs #define USE_INLINE_SRT_FIELD #endif From git at git.haskell.org Wed Sep 19 18:26:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:26:17 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Don't shortcut SRTs for static functions (#15544) (28356f2) Message-ID: <20180919182617.EE54A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/28356f217fe4d314bd5a4f0316b5bced755cbb2f/ghc >--------------------------------------------------------------- commit 28356f217fe4d314bd5a4f0316b5bced755cbb2f Author: Simon Marlow Date: Tue Sep 18 11:47:56 2018 -0400 Don't shortcut SRTs for static functions (#15544) Shortcutting the SRT for a static function can lead to resurrecting a static object at runtime, which violates assumptions in the GC. See comments for details. Test Plan: - manual testing (in progress) - validate Reviewers: osa1, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15544 Differential Revision: https://phabricator.haskell.org/D5145 (cherry picked from commit a324dfdf3b505ea30d134dc8183d7b4bb441ced4) >--------------------------------------------------------------- 28356f217fe4d314bd5a4f0316b5bced755cbb2f compiler/cmm/CmmBuildInfoTables.hs | 152 +++++++++++++++++++++++++++++++------ 1 file changed, 130 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 28356f217fe4d314bd5a4f0316b5bced755cbb2f From git at git.haskell.org Wed Sep 19 18:26:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 19 Sep 2018 18:26:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Fix code-block layout for QuantifiedConstraints (14e5864) Message-ID: <20180919182629.043513A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/14e5864006000c1a07eecd1d3fa41a6d278a2ea8/ghc >--------------------------------------------------------------- commit 14e5864006000c1a07eecd1d3fa41a6d278a2ea8 Author: Takenobu Tani Date: Mon Sep 17 16:47:02 2018 +0200 users-guide: Fix code-block layout for QuantifiedConstraints Summary: Fix code-block layout for QuantifiedConstraints. [ci skip] Test Plan: build Reviewers: bgamari, monoidal Reviewed By: monoidal Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5121 (cherry picked from commit 43967c0c7d2d0110cfc5f9d64a7dab3a3dda8953) >--------------------------------------------------------------- 14e5864006000c1a07eecd1d3fa41a6d278a2ea8 docs/users_guide/glasgow_exts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index b917f31..1b8ce47 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -9713,7 +9713,7 @@ This idea is very old; see Seciton 7 of `Derivable type classes `_ defines a ``context`` (the bit to the left of ``=>`` in a type) like this :: +`Haskell 2010 `_ defines a ``context`` (the bit to the left of ``=>`` in a type) like this .. code-block:: none @@ -9723,7 +9723,7 @@ Syntax changes class ::= qtycls tyvar | qtycls (tyvar atype1 ... atypen) -We to extend ``class`` (warning: this is a rather confusingly named non-terminal symbol) with two extra forms, namely precisely what can appear in an instance declaration :: +We to extend ``class`` (warning: this is a rather confusingly named non-terminal symbol) with two extra forms, namely precisely what can appear in an instance declaration .. code-block:: none @@ -9736,9 +9736,9 @@ That is the only syntactic change to the language. Notes: -- Where GHC allows extensions instance declarations we allow exactly the same extensions to this new form of ``class``. Specifically, with :extension:`ExplicitForAll` and :extension:`MultiParameterTypeClasses` the syntax becomes :: +- Where GHC allows extensions instance declarations we allow exactly the same extensions to this new form of ``class``. Specifically, with :extension:`ExplicitForAll` and :extension:`MultiParameterTypeClasses` the syntax becomes -.. code-block:: none + .. code-block:: none class ::= ... | [forall tyavrs .] context => qtycls inst1 ... instn From git at git.haskell.org Thu Sep 20 03:30:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 03:30:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: Bump stm submodule (be14113) Message-ID: <20180920033052.0887B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/be14113c27174bb1580435ca635a78274bb17765/ghc >--------------------------------------------------------------- commit be14113c27174bb1580435ca635a78274bb17765 Author: Ben Gamari Date: Wed Sep 19 14:56:41 2018 -0400 Bump stm submodule >--------------------------------------------------------------- be14113c27174bb1580435ca635a78274bb17765 libraries/stm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stm b/libraries/stm index 5f4d7c6..d17acd2 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 5f4d7c6d07a760d935c9d96e62999f1ad38a5e43 +Subproject commit d17acd286344641da2748df1553aff5e4d1f6ebe From git at git.haskell.org Thu Sep 20 03:30:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 03:30:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Fill out release highlights (3595949) Message-ID: <20180920033054.C61573A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/359594905e2ce04fbf3fb7fa4e9ecaa9953cb12c/ghc >--------------------------------------------------------------- commit 359594905e2ce04fbf3fb7fa4e9ecaa9953cb12c Author: Ben Gamari Date: Wed Sep 19 15:28:47 2018 -0400 users-guide: Fill out release highlights >--------------------------------------------------------------- 359594905e2ce04fbf3fb7fa4e9ecaa9953cb12c docs/users_guide/8.6.1-notes.rst | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst index 13fd354..2a54b41 100644 --- a/docs/users_guide/8.6.1-notes.rst +++ b/docs/users_guide/8.6.1-notes.rst @@ -13,6 +13,17 @@ Highlights The highlights, since the 8.4.1 release, are: +- Support for :extension:`QuantifiedConstraints`. + +- A new flexible deriving scheme, :extension:`DerivingVia`. + +- A new plugin mechanism and support for plugins to modify their effect on GHC's + recompilation checking logic. + +- :ref:`Valid hole fits ` in error messages. + +- A number of syntactic language extensions. + - Programs are no longer constrained by the Windows ``MAX_PATH`` file path length limit. The file path limit is now approximately 32,767 characters. Note that GHC itself is still somewhat limited due to GCC not supporting file @@ -231,6 +242,8 @@ Template Haskell ``ghc`` library ~~~~~~~~~~~~~~~ +- The ``Plugin`` record now has a several new fields for the new source plugins + and recompilation checking mechanisms. ``base`` library ~~~~~~~~~~~~~~~~ @@ -245,8 +258,6 @@ Template Haskell ``ghc-prim`` library ~~~~~~~~~~~~~~~~~~~~ -- Version number 0.5.2.1 (was 0.5.2.0) - - Added new ``addWordC#`` operation for unsigned addition with carry. Build system From git at git.haskell.org Thu Sep 20 13:04:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 13:04:46 +0000 (UTC) Subject: [commit: ghc] master: Remove -Waggregate-return when building RTS (077b92f) Message-ID: <20180920130446.021C03ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/077b92fa39839a8e83cd87398435424403cf6486/ghc >--------------------------------------------------------------- commit 077b92fa39839a8e83cd87398435424403cf6486 Author: Ömer Sinan Ağacan Date: Thu Sep 20 16:04:11 2018 +0300 Remove -Waggregate-return when building RTS This causes slow validate build to fail (in Profiling.c:countTickss), and there's nothing wrong with struct returns. Reviewers: simonmar, bgamari, erikd Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5164 >--------------------------------------------------------------- 077b92fa39839a8e83cd87398435424403cf6486 rts/ghc.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/rts/ghc.mk b/rts/ghc.mk index 532c9aa..ff3f18f 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -329,7 +329,6 @@ WARNING_OPTS += -Wstrict-prototypes WARNING_OPTS += -Wmissing-prototypes WARNING_OPTS += -Wmissing-declarations WARNING_OPTS += -Winline -WARNING_OPTS += -Waggregate-return WARNING_OPTS += -Wpointer-arith WARNING_OPTS += -Wmissing-noreturn WARNING_OPTS += -Wnested-externs From git at git.haskell.org Thu Sep 20 14:25:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 14:25:52 +0000 (UTC) Subject: [commit: ghc] master: users guide: Fix a few issues (4e3f6a0) Message-ID: <20180920142552.53DC23ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4e3f6a0767b57dfa54934eb4fdb27f54db7016ee/ghc >--------------------------------------------------------------- commit 4e3f6a0767b57dfa54934eb4fdb27f54db7016ee Author: Frank Steffahn Date: Tue Aug 21 23:37:33 2018 +0200 users guide: Fix a few issues >--------------------------------------------------------------- 4e3f6a0767b57dfa54934eb4fdb27f54db7016ee docs/users_guide/glasgow_exts.rst | 8 ++++---- docs/users_guide/using-warnings.rst | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 3ce6a60..4fd6f1b 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -3558,10 +3558,10 @@ More details: module M where data R = R { a,b,c :: Int } module X where - import M( R(a,c) ) - f b = R { .. } + import M( R(R,a,c) ) + f a b = R { .. } - The ``R{..}`` expands to ``R{M.a=a}``, omitting ``b`` since the + The ``R{..}`` expands to ``R{a=a}``, omitting ``b`` since the record field is not in scope, and omitting ``c`` since the variable ``c`` is not in scope (apart from the binding of the record selector ``c``, of course). @@ -15340,7 +15340,7 @@ The solution is to define the instance-specific function yourself, with a pragma to prevent it being inlined too early, and give a RULE for it: :: instance C Bool where - op x y = opBool + op = opBool opBool :: Bool -> Bool -> Bool {-# NOINLINE [1] opBool #-} diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index a715fc1..d93064b 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -20,13 +20,16 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wdeprecations` * :ghc-flag:`-Wdeprecated-flags` * :ghc-flag:`-Wunrecognised-pragmas` - * :ghc-flag:`-Wduplicate-constraints` * :ghc-flag:`-Wduplicate-exports` * :ghc-flag:`-Woverflowed-literals` * :ghc-flag:`-Wempty-enumerations` * :ghc-flag:`-Wmissing-fields` * :ghc-flag:`-Wmissing-methods` * :ghc-flag:`-Wwrong-do-bind` + * :ghc-flag:`-Wsimplifiable-class-constraints` + * :ghc-flag:`-Wtyped-holes` + * :ghc-flag:`-Wdeferred-type-errors` + * :ghc-flag:`-Wpartial-type-signatures` * :ghc-flag:`-Wunsupported-calling-conventions` * :ghc-flag:`-Wdodgy-foreign-imports` * :ghc-flag:`-Winline-rule-shadowing` @@ -286,7 +289,7 @@ of ``-W(no-)*``. Defer variable out-of-scope errors (errors about names without a leading underscore) until runtime. This will turn variable-out-of-scope errors into warnings. - Using a value that depends on a typed hole produces a runtime error, + Using a value that depends on an out-of-scope variable produces a runtime error, the same as :ghc-flag:`-fdefer-type-errors` (which implies this option). See :ref:`typed-holes` and :ref:`defer-type-errors`. From git at git.haskell.org Thu Sep 20 14:26:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 14:26:10 +0000 (UTC) Subject: [commit: ghc] master: Add testcase for #14251 (ba086ca) Message-ID: <20180920142610.C19F33ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ba086ca72ee6c77abba685f3100ad513e38a1a87/ghc >--------------------------------------------------------------- commit ba086ca72ee6c77abba685f3100ad513e38a1a87 Author: Ben Gamari Date: Wed Sep 19 15:04:11 2018 -0400 Add testcase for #14251 >--------------------------------------------------------------- ba086ca72ee6c77abba685f3100ad513e38a1a87 testsuite/tests/codeGen/should_run/T14251.hs | 27 ++++++++++++++++++++++ .../should_run/{T6084.stdout => T14251.stdout} | 3 ++- testsuite/tests/codeGen/should_run/all.T | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/T14251.hs b/testsuite/tests/codeGen/should_run/T14251.hs new file mode 100644 index 0000000..d31498e --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T14251.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE MagicHash, BangPatterns #-} +module Main where + +import GHC.Exts + +{-# NOINLINE f #-} +f :: (Int# -> Float# -> Double# -> Float# -> Double# -> String) -> String +f g = g 3# 4.0# 5.0## 6.0# 6.9## ++ " World!" + +{-# NOINLINE p #-} +p :: Int# -> Float# -> Double# -> Float# -> Double# -> String +p i j k l m = "Hello" + +{-# NOINLINE q #-} +q :: Int# -> Int# -> Float# -> Double# -> Float# -> Double# -> String +q _ i j k l m = "Hello " ++ show (F# l) ++ " " ++ show (D# m) + +{-# NOINLINE r #-} +r :: Int# -> Float# -> Double# -> Float# -> Double# -> String +r i = let !(I# z) = length [I# 1# .. I# i] in \j k l m -> p z j k l m + -- ghc won't eta-expand around the length, because it has unknown cost + +main = do + putStrLn (f p) -- fast call + putStrLn (f r) -- slow call: function but wrong arity + let g = last [q 1#] + putStrLn (f g) -- slow call: thunk diff --git a/testsuite/tests/codeGen/should_run/T6084.stdout b/testsuite/tests/codeGen/should_run/T14251.stdout similarity index 54% copy from testsuite/tests/codeGen/should_run/T6084.stdout copy to testsuite/tests/codeGen/should_run/T14251.stdout index 8baa6e3..de80321 100644 --- a/testsuite/tests/codeGen/should_run/T6084.stdout +++ b/testsuite/tests/codeGen/should_run/T14251.stdout @@ -1,3 +1,4 @@ Hello World! Hello World! -Hello World! +Hello 6.0 6.9 World! + diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 60f86d7..025acb4 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,3 +172,6 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) +test('T14251', [extra_ways(['llvm', 'optllvm']), + expect_broken_for(14251, ['optllvm'])], + compile_and_run, ['']) From git at git.haskell.org Thu Sep 20 14:26:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 14:26:25 +0000 (UTC) Subject: [commit: ghc] master: Revert "adds -latomic to. ghc-prim" (d7fa869) Message-ID: <20180920142625.9ED413ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d7fa8695324d6e0c3ea77228f9de93d529afc23e/ghc >--------------------------------------------------------------- commit d7fa8695324d6e0c3ea77228f9de93d529afc23e Author: Ben Gamari Date: Wed Sep 19 15:23:27 2018 -0400 Revert "adds -latomic to. ghc-prim" This commit was never properly justified and relies on the existence of libatomic, which doesn't appear to exist on Darwin. This reverts commit ec9aacf3eb2975fd302609163aaef429962ecd87. >--------------------------------------------------------------- d7fa8695324d6e0c3ea77228f9de93d529afc23e aclocal.m4 | 18 ++++++++++++++++++ configure.ac | 5 +++++ libraries/ghc-prim/Setup.hs | 2 +- libraries/ghc-prim/aclocal.m4 | 17 ----------------- libraries/ghc-prim/configure.ac | 18 ------------------ libraries/ghc-prim/ghc-prim.buildinfo.in | 2 -- 6 files changed, 24 insertions(+), 38 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 1412350..e2804cf 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1296,6 +1296,24 @@ AC_SUBST(GccIsClang) rm -f conftest.txt ]) +# FP_GCC_SUPPORTS__ATOMICS +# ------------------------ +# Does gcc support the __atomic_* family of builtins? +AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) + echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c + if $CC -c conftest.c > /dev/null 2>&1; then + CONF_GCC_SUPPORTS__ATOMICS=YES + AC_MSG_RESULT([yes]) + else + CONF_GCC_SUPPORTS__ATOMICS=NO + AC_MSG_RESULT([no]) + fi + rm -f conftest.c conftest.o +]) + # FP_GCC_SUPPORTS_NO_PIE # ---------------------- # Does gcc support the -no-pie option? If so we should pass it to gcc when diff --git a/configure.ac b/configure.ac index 2b05535..f794375 100644 --- a/configure.ac +++ b/configure.ac @@ -739,6 +739,11 @@ FP_GCC_VERSION dnl ** See whether gcc supports -no-pie FP_GCC_SUPPORTS_NO_PIE +dnl ** Used to determine how to compile ghc-prim's atomics.c, used by +dnl unregisterised, Sparc, and PPC backends. +FP_GCC_SUPPORTS__ATOMICS +AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?]) + FP_GCC_EXTRA_FLAGS dnl ** look to see if we have a C compiler using an llvm back end. diff --git a/libraries/ghc-prim/Setup.hs b/libraries/ghc-prim/Setup.hs index cccc416..5bb17e2 100644 --- a/libraries/ghc-prim/Setup.hs +++ b/libraries/ghc-prim/Setup.hs @@ -18,7 +18,7 @@ import System.Exit import System.Directory main :: IO () -main = do let hooks = autoconfUserHooks { +main = do let hooks = simpleUserHooks { regHook = addPrimModule $ regHook simpleUserHooks, buildHook = build_primitive_sources diff --git a/libraries/ghc-prim/aclocal.m4 b/libraries/ghc-prim/aclocal.m4 deleted file mode 100644 index 81fc44c..0000000 --- a/libraries/ghc-prim/aclocal.m4 +++ /dev/null @@ -1,17 +0,0 @@ -# FP_GCC_SUPPORTS__ATOMICS -# ------------------------ -# Does gcc support the __atomic_* family of builtins? -AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], -[ - AC_REQUIRE([AC_PROG_CC]) - AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) - echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c - if $CC -c conftest.c > /dev/null 2>&1; then - CONF_GCC_SUPPORTS__ATOMICS=YES - AC_MSG_RESULT([yes]) - else - CONF_GCC_SUPPORTS__ATOMICS=NO - AC_MSG_RESULT([no]) - fi - rm -f conftest.c conftest.o -]) diff --git a/libraries/ghc-prim/configure.ac b/libraries/ghc-prim/configure.ac deleted file mode 100644 index 8249be3..0000000 --- a/libraries/ghc-prim/configure.ac +++ /dev/null @@ -1,18 +0,0 @@ -AC_INIT([ghc-prim package], [2.1], [glasgow-haskell-bugs at haskell.org], [ghc-prim]) - -AC_CONFIG_SRCDIR([ghc-prim.cabal]) - -# ------------------------------------------------------------------------- -dnl ** Used to determine how to compile ghc-prim's atomics.c, used by -dnl unregisterised, Sparc, and PPC backends. -FP_GCC_SUPPORTS__ATOMICS -AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?]) - -if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES" -then PRIM_CFLAGS=-DHAVE_C11_ATOMICS - PRIM_EXTRA_LIBRARIES=atomic -fi -AC_SUBST([PRIM_CFLAGS]) -AC_SUBST([PRIM_EXTRA_LIBRARIES]) -AC_CONFIG_FILES([ghc-prim.buildinfo]) -AC_OUTPUT diff --git a/libraries/ghc-prim/ghc-prim.buildinfo.in b/libraries/ghc-prim/ghc-prim.buildinfo.in deleted file mode 100644 index a093282..0000000 --- a/libraries/ghc-prim/ghc-prim.buildinfo.in +++ /dev/null @@ -1,2 +0,0 @@ -cc-options: @PRIM_CFLAGS@ -extra-libraries: @PRIM_EXTRA_LIBRARIES@ \ No newline at end of file From git at git.haskell.org Thu Sep 20 14:26:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 14:26:40 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Fix build with sphinx 1.8 (4eebc80) Message-ID: <20180920142640.683C73ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4eebc8016f68719e1ccdf460754a97d1f4d6ef05/ghc >--------------------------------------------------------------- commit 4eebc8016f68719e1ccdf460754a97d1f4d6ef05 Author: Ben Gamari Date: Thu Sep 20 08:27:37 2018 -0400 users-guide: Fix build with sphinx 1.8 It seems that both add_object_type and add_directive_to_domain both register a directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it crashes with an exception. >--------------------------------------------------------------- 4eebc8016f68719e1ccdf460754a97d1f4d6ef05 docs/users_guide/flags.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index a70f7fe..284b5e0 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,6 +48,8 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject +from sphinx.domains import ObjType +from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -599,14 +601,20 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): + # Yuck: We can't use app.add_object_type since we need to provide the + # Directive instance ourselves. + std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_object_type('ghc-flag', 'ghc-flag') app.add_directive_to_domain('std', 'ghc-flag', Flag) + app.add_role_to_domain('std', 'ghc-flag', XRefRole()) + std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') # Add extension directive, and override the class with our own - app.add_object_type('extension', 'extension') app.add_directive_to_domain('std', 'extension', LanguageExtension) + app.add_role_to_domain('std', 'extension', XRefRole()) + std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') + # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 14:41:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 14:41:21 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users-guide: Fix build with sphinx 1.8 (6f717bc) Message-ID: <20180920144121.9A8FE3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/6f717bc6440d6dcf368fc605fabb86d7619510af/ghc >--------------------------------------------------------------- commit 6f717bc6440d6dcf368fc605fabb86d7619510af Author: Ben Gamari Date: Thu Sep 20 08:27:37 2018 -0400 users-guide: Fix build with sphinx 1.8 It seems that both add_object_type and add_directive_to_domain both register a directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it crashes with an exception. (cherry picked from commit 4eebc8016f68719e1ccdf460754a97d1f4d6ef05) >--------------------------------------------------------------- 6f717bc6440d6dcf368fc605fabb86d7619510af docs/users_guide/flags.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index cc30b8c..c9f14f0 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,6 +48,8 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject +from sphinx.domains import ObjType +from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -597,14 +599,20 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): + # Yuck: We can't use app.add_object_type since we need to provide the + # Directive instance ourselves. + std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_object_type('ghc-flag', 'ghc-flag') app.add_directive_to_domain('std', 'ghc-flag', Flag) + app.add_role_to_domain('std', 'ghc-flag', XRefRole()) + std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') # Add extension directive, and override the class with our own - app.add_object_type('extension', 'extension') app.add_directive_to_domain('std', 'extension', LanguageExtension) + app.add_role_to_domain('std', 'extension', XRefRole()) + std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') + # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 20:06:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 20:06:13 +0000 (UTC) Subject: [commit: ghc] master: users_guide: fix sphinx error caused by non-explicit override (8c7d33a) Message-ID: <20180920200613.201603ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8/ghc >--------------------------------------------------------------- commit 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8 Author: Zejun Wu Date: Thu Sep 20 16:05:28 2018 -0400 users_guide: fix sphinx error caused by non-explicit override Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161 >--------------------------------------------------------------- 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8 docs/users_guide/flags.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index 284b5e0..0e56bdf 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,8 +48,6 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject -from sphinx.domains import ObjType -from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -601,20 +599,15 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): - # Yuck: We can't use app.add_object_type since we need to provide the - # Directive instance ourselves. - std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_directive_to_domain('std', 'ghc-flag', Flag) - app.add_role_to_domain('std', 'ghc-flag', XRefRole()) - std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) # Add extension directive, and override the class with our own - app.add_directive_to_domain('std', 'extension', LanguageExtension) - app.add_role_to_domain('std', 'extension', XRefRole()) - std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') - + app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension, + override=True) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 20:06:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 20:06:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users_guide: fix sphinx error caused by non-explicit override (5ed9c86) Message-ID: <20180920200615.E2B7F3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/5ed9c86134200db615908d445702522d95f9025a/ghc >--------------------------------------------------------------- commit 5ed9c86134200db615908d445702522d95f9025a Author: Zejun Wu Date: Thu Sep 20 16:05:28 2018 -0400 users_guide: fix sphinx error caused by non-explicit override Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161 (cherry picked from commit 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8) >--------------------------------------------------------------- 5ed9c86134200db615908d445702522d95f9025a docs/users_guide/flags.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index c9f14f0..df23f38 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,8 +48,6 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject -from sphinx.domains import ObjType -from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -599,20 +597,15 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): - # Yuck: We can't use app.add_object_type since we need to provide the - # Directive instance ourselves. - std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_directive_to_domain('std', 'ghc-flag', Flag) - app.add_role_to_domain('std', 'ghc-flag', XRefRole()) - std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) # Add extension directive, and override the class with our own - app.add_directive_to_domain('std', 'extension', LanguageExtension) - app.add_role_to_domain('std', 'extension', XRefRole()) - std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') - + app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension, + override=True) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 20:06:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 20:06:16 +0000 (UTC) Subject: [commit: ghc] master: users_guide: fix sphinx error caused by non-explicit override (8c7d33a) Message-ID: <20180920200616.CCD1B3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8/ghc >--------------------------------------------------------------- commit 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8 Author: Zejun Wu Date: Thu Sep 20 16:05:28 2018 -0400 users_guide: fix sphinx error caused by non-explicit override Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161 >--------------------------------------------------------------- 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8 docs/users_guide/flags.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index 284b5e0..0e56bdf 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,8 +48,6 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject -from sphinx.domains import ObjType -from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -601,20 +599,15 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): - # Yuck: We can't use app.add_object_type since we need to provide the - # Directive instance ourselves. - std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_directive_to_domain('std', 'ghc-flag', Flag) - app.add_role_to_domain('std', 'ghc-flag', XRefRole()) - std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) # Add extension directive, and override the class with our own - app.add_directive_to_domain('std', 'extension', LanguageExtension) - app.add_role_to_domain('std', 'extension', XRefRole()) - std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') - + app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension, + override=True) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 20:06:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 20:06:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: users_guide: fix sphinx error caused by non-explicit override (5ed9c86) Message-ID: <20180920200619.ADA8F3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/5ed9c86134200db615908d445702522d95f9025a/ghc >--------------------------------------------------------------- commit 5ed9c86134200db615908d445702522d95f9025a Author: Zejun Wu Date: Thu Sep 20 16:05:28 2018 -0400 users_guide: fix sphinx error caused by non-explicit override Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161 (cherry picked from commit 8c7d33a8ff6d3ea55b5dc8108d9441521af68ab8) >--------------------------------------------------------------- 5ed9c86134200db615908d445702522d95f9025a docs/users_guide/flags.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index c9f14f0..df23f38 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -48,8 +48,6 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx import addnodes from sphinx.domains.std import GenericObject -from sphinx.domains import ObjType -from sphinx.roles import XRefRole from sphinx.errors import SphinxError from utils import build_table_from_list @@ -599,20 +597,15 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): - # Yuck: We can't use app.add_object_type since we need to provide the - # Directive instance ourselves. - std_object_types = app.registry.domain_object_types.setdefault('std', {}) # Add ghc-flag directive, and override the class with our own - app.add_directive_to_domain('std', 'ghc-flag', Flag) - app.add_role_to_domain('std', 'ghc-flag', XRefRole()) - std_object_types['ghc-flag'] = ObjType('ghc-flag', 'ghc-flag') + app.add_object_type('ghc-flag', 'ghc-flag') + app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) # Add extension directive, and override the class with our own - app.add_directive_to_domain('std', 'extension', LanguageExtension) - app.add_role_to_domain('std', 'extension', XRefRole()) - std_object_types['extension'] = ObjType('ghc-flag', 'ghc-flag') - + app.add_object_type('extension', 'extension') + app.add_directive_to_domain('std', 'extension', LanguageExtension, + override=True) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 22:18:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 22:18:41 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: user-guide: Allow build with sphinx < 1.8 (af0bf16) Message-ID: <20180920221841.5F90B3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/af0bf169a4fb70b7cf371026906663df04e2023e/ghc >--------------------------------------------------------------- commit af0bf169a4fb70b7cf371026906663df04e2023e Author: Ben Gamari Date: Thu Sep 20 17:35:05 2018 -0400 user-guide: Allow build with sphinx < 1.8 Apparently the override argument to add_directive_to_domain was added in sphinx 1.8. (cherry picked from commit a257782f56e5e330349d4cc7db71e297d8396c67) >--------------------------------------------------------------- af0bf169a4fb70b7cf371026906663df04e2023e docs/users_guide/flags.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index df23f38..21c7ae3 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -46,9 +46,11 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives +import sphinx from sphinx import addnodes from sphinx.domains.std import GenericObject from sphinx.errors import SphinxError +from distutils.version import LooseVersion from utils import build_table_from_list ### Settings @@ -597,15 +599,18 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): + # The override argument to add_directive_to_domain is only supported by >= 1.8 + sphinx_version = LooseVersion(sphinx.__version__) + override_arg = {'override': True} if sphinx_version >= LooseVersion('1.8') else {} # Add ghc-flag directive, and override the class with our own app.add_object_type('ghc-flag', 'ghc-flag') - app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) + app.add_directive_to_domain('std', 'ghc-flag', Flag, **override_arg) # Add extension directive, and override the class with our own app.add_object_type('extension', 'extension') app.add_directive_to_domain('std', 'extension', LanguageExtension, - override=True) + **override_arg) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Thu Sep 20 23:51:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 20 Sep 2018 23:51:31 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Allow build with sphinx < 1.8 (a257782) Message-ID: <20180920235131.CFE8C3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a257782f56e5e330349d4cc7db71e297d8396c67/ghc >--------------------------------------------------------------- commit a257782f56e5e330349d4cc7db71e297d8396c67 Author: Ben Gamari Date: Thu Sep 20 17:35:05 2018 -0400 user-guide: Allow build with sphinx < 1.8 Apparently the override argument to add_directive_to_domain was added in sphinx 1.8. >--------------------------------------------------------------- a257782f56e5e330349d4cc7db71e297d8396c67 docs/users_guide/flags.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py index 0e56bdf..c95b9aa 100644 --- a/docs/users_guide/flags.py +++ b/docs/users_guide/flags.py @@ -46,9 +46,11 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives +import sphinx from sphinx import addnodes from sphinx.domains.std import GenericObject from sphinx.errors import SphinxError +from distutils.version import LooseVersion from utils import build_table_from_list ### Settings @@ -599,15 +601,18 @@ def purge_flags(app, env, docname): ### Initialization def setup(app): + # The override argument to add_directive_to_domain is only supported by >= 1.8 + sphinx_version = LooseVersion(sphinx.__version__) + override_arg = {'override': True} if sphinx_version >= LooseVersion('1.8') else {} # Add ghc-flag directive, and override the class with our own app.add_object_type('ghc-flag', 'ghc-flag') - app.add_directive_to_domain('std', 'ghc-flag', Flag, override=True) + app.add_directive_to_domain('std', 'ghc-flag', Flag, **override_arg) # Add extension directive, and override the class with our own app.add_object_type('extension', 'extension') app.add_directive_to_domain('std', 'extension', LanguageExtension, - override=True) + **override_arg) # NB: language-extension would be misinterpreted by sphinx, and produce # lang="extensions" XML attributes From git at git.haskell.org Fri Sep 21 07:04:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 07:04:34 +0000 (UTC) Subject: [commit: ghc] master: Fix slop zeroing for AP_STACK eager blackholes in debug build (66c1729) Message-ID: <20180921070434.585C43ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/66c17293648fd03a04aabfd807b3c8336e8f843a/ghc >--------------------------------------------------------------- commit 66c17293648fd03a04aabfd807b3c8336e8f843a Author: Ömer Sinan Ağacan Date: Fri Sep 21 09:33:38 2018 +0300 Fix slop zeroing for AP_STACK eager blackholes in debug build As #15571 reports, eager blackholing breaks sanity checks as we can't zero the payload when eagerly blackholing (because we'll be using the payload after blackholing), but by the time we blackhole a previously eagerly blackholed object (in `threadPaused()`) we don't have the correct size information for the object (because the object's type becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero the slop. This problem can be solved for AP_STACK eager blackholing (which unlike eager blackholing in general, is not optional) by zeroing the payload after entering the stack. This patch implements this idea. Fixes #15571. Test Plan: Previously concprog001 when compiled and run with sanity checks ghc-stage2 Mult.hs -debug -rtsopts ./Mult +RTS -DS was failing with Mult: internal error: checkClosure: stack frame (GHC version 8.7.20180821 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug thic patch fixes this panic. The test still panics, but it runs for a while before panicking (instead of directly panicking as before), and the new problem seems unrelated: Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296 (GHC version 8.7.20180919 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug The new problem will be fixed in another diff. I also tried slow validate (which requires D5164): this does not introduce any new failures. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15571 Differential Revision: https://phabricator.haskell.org/D5165 >--------------------------------------------------------------- 66c17293648fd03a04aabfd807b3c8336e8f843a includes/Cmm.h | 5 ++-- includes/rts/storage/ClosureMacros.h | 47 +++++++++++++++--------------------- rts/Apply.cmm | 5 ++++ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/includes/Cmm.h b/includes/Cmm.h index 059220a..7334eab 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -617,10 +617,11 @@ #define mutArrPtrsCardWords(n) ROUNDUP_BYTES_TO_WDS(mutArrPtrCardUp(n)) #if defined(PROFILING) || (!defined(THREADED_RTS) && defined(DEBUG)) +#define OVERWRITING_CLOSURE_SIZE(c, size) foreign "C" overwritingClosureSize(c "ptr", size) #define OVERWRITING_CLOSURE(c) foreign "C" overwritingClosure(c "ptr") -#define OVERWRITING_CLOSURE_OFS(c,n) \ - foreign "C" overwritingClosureOfs(c "ptr", n) +#define OVERWRITING_CLOSURE_OFS(c,n) foreign "C" overwritingClosureOfs(c "ptr", n) #else +#define OVERWRITING_CLOSURE_SIZE(c, size) /* nothing */ #define OVERWRITING_CLOSURE(c) /* nothing */ #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ #endif diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 71d53ae..e52059e 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -530,8 +530,7 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) #if ZERO_SLOP_FOR_LDV_PROF || ZERO_SLOP_FOR_SANITY_CHECK #define OVERWRITING_CLOSURE(c) overwritingClosure(c) -#define OVERWRITING_CLOSURE_OFS(c,n) \ - overwritingClosureOfs(c,n) +#define OVERWRITING_CLOSURE_OFS(c,n) overwritingClosureOfs(c,n) #else #define OVERWRITING_CLOSURE(c) /* nothing */ #define OVERWRITING_CLOSURE_OFS(c,n) /* nothing */ @@ -541,28 +540,32 @@ INLINE_HEADER StgWord8 *mutArrPtrsCard (StgMutArrPtrs *a, W_ n) void LDV_recordDead (const StgClosure *c, uint32_t size); #endif -EXTERN_INLINE void overwritingClosure (StgClosure *p); -EXTERN_INLINE void overwritingClosure (StgClosure *p) +EXTERN_INLINE void overwritingClosure_ (StgClosure *p, + uint32_t offset /* in words */, + uint32_t size /* closure size, in words */); +EXTERN_INLINE void overwritingClosure_ (StgClosure *p, uint32_t offset, uint32_t size) { - uint32_t size, i; - #if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK // see Note [zeroing slop], also #8402 if (era <= 0) return; #endif - size = closure_sizeW(p); - // For LDV profiling, we need to record the closure as dead #if defined(PROFILING) LDV_recordDead(p, size); #endif - for (i = 0; i < size - sizeofW(StgThunkHeader); i++) { - ((StgThunk *)(p))->payload[i] = 0; + for (uint32_t i = offset; i < size; i++) { + ((StgWord *)p)[i] = 0; } } +EXTERN_INLINE void overwritingClosure (StgClosure *p); +EXTERN_INLINE void overwritingClosure (StgClosure *p) +{ + overwritingClosure_(p, sizeofW(StgThunkHeader), closure_sizeW(p)); +} + // Version of 'overwritingClosure' which overwrites only a suffix of a // closure. The offset is expressed in words relative to 'p' and shall // be less than or equal to closure_sizeW(p), and usually at least as @@ -573,22 +576,12 @@ EXTERN_INLINE void overwritingClosure (StgClosure *p) EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset); EXTERN_INLINE void overwritingClosureOfs (StgClosure *p, uint32_t offset) { - uint32_t size, i; - -#if ZERO_SLOP_FOR_LDV_PROF && !ZERO_SLOP_FOR_SANITY_CHECK - // see Note [zeroing slop], also #8402 - if (era <= 0) return; -#endif - - size = closure_sizeW(p); - - ASSERT(offset <= size); - - // For LDV profiling, we need to record the closure as dead -#if defined(PROFILING) - LDV_recordDead(p, size); -#endif + overwritingClosure_(p, offset, closure_sizeW(p)); +} - for (i = offset; i < size; i++) - ((StgWord *)p)[i] = 0; +// Version of 'overwritingClosure' which takes closure size as argument. +EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size /* in words */); +EXTERN_INLINE void overwritingClosureSize (StgClosure *p, uint32_t size) +{ + overwritingClosure_(p, sizeofW(StgThunkHeader), size); } diff --git a/rts/Apply.cmm b/rts/Apply.cmm index 15d8250..40f890d 100644 --- a/rts/Apply.cmm +++ b/rts/Apply.cmm @@ -679,6 +679,11 @@ for: R1 = StgAP_STACK_fun(ap); + // Because of eager blackholing the closure no longer has correct size so + // threadPaused() can't correctly zero the slop, so we do it here. See #15571 + // and Note [zeroing slop]. + OVERWRITING_CLOSURE_SIZE(ap, BYTES_TO_WDS(SIZEOF_StgThunkHeader) + 2 + Words); + ENTER_R1(); } From git at git.haskell.org Fri Sep 21 07:08:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 07:08:37 +0000 (UTC) Subject: [commit: ghc] master: Remove redundant slop zeroing (29f1c55) Message-ID: <20180921070837.4CB4A3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/29f1c556dd563f563c3c0522823fa66f171ff023/ghc >--------------------------------------------------------------- commit 29f1c556dd563f563c3c0522823fa66f171ff023 Author: Ömer Sinan Ağacan Date: Fri Sep 21 10:08:18 2018 +0300 Remove redundant slop zeroing OVERWRITE_INFO already does zero slopping by calling OVERWRITING_CLOSURE >--------------------------------------------------------------- 29f1c556dd563f563c3c0522823fa66f171ff023 rts/Threads.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/rts/Threads.c b/rts/Threads.c index 78c5b6c..9776353 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -371,12 +371,6 @@ wakeBlockingQueue(Capability *cap, StgBlockingQueue *bq) // overwrite the BQ with an indirection so it will be // collected at the next GC. -#if defined(DEBUG) && !defined(THREADED_RTS) - // XXX FILL_SLOP, but not if THREADED_RTS because in that case - // another thread might be looking at this BLOCKING_QUEUE and - // checking the owner field at the same time. - bq->bh = 0; bq->queue = 0; bq->owner = 0; -#endif OVERWRITE_INFO(bq, &stg_IND_info); } From git at git.haskell.org Fri Sep 21 15:46:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 15:46:36 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Don't force run of llvm ways in T14251 (d0d7484) Message-ID: <20180921154636.2BF1A3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d0d74842868ceb6716b7334eb6310f61f90023bf/ghc >--------------------------------------------------------------- commit d0d74842868ceb6716b7334eb6310f61f90023bf Author: Ben Gamari Date: Fri Sep 21 11:44:35 2018 -0400 testsuite: Don't force run of llvm ways in T14251 This breaks if LLVM is not available. >--------------------------------------------------------------- d0d74842868ceb6716b7334eb6310f61f90023bf testsuite/tests/codeGen/should_run/all.T | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 025acb4..4959295 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,6 +172,5 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) -test('T14251', [extra_ways(['llvm', 'optllvm']), - expect_broken_for(14251, ['optllvm'])], +test('T14251', [expect_broken_for(14251, ['optllvm'])], compile_and_run, ['']) From git at git.haskell.org Fri Sep 21 16:19:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 16:19:09 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Mark readFail032 and readFail048 as broken on Darwin (73d9cad) Message-ID: <20180921161909.862DB3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/73d9cade32105b3e9c13ed1936c2e48407355a94/ghc >--------------------------------------------------------------- commit 73d9cade32105b3e9c13ed1936c2e48407355a94 Author: Ben Gamari Date: Fri Sep 21 12:16:35 2018 -0400 testsuite: Mark readFail032 and readFail048 as broken on Darwin It looks like Clang's CPP implementation has an off-by-one error here. >--------------------------------------------------------------- 73d9cade32105b3e9c13ed1936c2e48407355a94 testsuite/tests/parser/should_fail/all.T | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 8233d76..c655827 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -35,7 +35,8 @@ test('readFail028', normal, compile_fail, ['']) test('readFail029', normal, compile_fail, ['']) test('readFail030', normal, compile_fail, ['']) test('readFail031', normal, compile_fail, ['']) -test('readFail032', normal, compile_fail, ['-cpp']) +test('readFail032', when(opsys('darwin', expect_broken(15662))), + compile_fail, ['-cpp']) test('readFail033', normal, compile_fail, ['']) test('readFail034', normal, compile_fail, ['']) test('readFail035', normal, compile_fail, ['']) @@ -50,7 +51,8 @@ test('readFail043', normal, compile_fail, ['']) test('readFail044', normal, compile_fail, ['']) test('readFail046', normal, compile_fail, ['']) test('readFail047', normal, compile_fail, ['']) -test('readFail048', normal, compile_fail, ['-cpp -haddock']) +test('readFail048', when(opsys('darwin', expect_broken(15662))), + compile_fail, ['-cpp -haddock']) test('T3095', normal, compile_fail, ['']) test('T3153', normal, compile_fail, ['']) test('T3751', normal, compile_fail, ['']) From git at git.haskell.org Fri Sep 21 16:51:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 16:51:38 +0000 (UTC) Subject: [commit: ghc] tag 'ghc-8.6.1-release' created Message-ID: <20180921165138.2A1603ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New tag : ghc-8.6.1-release Referencing: 7283a040fc3282d5a055b42c1de1b37ce3112b38 From git at git.haskell.org Fri Sep 21 16:51:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 16:51:41 +0000 (UTC) Subject: [commit: ghc] : Set RELEASE=YES (0d2cdec) Message-ID: <20180921165141.0AFFC3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : Link : http://ghc.haskell.org/trac/ghc/changeset/0d2cdec78471728a0f2c487581d36acda68bb941/ghc >--------------------------------------------------------------- commit 0d2cdec78471728a0f2c487581d36acda68bb941 Author: Ben Gamari Date: Fri Sep 21 12:39:51 2018 -0400 Set RELEASE=YES >--------------------------------------------------------------- 0d2cdec78471728a0f2c487581d36acda68bb941 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8b24135..5fd3441 100644 --- a/configure.ac +++ b/configure.ac @@ -13,10 +13,10 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.6.0], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.6.1], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO -: ${RELEASE=NO} +: ${RELEASE=YES} # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line # above. If this is not a released version, then we will append the From git at git.haskell.org Fri Sep 21 18:35:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 18:35:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.6's head updated: Set RELEASE=YES (0d2cdec) Message-ID: <20180921183540.04D3D3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'ghc-8.6' now includes: 0d2cdec Set RELEASE=YES From git at git.haskell.org Fri Sep 21 20:06:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 21 Sep 2018 20:06:33 +0000 (UTC) Subject: [commit: ghc] ghc-8.6: circleci: Run cabal update with -v (f28b05b) Message-ID: <20180921200633.D4CD23ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.6 Link : http://ghc.haskell.org/trac/ghc/changeset/f28b05b5e49487317885472afcdf7c231ad9a912/ghc >--------------------------------------------------------------- commit f28b05b5e49487317885472afcdf7c231ad9a912 Author: Ben Gamari Date: Fri Sep 21 16:05:30 2018 -0400 circleci: Run cabal update with -v The cabal update command appears to be timing out with no output after 10 minutes. >--------------------------------------------------------------- f28b05b5e49487317885472afcdf7c231ad9a912 .circleci/prepare-system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/prepare-system.sh b/.circleci/prepare-system.sh index dbb1011..636b792 100755 --- a/.circleci/prepare-system.sh +++ b/.circleci/prepare-system.sh @@ -44,7 +44,7 @@ case "$(uname)" in fail "TARGET=$target not supported" fi else - cabal update + cabal update -v cabal install --reinstall hscolour sudo ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour || true fi From git at git.haskell.org Sat Sep 22 00:50:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 22 Sep 2018 00:50:27 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Fix readFail048 and readFail032 brokenness declarations (3e5b8e3) Message-ID: <20180922005027.53F103ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3e5b8e334862f18e08a5721150bc2b88ffa2b21b/ghc >--------------------------------------------------------------- commit 3e5b8e334862f18e08a5721150bc2b88ffa2b21b Author: Ben Gamari Date: Fri Sep 21 16:18:08 2018 -0400 testsuite: Fix readFail048 and readFail032 brokenness declarations Whoops. >--------------------------------------------------------------- 3e5b8e334862f18e08a5721150bc2b88ffa2b21b testsuite/tests/parser/should_fail/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index c655827..960144c 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -35,7 +35,7 @@ test('readFail028', normal, compile_fail, ['']) test('readFail029', normal, compile_fail, ['']) test('readFail030', normal, compile_fail, ['']) test('readFail031', normal, compile_fail, ['']) -test('readFail032', when(opsys('darwin', expect_broken(15662))), +test('readFail032', when(opsys('darwin'), expect_broken(15662)), compile_fail, ['-cpp']) test('readFail033', normal, compile_fail, ['']) test('readFail034', normal, compile_fail, ['']) @@ -51,7 +51,7 @@ test('readFail043', normal, compile_fail, ['']) test('readFail044', normal, compile_fail, ['']) test('readFail046', normal, compile_fail, ['']) test('readFail047', normal, compile_fail, ['']) -test('readFail048', when(opsys('darwin', expect_broken(15662))), +test('readFail048', when(opsys('darwin'), expect_broken(15662)), compile_fail, ['-cpp -haddock']) test('T3095', normal, compile_fail, ['']) test('T3153', normal, compile_fail, ['']) From git at git.haskell.org Sat Sep 22 00:50:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 22 Sep 2018 00:50:30 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Bump expected allocations for T12707 (78beade) Message-ID: <20180922005030.251DE3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/78beadecf4f15fe9223b26f871a5594339f72b12/ghc >--------------------------------------------------------------- commit 78beadecf4f15fe9223b26f871a5594339f72b12 Author: Ben Gamari Date: Fri Sep 21 18:51:38 2018 -0400 testsuite: Bump expected allocations for T12707 >--------------------------------------------------------------- 78beadecf4f15fe9223b26f871a5594339f72b12 testsuite/tests/perf/compiler/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 082bcdc..66c8309 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1137,7 +1137,7 @@ test('T13056', test('T12707', [ compiler_stats_num_field('bytes allocated', - [(wordsize(64), 1141555816, 5), + [(wordsize(64), 1201750816, 5), # initial: 1271577192 # 2017-01-22: 1348865648 Allow top-level strings in Core # 2017-01-31: 1280336112 Join points (#12988) @@ -1147,6 +1147,7 @@ test('T12707', # 2017-05-14: 1163821528 (amd64/Linux) Two-pass CmmLayoutStack # 2018-04-09: 1237898376 Inexplicable, collateral of #14737 # 2018-04-30: 1141555816 improved simplCast performance #15019 + # 2018-09-21: 1201750816 (amd64/darwin) Drift ]), ], compile, From git at git.haskell.org Sat Sep 22 00:50:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 22 Sep 2018 00:50:32 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Bump expected allocations of T9675 (fd89bb4) Message-ID: <20180922005032.ED3AF3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fd89bb44c1ebe36498c84f5e1ab4e4308a5a594a/ghc >--------------------------------------------------------------- commit fd89bb44c1ebe36498c84f5e1ab4e4308a5a594a Author: Ben Gamari Date: Fri Sep 21 16:24:32 2018 -0400 testsuite: Bump expected allocations of T9675 This inexplicably started with 989dca6cbd93, which appears to be a bump of the `text` submodule. This is very fishy so I've opened #15663 to ensure we investigate. >--------------------------------------------------------------- fd89bb44c1ebe36498c84f5e1ab4e4308a5a594a testsuite/tests/perf/compiler/all.T | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index e7c04ae..082bcdc 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -776,7 +776,7 @@ test('T9020', test('T9675', [ only_ways(['optasm']), compiler_stats_num_field('max_bytes_used', # Note [residency] - [(wordsize(64), 17675240, 15), + [(wordsize(64), 20499224, 15), # 2014-10-13 29596552 # 2014-10-13 26570896 seq the DmdEnv in seqDmdType as well # 2014-10-13 18582472 different machines giving different results.. @@ -787,12 +787,13 @@ test('T9675', # 2016-03-14 38776008 Final demand analyzer run # 2016-04-01 29871032 Fix leaks in demand analysis # 2016-04-30 17675240 Fix leaks in tidy unfoldings + # 2018-09-21 20499224 See #15663 (wordsize(32), 18043224, 15) # 2015-07-11 15341228 (x86/Linux, 64-bit machine) use +RTS -G1 # 2016-04-06 18043224 (x86/Linux, 64-bit machine) ]), compiler_stats_num_field('peak_megabytes_allocated', # Note [residency] - [(wordsize(64), 63, 15), + [(wordsize(64), 75, 15), # 2014-10-13 66 # 2014-10-13 58 seq the DmdEnv in seqDmdType as well # 2014-10-13 49 different machines giving different results... @@ -804,6 +805,7 @@ test('T9675', # 2016-04-14 144 Final demand analyzer run # 2016-07-26 121 Unboxed sums? # 2017-04-30 63 Fix leaks in tidy unfoldings + # 2018-09-21 75 See #15663 (wordsize(32), 56, 15) # 2015-07-11 56 (x86/Linux, 64-bit machine) use +RTS -G1 ]), From git at git.haskell.org Sat Sep 22 15:14:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 22 Sep 2018 15:14:41 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Bump T9630 expected allocations (7e77f41) Message-ID: <20180922151441.135AD3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7e77f41430ae1cad84d5b0c90328331d38f3eda0/ghc >--------------------------------------------------------------- commit 7e77f41430ae1cad84d5b0c90328331d38f3eda0 Author: Ben Gamari Date: Sat Sep 22 11:12:59 2018 -0400 testsuite: Bump T9630 expected allocations This failed on Darwin. >--------------------------------------------------------------- 7e77f41430ae1cad84d5b0c90328331d38f3eda0 testsuite/tests/perf/compiler/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 66c8309..7420690 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1306,10 +1306,11 @@ test ('T9630', [ compiler_stats_num_field('max_bytes_used', # Note [residency] [(platform('x86_64-unknown-mingw32'), 39867088, 15), # 2017-12-24: 34171816 (x64/Windows) - (wordsize(64), 35324712, 15) + (wordsize(64), 41365088, 15) # initial: 56955240 # 2017-06-07: 41568168 Stop the specialiser generating loopy code # 2018-02-25: 35324712 It's not entirely clear + # 2018-09-22: 41365088 It's not entirely clear (x86_64/darwin) ]), extra_clean(['T9630a.hi', 'T9630a.o']) ], From git at git.haskell.org Sun Sep 23 11:16:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 23 Sep 2018 11:16:29 +0000 (UTC) Subject: [commit: ghc] master: Fix get getIdFromTrivialExpr (2dbf88b) Message-ID: <20180923111629.AEE483A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2dbf88b3558c3b53a1207fb504232c3da67b266e/ghc >--------------------------------------------------------------- commit 2dbf88b3558c3b53a1207fb504232c3da67b266e Author: Simon Peyton Jones Date: Sun Sep 23 00:44:14 2018 +0100 Fix get getIdFromTrivialExpr This bug, discovered by Trac #15325, has been lurking since commit 1c9fd3f1c5522372fcaf250c805b959e8090a62c Author: Simon Peyton Jones Date: Thu Dec 3 12:57:54 2015 +0000 Case-of-empty-alts is trivial (Trac #11155) I'd forgotttnen to modify getIdFromTrivialExpr when I modified exprIsTrivial. Easy to fix, though. >--------------------------------------------------------------- 2dbf88b3558c3b53a1207fb504232c3da67b266e compiler/coreSyn/CoreUtils.hs | 22 ++++++++++++++-------- testsuite/tests/ghci/scripts/T15325.hs | 11 +++++++++++ testsuite/tests/ghci/scripts/T15325.script | 2 ++ testsuite/tests/ghci/scripts/T15325.stderr | 25 +++++++++++++++++++++++++ testsuite/tests/ghci/scripts/all.T | 1 + 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index a1dae98..453d984 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -955,6 +955,8 @@ it off at source. -} exprIsTrivial :: CoreExpr -> Bool +-- If you modify this function, you may also +-- need to modify getIdFromTrivialExpr exprIsTrivial (Var _) = True -- See Note [Variables are trivial] exprIsTrivial (Type _) = True exprIsTrivial (Coercion _) = True @@ -984,20 +986,24 @@ if the variable actually refers to a literal; thus we use T12076lit for an example where this matters. -} -getIdFromTrivialExpr :: CoreExpr -> Id +getIdFromTrivialExpr :: HasDebugCallStack => CoreExpr -> Id getIdFromTrivialExpr e = fromMaybe (pprPanic "getIdFromTrivialExpr" (ppr e)) (getIdFromTrivialExpr_maybe e) getIdFromTrivialExpr_maybe :: CoreExpr -> Maybe Id -- See Note [getIdFromTrivialExpr] -getIdFromTrivialExpr_maybe e = go e - where go (Var v) = Just v - go (App f t) | not (isRuntimeArg t) = go f - go (Tick t e) | not (tickishIsCode t) = go e - go (Cast e _) = go e - go (Lam b e) | not (isRuntimeVar b) = go e - go _ = Nothing +-- Th equations for this should line up with those for exprIsTrivial +getIdFromTrivialExpr_maybe e + = go e + where + go (App f t) | not (isRuntimeArg t) = go f + go (Tick t e) | not (tickishIsCode t) = go e + go (Cast e _) = go e + go (Lam b e) | not (isRuntimeVar b) = go e + go (Case e _ _ []) = go e + go (Var v) = Just v + go _ = Nothing {- exprIsBottom is a very cheap and cheerful function; it may return diff --git a/testsuite/tests/ghci/scripts/T15325.hs b/testsuite/tests/ghci/scripts/T15325.hs new file mode 100644 index 0000000..3a0407b --- /dev/null +++ b/testsuite/tests/ghci/scripts/T15325.hs @@ -0,0 +1,11 @@ +{-# OPTIONS_GHC -fdefer-type-errors #-} +module T15325 where + +class PolyList e where + polyList :: e -> () + +f :: PolyList e => e -> () +f x = polyList x + +plh :: () +plh = f 0 diff --git a/testsuite/tests/ghci/scripts/T15325.script b/testsuite/tests/ghci/scripts/T15325.script new file mode 100644 index 0000000..227c00c --- /dev/null +++ b/testsuite/tests/ghci/scripts/T15325.script @@ -0,0 +1,2 @@ +:l T15325 +plh diff --git a/testsuite/tests/ghci/scripts/T15325.stderr b/testsuite/tests/ghci/scripts/T15325.stderr new file mode 100644 index 0000000..c767528 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T15325.stderr @@ -0,0 +1,25 @@ + +T15325.hs:11:7: warning: [-Wdeferred-type-errors (in -Wdefault)] + • No instance for (PolyList e0) arising from a use of ‘f’ + • In the expression: f 0 + In an equation for ‘plh’: plh = f 0 + +T15325.hs:11:9: warning: [-Wdeferred-type-errors (in -Wdefault)] + • Ambiguous type variable ‘e0’ arising from the literal ‘0’ + prevents the constraint ‘(Num e0)’ from being solved. + Probable fix: use a type annotation to specify what ‘e0’ should be. + These potential instances exist: + instance Num Integer -- Defined in ‘GHC.Num’ + instance Num Double -- Defined in ‘GHC.Float’ + instance Num Float -- Defined in ‘GHC.Float’ + ...plus two others + ...plus one instance involving out-of-scope types + (use -fprint-potential-instances to see them all) + • In the first argument of ‘f’, namely ‘0’ + In the expression: f 0 + In an equation for ‘plh’: plh = f 0 +*** Exception: T15325.hs:11:7: error: + • No instance for (PolyList e0) arising from a use of ‘f’ + • In the expression: f 0 + In an equation for ‘plh’: plh = f 0 +(deferred type error) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index c02fb87..290c274 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -283,3 +283,4 @@ test('T14969', normal, ghci_script, ['T14969.script']) test('T15259', normal, ghci_script, ['T15259.script']) test('T15341', normal, ghci_script, ['T15341.script']) test('T15568', normal, ghci_script, ['T15568.script']) +test('T15325', normal, ghci_script, ['T15325.script']) From git at git.haskell.org Sun Sep 23 11:16:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 23 Sep 2018 11:16:32 +0000 (UTC) Subject: [commit: ghc] master: Comments only (ab44ff8) Message-ID: <20180923111632.820AF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ab44ff817bcbf81aa5311eb8bb6f2073f521bd26/ghc >--------------------------------------------------------------- commit ab44ff817bcbf81aa5311eb8bb6f2073f521bd26 Author: Simon Peyton Jones Date: Thu Sep 20 20:05:05 2018 +0100 Comments only >--------------------------------------------------------------- ab44ff817bcbf81aa5311eb8bb6f2073f521bd26 compiler/typecheck/TcSMonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 5bf5cef..db29f67 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -2196,7 +2196,7 @@ are some wrinkles: Note [Let-bound skolems] ~~~~~~~~~~~~~~~~~~~~~~~~ If * the inert set contains a canonical Given CTyEqCan (a ~ ty) -and * 'a' is a skolem bound in this very implication, b +and * 'a' is a skolem bound in this very implication, then: a) The Given is pretty much a let-binding, like From git at git.haskell.org Sun Sep 23 11:16:36 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 23 Sep 2018 11:16:36 +0000 (UTC) Subject: [commit: ghc] master: Don't look up unnecessary return in LastStmt (4bde71d) Message-ID: <20180923111636.5D35E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4bde71df9a32bf6f5ee7d44fbbf79523da4b0a9e/ghc >--------------------------------------------------------------- commit 4bde71df9a32bf6f5ee7d44fbbf79523da4b0a9e Author: Simon Peyton Jones Date: Thu Sep 20 20:02:39 2018 +0100 Don't look up unnecessary return in LastStmt This fixes Trac #15607. The general pattern is well established (e.g. see the guard_op binding in rnStmt of BodyStme), but we weren't using it for LastStmt. >--------------------------------------------------------------- 4bde71df9a32bf6f5ee7d44fbbf79523da4b0a9e compiler/hsSyn/HsExpr.hs | 37 +++++++++++++----------- compiler/rename/RnExpr.hs | 22 ++++++++++---- testsuite/tests/rename/should_fail/T15607.hs | 6 ++++ testsuite/tests/rename/should_fail/T15607.stderr | 5 ++++ testsuite/tests/rename/should_fail/all.T | 1 + 5 files changed, 49 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4bde71df9a32bf6f5ee7d44fbbf79523da4b0a9e From git at git.haskell.org Sun Sep 23 11:16:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 23 Sep 2018 11:16:39 +0000 (UTC) Subject: [commit: ghc] master: Buglet in reporting out of scope errors in rules (cad5d0b) Message-ID: <20180923111639.F3A383A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed/ghc >--------------------------------------------------------------- commit cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed Author: Simon Peyton Jones Date: Thu Sep 20 19:53:56 2018 +0100 Buglet in reporting out of scope errors in rules Most out of scope errors get reported by the type checker these days, but not all. Example, the function on the LHS of a RULE. Trace #15659 pointed out that this less-heavily-used code path produce a "wacky" error message. Indeed so. Easily fixed. >--------------------------------------------------------------- cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed compiler/hsSyn/HsExpr.hs | 11 +++++++++-- compiler/rename/RnSource.hs | 8 ++++---- compiler/rename/RnUnbound.hs | 11 ++++++----- testsuite/tests/rename/should_fail/T15659.hs | 5 +++++ testsuite/tests/rename/should_fail/T15659.stderr | 6 ++++++ testsuite/tests/rename/should_fail/all.T | 2 +- 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 6ca37e0..61285ba 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -179,8 +179,15 @@ is Less Cool because typecheck do-notation with (>>=) :: m1 a -> (a -> m2 b) -> m2 b.) -} --- | An unbound variable; used for treating out-of-scope variables as --- expression holes +-- | An unbound variable; used for treating +-- out-of-scope variables as expression holes +-- +-- Either "x", "y" Plain OutOfScope +-- or "_", "_x" A TrueExprHole +-- +-- Both forms indicate an out-of-scope variable, but the latter +-- indicates that the user /expects/ it to be out of scope, and +-- just wants GHC to report its type data UnboundVar = OutOfScope OccName GlobalRdrEnv -- ^ An (unqualified) out-of-scope -- variable, together with the GlobalRdrEnv diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 00fc335..91c46b3 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -29,7 +29,7 @@ import RnUtils ( HsDocContext(..), mapFvRn, bindLocalNames , checkDupRdrNames, inHsDocContext, bindLocalNamesFV , checkShadowedRdrNames, warnUnusedTypePatterns , extendTyVarEnvFVRn, newLocalBndrsRn ) -import RnUnbound ( mkUnboundName ) +import RnUnbound ( mkUnboundName, notInScopeErr ) import RnNames import RnHsDoc ( rnHsDoc, rnMbLHsDoc ) import TcAnnotations ( annCtxt ) @@ -1093,14 +1093,14 @@ badRuleVar name var badRuleLhsErr :: FastString -> LHsExpr GhcRn -> HsExpr GhcRn -> SDoc badRuleLhsErr name lhs bad_e = sep [text "Rule" <+> pprRuleName name <> colon, - nest 4 (vcat [err, + nest 2 (vcat [err, text "in left-hand side:" <+> ppr lhs])] $$ text "LHS must be of form (f e1 .. en) where f is not forall'd" where err = case bad_e of - HsUnboundVar _ uv -> text "Not in scope:" <+> ppr uv - _ -> text "Illegal expression:" <+> ppr bad_e + HsUnboundVar _ uv -> notInScopeErr (mkRdrUnqual (unboundVarOcc uv)) + _ -> text "Illegal expression:" <+> ppr bad_e {- ************************************************************** * * diff --git a/compiler/rename/RnUnbound.hs b/compiler/rename/RnUnbound.hs index a77025f..ce5d0dc 100644 --- a/compiler/rename/RnUnbound.hs +++ b/compiler/rename/RnUnbound.hs @@ -12,7 +12,8 @@ module RnUnbound ( mkUnboundName , WhereLooking(..) , unboundName , unboundNameX - , perhapsForallMsg ) where + , perhapsForallMsg + , notInScopeErr ) where import GhcPrelude @@ -60,8 +61,7 @@ unboundNameX :: WhereLooking -> RdrName -> SDoc -> RnM Name unboundNameX where_look rdr_name extra = do { dflags <- getDynFlags ; let show_helpful_errors = gopt Opt_HelpfulErrors dflags - what = pprNonVarNameSpace (occNameSpace (rdrNameOcc rdr_name)) - err = unknownNameErr what rdr_name $$ extra + err = notInScopeErr rdr_name $$ extra ; if not show_helpful_errors then addErr err else do { local_env <- getLocalRdrEnv @@ -72,12 +72,13 @@ unboundNameX where_look rdr_name extra ; addErr (err $$ suggestions) } ; return (mkUnboundNameRdr rdr_name) } -unknownNameErr :: SDoc -> RdrName -> SDoc -unknownNameErr what rdr_name +notInScopeErr :: RdrName -> SDoc +notInScopeErr rdr_name = vcat [ hang (text "Not in scope:") 2 (what <+> quotes (ppr rdr_name)) , extra ] where + what = pprNonVarNameSpace (occNameSpace (rdrNameOcc rdr_name)) extra | rdr_name == forall_tv_RDR = perhapsForallMsg | otherwise = Outputable.empty diff --git a/testsuite/tests/rename/should_fail/T15659.hs b/testsuite/tests/rename/should_fail/T15659.hs new file mode 100644 index 0000000..9fa516f --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15659.hs @@ -0,0 +1,5 @@ +module T15659 where + +{-# RULES "test" forall x. f x = x #-} + + diff --git a/testsuite/tests/rename/should_fail/T15659.stderr b/testsuite/tests/rename/should_fail/T15659.stderr new file mode 100644 index 0000000..e1cbf9f --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15659.stderr @@ -0,0 +1,6 @@ + +T15659.hs:3:11: error: + Rule "test": + Not in scope: ‘f’ + in left-hand side: f x + LHS must be of form (f e1 .. en) where f is not forall'd diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index c69efb9..f8b950b 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -134,4 +134,4 @@ test('T14591', normal, compile_fail, ['']) test('T15214', normal, compile_fail, ['']) test('T15539', normal, compile_fail, ['']) test('T15487', normal, multimod_compile_fail, ['T15487','-v0']) - +test('T15659', normal, compile_fail, ['']) From git at git.haskell.org Sun Sep 23 14:13:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 23 Sep 2018 14:13:37 +0000 (UTC) Subject: [commit: ghc] master: Add a recursivity check in nonVoid (e68b439) Message-ID: <20180923141337.DB5FE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e68b439fe5de61b9a2ca51af472185c62ccb8b46/ghc >--------------------------------------------------------------- commit e68b439fe5de61b9a2ca51af472185c62ccb8b46 Author: Ryan Scott Date: Sun Sep 23 08:15:13 2018 -0400 Add a recursivity check in nonVoid Summary: Previously `nonVoid` outright refused to call itself recursively to avoid the risk of hitting infinite loops when checking recurisve types. But this is too conservative—we //can// call `nonVoid` recursively as long as we incorporate a way to detect the presence of recursive types, and bail out if we do detect one. Happily, such a mechanism already exists in the form of `checkRecTc`, so let's use it. Test Plan: make test TEST=T15584 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15584 Differential Revision: https://phabricator.haskell.org/D5116 >--------------------------------------------------------------- e68b439fe5de61b9a2ca51af472185c62ccb8b46 compiler/deSugar/Check.hs | 191 +++++++++++++++++------ compiler/types/TyCon.hs | 19 ++- testsuite/tests/pmcheck/should_compile/T15584.hs | 15 ++ testsuite/tests/pmcheck/should_compile/all.T | 2 + 4 files changed, 174 insertions(+), 53 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e68b439fe5de61b9a2ca51af472185c62ccb8b46 From git at git.haskell.org Mon Sep 24 13:48:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 24 Sep 2018 13:48:26 +0000 (UTC) Subject: [commit: ghc] master: Fix a MSG_BLACKHOLE sanity check, add some comments (d90946c) Message-ID: <20180924134826.C040E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d90946cea1357d3e99805c27dab1e811785a4088/ghc >--------------------------------------------------------------- commit d90946cea1357d3e99805c27dab1e811785a4088 Author: Ömer Sinan Ağacan Date: Mon Sep 24 16:21:27 2018 +0300 Fix a MSG_BLACKHOLE sanity check, add some comments Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15508 Differential Revision: https://phabricator.haskell.org/D5178 >--------------------------------------------------------------- d90946cea1357d3e99805c27dab1e811785a4088 includes/rts/storage/Closures.h | 7 ++++++- rts/sm/Sanity.c | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 15231e0..7db67c7 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -130,10 +130,13 @@ typedef struct { typedef struct StgBlockingQueue_ { StgHeader header; - struct StgBlockingQueue_ *link; // here so it looks like an IND + struct StgBlockingQueue_ *link; + // here so it looks like an IND, to be able to skip the queue without + // deleting it (done in wakeBlockingQueue()) StgClosure *bh; // the BLACKHOLE StgTSO *owner; struct MessageBlackHole_ *queue; + // holds TSOs blocked on `bh` } StgBlockingQueue; typedef struct { @@ -400,6 +403,8 @@ typedef struct MessageThrowTo_ { typedef struct MessageBlackHole_ { StgHeader header; struct MessageBlackHole_ *link; + // here so it looks like an IND, to be able to skip the message without + // deleting it (done in throwToMsg()) StgTSO *tso; StgClosure *bh; } MessageBlackHole; diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 8d4171b..c6861f4 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -292,8 +292,12 @@ checkClosure( const StgClosure* p ) ASSERT(LOOKS_LIKE_CLOSURE_PTR(bq->bh)); ASSERT(get_itbl((StgClosure *)(bq->owner))->type == TSO); - ASSERT(bq->queue == (MessageBlackHole*)END_TSO_QUEUE - || bq->queue->header.info == &stg_MSG_BLACKHOLE_info); + ASSERT(// A bq with no other blocked TSOs: + bq->queue == (MessageBlackHole*)END_TSO_QUEUE || + // A bq with blocked TSOs in its queue: + bq->queue->header.info == &stg_MSG_BLACKHOLE_info || + // A bq with a deleted (in throwToMsg()) MSG_BLACKHOLE: + bq->queue->header.info == &stg_IND_info); ASSERT(bq->link == (StgBlockingQueue*)END_TSO_QUEUE || get_itbl((StgClosure *)(bq->link))->type == IND || get_itbl((StgClosure *)(bq->link))->type == BLOCKING_QUEUE); From git at git.haskell.org Mon Sep 24 15:59:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 24 Sep 2018 15:59:02 +0000 (UTC) Subject: [commit: ghc] wip/T13904: update to current master again (84c2ad9) Message-ID: <20180924155902.1EE9E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T13904 Link : http://ghc.haskell.org/trac/ghc/changeset/84c2ad99582391005b5e873198b15e9e9eb4f78d/ghc >--------------------------------------------------------------- commit 84c2ad99582391005b5e873198b15e9e9eb4f78d Merge: 8ddb47c e68b439 Author: Kavon Farvardin Date: Sun Sep 23 15:29:37 2018 -0500 update to current master again >--------------------------------------------------------------- Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 84c2ad99582391005b5e873198b15e9e9eb4f78d From git at git.haskell.org Mon Sep 24 15:59:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 24 Sep 2018 15:59:14 +0000 (UTC) Subject: [commit: ghc] wip/T13904's head updated: update to current master again (84c2ad9) Message-ID: <20180924155914.409A93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/T13904' now includes: 746ab0b Add an Outputable instance for ListMap 75bf11c Fix binder visiblity for default methods 6386fc3 Comments and tc-tracing only f959624 Comments only d31181b Test Trac #14033 362339d Fix note references and some typos d774b4e Fix #13968 by consulting isBuiltInOcc_maybe 4a26415 Remove unneeded import 8e15e3d Improve error messages around kind mismatches. c9667d3 Fix #11400, #11560 by documenting an infelicity. 9a54975 Test #11672 in typecheck/should_fail/T11672. ef39af7 Don't tidy vars when dumping a type bb2a446 Preserve CoVar uniques during pretty printing 79cfb19 Remove old coercion pretty-printer c2417b8 Fix #13819 by refactoring TypeEqOrigin.uo_thing fb75213 Track visibility in TypeEqOrigin 10d13b6 Fix #11963 by checking for more mixed type/kinds ca47186 Document that type holes kill polymorphic recursion 1696dbf Fix #12176 by being a bit more careful instantiating. 4239238 Fix #12369 by being more flexible with data insts 791947d Refactor tcInferApps. 7af0b90 Initialize hs_init with UTF8 encoded arguments on Windows. 6b77914 Fix instantiation of pattern synonyms af6d225 Remove redundant constraint in context b1317a3 Fix ASSERT failure in tc269 452755d Do not discard insolubles in implications ad0037e Add DebugCallStack to piResultTy d618649 Error eagerly after renaming failures in reifyInstances b3b564f Merge types and kinds in DsMeta 424ecad Add regression tests for #13601, #13780, #13877 5e940bd Switched out optparse for argparse in runtests.py 54d3a1f testsuite: Produce JUnit output 262bb95 testsuite: Add test for #14028 274e9b2 Add “BINARY_DIST_DIR” to Makefile dac4b9d ByteCodeGen: use byte indexing for BCenv 2974f81 Fix lld detection if both gold and lld are found f134bfb gitmodules: Delete entry for dead hoopl submodule d08b9cc configure: Ensure that user's LD setting is respected 0e3c101 Ensure that we always link against libm 0e3eacc testsuite: Don't pass allow_abbrev 121fee9 Remove unnecessary GHC option from SrcLoc 9e9fb57 Fix hs-boot knot-tying with record wild cards. d75bba8 Add rtsopts ignore and ignoreAll. 84f8e86 Ensure that GHC.Stack.callStack doesn't fail 9cfabbb Add '<&>' operator to Data.Functor. '<&>' calls '<$>' with flipped arguments. d1ef223 Fix #14045 by omitting an unnecessary check f839b9d Add regression test for #14055 7089dc2 Follow-up to #13887, for promoted infix constructors 9699286 Typofixes [ci skip] f2c12c3 Add haddock markup 49e334c Allow Windows to set blank environment variables c6d4219 Clarify comment about data family arities 2535a67 Refactoring around FunRhs 4636886 Improve the desugaring of -XStrict 3ab342e Do a bit more CSE af89d68 Reject top-level banged bindings 7f2dee8 Remove redundant goop 4fdc523 Use field names for all uses of datacon Match 2ef973e A bunch of typofixes 7a74f50 Typofixes [ci skip] 5a7af95 KnownUniques: Handle DataCon wrapper names 29f07b1 Allow bundling pattern synonyms with exported data families 74c7016 rts: Fix "variable set but not used" warning b311096 Simplify OccurAnal.tagRecBinders c13720c Drop GHC 7.10 compatibility 36fe21a Enable building Cabal with parsec 9df71bf Bump unix submodule 8ef8520 Add .gitmodules entries for text, parsec, mtl submodules d74983e Get the roles right for newtype instances f68a00c Remove unneeded uses of ImplicitParams 884bd21 Add the bootstrapping/ dir to .gitignore 394c391 Add MonadIO Q - by requiring MonadIO => Quasi a81b5b0 Remove the deprecated Typeable{1..7} type synonyms a267580 Don't warn when empty casing on Type 6ea13e9 Add forgotten > in Control.Applicative e8fe12f Fix string escaping in JSON 2f29f19 Convert examples to doctests, and add a handful of new ones 14457cf Fix EmptyCase documentation a4f347c Split out inferConstraintsDataConArgs from inferConstraints 3f05e5f Don't suppress unimplemented type family warnings with DeriveAnyClass 7d69978 Use NonEmpty lists to represent lists of duplicate elements 4f1f986 Change isClosedAlgType to be TYPE-aware, and rename it to pmIsClosedType 0bb1e84 Expand type synonyms during role inference c6462ab Add test for #14101 7c37ffe Point to FunDeps documentation on Haskell wiki ad7b945 Fix #14060 by more conservatively annotating TH-reified types 0a891c8 Properly handle dlerror() message on FreeBSD when linking linker scripts ddb870b Don't drop GHCi-defined functions with -fobject-code enabled ed7a830 Use a ReaderT in TcDeriv to avoid some tedious plumbing 21bd9b2 Recognize FreeBSD compiler as Clang. a520adc Bump mtl, parsec, text submodules 441c52d Add Semigroup/Monoid instances to ST monad b0285d1 Bump nofib submodule e054c5f Bump mtl, parsec, text submodules 6e9c8eb Bump mtl, parsec, text submodules (again) a8da0de Speed up compilation of profiling stubs b0ed07f Allow TcDerivInfer to compile with GHC 8.0.1 38260a9 Fix #13972 by producing tidier errors 039fa1b Suggest how to fix illegally nested foralls in GADT constructor type signatures c948b78 Fix #11785 by making reifyKind = reifyType af9f3fa Remove extra ` from "kind-indexed GADTs" doc 03327bf Handle ListPat in isStrictPattern 36d1b08 Doctest for Void.absurd 49ddea9 Sections with undefined operators have non-standard behavior 43b0c2c Insert missing blank line to fix Applicative doc 63397cb Add some Monoid doctests f762181 Mention the category laws explicitly a30187d Convert documentation examples to doctests for ReadP module bfa9048 Loads of doc(test)s 2c0ab47 Add missing initial version for extension doc. 0e1b6f8 Fix index entries in "separate compilation" section 3385669 user-guide: fix examples of ghci commands 69a0f01 rts: Enable USDT probes object on Linux 82ee71f user-guide: add `:type +d` and `:type +v` in release highlight dc42c0d Fix #13399 by documenting higher-rank kinds. 0385347 Remove unneeded reqlibs for mtl and parsec in the GHC testsuite c5605ae Make function intToSBigNat# preserve sign (fixes #14085) 0286214 testsuite: Add test for #13916 fee253f CSE.cseOneExpr: Set InScopeSet correctly 6257fb5 Comments about GlobalRdrEnv shadowing 118efb0 Restrict Lint's complaints about recursive INLINEs somewhat 698adb5 Tracing in OccAnal (commented out) 4c6fcd7 Comments only 61c4246 Test Trac #14110 f50e30e Doctests for Data.Tuple 6267d8c Enable -Wcpp-undef for GHC and runtime system cf8ab1c users_guide: Convert mkUserGuidePart generation to a Sphinx extension 8e5b6ec Add strict variant of iterate ee2e9ec Correct incorrect free in PE linker 1cdceb9 Revert "Add strict variant of iterate" 34bd43d Fix loading of dlls on 32bit windows 6982ee9 Fix #14125 by normalizing data family instances more aggressively a89bb80 Fix #14114 by checking for duplicate vars on pattern synonym RHSes 79b259a Fix #13885 by freshening reified GADT constructors' universal tyvars 8476097 Revise function arity mismatch errors involving TypeApplications 8fd9599 Make the Read instance for Proxy (and friends) ignore precedence afc2f79 Move validate cleaning from distclean to clean 4717ce8 Fix incorrect retypecheck loop in -j (#14075) 9afaebe StgLint: Allow join point bindings of unlifted type cd5a970 Make law for Foldable.length explicit 20c7053 Bump haddock submodule 090d896 fix typo (expreesions -> expressions) 028645c Fixed a typo in template-haskell documentation dbaa9a2 DynFlags: Add inverse of -dno-debug-output 3625728 Add support for producing position-independent executables 7463a95 users-guide: Better error messages on incomplete ghc-flag directives 74af2e7 Typo fixed 11657c4 Better pretty-printing for CHoleCan a211dca Fix defer-out-of-scope-variables aeb4bd9 Remove typeKind from Type.hs-boot 5f3d2d3 CNF: Implement compaction for small pointer arrays a0b7b10 Restrict exprOkForSpeculation/case to unlifted types 407c11b Bottoming expressions should not be expandable 33452df Refactor the Mighty Simplifier 8649535 Don't do the RhsCtxt thing for join points dd89a13 Comments, plus adjust debug print of TcTyThing(ATyVar) a67b66e Add strict variant of iterate f135fb2 rts: Fix warnings on aarch64 and clean up style 80ccea8 rts: Fix references to Note [BFD import library] 76e59a2 rts: Fix ASSERTs with space before opening paren 8f19c65 Rip out mkUserGuidePart 83484a6 Fix two typos in the ImpredicativeTypes user guide a055f24 Adjust test suite stats 682e8e6 Actually bump T12150 29da01e Make parsed AST dump output lazily 6e0e0b0 Comments only 8834d48 Better debug-printing for Outputable TyConBinder 547e4c0 A bit more -ddump-tc tracing 6f050d9 Add TcRnMonad.unlessXOptM 0257dac Refactor bindHsQTyVars and friends 86e6a5f Small refactoring of meta-tyvar cloning 4455c86 Use a well-kinded substitution to instantiate 8eead4d Improve kind-application-error message a6c448b Small refactor of getRuntimeRep aed7d43 Add HasDebugStack for typeKind 248ad30 testsuite: Add test for #14128 db3a8e1 desugar: Ensure that a module's dep_orphs doesn't contain itself 5266ab9 Remove dll-split. 895a765 Refactor type family instance abstract syntax declarations 3c6b2fc Fix decomposition error on Windows 5f6a820 Add gen-dll as replacement for dll-split f86de44 ghc-pkg: Try opening lockfiles in read-write mode first a27bb1b base: Add support for file unlocking 779b9e6 PackageDb: Explicitly unlock package database before closing 9d57d8c nativeGen: Don't index into linked lists 651b4dc StgLint: Show type of out-of-scope binders a36b34c StgLint: Enforce MultiValAlt liveness invariant only after unariser f17f106 StgLint: Give up on trying to compare types 1561525 HsExpr: Fix typo 6f1ccaa Add a Note describing #14128 567dca6 Add some traceRn and (Outputable StmtTree) 628b666 Add comments to RnTypes fca1962 Define and use HsArg 805b29b Add debugPprType 3790ea9 Small changes to ddump-tc tracing 2c133b6 Really fix Trac #14158 c0feee9 Add missing Semigroup instances to compiler b2c2e3e Add missing Semigroup instances in utils/{hpc,runghc} dd643bc Improve stm haddocks 1f052c5 Fix order of PrelRule 8a1de42 Add testcase for #14178 f089c32 Remove broken citeseer citation links 590e737 Update transformers submodule 6330b0b Document the intricacies of ForallC variable quantification better 5dd6b13 Disallow bang/lazy patterns in the RHSes of implicitly bidirectional patsyns 8e4229a Fix #14167 by using isGadtSyntaxTyCon in more places 0ec4376 Document the Generic(1) laws cb3363e Move NonEmpty definition into GHC.Base 31281a4 testsuite: Fix validation of ways b996e12 testsuite: Add test for #14129 7e5d4a0 Remember the AvailInfo for each IE b9ac9e0 Fix egregious duplication of vars in RnTypes 1300afa get-win32-tarballs: Use bash, not sh a4c2ac2 get-win32-tarballs: Use correct `find` 542f89f Replace hashing function for string keys implementation with xxhash cd857dd SetLevels: Substitute in ticks in lvlMFE 6458b8d base: Update acosh to handle -1::Complex c2881a2 StgLint: Show constructor arity in mismatch message 822abbb eventlog: Clean up profiling heap breakdown type 24e50f9 rts: Add heap breakdown type for -hT 0829821 Implicitly bind kind variables in type family instance RHSes when it's sensible 0cd467b rts: Fix use of #if 2273353 Clean up opt and llc c6726d6 Cleanups, remove commented-out code a04cfcf Update xhtml submodule fee403f Handle W80 in floatFormat d97a6fe Fix typos in diagnostics, testsuite and comments 055d73c Travis: Boot with ghc-8.2.1, and disable test suite 8ae263c Make Semigroup a superclass of Monoid (re #14191) be514a6 includes/rts: Drop trailing comma cb4878f Drop special handling of iOS and Android 011e15a Deal with unbreakable blocks in Applicative Do 22f11f1 Bump T783 expected allocations cf6b4d1 Remove now redundant CPP 122f183 Remove now redundant cabal conditionals in {ghc,template-haskell}.cabal 400ead8 Remove makefile logic for legacy -this-package-key dab0e51 Canonicalise Monoid instances in GHC 346e562 Canonicalise MonoidFail instances in GHC 838a10f Retire cabal_macros_boot.h hack fe35b85 Add testcase for #14186 fe04f37 Allow CSE'ing of work-wrapped bindings (#14186) 0ebc8dc Add a test for #14140 9ff9c35 Check if -XStaticPointers is enabled when renaming static expressions dafa012 Add regression test for #14209 b890e88 rts: Print message before SIGUSR2 backtrace d645e44 DriverMkDepend: Kill redundant import f8e383f Clarify Data.Data documentation 91262e7 Use ar for -staticlib e62391a [RTS] Harden against buffer overflow cbd4911 Make IntPtr and WordPtr as instance of Data.Data typeclass, fix #13115 8ff11c4 Fix @since annotations in GHC.Stats 6139f7f Add non-ASCII isLetter True example 2fe6f6b Option "-ddump-rn-ast" dumps imports and exports too f9bf621 Better document TypeRep patterns 4be195e Simplify Data.Type.Equality.== 4e22220 Clarify seq documentation 4cead3c rts: Add regsterCc(s)List to RTS symbols list 10a1a47 Model divergence of retry# as ThrowsExn, not Diverges 959a623 No need to check ambiguity for visible type args ab2d3d5 More refinements to debugPprType 3a27e34 Fix subtle bug in TcTyClsDecls.mkGADTVars 8bf865d Tidying could cause ill-kinded types 0390e4a Refactor to eliminate FamTyConShape a38acda Refactor tcInferApps 9218ea6 Interim fix for a nasty type-matching bug 9e46167 Remove unused variable binding b6b56dd [RTS] Make -po work 93da9f9 Add test for Trac #14232 3b68687 Test #14038 in dependent/should_compile/T14038 c813d8c Regression test for #12742 b977630 Test #12938 in indexed-types/should_compile/T12938 04bb873 Fix #13407 by suppressing invisibles better. ecb316c nativeGen: A few strictness fixes 58f1f73 Bump primitive submodule 3edbf5c testsuite: Fix dependence on grep behavior in T8129 89c8d4d Fix #13909 by tweaking an error message. e5beb6e Make rejigConRes do kind substitutions fa626f3 Fix #13929 by adding another levity polymorphism check 86e1db7 Test #13938, with expect_broken 8f99cd6 Fix #13963. 7b8827a Bump submodule nofib (Semigroup now required) f043cd5 Fix name of note 4340165 Ignore untracked in text, parsec and mtl submodules [skip ci] 9e227bb Fix missing fields warnings in empty record construction, fix #13870 f4d50a0 Fix #14228 by marking SumPats as non-irrefutable 2bfba9e base: Fix mixed tabs/spaces indentation in inputReady.c 9498c50 Renamer now preserves location for IEThingWith list items 47a9ec7 Remove dead function TcUnify.wrapFunResCoercion b099171 base: Enable TypeInType in Data.Type.Equality 4ec4ca9 base: Add missing MonadFail instance for strict ST 60a3f11 Fix pointer tagging mistake a83f17e base: Fix missing import of Control.Monad.Fail 2258a29 testsuite: Fix MonadFail test output for new ST instance cdaf5f2 [RTS] Add getObjectLoadStatus 120c568 Allow opt+llc from LLVM5 10ca801 Generalise constraint on `instance Monoid (Maybe a)` to Semigroup a2f004b Remove redundant/obsolete CPP usage 1db0f4a Fix unused-given-constraint bug 6252292 rts/RetainerProfile: Adding missing closure types to isRetainer 8b007ab nativeGen: Consistently use blockLbl to generate CLabels from BlockIds 12a92fe OccurAnal: Ensure SourceNotes don't interfere with join-point analysis f63bc73 compiler: introduce custom "GhcPrelude" Prelude 7c7914d Fix Windows build regression due to GhcPrelude change 28a115e base: fdReady(): Improve accuracy and simplify code. c2a1fa7 base: Fix fdReady() potentially running forever on Windows. 826c3b1 base: Fix fdReady() potentially running forever for Windows Char devices. 66240c9 base: Fix fdReady() returning immediately for pipes on Windows. 11c478b rts: Update comment about FreeBSD's unsigned FD_SETSIZE b7f2d12 rts: Fix typo in comment ba4dcc7 base: Make it less likely for fdReady() to fail on Windows sockets. 022455f base: Add more detail to FD_SETSIZE related error message bbb8cb9 users-guide: Mention changes necessary due to #13391 3198956 Factor mkCoreApp and mkCoreApps 7920a7d cmm/CBE: Collapse blocks equivalent up to alpha renaming of local registers 0aba999 Restore function powModSecInteger 11d9615 Make zipWith and zipWith3 inlinable. 02ff705 Add 'stm' package to the global package database d7705f2 aclocal.m4: call cygpath on mingw32 only ced2cb5 Typofixes (visiblity -> visibility) 283eb1a Initial CircleCI support. cc6be3a Typeable: Allow App to match arrow types 9e46d88 Typeable: Generalize kind of represented type 72b00c3 Identify fields by selector when type-checking (fixes #13644) acd346e testsuite: Add testcase for #14253 d86b237 testsuite: Add unboxed sum to T13929 58a7062 base: Add changelog entry for withTypeable generalization 063e0b4 Bump base to 4.11.0.0 1c92083 Also show types that subsume a hole as valid substitutions for that hole. ddb38b5 testsuite: Bump allocations of T12150 9aa7389 cmm/CBE: Use foldLocalRegsDefd feac0a3 Reexport Semigroup's <> operator from Prelude (#14191) 760b9a3 rts: Set unwind information for remaining stack frames a9d417d rts: Set unwind information for catch_frame 1755869 Implement TH addCorePlugin. d7b8da1 Fix broken LLVM code gen 5a8b843 Remove 'stm' from EXTRA_PACKAGES set 2f10438 Fix build with GhcWithInterpreter=NO 65943a3 Bump haskeline submodule c2373b7 Additional LLVM_TARGET logic. d559612 Fix AsmTempLabel d7b260f [Semigroup] fix genapply 9c7d065 Revert "Typeable: Allow App to match arrow types" b3ae47c don't allow AsmTempLabel in UNREG mode (Trac #14264) 3c74a51 Deal with large extra-contraints wildcards 7721e8e Make pprQuotedList use fsep not hsep 3b4833a Comments only 1b476ab Improve type-error reporting abed9bf Fix solving of implicit parameter constraints 0e60cc1 Document how GHC disambiguates between multiple COMPLETE sets 3804a7e Bump template-haskell to 2.13.0.0 2b2595e Ensure text mode when calling debug functions c839c57 Fix the searching of target AR tool abca29f Adds mingw64 to the valid GHC OSs. 6de1a5a Document Typeable's treatment of kind polymorphic tycons d07b8c7 Include original process name in worker thread name (#14153) 9acbeb5 integer-gmp: Fix style d11611f Add NOINLINE pragma to builtinRules 9738e8b Use SIGQUIT for DWARF backtraces instead of SIGUSR2 49c1a20 configure: Catch case where LLVM tools can't be found 65f7d87 configure: Don't hard-code strip tool 2f8e6e7 testsuite: Expect T13168 to be broken on Windows 7446c7f A bunch of typofixes c41ccbf Omit Typeable from the "naturally coherent" list 6e7c09d StgCmmMonad: Remove unnecessary use of unboxed tuples 6246407 primops: Add some notes regarding the meaning of the "type" field 1d1b991 rts: Inform kernel that we won't need reserved address space 57372a7 PrelRules: Handle Int left shifts of more than word-size bits 0ffa396 testsuite: Add test for #14272 f9f1e38 TcInteract: Remove redundant import of Typeable 3ec579d Release console for ghci wrapper 8c23b54 Rules: Show the binder type in the unbound template binder error 7fb89e8 rts: Silence missing __noreturn__ warning 1825cbd Switch VEH to VCH and allow disabling of SEH completely. 8f468fe base: fdReady(): Add note about O_NONBLOCK requirement 018c40f desugar: Catch levity polymorphism in unboxed sum expressions 30a1eee rts: Throw proper HeapOverflow exception on allocating large array 47888fd Revert "Switch VEH to VCH and allow disabling of SEH completely." 1421d87 Switch VEH to VCH and allow disabling of SEH completely. 07ddeaf GHC_LLVM_TARGET: Keep android OS 60b0645 llvm-targets: drop soft-float 4364f1e Typofixes 1e9f90a Move check-ppr and check-api-annotations to testsuite/utils 9bf6310 Add TODO about getMonotonicNSec() wrapping that can no longer happen. dddef31 fdReady(): Fix some C -Wconversion warnings. 03009aa base: fdReady(): Ensure and doc that return values are always -1/0/1 a10729f configure: Make sure we try all possible linkers 5935acd mkDataConRep: fix bug in strictness signature (#14290) 7aa000b Fix #13391 by checking for kind-GADTs 464396d Fix Raspberry Pi target name 9c05fc4 user-guide: Document -Weverything 626f045 Document a law for TH's Lift class effcd56 Don't use "character" in haddocks of Char c15c427 iserv: Don't build vanilla iserv unless vanilla libraries are built e515c7f Allow libffi snapshots e299121 Bump submodule nofib again (Semigroup now required) 00ff023 Travis: Install texinfo 11a59de CircleCI: Install texinfo 0e96812 Pretty-printer missing parens for infix class declaration c0e6c73 Rewrite boot in Python e30d9ca rel-notes: Mention libffi packaging change e462b65 Bump libffi-tarballs submodule d5e60de user-guide: Fix :since: annotation of -pie and add documentation for -fPIE d0c5d8d No libffi docs a4ee289 Adds x86 NONE relocation type a1fc7ce Comments only a8fde18 Fix bug in the short-cut solver b1e0c65 Make GHC.IO.Buffer.summaryBuffer strict dbbee1b Fix nasty bug in w/w for absence analysis cb76754 Suppress error cascade in record fields a02039c Add regression test for #9725 a36eea1 Revert installing texinfo in CI systems 55001c0 Sync base/changelog.md ec9ac20 Add ability to produce crash dumps on Windows 8d64745 Optimize linker by minimizing calls to tryGCC to avoid fork/exec overhead. ef26182 Track the order of user-written tyvars in DataCon fa8035e Implement Div, Mod, and Log for type-level nats. 377d5a2 base: Add missing @since annotations in GHC.TypeNats de1b802 genapply: Explicitly specify arguments f3f624a Include libraries which fill holes as deps when linking. 4899a86 Don't pass HscEnv to functions in the Hsc monad 361af62 base: Remove deprecated Chan combinators 3201d85 user-guide: Mention COMPLETE pragma in release notes 3030eee rts: Print newline after "Stack trace:" on barf 7109fa8 configure: Accept *-msys as a Windows OS in a triple d8d87fa Remove m_type from Match (#14313) 429fafb Add regression test for #14326 f6bca0c Testsuite update following d8d87fa 341d3a7 Incorporate changes from #11721 into Template Haskell f1d2db6 Fix #14320 by looking through HsParTy in more places f337a20 Simply Data instance context for AmbiguousFieldOcc e51e565 Split SysTools up some 7720c29 Tidy up some convoluted "child/parent" code ab1a7583 Typos in comments only 461c831 Minor refactoring c81f66c Fix over-eager error suppression in TcErrors 79ae03a Change "cobox" to "co" in debug output 3e44562 Delete two unused functions f20cf98 Remove wc_insol from WantedConstraints 9c3f731 Fix #10816 by renaming FixitySigs more consistently 6869864 Pretty-printing of derived multi-parameter classes omits parentheses 4bb54a4 Avoid creating dependent types in FloatOut 13fdca3 Add a missing zonk in TcDerivInfer.simplifyDeriv 82b77ec Do not quantify over deriving clauses 15aefb4 Add missing T14325.stderr fb050a3 Do not bind coercion variables in SpecConstr rules 3de788c Re-apply "Typeable: Allow App to match arrow types" 2be55b8 Delete obsolete docs on GADT interacton with TypeApplications 4a677f7 Remove section about ApplicativeDo & existentials (#13875) 8adb84f Fix calculation in threadStackOverflow afac6b1 Fix typo 6aa6a86 Fix typo add85cc Fix panic for `ByteArray#` arguments in CApiFFI foreign imports e3ba26f Implement new `compareByteArrays#` primop 5984a69 Override default `clearBit` method impl for `Natural` 843772b Enable testing 'Natural' type in TEST=arith011 6cc232a Implement {set,clear,complement}BitBigNat primitives 71a4235 configure: Fix CC version check on Apple compilers fd8b044 Levity polymorphic Backpack. 5dab544 FreeBSD dtrace probe support 7e790b3 rts: Label all threads created by the RTS 8536b7f users-guide: Rework and finish debug flag documentation d7f4f41 users guide: Eliminate redundant :category: tags in debugging.rst c5da84d users-guide: Fix various warnings a69fa54 rts/posix: Ensure that memory commit succeeds d6c33da RtClosureInspect: Fix inspecting Char# on 64-bit big-endian 366182a ghci: Include "Rts.h" before using TABLES_NEXT_TO_CODE 9e3add9 Flags.hsc: Peek a CBool (Word8), not a Bool (Int32) aa98268 updateThunk: indirectee can be tagged 21b7057 users-guide: Clarify -ddump-asm-regalloc-stages documentation 6cb4642 Bump ghc-prim to 0.5.2.0 and update changelog ed48d13 Simplify, no functionality change 2f43615 Fix grammaros in comments 317aa96 Improve user’s guide around deriving 74cd1be Don't deeply expand insolubles 5a66d57 Better solving for representational equalities aba7786 Typofix in comment 870020e whitespace only 20ae22b Accept test output for #14350 e023e78 Disable -XRebindableSyntax when running internal GHCi expressions 101a8c7 Error when deriving instances in hs-boot files 8846a7f Fix #14369 by making injectivity warnings finer-grained de8752e Export injectiveVarsOf{Binder,Type} from TyCoRep 7ac22b7 User's guide: Fix the category of some flags 3befc1a Bump arcanist-external-json-linter submodule 1ba2851 Expose monotonic time from GHC.Event.Clock 13758c6 Added a test for 'timeout' to be accurate. 098dc97 Give a reference to Foreign.Concurrent. b6204f7 Untag the potential AP_STACK in stg_getApStackValzh 2ca8cf6 Add Functor Bag instance afc04b2 Outputable: Add pprTraceException c1efc6e Comments and white space 3acd616 Improve kick-out in the constraint solver e375bd3 Update record-wildcard docs 99c61e2 Add stack traces on crashes on Windows bb537b2 nofib submodule: Fix a problem with fasta-c.c 1e24a24 submodule nofib: Add digits-of-e1.faststdout 052ec24 submodule nofib: Add digits-of-e2.faststdout b10a768 Comments only d1eaead Temporary fix to Trac #14380 671b1ed User’s guide: Properly link to RTS flag -V 8843a39 Include usg_file_hash in ghc --show-iface output 3825b7e Remove the 'legroom' part of the timeout-accurate-pure test. b62097d Windows: Bump to GCC 7.2 for GHC 8.4 e888a1f Revert "Windows: Bump to GCC 7.2 for GHC 8.4" 561bdca Update Win32 version for GHC 8.4. f744261 ghc-cabal: Inline removed function from Cabal. 2e16a57 Revert "ghc-cabal: Inline removed function ..." b1ad0bb Revert "Update Win32 version for GHC 8.4." 61f1b46 Make language extensions their own category in the documentation bf83435 typecheck: Clarify errors mentioned in #14385 bd53b48 Add info about Github pull requests. 2a4c24e Make layLeft and reduceDoc stricter (#7258) 980e127 Windows: Update the mirror script to generate hashes and use mirror fallback 1c15d8e Fix space leak in BinIface.getSymbolTable df63668 Performance improvements linear regAlloc (#7258) f7f270e Implement `-Wpartial-fields` warning (#7169) 821adee Fix a bug in 'alexInputPrevChar' 2c23fff user-guide: Clarify default optimization flags 4c06ccb base: Enable listToMaybe to fuse via foldr/build dbd81f7 Factor out readField (#14364) d91a6b6 Declare upstram repo location for hsc2hs 160a491 users-guide: Disable index node generation 9ae24bb configure: Add Alpine Linux to checkVendor a10c2e6 Don't use $SHELL in wrapper scripts 355318c Add more pprTrace to SpecConstr (debug only) 7d7d94f Fix an exponential-blowup case in SpecConstr 41f9055 ApplicativeDo: handle BodyStmt (#12143) acd355a relnotes: Fix a few minor formatting issues faf60e8 Make tagForCon non-linear 922db3d Manual: The -ddump-cmm-* flags had a wrong spelling in the manual 97ca0d2 simplNonRecJoinPoint: Handle Shadowing correctly 0e953da Implement a dedicated exitfication pass #14152 3b784d4 base: Implement file locking in terms of POSIX locks cecd2f2 Add -falignment-sanitization flag 7673561 Turn `compareByteArrays#` out-of-line primop into inline primop 85aa1f4 Fix #14390 by making toIfaceTyCon aware of equality cca2d6b Allow packing constructor fields 82bad1a A bit more tc-tracing 1b115b1 Fix typo in accessor name ec356e8 Typofix in panic 1569668 Typofixes in comments 53700a9 minor wordsmithing 201b5aa Catch a few more typos in comments 609f284 Add Note [Setting the right in-scope set] af0aea9 core-spec: Add join points to formalism 29ae833 Tidy up IfaceEqualityTyCon 1317ba6 Implement the EmptyDataDeriving proposal 1130c67 PPC NCG: Impl branch prediction, atomic ops. b0b80e9 Implement the basics of hex floating point literals e0df569 Use proper Unique for Name b938576 Add custom exception for fixIO 36f0cb7 TcRnDriver: Bracket family instance consistency output in -ddump-rn-trace cbd6a4d Introduce -dsuppress-stg-free-vars flag bd765f4 Fix atomicread/write operations d9b6015 Revert "Move check-ppr and check-api-annotations to testsuite/utils" 51321cf rts/PrimOps.cmm: add declaration for heapOverflow closure 4353756 CmmSink: Use a IntSet instead of a list 15f788f llvmGen: Pass vector arguments in vector registers by default eb37132 Bump haddock submodule 3c8e55c Name TypeRep constructor fields 19ca2ca Deserialize all function TypeReps 5d48f7c Fix documentation and comment issues df479f7 change example from msum to mfilter 436b3ef Clean up comments about match algorithm a bit. f6521e6 testsuite: Bump metrics of haddock.Cabal 4dfb790 rts/win32: Emit exception handler output to stderr 6f990c5 cmm/CBE: Fix comparison between blocks of different lengths a27056f cmm/CBE: Fix a few more zip uses 2ded536 Typo in glasgow_exts.rst 35642f4 Update ErrorCall documentation for the location argument 8613e61 DynFlags: Introduce -show-mods-loaded flag 59de290 Update autoconf test for gcc to require 4.7 and up 66b5b3e Specialise lcm :: Word -> Word -> Word (trac#14424) 275ac8e base: Add examples to Bifunctor documentation 7b0b9f6 Squashed 'hadrian/' content from commit 438dc57 5cee480 Merge commit '7b0b9f603bb1215e2b7af23c2404d637b95a4988' as 'hadrian' 0ff152c WIP on combining Step 1 and 3 of Trees That Grow 7d6fa32 Set up Linux, OSX and FreeBSD on CircleCI. b0cabc9 Set up AppVeyor, Windows CI. 6f665cc Sdist -> bindist -> tests 07e0d0d Revert "Sdist -> bindist -> tests" ed18f47 Factor out builds into steps. Address ghc/ghc#83 comments. ae7c33f testsuite: Bump haddock.compiler allocations 7d34f69 relnotes: Clarify a few things c1bc923 relnotes: Note enabling of -fllvm-pass-vectorse-in-regs 93b4820 Revert "WIP on combining Step 1 and 3 of Trees That Grow" 9f8dde0 Update link to Haskeline user preferences bf9ba7b base: Escape \ in CallStack example 14d885e Merge remote-tracking branch 'github/pr/83' 21970de Imrpove comments about equality types 30058b0 Fix another dark corner in the shortcut solver 2c2f3ce Minimise provided dictionaries in pattern synonyms fe6848f Fix in-scope set in simplifier 438dd1c WIP on Doing a combined Step 1 and 3 for Trees That Grow 803ed03 Invoke lintUnfolding only on top-level unfoldings (#14430) 6bd352a Remove left-overs from compareByteArray# inline conversion 10ff3e3 testsuite: Fix output of T14394 bdd2d28 Update Win32 version for GHC 8.4. 9773053 Merge initial Hadrian snapshot ce9a677 base: Add test for #14425 c59d6da base: Normalize style of approxRational 5834da4 base: Fix #14425 0656cb4 Update comment in GHC.Real (trac#14432) 6b52b4c Remove unreliable Core Lint empty case checks e6b13c9 testsuite: Add test for #5889 75291ab Change `OPTIONS_GHC -O` to `OPTIONS_GHC -O2` f8e7fec Fix PPC NCG after blockID patch 5229c43 Squashed 'hadrian/' changes from 438dc576e7..5ebb69ae1e 506ba62 Merge commit '5229c43ccf77bcbffeced01dccb27398d017fa34' f11f252 Windows: Bump to GCC 7.2 for GHC 8.4 ba2ae2c Adds cmm-sources to base 426af53 Use LICENSE instead of ../LICENSE in the compiler.cabal file 5f158bc circleci: Bump down thread count 86c50a1 Declare proper spec version in `base.cabal` e3ec2e7 WIP on combined Step 1 and 3 for Trees That Grow, HsExpr 0a85190 Fix a TyVar bug in the flattener f570000 A bit more tc-tracing 47ad657 TTG3 Combined Step 1 and 3 for Trees That Grow f5dc8cc Add new mbmi and mbmi2 compiler flags 6dfe982 StaticPointers: Clarify documentation 5dea62f Adds rts/rts.cabal.in file 8b1020e RTS: Disable warnings in ffi.h ea26162 CLabel: Clean up unused label types 1aba27a CLabels: Remove CaseLabel 383016b Add dump flag for timing output d9f0c24 rts: Fix gc timing d0a641a Allow the rts lib to be called rts-1.0 3bed4aa Cabalify all the things e14945c Adjust AltCon Ord instance to match Core linter requirements. ec080ea users_guide: Fix "CancelSynchronousIo" casing c1fcd9b Squashed 'hadrian/' changes from 5ebb69a..fa3771f 07ac921 Pull recent Hadrian changes from upstream 2f46387 Detect overly long GC sync 2da7813 Document -ddump-timings c729734 configure: Fix incorrect quoting 12a7444 Adds -ghc-version flag to ghc. 835d8dd GHC.Prim use virtual-modules bb11a2d Relocatable GHC 74070bb Fix rts.cabal.in 912a72d Fix T4437 b8e324a base: Make documentation of atomically more accurate 7d16d8a Fix #elfi -> #elif; unbreak -Werror. ca3700a Rename ghc-version -> ghcversion-file 606bbc3 Stop generating make files when using hadrian. e66913d Bump hsc2hs submodule 25f36bd Bump haddock submodule ddded7e ghc-pkg: Add missing newlines to usage message 1b1ba9d rel-notes: Fix up formatting in release notes d213ee8 CircleCI: Disable artifact collection on OS X 66d1799 configure: Fix ar probed flags 0b20d9c base: Document GHC.Stack.CCS internals 314bc31 Revert "trees that grow" work 90a819b CircleCI: Add webhook for Harbormaster builds 2ca2259 Update ANNOUNCE 763ecac rts: Move libdwPrintBacktrace to public interface f376eba rts: Fix inconsistencies in how retainer and heap censuses are timed. 63e4ac3 Add warn-missing-export-lists 8a8a79a Update leftover reference to refer to [FunBind vs PatBind] dad9864 Remove hadrian sub-dir from .gitignore 0db4627 Test Trac #14488 bb2a08e testsuite: Add test for #14257 23116df cmm: Optimise remainders by powers of two eb5a40c base: Remove redundant subtraction in (^) and stimes 7a73a1c Bump stm submodule 2d1c671 ErrUtils: Refactor dump file logic c11f145 ErrUtils: Ensure timing dumps are always output on one line 360d740 Squashed 'hadrian/' changes from fa3771fe6b..4499b294e4 abdb555 Update Hadrian 341013e Revert "Add new mbmi and mbmi2 compiler flags" 5fdb858 Fix README 33cbc9f CircleCI: Perform nightly validation of unregisterised build 866f669 CircleCI: Try validating LLVM as well e2cc106 circleci: Build with Hadrian ad57e28 CircleCI: Install lbzip2 and patch 5e35627 rts/Printer: add closure name entries for small arrays (Fixes #14513) 30aa643 SysTools: Expand occurrences of $topdir anywhere in a Settings path 69cd1e9 SysTools: Split up TopDir logic into new module 599243e DynFlags: Expand $topdir in --info output 99089fc users-guide: Fix :default: placement f209e66 base: fdReady(): Fix timeouts > ~49 days overflowing. Fixes #14262. a1950e6 CircleCI: Reenable artifact collection on Darwin 471d677 Don't complain about UNPACK in -fno-code. 6282366 Follow symlinks in the Win32 code for System.Environment.getExecutablePath b241d6d Add obvious Outputable Integer instance. f713be7 RtsFlags: allow +RTS -K0 00b96b2 boot: Eliminate superfluous output 4efe5fe Check quantification for partial type signatues df1a0c0 typecheck: Consistently use pretty quotes in error messages eb86e86 Don't call alex for Cabal lib during GHC build e4dc2cd relnotes: Rework treatment of included package list 54fda25 base: Rip out old RTS statistics interface 17e71c1 CLabel.labelType: Make catch-all case explicit 048a913 cmm: Use LocalBlockLabel instead of AsmTempLabel to represent blocks 16dd532 CLabel: Refactor pprDynamicLinkerAsmLabel 55e621c nativeGen: Use plusUFMList instead of foldr 7dc82d6 nativeGen: Use foldl' instead of foldl 66c1c8e CLabel: More specific debug output from CLabel d3b80c7 Cmm: Add missing cases for BlockInfoTable 030d9d4 CLabel: A bit of documentation 4c65867 CircleCI: Disallow hscolour 1.24.3 3c0ffd1 CircleCI: Freeze all packages at fixed index state 5b3f33b Minor tweaks to codegens.rst b6428af Comments only: Trac #14511 b6a2691 Bump unix submodule f246d35 Darwin: Set deployment target d672b7f Darwin: Use gmp from homebrew 6998772 Make use of boot TyThings during typechecking. e1fb283 Handle CPP properly in Backpack 12efb23 Add trace injection bc761ad Cache TypeRep kinds aggressively 1acb922 Make the Con and Con' patterns produce evidence cfea745 template-haskell: Rip out FamFlavour 595f60f Fix ghc_packages d6fccfb Bump version to 8.5 30d6373 rts: fix filename case for mingw32 target 1ecbe9c utils/hsc2hs: update submodule 5f332e1 Forward-port changes from GHC 8.2 branch fa29df0 Refactor ConDecl: Trac #14529 e4a1f03 Revert accidental hsc2hs submodule downgrade de20440 Refactor kcHsTyVarBndrs 800009d Improve LiberateCase 5695f46 Occurrrence analysis improvements for NOINLINE functions 7733e44 Rip out hadrian subtree 4335c07 Add hadrian as a submodule 716acbb Improved panic message for zonkTcTyVarToTyVar 8b36ed1 Build only well-kinded types in type checker 8361b2c Fix SigTvs at the kind level abd5db6 Only look for locales of the form LL.VV 21be5bd Fixed misprint 'aqcuired' 6847c6b Improve Control.Monad.guard and Control.Monad.MonadPlus docs 00d7132 Add information about irrefutable pattern Syntax to XStrict. 21cdfe5 Add NOINLINE pragma to hPutStr' 4bfff7a rts: Don't default to single capability when profiled cafe983 Always use the safe open() call 708ed9c Allow users to ignore optimization changes 430d1f6 fdReady: Use C99 bools / CBool in signature 9d29925 base: fdReady(): Return only after sycall returns after `msecs` have passed be1ca0e Add regression test for #14040 a106a20 Minor refactor of TcExpr.tcApp e40db7b Detect levity-polymorphic uses of unsafeCoerce# 321b420 Tidy up of wired-in names aef4dee Add missing stderr for Trac #14561 63e968a Re-centre perf for T5321Fun 0a12d92 Further improvements to well-kinded types 6eb3257 Typofix in comment 6f6d105 Add test for Trac #14580 b1ea047 Fix an outright bug in the unflattener fa1afcd Better tc-trace messages eeb36eb typos in local var 16c7d9d Fix #14135 by validity checking matches d4c8d89 users-guide: Consistently document LLVM version requirement 4a331e6 users-guide: Fix various bits of markup 6814945 Fix tcDataKindSig 3910d3e Add some commentary re: fix to #11203 23b5b80 Add missing case to HsExpr.isMonadFailStmtContext 1e64fc8 Tiny refactor: use mkTyVarNamePairs f1fe5b4 Fix scoping of pattern-synonym existentials fb1f0a4 Blackholes can be large objects (#14497) 0302439 testsuite: Exit with non-zero exit code when tests fail 8c9906c testsuite: Semigroup/Monoid compat for T3001-2 244d144 Typos in comments a100763 Get rid of some stuttering in comments and docs 10ed319 Stop runRW# being magic ff1544d Rmove a call to mkStatePrimTy 71f96bb Sync up ghc-prim changelog from GHC 8.2 branch 1bd91a7 Fix #14578 by checking isCompoundHsType in more places 9caf40e Fix #14588 by checking for more bang patterns 9cb289a Remove hack put in place for #12512 b6304f8 Document ScopedTypeVariables' interaction with nested foralls 4d41e92 Improve treatment of sectioned holes 584cbd4 Simplify HsPatSynDetails 72938f5 Check for bogus quantified tyvars in partial type sigs a492af0 Refactor coercion holes f5cf9d1 Fix floating of equalities bcb519c Typos in comments 05551d0 Comments only [skip ci] fc257e4 Sync `ghc-prim` changelog from GHC 8.2 c88564d MkIface: Ensure syntactic compatibility with ghc 8.0.1 6549706 relnotes: Fix typo in pattern synonym example e237e1f Bump Cabal submodule d7d0aa3 Add GHC 8.6.1 release notes 02aaeab aclocal.m4: add minimal support for nios2 architecture e19b646 Compute InScopeSet in substInteractiveContext 722a658 Fix #14618 by applying a subst in deeplyInstantiate f2db228 Typos in comments [ci skip] 862c59e Rewrite Note [The polymorphism rule of join points] a2e9549 users-guide: Fix markup b31c721 Fix sign error in kelvinToC. 12f5c00 Prevent "C--" translating to "C–" in the User's Guide. 69f1e49 Reformat Control.Monad.mfilter docs a67c264 Add example to Control.Monad.join docs 4887c30 Improve Control.Monad docs 27b7b4d Windows: fix all failing tests. 46287af Make System.IO.openTempFile thread-safe on Windows ecff651 Fix #14608 by restoring an unboxed tuple check 3382ade Rename HEq_sc and Coercible_sc to heq_sel and coercible_sel 2c7b183 Comments only 83b96a4 More informative pretty-printing for phantom coercions f3a0fe2 Comments about join point types 1e12783 Tiny refactor around fillInferResult 3bf910d Small refactoring in Coercion 112266c White space only 9e5535c Fix OptCoercion bd438b2 Get evaluated-ness right in the back end 298ec78 No deferred type errors under a forall 7a25659 Typos in comments 649e777 Make typeToLHsType produce kind signatures for tycon applications 6c34824 Cache the number of data cons in DataTyCon and SumTyCon 954cbc7 Drop dead Given bindings in setImplicationStatus e2998d7 Stop double-stacktrace in ASSERT failures 86ea3b1 comments only 307d1df Fix deep, dark corner of pattern synonyms c732711 Improve pretty-printing for pattern synonyms 40cbab9 Fix another obscure pattern-synonym crash 303106d Make the Div and Mod type families `infixl 7` a1a689d Improve accuracy of get/setAllocationCounter fb78b0d Export typeNat{Div;Mod;Log}TyCon from TcTypeNats 30b1fe2 Remove a bogus warning 66ff794 Fix join-point decision 1c1e46c preInlineUnconditionally is ok for INLINEABLE 448685c Small local refactoring 1577908 Fix two more bugs in partial signatures dbdf77d Lift constructor tag allocation out of a loop f3f90a0 Fix previous patch 6c3eafb KQueue: Fix write notification requests being ignored... b2f10d8 Fix mistaken merge e20046a Support constructor Haddocks in more places a770226 Fix regression on i386 due to get/setAllocationCounter change d1ac1c3 Rename -frule-check to -drule-check and document 492e604 Kill off irrefutable pattern errors 3d17f1f Tweak link order slightly to prefer user shared libs before system ones. 87917a5 Support LIBRARY_PATH and LD_LIBRARY_PATH in rts 9f7edb9 Fix hashbang of gen-data-layout 78306b5 CoreLint: typo in a comment 2feed11 Fix hash in haddock of ghc-prim. 41afbb3 Add flag -fno-it f380115 Parenthesize forall-type args in cvtTypeKind 1bf70b2 Remove executable filename check on windows bc383f2 Simplify guard in createSwitchPlan. 8de8930 configure: Various cleanups cf2c029 Fix quadratic behavior of prepareAlts c65104e Typos in comments 6b1ff00 Fix references to cminusminus.org 1e14fd3 Inform hole substitutions of typeclass constraints (fixes #14273). 8bb150d Revert "Fix regression on i386 due to get/setAllocationCounter change" e1d4140 Revert "Improve accuracy of get/setAllocationCounter" 3335811 cmm: Include braces on default branch as required by the parser 2a78cf7 Remove unused extern cost centre collection 575c009 Fix #14681 and #14682 with precision-aimed parentheses 5e8ea6a testsuite: Add test for #14335 f855769 Add new mbmi and mbmi2 compiler flags 765ba65 testsuite: Add testcase for #14670 0074a08 Fix #14692 by correcting an off-by-one error in TcGenDeriv 5edb18a tentative improvement to callstack docs 180ca65 [rts] Adjust whitehole_spin 4a13c5b Implement underscores in numeric literals (NumericUnderscores extension) 8829743 Use IntSet in Dataflow 6c0db98 SysTools: Add detection support for LLD linker 2671ccc Update Cabal submodule 24e56eb Bump transformers submodule to 0.5.5.0 a3cde5f Improve comments about TcLevel invariants 452dee3 Pass -dsuppress-uniques when running T14507 f00ddea Allocate less in plus_mod_dep d36ae5d Comments about CoercionHoles 076bdb3 Remove dead code: mkNthCoRole 2a2e6a8 Comments only 0636689 Fix the lone-variable case in callSiteInline d6e0338 Bump terminfo submodule 40c753f testsuite: Bump haddock.Cabal allocations due to submodule bump 0e022e5 Turn EvTerm (almost) into CoreExpr (#14691) 983e491 testsuite: Add testcase for #12158 66961dc Haddock needs to pass visible modules for instance filtering 302aee5 base: Refactor Show ErrorCall instance into proper ShowS style 52dfb25 Handle the likely:True case in CmmContFlowOpt e7dcc70 Add ability to parse likely flags for ifs in Cmm. 31c260f Add ptr-eq short-cut to `compareByteArrays#` primitive cbdea95 Sort valid substitutions for typed holes by "relevance" cacba07 Linker: ignore empty paths in addEnvPaths bd58e29 Remove Hoopl.Unique 9a57cfe Option for LINE pragmas to get lexed into tokens a55d581 Fix Windows stack allocations. 59fa7b3 Fix #14719 by using the setting the right SrcSpan 7ff6023 cmm: Use two equality checks for two alt switch with default 1cb12ea Bump hadrian submodule 96d2eb2 Invert likeliness when improving conditionals 1205629 Add likely annotation to cmm files in a few obvious places. 5e8d314 Update outputs of T12962, scc003 47031db A bit more tc-tracing e7c3878 Move zonkWC to the right place in simplfyInfer 0f43d0d More tc-tracing efba054 Prioritise equalities when solving, incl deriveds e9ae0ca Look inside implications in simplifyRule 55aea8f testsuite: Mark scc001 and T5363 as broken due to #14705 370b167 circleci: Add Dockerfile for x86_64-linux b37dc23 appveyor: Don't install gcc fe6fdf6 testsuite: Fix test output of T14715 7d9812e testsuite: Fix test output broken by efba054640d3 5f922fb appveyor: Refactor 0171e09 Make RTS keep less memory (fixes #14702) 0bff9e6 Don't add targets that can't be found in GHCi be84823 Implement BlockArguments (#10843) 1a911f2 Sequester deriving-related validity check into cond_stdOK 382c12d rts: Ensure that forkOS releases Task on termination add4e1f Mark xmm6 as caller saved in the register allocator for windows. e4ab65b Optimize coercionKind (Trac #11735) ced9fbd UnboxedTuples can't be used as constraints 618a805 Experiment with eliminating the younger tyvar db5a4b8 Re-center improved perf for T3064 efce943 Add -ddump-ds-preopt e31b41b Flag `-fdefer-typed-holes` also implies `-fdefer-out-of-scope-variables`. 2974b2b Hoopl.Collections: change right folds to strict left folds c3ccd83 testsuite: Fix scc001 profile output 7fb3287 Add HasDebugCallStack to nameModule 4f52bc1 DriverPhases: Fix flipped input extensions for cmm and cmmcpp 3441b14 integer-gmp: Simplify gmp/configure invocation fdf518c Upgrade containers submodule 217e417 ghc-prim: Emulate C11 atomics when not available d8a0e6d Don't apply dataToTag's caseRules for data families e5d0101 base: Deprecate STM invariant checking primitives 50adbd7 cmm: Revert more aggressive CBE due to #14226 606edbf testsuite: Add testcase for #14754 d987f71 Improve unboxed sum documentation 326df5d Bump Cabal submodule d2511e3 Compute the union of imp_finsts on the side 7ad72eb cmm: Remove unnecessary HsVersion.h includes 1512b63 rts: Fix format of failed memory commit message 4d1c3b7 rts: Add format attribute to barf 4c36440 Restore 'It is a member of hidden package' message. 2987b04 Improve X86CodeGen's pprASCII. 3cd1305 rts: Use BITS_IN macro in bitmap calculations 00f1a4a rts: fix some barf format specifiers. da46813 testsuite: Add test for #14768 4aa98f4 Fix utterly bogus TagToEnum rule in caseRules 41d29d5 Comments only 6506980 Fix solveOneFromTheOther for RecursiveSuperclasses be53d19 Use SPDX syntax in rts/package.conf.in 059596d rts: fix barf format attribute 6edafe3 Fix isDroppableCt (Trac #14763) f489c12 Simplify Foreign.Marshal.Alloc functions with ScopedTypeVariables 583f561 Evac.c: remove unused CPP guard c9a88db Make ($!) representation-polymorphic 5957405 Collect CCs in CorePrep, including CCs in unfoldings 0c9777b Fix tests broken by c9a88db3ac4f1c3e97e3492ebe076f2df6463540 8936ab6 Raise parse error for `data T where`. df449e1 Various documentation improvements ec9aacf adds -latomic to. ghc-prim d5ff33d Adds `smp` flag to rts.cabal. e03ca71 Update .cabal files for Cabal 2.1 0c2350c rts.cabal.in: advertise profiling flavours of libraries, behind a flag 8529fbb Get eqTypeRep to inline 7c173b9 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` d5ac582 Fix #14811 by wiring in $tcUnit# a644dff circleci: Add nightly build using devel2 flavour 9080466 base: Fix changelog entry for openTempFile 1ede46d Implement stopgap solution for #14728 918c0b3 Add valid refinement substitution suggestions for typed holes 9ff4cce Build Haddocks with --quickjump bfb90bc Remove doubled words ccda486 Tidy up and consolidate canned CmmReg and CmmGlobals c05529c myThreadId# is trivial; make it an inline primop 4e513bf CBE: re-introduce bgamari's fixes d924c17 testsuite: Add newline to test output fc33f8b Improve error message for UNPACK/strictness annotations. 7f389a5 StgLint overhaul 043466b Rename the types in a GADT constructor in toposorted order 5b63240 Increase the amount of parallelism in circleci. 9fc4608 Bump haddock submodule again 2382bbf Bump process submodule fc04a8f Bump filepath submodule d20524e Bump pretty submodule 9ad3fa1 Bump stm submodule to 2.4.5.0 bd0af2a Bump primitive submodule to 0.6.3.0 e26d774 Bump parsec submodule to 0.3.13.0 1ee5abc Bump haskeline submodule to 0.7.4.2 2cb19b4 Bump text submodule to 1.2.3.0 71294f3 testsuite: Bump allocations for T1969 and T5837 eb2daa2 Change how includes for input file directory works 517c194 Document missing dataToTag# . tagToEnum# rule 81a5e05 circleci: Skip performance tests f511bb5 Add ghc-prim.buildinfo to .gitignore f433659 Slight refactor of stock deriving internals abfe104 Revert "Move `iserv` into `utils` and change package name a032ff7 Add references to #6087 0a3629a Don't use ld.gold when building libraries for GHCi 3483423 Comments in Unify, fixing #12442 bf3f0a6 Update Hadrian submodule c969c98 driver/utils/dynwrapper.c: Remove unused variable be498a2 RTS: Remember to free some pointers cb89ba8 RTS: Remove unused retainer schemes 3d43fd5 Introduce the flag -dsuppress-timestamps to avoid timestamps in dumps. 5e5e60d boot: Create GNUmakefiles for libraries f57c305 testsuite: Bump allocations for T9630 ffdb110 Update .gitignore da4766c circleci: Simplify Hadrian build 8c1d6b7 Tiny refactor in Core Lint 40fa420 Comments only e99fdf7 Fix a nasty bug in the pure unifier d675a35 Better stats for T5837 3dec923 Test for Trac #13075 is working now 51e0a38 Comments only b2996f1 Fix test for Trac #13075 df2c3b3 Build quick flavor and run some tests on Windows 2756117 Revert "Better stats for T5837" b8f03bb Cache the fingerprint of sOpt_P e261b85 forkProcess: fix task mutex release order 8dab89b rts: Note functions which must take all_tasks_mutex. f8e3cd3 Only load plugins once d8e47a2 Make cost centre symbol names deterministic. 8c7a155 Move Data.Functor.Contravariant from the contravariant package to base. e8e9f6a Improve exhaustive checking for guards in pattern bindings and MultiIf. 125d151 Add regression test for #12790 aef2b42 Fix #14817 by not double-printing data family instance kind signatures 4a0d0d8 Various Windows / Cross Compile to Windows fixes 1773964 DynFlags: Support British spelling of GeneralisedNewtypeDeriving 969e747 GHCi info: Use src file for cache invalidation 6a7e159 Improve missing-home-modules warning formatting 5c28ee8 Add @since annotations for derived instances in base 6e4fa81 rts/win32: Assert that the IO manager has been initialised bc1bcaa configure: Enable LD_NO_GOLD is set in all codepaths 7782b47 Add Applicative, Semigroup, and Monoid instances in GHC.Generics e4dcebf Adds *-cross-ncg flavour. 6835702 Permit conversion of partially applied PromotedTupleTs ffb2738 Fix #14838 by marking TH-spliced code as FromSource 5f6fcf7 Compile with `--via-asm` when cross compiling. 44ba60f doCorePass: Expand catch-all 821daad Correct default -A value in RTS flag usage info a2d03c6 Fix the coverage checker's treatment of existential tyvars 99c556d Parenthesize (() :: Constraint) in argument position 4631ceb Bump hsc2hs submodule 8f0b2f5 Bump Cabal submodule to 2.2 a9f680f Bump Cabal submodule e7653bc Wombling around in Trac #14808 3d25203 Respect Note [The tcType invariant] 6ee831f Fix #14888 by adding more special cases for ArrowT 1c062b7 Simplify rnLHsInstType df7ac37 Fixup include of gmp/config.mk to use new location f6cf400 `--via-asm` only for windows targets cf5bc96 add CCX=$(CXX) to integer-gmp ee597e9 Schedule.c: remove a redundant CPP guard 5bc195a Allow top level ticked string literals 9bccfcd Correct -g flag description 64c0af7 cmm/: Avoid using lazy left folds 08345bd Make accumArray and accum stricter 1488591 Bump nofib submodule 488d63d Fix interpreter with profiling 40c4313 Add perf test for #14052 b120e64 Add bindist-list.uniq to .gitignore d9d4632 Schedule.c: remove unreachable code block 648cb28 Use docker images with non-root user b320ba8 Fix a typo about pattern synonyms in documentation. b3bfbed Users Guide: Add that --numa is available on Windows too 43fbb90 Fix typo in description of -V RTS flag d99a65a Add -fexternal-dynamic-refs 98c7749 Revert "GHCi: Don't remove shadowed bindings from typechecker scope." bc95fed Error message and doc improvements for #14335 ed6f9fb ghc-prim: Reduce scope of Clang sync_fetch_and_nand workaround 94f0254 ghc-prim: Silence -Wsync-nand warning in atomic.c 47e2a28 Remove outdated documentation bits concerning -Wmissing-methods a25b763 configure: Accept suffix in OpenBSD triple's OS name df2ea10 Compacted arrays are pinned for isByteArrayPinned# dd3906b UNREG: fix implicit declarations from pdep and pext 8e34101 Fix a debug print in disassembler (#14905) e3ae0eb testsuite: disable T13615 on non-smp targets 5c804e5 Remove splitEithers, use partitionEithers from base 02b3dad Bump Cabal submodule 50972d6 Comment improvements on interpreter breakpoint IO action ba57979 Update a comment in Exception.cmm 152055a Drop GHC 8.0 compatibility cb6d858 Slighly improve infix con app pattern errors 1522cf0 aclocal.m4: allow more GNU/Hurd tuples 0693b0b aclocal.m4: add OSHurd (debian patch) 2a3702d Comments and tiny refactor 5a1ad23 Update test for #5129: f9a6d42 Add a build with 32bit Ubuntu container 2918abf rts: Add --internal-counters RTS flag and several counters 3d378d9 Also check local rules with -frules-check 39c7406 Be more selective in which conditionals we invert fad822e Improve the warning message of qualified unused imports. 0db0e46 Get rid of more CPP in cmm/ and codeGen/ bbcea13 Hoopl: improve postorder calculation a00b88b Implement -dword-hex-literals b37a87b PPC nativeGen: Add support for MO_SS_Conv_W32_W64 5241f29 SPARC nativeGen: Support for MO_SS_Conv_W32_W64 d27336e [RFC] nativeGen: Add support for MO_SS_Conv_W32_W64 on i386 20cbb01 Improve accuracy of get/setAllocationCounter 256577f CmmUtils: get rid of insertBlock fbd9b88 Implement equalKeysUFM the right way 9868f91 Turn a TH Name for built-in syntax into an unqualified RdrName e358854 Require GHC 8.2 to bootstrap GHC c3aea39 Fix #14934 by including axSub0R in typeNatCoAxiomRules f748c52 Don't permit data types with return kind Constraint fdec06a Update tests for #12870 to pass with a slow run of the testsuite. 98c1f22 Bump array submodule 960cd42 Fix typo in user guide about ConstraintKinds 82e8d1f Fix typo b3b394b gen-data-layout.sh: Use bash array for readability 2d4bda2 rts, base: Refactor stats.c to improve --machine-readable report afad556 Add -flate-specialise which runs a later specialisation pass 6a71ef7 Bump autoconf version bound to >= 2.69 d718023 relnotes: Fix parsing of Version: field from Cabal file 60aa53d configure: Accept version suffix in solaris name 57001d9 Update T5129 test: 0a778eb Revert "rts, base: Refactor stats.c to improve --machine-readable report" abaf43d Fix seq# case of exprOkForSpeculation 49ac3f0 Fix #14869 by being more mindful of Type vs. Constraint 411a97e Allow as-patterns in unidirectional patttern synonyms 3446cee Fix two obscure bugs in rule matching efc844f Fix over-eager constant folding in bitInteger 034c32f Improve shortOutIndirections slightly d5577f4 Special-case record fields ending with hash when deriving Read affdea8 Allow PartialTypeSignatures in standalone deriving contexts ceb9147 Support adding objects from TH 7bb1fde testsuite: Add test for #14931 10566a8 Support iOS variants elsewhere when configuring 9893042 Fix two pernicious bugs in DeriveAnyClass cf80995 Add Note [BLACKHOLE points to IND] f7bbc34 Run C finalizers incrementally during mutation fb462f9 Fix panic on module re-exports of DuplicateRcordFields c16df60 document: fix trac issue #14229 9a00bfb rts/RetainerProfile: Dump closure type if push() fails 0703c00 testsuite: Add test for #14925 20f14b4 Fix #14916 with an additional validity check in deriveTyData 0cbb13b Don't refer to blocks in debug info when -g1 a3986d7 Fix scoped type variables in TH for several constructs 41db237 llvmGen: Pass -optlo flags last to opt 20ae19f base: Fix Unicode handling of TyCon's Show instance ecfb4d3 Add new debugging flag -dinline-check efd70cf Add unaligned bytearray access primops. Fixes #4442. d152dab Add a job running on Fedora 60e29dc circleci: Bump Hackage index state f0b258b rts, base: Refactor stats.c to improve --machine-readable report 41c1558 Make it evident in types that StgLam can't have empty args 97e1f30 Fix compilation stopper on macOS with -Werror e3dbb44 Fix #12919 by making the flattener homegeneous. b47a6c3 Fix performance of flattener patch (#12919) f13a0fc Comments only 1fce2c3 Avoid quadratic complexity in typeKind 71d50db Minor refactor and commments 9cc6a18 White space only a7628dc Deal with join points with RULES 3ebf05f Fix the test for #13938 8cfd2e4 configure: Throw error if OS is found to be msys d5c4d46 CmmPipeline: add a second pass of CmmCommonBlockElim d1fb583 testsuite: Add test for #14965 ab9e986 rts: Fix profiled build after D4529 b58282a More format string fixes 88f06d4 rts: One last formatting string fix bf2b9cc Update Note [Documenting optimisation flags] d06a5a9 Rename CI docker images 0951e03 Full AppVeyor build with tests 0017a7b Fix syntax in -flate-specialise docs c00b6d2 Update a few comments regarding CAF lists afb686a printClosure: slightly improve MVAR printing 4de585a Remove MAX_PATH restrictions from RTS, I/O manager and various utilities ca535f9 testsuite: allow accepting of fine grained results [skip ci] faec8d3 Track type variable scope more carefully. ef44382 Apply the interim fix for #14119 to liftCoMatch 3eaa55d Apply Note [EtaAppCo] in OptCoercion to another case 1845d1b Clarify comments around dropping Derived constraints 07abff7 Test #14884, #14969 9187d5f Allow unpacking of single-data-con GADTs 5ab8094 SpecConstr: accommodate casts in value arguments ddf8955 Mark test as expected to pass. d8d4266 Fix #14991. 72b5f64 Fix accidental breakage in T7050 c2f90c8 Remove unused bdescr flag BF_FREE 891ffd5 Comments only, about exitifcation 54acfbb base: Add dependency on GHC.Integer in a few boot files 875e59d testsuite: Accept output for T12593 718a018 Fix #14238 by always pretty-printing visible tyvars 5819ae2 Remove HasSourceText and SourceTextX classes d386cd6 Collect build artifacts with S3 26cfe29 Document SumTyCon 7bd7fec Improve documentation for refineDefaultAlt 605ae8d Run tests after artifact collection a5bfb7e CoreUtils.filterAlts: Correct docs 8b823f2 docs(Data.Function): fix and augment `on` annotation b14c037 Some cleanup of the Exitification code 48f55e7 Bump template-haskell to 2.14.0.0 1aa1d40 Restore Trees That Grow reverted commits ae0cff0 CSE: Walk past join point lambdas (#15002) a1fcdf3 Add a forgotten newline in a debug print b2eb9ad Fix GHC collector flavor for Fedora job (Circle CI) 3f59d38 Add test case for #15005 635a784 Remove PARALLEL_HASKELL comments 5161609 testsuite: Add test for negative sqrts (#10010) d5f6d7a rts/RetainerProfile: Handle BLOCKING_QUEUES 81e7980 Minor typofix in LoadArchive.c 2534164 Move gmp/config.mk.in to config.mk.in, fix #14972 c054162 Revert "Fix #14838 by marking TH-spliced code as FromSource" 7bb7f99 Discard reflexive casts during Simplify 3cfb12d In Exitify, zap idInfo of abstracted variables (fixes #15005) a323f21 Move T14925.stdout to its correct location, remove expect_broken ed57a34 Schedule.c: remove unused code 74e768e Schedule.c: remove some unused parameters 270e3e9 No need for sortQuantVars in Exitify after all 111556f Remove fs files from rts install-includes. 4e6da0f Revert "Remove fs files from rts install-includes." 5417c68 Remove fs files from rts install-includes. b138694 TTG for HsBinds and Data instances Plan B c4814ab Bump version numbers: base-4.11.1.0, integer-gmp-1.0.2.0 f02309f users-guide: Update release notes and language extensions 78ff6e5 Revert "CmmPipeline: add a second pass of CmmCommonBlockElim" a303584 Fix processHeapClosureForDead CONSTR_NOCAF case: 120a261 Update JMP_TBL targets during shortcutting in X86 NCG. f78df87 Fix rts.cabal.in 6f62303 Remove unused function: mkFunCos 7613a81 Fix #9438 by converting a panic to an error message 6a78a40 Use newtype deriving for Hoopl code 9430901 Revert "Fix processHeapClosureForDead CONSTR_NOCAF case:" ce27c7d Correct FixIOException's @since annotation retroactively 00b8ecb Declare `catchRetry#` lazy in its first argument 3c7f9e7 Make shortcutting at the asm stage toggleable and default for O2. 9e89092 Omit ways depending on rts flags for #12870 related tests. 4b831c2 Configure option to disable dtrace fea04de Enhanced constant folding 09128f3 users guide: Note improved constant folding in 8.6 release notes 0e37361 Revert "Enhanced constant folding" 90283b5 rts: Comment wibbles 4d30bc8 Remove markSignalHandlers 7889659 Minor comments in CSE fe325d3 Comments only 4a16804 Fix markup in the UNPACK pragma section of the user's guide. cab3e6b Proper safe coercions paper link 5d76846 Introduce a $tooldir variable for nicer toolchain detection on Windows 447d126 Fix #14710 with more validity checks during renaming 2fdfe05 Bump unix submodule to version 2.8.0.0 19ddd04 Add a test case from the nested CPR work 803178a users-guide: Override mathjax_path 48b8842 rts: fix format arguments for debugBelch calls on 32-bit systems f7f567d Add a test for #14815: cac8be6 Better error message for empty character literal, for Trac #13450. b08a6d7 Fix #15012 with a well-placed use of Any 8f19ecc Bump base to version 4.12.0.0 d9d8015 testsuite: Fix `./validate --slow` 3c3e731 parsec: Make version hack compatible with Windows cbd73bb configure: Use -Werror to check for existence of -no-pie 8fa688a boot: Fix computation of TOP 257c13d Lint types in newFamInst a26983a Fixes isAlphaNum re. isAlpha/isNumber and doc fix (trac issue #10412) b41a42e Bump transformers submodule 2fbe0b5 Caching coercion roles in NthCo and coercionKindsRole refactoring 8b10b89 Inline wrappers earlier f6db0b2 comments only 430e6fe Remove broken top-level shell.nix 698db813 Fix implementation of rnIfaceBndr da74385 base: Add a test for T10412 2a5bdd9 Remove unnecessary check in simplCast 98b0c3f s/traverse_weak_ptr_list/traverseWeakPtrList in comments [skip ci] ea01daf rts: Use g0 for &generations[0] c7c53c6 Remove a outdated comment [skip ci] bfc1fc2 Typo fix in scavenge_one comment [skip ci] f19b07a users-guide: Fix up formatting in 8.6 release notes 2eafd76 coercion: Improve debugging output f04ac4d Add testcase for #15050 e732210 ghc-prim: Refactor and document __sync_fetch_and_nand workaround 1126e69 testsuite: Fix overflow in T13623 on 32-bit machines ec9638b testsuite: Fix T4442 on 32-bit architectures acb7361 Stable.c: minor refactoring, add/update some comments 625eea9 Update Hadrian submodule 3d38e82 Do not unpack class dictionaries with INLINABLE 693857f Comments only 705dcb0 Refactor in OccurAnal 313720a Rename a local variable c3823cb TTG : complete for balance of hsSyn AST 56bbe1e Add missing stdout file for T14955 512f503 Minor refactoring in Exitify 69119b2 Comments only: the FVAnn invariant 0c01224 Refactor tcExtendLocalFamInst a bit 08003e7 Make out-of-scope errors more prominent 6da5b87 Better linting for types 4e45ebe Add test case for #15108 07cc603 Don't crash when pretty-printing bad joins d4cc74f Preserve join-point arity in CoreOpt b5739bd rts: Don't disable formatting warning in RetainerSet.c 6212d01 testsuite: Bump performance meterics due to 3d38e8284b73 260e23b rts: Add -hT to the rts usage message b7b6617 rts: Allow profiling by closure type in prof way 60f9e46 Exitify: Do not trip over shadowing (fixes #15110) dc655bf errorWithoutStackTrace: omit profiling stack trace (#14970) 4cb5595 storageAddCapabilities: fix bug in updating nursery pointers 198db04 Set arity for absentError 6742ce2 Test Trac #15114 5de0be8 Add regression tests for #14904 358b508 Compute DW_FORM_block length correctly; also fixes #15068 e34e30e Warn against using Data.Monoid.First 90589a9 document the plan for removing Data.Semigroup.Option cf35ab9 minor improvement to wording of warning against First. Add warning against Last 107d2cb Don't shadow "result" in JUnit driver 1ad0277 CircleCI: Save test results as JUnit XML 75361b1 Fix NUMA support on Windows (#15049) 6132d7c Correctly add unwinding info in manifestSp and makeFixupBlocks 866525a Move the ResponseFile module from haddock into base 721e826 GHCi: Improve the error message for hidden packages 6462d90 rts: Throw better error if --numa is used without libnuma support 79c4f10 Enable warning flags to safe-guard against regressions in `base` 5697432 Normalize T14999 test output some more 33de71f Simplify callSiteInline a little b750dcc testsuite: Bump T9630 allocations as a result of 33de71fa06d0 56e8c6f Update docker images to use GHC 8.4.2 and cabal-install-2.2 13e8bc0 Fix typo in user guide about promoted list 49f5943 rel-notes: Note that -hT is now allowed 426ae98 Split TrieMap into a general (TrieMap) and core specific (CoreTrieMap) module. 361d23a Normalize the element type of ListPat, fix #14547 0f046aa testsuite: Add test for #15067 cb1ee7e Do not supply `-mcpu` if `-optlc` provides `-mcpu` already. 418881f Use unsafeInsertNew to create timers in TimerManager 6243bba Add 'addWordC#' PrimOp be580b4 Add test for invertability of `Floating` methods. d814dd3 Add hyperbolic functions to test of Float-inverses 3ea3341 Stable area hyperbolic sine for `Double` and `Float`. 46548ed base/changelog: Note stabilization of asinh (#14927) 7271db4 testsuite: Bump T5631 expected allocations 875b61e printStackChunk: recognise a few more ret frames 61b245a Small refactoring in Exitify 5b3104a Used named fields for DataDeclRn aa03ad8 Simplify the kind checking for type/class decls 37acca7 users-guide: Move discussion MAX_PATH out of release notes 280de0c Revert "Normalize the element type of ListPat, fix #14547" 981bf47 Normalize the element type of ListPat, fix #14547 849547b Revert "Normalize the element type of ListPat, fix #14547" ba6e445 Normalize the element type of ListPat, fix #14547 5fe6aaa Add -fghci-leak-check to check for space leaks b2ff5dd Fix #15038 e5bb515 rts: remove unused round_up_to_mblocks function 87e169a Revert "Add -fghci-leak-check to check for space leaks" 40a76c9 BlockAlloc.c: reuse tail_of function cb5c2fe Fix unwinding of C -> Haskell FFI calls with -threaded 3781034 Expand $tooldir in ghc --info output 2323ffd Adds CTRL-C handler in Windows's timeout (trac issue #12721) bec2e71 Revert "Fix unwinding of C -> Haskell FFI calls with -threaded" 78db41e Use correct source spans for EmptyCase 00049e2 Emit info-level log message when package envs are loaded 6ab7cf9 Simplify -ddump-json implementation 9039f84 base: Fix handling of showEFloat (Just 0) f0212a9 TcInteract: Ensure that tycons have representations before solving for Typeable 2188427 Bump array submodule 7c665f9 Refactor LitString eb39f98 Fix a few GCC warnings 2828dbf Fix changelog message for asinh cdbe00f Remove unused things from utils/Digraph d4abd03 rts: Compile with gcc -Og 30c887d GHCi: Include a note in the hint to expose a hidden package 48dee7c Clarify what the FFI spec says bf6cad8 Add note documenting refineDefaultAlt 21e1a00 Fix #14875 by introducing PprPrec, and using it cf88c2b ghc-pkg: Configure handle encodings 8f3c149 Add support for opting out of package environments ca3d303 Fix another batch of `./validate --slow` failures b713986 Improve some Foldable methods for NonEmpty 6d57a92 utils/fs: use , not e408d03 Fix #14973 1e27209 Revert "rts: Compile with gcc -Og" d92c755 Fix performance regressions from #14737 79bbb23 rts: export new absentSumFieldError from base f49f90b Tidy up error suppression df6670e testsuite: Fix expected allocations of T9020 and T12425 9dbf66d Revert "Simplify callSiteInline a little" 45ad0c3 Ensure that RTS cabal file reflects dependency on libnuma 1154c9b More explicit comment on switch in registerDelay af986f9 testsuite: Disable T14697 on Windows 01b15b8 Calling GetLastError() on Windows for socket IO (trac issue #12012) bb338f2 Algebraically simplify add/sub with carry/overflow bb3fa2d Less Tc inside simplCore (Phase 1 for #14391) a18e7df Force findPtr to be included in the binary eb8e692 An overhaul of the SRT representation fbd28e2 Allow CmmLabelDiffOff with different widths 2b0918c Save a word in the info table on x86_64 838b690 Merge FUN_STATIC closure with its SRT 01bb17f Make finalizers more reliable. 3310f7f InfoTables: Fix #if uses introduced by D4634 126b412 Add pprTraceM to Outputable as analog to traceM. 99f8cc8 Fix #15039 by pretty-printing equalities more systematically 4ffaf4b Improve numeric stability of numericEnumFrom for floating numbers 0c7db22 Fix #15073 by suggesting UnboxedTuples in an error message f2d27c1 Comments and refactoring only b701e47 Update Cabal submodule 5f15d53 Add /* fallthrough */ to fix -Wimplicit-fallthrough warning f27e4f6 Fix GHCi space leaks (#15111) 5d3b15e Fix unwinding of C -> Haskell FFI calls with -threaded (2nd try) 819b9cf Add regression tests for #11515 and #12563 797a462 Comments only efe4054 Tiny refactor 2bbdd00 Orient TyVar/TyVar equalities with deepest on the left 5a7c657 Debug tracing only ae292c6 Do not unify representational equalities d78dde9 Fix retainer profiling after SRT overhaul c617c1f base: Add Foldable and Traversable instances for Alt 9171c7f base: Fix typo c4219d9 Another batch of './validation --slow' tweaks 12deb9a rts: Fix compaction of SmallMutArrPtrs ec22f7d Add HeapView functionality e1fd946 ghc-prim: Bump version 1cdc14f ghc-pkg: recompute `abi-depends` for updated packages f2ce86c Do better sharing in the short-cut solver 5f3fb71 Fix perf numbers for #15164 b7e80ae Remove TcType.toTcType 57858fc Make dischargeFmv handle Deriveds af0757d Check for type families in an instance context 97121b6 Revert "ghc-pkg: recompute `abi-depends` for updated packages" db6085b Improve performance of CallArity 928f606 Typo in comments 49a832d Remove special case from TcTyVar level check 86bba7d Add missing check to isReflCoVar_maybe d191db4 Don't expose strictness when sm_inline is False a32c8f7 Use dischargeFunEq consistently d424d4a Fix a bug in SRT generation bf10456 Disable the SRT offset optimisation on MachO platforms 49691c4 testsuite: Bump OS X performance numbers 1879d9d Check for mismatched class methods during typechecking 979f085 Clean up the conflicting data family instances error message 5ca623a Minor typos 5b6ef59 Add -fghci-leak-check to check for space leaks c618732 isDllName: use Opt_ExternalDynamicRefs, not WayDyn 40d5b9e Comments about the substition invariant 11eed2f testsuite: Don't rely on find command in T15038 72835ff Add regression test for #11766 00f7e28 Add regression test for #14172 9ed7e8d Add regression test for #14246 6a9b9b4 Mark #12447's test case as expected to pass b67e8a3 base: Introduce Data.Monoid.Ap a5446c4 Update GHC.Stats docs 4778cba Fix 32 bit windows build 60fb2b2 Clean up Windows testsuite failures f804811 Factor stack chunk printing out of printTSO 25f01db Typofixes [ci skip] 6848a99 remove dead maybeIsLFCon 36656b9 Typofix in manual [ci skip] d14b1ec Minor refactoring 9969863 Use a less confusing type variable in a few types 576078a base: Improve zip documentation 5e91cde Unmask readMVar in readChan fa2d7e1 testsuite: Fix incorrectly capitalized True in testlib.py 1245835 testsuite: Use /usr/bin/env instead of /bin/bash 929bbe4 Handle TREC_CHUNK in printClosure 857005a Move printMutableList to Printer.c next to other printers e4003b6 llvm-targets: Add versioned ARM targets bdfc85b Fix validate for GHCi without TABLES_NEXT_TO_CODE bd429dc Update repository sub-dir for ghc-heap in ghc-heap.cabal.in 2ea93a7 Improve the documentation of lexically scoped type variables 8fe99c7 Remove incorrect comment 9ded0d6 Delete duplicate definition of fingerprintByteString c65159d T14732 now passes with the profasm way 49e423e Put the `ev_binds` of main function inside `runMainIO` 34464fe rts: Don't madvise if mmap failed 9aac442 Define MCoercion type a4ae199 Extract hard-coded LLVM opt flags into a file b876c1b users-guide: Point out GNTD may require additional extensions e0b44e2 Improved Valid Hole Fits 1d1e2b7 Implement "An API for deciding whether plugins should cause recompilation" 64fd0fa ghc-heap: Add dependency from GHC.Exts.Heap.Closures to InfoTableProf 5030109 testsuite: Fix hashbangs 730781b rts/posix: Use less aggressive backoff schedule for heap reservation sizing b57a54f SplicePat's should not trip -Wunused-pattern-binds 91a82de testsuite: Make T3234 more robust 15ece72 base: Improve documentation of indexArray# 533d345 configure: Make sphinx-build version test work on recent versions 471b2a0 users-guide: Fix various issues in debugging flags section d1beebb Make HsDocString a newtype of ByteString 21a9fb5 base/TimerManager: Clamp timer expiration time to maxBound b592bd9 dead strip dylibs on macOS 5748c79 Change jump targets in JMP_TBL from blocks to X86.JumpDest. 9921f5b Cleanups [ci skip] 9fd4ed9 UNREG: mark SRT as writable in generated C code bd43378 Optimizations for CmmBlockElim. c983a1d testsuite: Add test for #15186 f0c1eb8 Conservatively estimate levity in worker/wrapper 13a8660 Add llvm-target for powerpc64le-unknown-linux faee23b vectorise: Put it out of its misery 9ea4596 C codegen: print details of pprStatics panics a122d4f rts: Rip out support for STM invariants e0f33a6 testsuite: Don't assume location of bash 7272566 Bump version of stm submodule back to 2.4 c2783cc Extended the plugin system to run plugins on more representations ac91d07 Fix #13777 by improving the underdetermined CUSK error message 18cb4f5 Check for singletons when creating Bag/OrdList from a list. 21e9d4f Fix #15214 by listing (~) in isBuiltInOcc_maybe 2627377 rts: Query system rlimit for maximum address-space size 1626fe6 Handle abi-depends correctly in ghc-pkg 5b82ee6 Remove ~# from surface syntax 4d80044 Fix a bad interaction between GADTs and COMPLETE sets 08073e1 Turn "inaccessible code" error into a warning 9b7eec8 tcExtendTyVarEnv2 changed to tcExtendNameTyVarEnv f68c2cb Allow aligning of cmm procs at specific boundry 1f88f54 Improve exhaustiveness checking for literal values and patterns, fix #14546 6128037 Fix typo in OverloadedLabels docs 90e99c4 Add tests for #8128 and #8740 b564eb7 testsuite: Mark T14547 as broken 4dd1895 testsuite: Really mark T14547 as broken 554bc7f Provide `getWithUserData` and `putWithUserData` 0e5d2b7 Do a late CSE pass 9d600ea Expand type synonyms when Linting a forall a1a507a Refactor SetLevels.abstractVars c560f38 Bump stm and haskeline submodules d8efb09 Fix broken test T14547. 36091ec Document the fact that cmm dumps won't show unreachable blocks. 7df5896 Implement QuantifiedConstraints 1a61c6b Add Outputable instance for HsArg 97cea31 Improve extendTvSubst assertion aa77c60 Also suppress uniques in cmm dumps with `-dsuppress-uniques`. 85309a3 Serialize docstrings to ifaces, display them with new GHCi :doc command 8ed8b03 Introduce DerivingVia 4075656 Rename some mutable closure types for consistency 455477a rts: Reuse dbl_link_remove in a few places d964b05 Let the simplifier know that seq# forces 635a59a Do not scavenge SMALL_MUT_ARR_PTRS_CLEAN in mut_lists 7f45906 Comments only c16382d Remove ad-hoc special case in occAnal 1508600 testsuite: Fix dynamic-paper stderr file f741711 Update hadrian submodule 64c71ce Don't use unsafeGlobalDynFlags in optCoercion db4f064 WorkWrap: Rip out unsafeGlobalDynFlags usage in mkWwInlineRule e7678d6 Index arrays more eagerly 767536c Fix unparseable pretty-printing of promoted data cons efea32c Check if both branches of an Cmm if have the same target. 0361fc0 Move 'HsBangTy' out in constructor arguments 5026840 testsuite: Add test for #15232 569c16a Fix #15243 by fixing incorrect uses of NotPromoted bc9a838 Document #15079 in the users' guide 04e29fc testsuite: Skip T13838 in ghci way 5926b6e Don't expose (~#), (~R#), (~P#) from GHC.Prim 3397396 Fix #15236 by removing parentheses from funTyConName 838cb53 rts: Fix reference to srt_bitmap in ASSERT in RetainerProfile fa34ced Rename dataConRepNameUnique to dataConTyRepNameUnique dc8c03b Run typeCheckResultAction and renamedResultAction in TcM rather than Hsc 200c8e0 Allow Haddock comments before function arguments. 6fbe5f2 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` 297879a Add support for FreeBSD arm d66ca01 typecheck: Don't warn about "redundant" TypeError constraints 838aeb9 Run Linux slow validate nightly on Circle CI 40db277 Fix `print-explicit-runtime-reps` (#11786). a9eb645 users guide: Fix spelling 9976bed rts: Handle SMALL_MUT_ARR_PTRS in checkClosure bb83831 Do not omit T4030 in GHCi mode e1f74aa users-guide: Spelling and style pass over QuantifiedConstraints docs 229789a testsuite: Bump performance metrics of T9233 and T13035 14f4347 Bump Cabal submodule 96ddfa4 testsuite: Suppress uniques in T15243 output 93220d4 testsuite: Remove uniques from T15243's stderr output 502026f Make seq# evaluatedness look through casts 25597a9 Comments only a169149 Remove duplicate quantified constraints 97d0542 Small refactor, adding checkBadTelescope 6ccfa62 Remove a tc-trace 0180230 rts: Fix a var name in a comment, fix a typo da53417 docs: Add mentions of new plugins mechanisms to users guide aab3c6d Refactor TcExpr.tcSeq bb539cf Bump hadrian submodule a610c21 Fix some of the failures in sanity way cc78d25 testuite: remove strace call. b5ccee4 Do not skip conc004 in GHCi way a3c0b42 testsuite: Print summary even if interrupted f7b9456 Minor refactoring and docs in selector optimisation 16c70da Disable T12903 on Darwin due to flakiness f1b097f OptCoercion: Ensure we use new UnivCo provenance to construct optimised cos. 908edbf libiserv: Add license file 3606075 testsuite: Add -fghci-leak-check to expected output on mingw32 5600729 testsuite: Add Windows-specific output for T5611 261209d Duplicated and 97d1419 Update user manual sections for -rtsopts and -with-rtsopts ca7653a testsuite: Fix T4442 on i386 0238a6c UNREG: PprC: add support for of W32 literals 4a93166 Disable `-fdefer-out-of-scope-variables` in ghci. 8ae7c1b Make Control.Exception.throw levity polymorphic. 5f5d0c9 Mark test broken on powerpc64[le] 87d691c users-guide: Fix PtrRepLifted to LiftedRep 69b50ef Fix deserialization of docs (#15240) d24e73a Replace `showSDocUnsafe` with `showSDoc` in extending_ghc.rst 233d815 rts: Ignore RLIMIT_AS if it is zero 6f083b3 desugar: Rip out unsafeGlobalDynFlags usage in decomposeRuleLhs e4c41ec rts: Don't keep findPtr symbol alive if not -DDEBUG 4672e2e relnotes: Add mention of QuantifiedConstraints d650729 Embrace -XTypeInType, add -XStarIsType 0c5aac8 Revert inadvertant changes to .gitmodules 8ffac59 Revert "rts: Don't keep findPtr symbol alive if not -DDEBUG" 8062d7f Fix binary and haddock submodule commits f9b925a Bump haddock submodule 3a18a82 Fix broken link db5ef2b Exclude libraries/libiserv/ghc.mk and other things via .gitignore. 01c9d95 UNREG: PprC: add support for of W16 literals (Ticket #15237) 807ab22 Fix the bind-recovery type f903e55 Fix corner case in typeKind, plus refactoring 2f6069c Make better "fake tycons" in error recovery dbe5370 circleci: Remove systemd from Fedora nsswitch configuration 69954a1 Fix documentation for `-dth-dec-file` b7deeed testsuite: Make T4442 compile on i386 and mark as broken e6498d6 Bump supported LLVM version to 6.0 78f5344 No Unicode in Parser.y b67b971 Make NameSort note into proper Note 91822e4 Add "quantified constraint" context in error message, fix #15231. 9c89ef3 Make dtrace enabled GHC work as a bootstrap compiler on FreeBSD 7100850 Use data con name instead of parent in lookupRecFieldOcc 42f3b53 Fix #13833: accept type literals with no FlexibleInstances fe770c2 Built-in Natural literals in Core 1279428 Quantify unfixed kind variables in CUSKs 8ee9c57 Amend configure script to support lndir build tree 1ab2dcb testsuite: Mark num009 as broken due to #15062 1f2ed99 testsuite: Mark overflow1 as broken on 32-bit platforms due to #15255 86210b2 rts: Use .cfi_{start|end}proc directives cd95c2f Preserve parenthesis in function application in typechecker a81b99d Bump nofib submodule dbc8c0f base: Improve the documentation of the enumFrom series of functions de34a71 rts: Remove use of __USE_MINGW_ANSI_STDIO 819d8ef circleci: Bump fedora docker image tag f998947 circleci: Add a reference to the documentation on the Wiki 60e4bb4 Enhanced constant folding d55035f Revert "Amend configure script to support lndir build tree" 4cd5521 base: Add default implementation for Data.Bits.bitSize 8df2447 Warn about implicit kind variables with -Wcompat 76b343f Revert "rts: Use .cfi_{start|end}proc directives" 0db05ad Bump process submodule d1c7239 configure: Fail when bootstrapping with GHC 8.2.1 749bc1a testsuite: Mark T3001-2 as broken on 32-bit platforms 9897440 testsuite: Mark print022 as broken on 32-bit platforms ccd8ce4 Handle DuplicateRecordFields correctly in filterImports (fixes #14487) df0f148 Improve error message when importing an unusable package 793902e Improve documentation of Eq, Ord instances for Float and Double c637541 Provide a better error message for unpromotable data constructor contexts b8e3499 UNREG: fix CmmRegOff large offset handling on W64 platforms 008ea12 Use __FILE__ for Cmm assertion locations, fix #8619 04e9fe5 Add -Werror=compat 50d7b2a Remove accidentally checked-in T14845.stderr d621644 Fix an infinite loop in niFixTCvSubst 850ae8c Two small refactorings 30b029b Fix typechecking of kind signatures 6ac8a72 Typofixes in docs and comments [ci skip] de692fd Fix typo in comment only a9b01c0 Mark some TH tests as req_interp 83a7b1c Adjust comments (Trac #14164) 676c575 Fix API Annotations for GADT constructors 26e9806 Document and simplify tcInstTyBinders 4cdd574 configure: Bump version to 8.6.0 000ac86 testsuite: Bump metrics for T5631 and T6048 50e7bff containers: Bump to 0.6.0.1 f0179e3 testsuite: Skip T11627a and T11627b on Darwin 7b8dcd9 testsuite: Add broken test for #15289 a5eaa0f Tweak wording in documentation 436c0e9 findPtr: don't search the nursery 21fa62f base: Add missing instances for Data.Ord.Down 7363ba4 Revert "containers: Bump to 0.6.0.1" e839ee2 A few more typofixes in docs/comments [ci skip] 942e6c9 configure: Fix libnuma detection logic f4dce6c Allow :info for (~) in GHCi b948398 Remove HsEqTy and XEqTy 76e110f rts: A bit of cleanup of posix itimer implementation 227ede4 Fix gcc.exe: error: CreateProcess: No such file or directory c35ad6e containers: Bump to 0.6.0.1 c7cd5a6 configure: Set version to 8.7 3048a87 Fix incorrect GHC versioning 50a35e5 Drop redundant Note 32eb419 Instances in no-evidence implications e065369 Refactor try_solve_fromInstance in shortCutSolver d5459a3 Remove unnecessary call to checkReductionDepth 122ba98 Move a Note to the module that refers to it 5f06cf6 TTG for IPBind had wrong extension name 391b0ca Explain why opt-cmm is not dumped by ddump-cmm-verbose. 63d474b Include ghc-heap and libiserv in the "package" file. c7b1e93 rts: Abort if timerfd read fails 67c422c rts/linker/{SymbolExtras,elf_got}.c: map code as read-only 33724fc Remove -Wamp flag 5db9f91 Tweak API Annotations for ConDeclGADT 2896082 Fix error recovery for pattern synonyms 95324f0 Improve tc-tracing a bit 9fc40c7 Refactor the kind-checking of tyvar binders 577399c Coments and debug tracing only b4d5459 More misc comments cea409a Remove unused BottomFound from Tick 1c2c2d3 Record some notes about "innocuous" transformations e53c113 API Annotations when parsing typapp 261dd83 Fix TcLevel manipulation in TcDerivInfer.simplifyDeriv 7a2b5d0 A bit more tc-tracking in TcUnify.uUnfilledVar bb50eca Remove dead code 629d01a Typofixes in comments and whitespace only [ci skip] 5865e9a Typo fix in rts [skip ci] 3d00208 Add commnent about binder order 4168ee3 rts: Update some comments, minor refactoring a54c94f Show addresses of live objects in GHCi leak check 437ff69 Add ghc-prim as dependency to ghc-bin 45de833 Clarify role of coercion in flattening function 904abd4 Document SRT scavenging behavior of scavenge_block() and scavenge_one() 4760a8c Add -ddump-rtti to user's guide and man page 9a371d6 A few typofixes in comments 6bb0c5d Don't lock the MVar closure on tryReadMVar 6e4e6d1 Fix mkGadtDecl does not set con_forall correctly b4e6483 testsuite: remove unused scc001 target 6cb189d RtClosureInspect: add some docs, remove unused stuff 15bb4e0 Fix nptr field alignment in RtClosureInspect 39de4e3 Fix errors caused by invalid candidates leaking from hole fits e835fdb Add regression test for #15321 f6ac083 Add regression test for #15007 8f44995 Revert "Don't lock the MVar closure on tryReadMVar" 7ce6f64 Add comments on Typeable (n :: Nat) 14dfdf6 Fix comment 45f44e2 Refactor validity checking for constraints 59a15a5 Fix #15307 by making nlHsFunTy parenthesize more 93b7ac8 Fix #15308 by suppressing invisble args more rigorously 132273f Instantiate GND bindings with an explicit type signature 9275186 Fix newtype instance GADTs 5773397 Parenthesize rank-n contexts in Convert b6a3386 Fix #15331 with careful blasts of parenthesizeHsType dbdcacf Make ppr_tc_args aware of -fprint-explicit-kinds 9b26aa0 Comment out a pprTrace 45f0026 Accept new stdout for tcrun045 18cedbb Make a variant of mkCastErr for kind coercions 8c628ad Remove BUILD_DPH, not used de95bf4 circleci: Detect core count 87b28a8 users guide: Mention -fprint-typechecker-elaboration in -ddump-tc docs f59332f Mark AutoDeriveTypeable as deprecated fbe162f Add a broken test for lingering state from TH unique names #9693 379bb20 Simplify lintIdUnfolding 987b5e7 Fix for built-in Natural literals desugaring f03f0d6 testsuite: Add test for #15053 8736715 rts: Enable two-step allocator on FreeBSD 6715373 Revert "rts: Enable two-step allocator on FreeBSD" 6595bee Define an Outputable MCoercion instance 55a3f85 Refactor coercion rule fd0f033 More refactoring in TcValidity aedbf7f Fix decompsePiCos and visible type application 03d7268 More tc-tracing 5067b20 Add nakedSubstTy and use it in TcHsType.tcInferApps 8ec2946 Optional context for a quantified constraint 042df60 Unwrap casts before checking vars in eager unifier 030211d Kind-check CUSK associated types separately cf67e59 Expand and implement Note [The tcType invariant] 7f4dd88 Note [Ordering of implicit variables] 9768c94 Remove bad debugging output. 81d8b17 Add test for Trac #15352 e24da5e Better Note [The well-kinded type invariant] 1c35362 Use IfaceAppArgs to store an IfaceAppTy's arguments 3efd7cd Minor refactoring in CmmUtils.mkLiveness 5ee9a1c Correct Simple to Complex wording 00cb530 Adding missing 'no' 7527d1f Attempt to fix travis build 6a1e7e7 Link to iterate' doesn't work. 8bccefc Register 'haddockHTMLs' for inplace builds 8e51ece Bump xhtml submodule to 3000.2.2.1 471a992 Trac #8581 users_guide/glasgow_exts section 10.7 19e1e6b The Types section in Core-Spec doc is out-dated 7c207c8 Fix gcdExtInteger (trac#15350) 101e904 Make boot work if ACLOCAL_PATH is not set c4d9834 Add flag to show docs of valid hole fits 234093c Fix handling of ApplicativeDo in TH AST quotes 0f79b0e Fix handling of unbound constructor names in TH #14627 2b1adaa Export findImportUsage and ImportDeclUsage f282f02 docs: remove leftovers of static flags 305da44 Release notes about source plugins 1a79270 Run the renamed source plugin after each HsGroup 7fc418d Fix deadlock between STM and throwTo 3ee7ca1 Update submodule 2625f13 Fix processHeapClosureForDead CONSTR_NOCAF case b56926d Refactor floatEqualities slightly 56b9e47 Improve comments about CUSKs e40eb73 submodule update 2928b92 Comments only cbd4b33 Bump haskeline submodule to 0.7.4.3 c67cf9e Bump mtl submodule to v2.2.2 b794c7e Bump directory submodule to v1.3.3.0 c3328ff Bump unix submodule 0905fec Remove random submodule 502640c Optimise wakeups for STM a754a42 Remove ASSERTion about increasing TcLevels b7d6002 Make some tests robust against DEBUG compiler fe0fa63 Move check for dcUserTyVarBinders invariant 15ce9b4 Don't mkNakedCastTy on something unsaturated 6d55e36 Disable -fghci-leak-check in DEBUG mode 8a70ccb Reclassify some performance tests af9b744 Replace atomicModifyMutVar# 9269541 TTG typo: XFieldOcc should be XCFieldOcc 8b6a9e5 Fix parse errors in core-spec.pdf 71f6b18 Fix space leaks 0d6ef6d #15387 Fix setting testsuite verbose to zero 8ec4899 driver: skip -Bsymbolic on unregisterised targets (Trac #15338) beba89a aclocal.m4: allow riscv and riscv64 CPU 7fe4993 Modernize S_TPush in the core spec 65c186f Do not imply NoStarIsType by TypeOperators/TypeInType 5de8e26 Fix example in `asum` docs 28199a2 Fix hash in haddock of ghc-prim. c4b8e71 Fixed "Memory Model" example. 3bdf0d0 Support the GHCi debugger with -fexternal-interpreter 5364994 split-obj: disable split-objects on Windows. 973ff4a Fix a typo in related trac ticket number 5e63a25 aclocal.m4: narrow down 'riscv*' to 'riscv-*' and 'riscv32*' ab0c238 Fix a typo 2c38a6e Fix spelling errors 1f924cb Correct spelling errors 932300b Fix some typos in docs b290f15 testsuite: force plugin tests sequentially on Windows. d0bbe1b stack: fix stack allocations on Windows e175aaf fix osReserveHeapMemory block alignment 176abdf Small spelling fixes for Unify.hs 99f45e2 Fix #15423 by using pprAStmtContext f64f06b Avoid redundant invocation of 'findTopDir' b202e7a Fix the TcLevel not being set correctly when finding valid hole fits 5a49651 Harden fixST 4ea9311 Fix the GHCi debugger with ApplicativeDo f629442 Fix a major copy'n'paste error in LLVM CodeGen 3aa09cc Fix pretty-printing of data declarations in splices fd1cf1f Disable T10962 on llvm for now a606750 fixup! Disable T10962 on llvm for now af62407 Fix some casts. f0d27f5 Stop marking soluble ~R# constraints as insoluble e1b5a11 Fix a nasty bug in piResultTys 44a7b9b Suppress -Winaccessible-code in derived code 47561c9 Remove dead code in TcUnify 0dc86f6 Clone relevant constraints to avoid side-effects on HoleDests. Fixes #15370. 6c19112 Build more implications 12c0f03 Set GenSigCtxt for the argument part of tcSubType f7d3054 Improve error message on un-satisfied import c5d31df Treat isConstraintKind more consistently 857ef25 Fix and document cloneWC a434bcb tc-tracing only 0f5a63e Comments only 9897f67 Fix PrelRules.caseRules to account for out-of-range tags 4c571f3 Comments only f265008 Refactor (~) to reduce the suerpclass stack 45cfe65 Small refactor in desugar of pattern matching 890f646 Bump haddock submodule 7a3e1b2 rts: Flush eventlog in hs_init_ghc (fixes #15440) 25e1ea9 Make :doc work for the ghc library 13d40ff Add a script for running a ghci that can load and run ghc 774f366 Fail instead of panic-ing when qAddTopDecls has conversion error 3c311e5 Run StgCse after unarise, fixes #15300 e431d75 Fix gcCAFs() 3581212 Add an expect_broken test for #14185 e5f3de2 update core-spec for GRefl and re-factored Refl 60ecf43 Modifications to support loading GHC into GHCi ccdc032 rts: More forceful cc debugging flags 40e9ec9 Disable GNUC_ATTR_HOT when compiling with DEBUG d7cb1bb Fix endian issues in ghc-heap 2cb08d7 Remove dead code in testsuite driver 754c3a5 Fix Ar crashing on odd-sized object files (Trac #15396) 3539561 Fix Git commit ID detection in Git worktrees 11de438 Fix #15453: bug in ForAllCo case in opt_trans_rule 9d388eb Fix #15385 by using addDictsDs in matchGuards a7c8acd GHC doesn't handle ./ prefixed paths correctly (#12674) c626246 Bump terminfo submodule to 0.4.1.2 a698bbf Fix minor formatting issue in users_guide/bugs.rst 56590db base: Make Foreign.Marshal.Alloc.allocBytes[Aligned] NOINLINE 2110738 Don't inline functions with RULES too early 3a06561 Add the paper "Evidence normalisation in System FC" 80b8540 rts: Disable -fkeep-inline-functions due to lack of support on Clang 123aeb9 Enable two-step allocator on FreeBSD cb8efe7 doc: Fix command for creating a shared library. 6d2a9ec Bump Cabal submodule f8e5da9 testsuite: Add test for #14346 0e34a9f users-guide: Document default +RTS -I value 5e103a1 base: Fix documentation of System.Environment.Blank 9bd4864 rts: Fix unused function 1df50a0 Revert "Don't inline functions with RULES too early" f8618a9 Remove the type-checking knot. 52065e9 Plugin dependency information is stored separately b803c40 linker: Nub rpaths 7f3cb50 Fix #15450 by refactoring checkEmptyCase' 120cc9f Fix #15415 and simplify tcWildCardBinders c50574a Remove obsolete file c955a51 Remove decideKindGeneralisationPlan 653dc5f Bump Cabal submodule 8d04822 Bump binary submodule 7535fd6 Bump filepath submodule 8801642 testsuite: Bump T3064 expected allocations 47e54a0 Bump hadrian submodule 73683f1 Refactor printMinimalImports (#15439) 0095cde Fix typos f355b72 circleci: Don't build validate-x86_64-linux-debug unregisterised 4d91cab Allow scoped type variables refer to types d7bc05e Create 8.8.1 release notes b14040d Move 8.8.1-notes.rst to the right directory f811685 Mention #15050 in the release notes for 8.8.1 e94cc29 Use -fobject-code in the GHCi script for loading GHC 29dfb63 Strip ../ from testdir (fixes #15469) 36a4c19 Testsuite driver: fix encoding issue when calling ghc-pkg 4fc6524 Stop the linker panic ff06176 Improve error message for flags with missing required arguments (#12625) c6cc93b rts: Ensure that the_gc_thread is aligned 8b357c6 Add since annotation to GHC.ByteOrder ce9b459 docs: Fix wrong module name in hsig example 672f177 Unhide GHC.List for haddock 24b76d1 [docs] Add missed specialisations warnings to list of those not enabled by -Wall e28bb01 fix timeout related i686 validation issues 7d77198 Support typechecking of type literals in backpack 2604d9b Bump binary submodule to 0.8.6.0 f22baa4 users-guide: Enlarge title underlines in 8.8 release notes aab8656 Turn on MonadFail desugaring by default e5b128c Bump Cabal submodule 5487f30 testsuite: Add (broken) test for #15473 e2db2d5 Yet another Cabal submodule bump 4d6dfc3 Allow arbitrary options to be passed to tar compression e2b5c54 Revert "rts: Ensure that the_gc_thread is aligned" 9f93714 circleci: Fix documentation building 5be646f circleci: Reduce build verbosity 60e12f2 circleci: Reduce compression effort to 3 396aac4 Add FreeBSD amd64 LLVM target ce47a9c base: improve Functor documentation 342f27f Bump unix submodule b44e747 testsuite: Bump for unix 2.7 b324c56 Filter plugin dylib locations f27d714 Simplify testsuite driver 97596a4 Simplify testsuite driver, part 2 ec49b42 CSE should deal with letrec 193eeee use *test instead of *slowtest for llvm validation on Circle CI d42eef3 --show-iface: Qualify all non-local names f7f9820 Check if files are same in combineSrcSpans c552fee Suppress redundant givens during error reporting bd48a88 Bump parsec submodule 32008a9 Properly designate LambdaCase alts as CaseAlt in TH 2908899 primops: Drop support for WORD_SIZE_IN_BITS < 32 9f932d8 Add a test for Trac #15523 1e741fe Cosmetics in GraphColor 7a63f75 primops: Drop documentation for WORD_SIZE_IN_BITS < 32 5238f20 Fix #15527 by pretty-printing an RdrName prefixly a50244c Rename SigTv to TyVarTv (#15480) 23f6f31 Document default value of +RTS -N in user's guide 63b6a1d Be mindful of GADT tyvar order when desugaring record updates ae68f32 base: rewrite Monoid module docs 2748e95 base: Rewrite semigroup documentation 8154faf Make ghci work for stage1 and Hadrian 1bbb5fa Add comment explaining change in syntax error suggestion for #12146. 8f4df7f Add test cases for Ticket #12146. a08b285 CSE should deal with letrec (#9441) ecc0ddf Initialise cec_suppress properly d04a152 Update .mailmap [skip ci] 2671ec5 Bump stm submodule 9c4e6c6 Expose the StableName constructor ce6ce78 Set strictness correctly for JoinIds 18c302c Improve ambiguous-occurrence error message 828e949 Comments only 43b08cf Add a solveEqualities to tcClassDecl1 1cc9061 driver: unconditionally disable relaxation when linking partially 966aa78 Fix redundant imports of Class 02518f9 Fix #line pragmas in nested comments 09c1d5a Replace most occurences of foldl with foldl'. 23774c9 function-section: enable on windows ebcbfba Introduce flag -keep-hscpp-files 8a05836 Simplify callSiteInline a little 92db10b testsuite: Deduplicate source in wcompat-warnings test c971e11 Explicitly tell 'getNameToInstances' mods to load 2bacf6f rts/RetainerProfile: Dump closure type if pop() fails 1481762 base: Mark `findIndices` as INLINABLE instead of INLINE (fixes #15426) ddffa0c Fix ambiguous/out-of-scope Haddock identifiers dcf27e6 Show -with-rtsopts options in runtime's --info (#15261) 68a1fc2 rts: Align the_gc_thread to 64 bytes 2693eb1 Properly tag fun field of PAPs generated by ap_0_fast c331592 Correct limb length and assertion for gcdExtInteger c6f4eb4 Fix precision of asinh/acosh/atanh by making them primops 8546afc docs: "state transformer" -> "state monad" / "ST" (whichever is meant) 21f0f56 Add traceBinaryEvent# primop ab55b4d Revert "Properly tag fun field of PAPs generated by ap_0_fast" 44ba665 Revert "driver: unconditionally disable relaxation when linking partially" db6f1d9 Turn infinite loop into a panic 8c7f90a Fix a typo in TcValidity.checkFamInstRhs 2a54209 Comments only 4293a80 Accommodate API change in transSuperClasses 8d72f87 TcSimplify: Condense MASSERT2() usage onto a single line edb4714 docs: Add changelog and release notes entry for traceBinaryEvent# 14d8838 Update unicode tables to v. 12 of the standard 184a569 Clean up TcHsSyn.zonkEnv 1cca442 Comments only 4b79329 Add comments about pretty-printing via IfaceSyn ff29fc8 Better error reporting for inaccessible code c523525 ghc, ghc-pkg: use getExecutablePath on Windows when base >= 4.11.0 5e6cf2a Fix #15550 by quoting RULE names during TH conversion 7a3cda5 Fix #15502 by not casting to Int during TH conversion 744b034 Take strict fields into account in coverage checking 6e765ae Don't reify redundant class method tyvars/contexts 2d953a6 Fix #10859 by using foldr1 while deriving Eq instances b1f5d2f Bump nofib submodule 154d4e2 Remove dph, vector, primitive and random from .gitmodules 2cf98e2 rts: Handle SMALL_MUT_ARR_PTRS in retainer profilter c18b525 Remove dead code for commandline parsing c46a5f2 Fix #15572 by checking for promoted names in ConT 34b8e61 Fix typo in 8.6.1 notes 102284e Rename kind vars in left-to-right order in bindHsQTyVars 36c1431 Fixed typo in exponent example 65eec9c Fix a constant folding rule f48e276 Finish stable split 97826e3 Fix the __GLASGOW_HASKELL__ comparison 12e6e19 A few typos [ci skip] 140563f fix -ddump-asm description 5d3eb64 Minor improvements to comments [skip ci] 5851885 Comments only fda2ea5 Commets on flatten_args_tc 565ef4c Remove knot-tying bug in TcHsSyn.zonkTyVarOcc 6dea7c1 Reject class instances with type families in kinds ed78951 make iToBase62's inner loop stricter in one of its arguments 2e226a4 canCFunEqCan: use isTcReflexiveCo (not isTcReflCo) d1514e8 Remove duplicate "since" field in glasgow_exts.rst fa3143c Fix typos in -Wsimplifiable-class-constraints flag docs df363a6 Compiler panic on invalid syntax (unterminated pragma) a3a1a17 Add a test for Trac #15586 2254912 testsuite: make CHECK_API_ANNOTATIONS and CHECK_PPR overridable 24d610a Fix tests ghci057 and T9293. (#15071) c0e5087 Skip eventlog tests in GHCi way 49d50b2 testsuite: Add test for #15368 a811d93 base: Add references to Notes for certain special imports ecde954 testsuite: Use bools for booleans, not ints e29ac2d Expose 'moduleToPkgConfAll' from 'PackageState' 1152a3b Define activeAfterInitial, activeDuringFinal 3addf72 Preserve specialisations despite CSE 16bc7ae Remove an incorrect assertion in threadPaused: c6fbac6 Fix a race between GC threads in concurrent scavenging d9a26c7 Various RTS bug fixes: 4caad16 Documentation tweaks 9400a5c ghc: Remove warning of StaticPointers not being supported by GHCi 2b6694a users-guide: Disable syntax highlighting 62cd440 Refactor Foreign.Marshal modules for more modern style 510c5f4 Avoid creating unevaluated Int thunks when iterating in GHC.Foreign 3cc3edf Update UnsafeReenter test d36b1ff Build debugged prof runtimes 36740b4 Revert incorrect STM wakeup optimisation 5d67d06 rts.cabal.in: advertise new default profiling ways for hadrian 03b779f Make CoreMonad independent of TcEnv (#14391) ce23451 Refactor info table entry error messages 0e6d42f Be a bit more aggressive about let-to-case 7ab8007 Revert "ghc: Remove warning of StaticPointers not being supported by GHCi" 5c48c41 template-haskell: Fix typo in changelog 900c47f rts/Printer.c: always define the findPtr symbol b9b1f99 Honor INLINE on 0-arity bindings (#15578) 1ad3c82 Typo in user guide wrongly claims DeriveLift was added in 7.2 0c07208 Comments about join-point return types 6bf11e6 Delete duplicated comment line 291b0f8 Comments only (on IfDataInstance) bd76875 Allow (~) in the head of a quantified constraints 0d4f394 Add regression test for Trac #15629 02edb8f More info for Implication with -dppr-debug 8533428 Remove dead variable binding 9912cdf Fix build 5f5898a eventlog: Factor out eventlog header generation into separate function e71e341 base: showEFloat: Handle negative precisions the same of zero precision ce240b3 Update hsc2hs submodule 9c6b749 Add support for ImplicitParams and RecursiveDo in TH 3040444 tests: increase (compile) timeout multiplier for T13701 and MultiLayerModules ecbe26b Fix T15502 on 32-bit 64c54ff Mark system and internal symbols as private symbols in asm c23f057 Mark code related symbols as @function not @object ea5ade3 Coercion Quantification a3bce95 Correct submodule update for haddock c6bff52 Fix for #13862: Optional "-v" not allowed with :load in GHCi d1c2f29 Stable name comment wibbles 88130db base: Add bangs to GHC.IO.Handle.Text hGet* functions 43967c0 users-guide: Fix code-block layout for QuantifiedConstraints e655aac Make sure forM_ and related functions fuse cleanly 5840734 Updated PE linker, section alignment and cleanup. 4edc6d6 Users guide: EmptyDataDecls on by default 01f7cd7 NoImplicitPrelude in ghc-boot-th, ghc-boot, ghc-heap, ghci ce3897f Fix check whether GCC supports __atomic_ builtins 6bb9bc7 Invert FP conditions to eliminate the explicit NaN check. e40b388 Bump stm submodule 989dca6 Bump text submodule 2b763b5 Bump deepseq submodule 1971e99 Don't shortcut SRTs for static functions (#15544) a4ae97e docs: fix example code 45befe2 Use predefined known-key names when possible 077b92f Remove -Waggregate-return when building RTS 4e3f6a0 users guide: Fix a few issues ba086ca Add testcase for #14251 d7fa869 Revert "adds -latomic to. ghc-prim" 4eebc80 users-guide: Fix build with sphinx 1.8 8c7d33a users_guide: fix sphinx error caused by non-explicit override a257782 user-guide: Allow build with sphinx < 1.8 66c1729 Fix slop zeroing for AP_STACK eager blackholes in debug build 29f1c55 Remove redundant slop zeroing d0d7484 testsuite: Don't force run of llvm ways in T14251 73d9cad testsuite: Mark readFail032 and readFail048 as broken on Darwin 3e5b8e3 testsuite: Fix readFail048 and readFail032 brokenness declarations fd89bb4 testsuite: Bump expected allocations of T9675 78beade testsuite: Bump expected allocations for T12707 7e77f41 testsuite: Bump T9630 expected allocations cad5d0b Buglet in reporting out of scope errors in rules 4bde71d Don't look up unnecessary return in LastStmt ab44ff8 Comments only 2dbf88b Fix get getIdFromTrivialExpr e68b439 Add a recursivity check in nonVoid 84c2ad9 update to current master again From git at git.haskell.org Tue Sep 25 12:02:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 25 Sep 2018 12:02:13 +0000 (UTC) Subject: [commit: ghc] master: aclocal.m4: fix shell comment syntax: '#', not '$' (a38eaa6) Message-ID: <20180925120213.CF92E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a38eaa66af711abd22a72774ae0f4cf95b2bff7a/ghc >--------------------------------------------------------------- commit a38eaa66af711abd22a72774ae0f4cf95b2bff7a Author: Sergei Trofimovich Date: Tue Sep 25 11:57:35 2018 +0200 aclocal.m4: fix shell comment syntax: '#', not '$' Summary: Reported-by: Evan Laforge Signed-off-by: Sergei Trofimovich Reviewers: bgamari Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5171 >--------------------------------------------------------------- a38eaa66af711abd22a72774ae0f4cf95b2bff7a aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index e2804cf..15b9f35 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2435,7 +2435,7 @@ AC_DEFUN([FIND_LD],[ # Fallback AC_CHECK_TARGET_TOOL([LD], [ld]) # This isn't entirely safe since $LD may have been discovered to be - $ ld.gold, but what else can we do? + # ld.gold, but what else can we do? if test "x$LD_NO_GOLD" = "x"; then LD_NO_GOLD=$LD; fi } From git at git.haskell.org Tue Sep 25 12:02:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 25 Sep 2018 12:02:17 +0000 (UTC) Subject: [commit: ghc] master: Don't show constraint tuples in errors (#14907) (9bfbc4e) Message-ID: <20180925120217.777753A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9bfbc4e16d511678cffa9f7f76b369c8cfca7a66/ghc >--------------------------------------------------------------- commit 9bfbc4e16d511678cffa9f7f76b369c8cfca7a66 Author: Alec Theriault Date: Tue Sep 25 11:58:12 2018 +0200 Don't show constraint tuples in errors (#14907) Summary: This means that 'GHC.Classes.(%,%)' is no longer mentioned in error messages for things like class (a,b,c) -- outside of 'GHC.Classes' class (a,Bool) Test Plan: make TEST=T14907a && make TEST=T14907b Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #14907 Differential Revision: https://phabricator.haskell.org/D5172 >--------------------------------------------------------------- 9bfbc4e16d511678cffa9f7f76b369c8cfca7a66 compiler/parser/RdrHsSyn.hs | 22 +++++++++++++++++++--- compiler/prelude/TysWiredIn.hs | 14 ++++++++++++++ compiler/rename/RnEnv.hs | 4 ++-- testsuite/tests/rename/should_fail/T14907a.hs | 3 +++ testsuite/tests/rename/should_fail/T14907a.stderr | 6 ++++++ testsuite/tests/rename/should_fail/T14907b.hs | 7 +++++++ testsuite/tests/rename/should_fail/T14907b.stderr | 6 ++++++ testsuite/tests/rename/should_fail/all.T | 2 ++ 8 files changed, 59 insertions(+), 5 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 5784b9e..e4f74d6 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -25,6 +25,7 @@ module RdrHsSyn ( mkTyClD, mkInstD, mkRdrRecordCon, mkRdrRecordUpd, setRdrNameSpace, + filterCTuple, cvBindGroup, cvBindsAndSigs, @@ -91,7 +92,8 @@ import Lexeme ( isLexCon ) import Type ( TyThing(..) ) import TysWiredIn ( cTupleTyConName, tupleTyCon, tupleDataCon, nilDataConName, nilDataConKey, - listTyConName, listTyConKey, eqTyCon_RDR ) + listTyConName, listTyConKey, eqTyCon_RDR, + tupleTyConName, cTupleTyConNameArity_maybe ) import ForeignCall import PrelNames ( forall_tv_RDR, allNameStrings ) import SrcLoc @@ -765,6 +767,13 @@ data_con_ty_con dc | otherwise -- See Note [setRdrNameSpace for wired-in names] = Unqual (setOccNameSpace tcClsName (getOccName dc)) +-- | Replaces constraint tuple names with corresponding boxed ones. +filterCTuple :: RdrName -> RdrName +filterCTuple (Exact n) + | Just arity <- cTupleTyConNameArity_maybe n + = Exact $ tupleTyConName BoxedTuple arity +filterCTuple rdr = rdr + {- Note [setRdrNameSpace for wired-in names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -809,12 +818,19 @@ checkTyVars pp_what equals_or_where tc tparms chk t@(L loc _) = Left (loc, vcat [ text "Unexpected type" <+> quotes (ppr t) - , text "In the" <+> pp_what <+> ptext (sLit "declaration for") <+> quotes (ppr tc) + , text "In the" <+> pp_what <+> ptext (sLit "declaration for") <+> quotes tc' , vcat[ (text "A" <+> pp_what <+> ptext (sLit "declaration should have form")) - , nest 2 (pp_what <+> ppr tc + , nest 2 (pp_what <+> tc' <+> hsep (map text (takeList tparms allNameStrings)) <+> equals_or_where) ] ]) + -- Avoid printing a constraint tuple in the error message. Print + -- a plain old tuple instead (since that's what the user probably + -- wrote). See #14907 + tc' = ppr $ fmap filterCTuple tc + + + whereDots, equalsDots :: SDoc -- Second argument to checkTyVars whereDots = text "where ..." diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index 1d47185..6e64d73 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -80,6 +80,7 @@ module TysWiredIn ( -- ** Constraint tuples cTupleTyConName, cTupleTyConNames, isCTupleTyConName, + cTupleTyConNameArity_maybe, cTupleDataConName, cTupleDataConNames, -- * Any @@ -160,6 +161,8 @@ import BooleanFormula ( mkAnd ) import qualified Data.ByteString.Char8 as BS +import Data.List ( elemIndex ) + alpha_tyvar :: [TyVar] alpha_tyvar = [alphaTyVar] @@ -777,6 +780,17 @@ isCTupleTyConName n nameModule n == gHC_CLASSES && n `elemNameSet` cTupleTyConNameSet +-- | If the given name is that of a constraint tuple, return its arity. +-- Note that this is inefficient. +cTupleTyConNameArity_maybe :: Name -> Maybe Arity +cTupleTyConNameArity_maybe n + | not (isCTupleTyConName n) = Nothing + | otherwise = fmap adjustArity (n `elemIndex` cTupleTyConNames) + where + -- Since `cTupleTyConNames` jumps straight from the `0` to the `2` + -- case, we have to adjust accordingly our calculated arity. + adjustArity a = if a > 0 then a + 1 else a + cTupleDataConName :: Arity -> Name cTupleDataConName arity = mkExternalName (mkCTupleDataConUnique arity) gHC_CLASSES diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 16897c2..516c43c 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -53,7 +53,7 @@ import RdrName import HscTypes import TcEnv import TcRnMonad -import RdrHsSyn ( setRdrNameSpace ) +import RdrHsSyn ( filterCTuple, setRdrNameSpace ) import TysWiredIn import Name import NameSet @@ -1653,4 +1653,4 @@ badOrigBinding name -- -- (See Trac #13968.) where - occ = rdrNameOcc name + occ = rdrNameOcc $ filterCTuple name diff --git a/testsuite/tests/rename/should_fail/T14907a.hs b/testsuite/tests/rename/should_fail/T14907a.hs new file mode 100644 index 0000000..d68e706 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907a.hs @@ -0,0 +1,3 @@ +module T14907a where + +class (Bool, a, b) diff --git a/testsuite/tests/rename/should_fail/T14907a.stderr b/testsuite/tests/rename/should_fail/T14907a.stderr new file mode 100644 index 0000000..26ce914 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907a.stderr @@ -0,0 +1,6 @@ + +T14907a.hs:3:8: error: + Unexpected type ‘Bool’ + In the class declaration for ‘(,,)’ + A class declaration should have form + class (,,) a b c where ... diff --git a/testsuite/tests/rename/should_fail/T14907b.hs b/testsuite/tests/rename/should_fail/T14907b.hs new file mode 100644 index 0000000..4cd4f28 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907b.hs @@ -0,0 +1,7 @@ +module T14907b where + +-- This is effectively trying to redefine the constraint tuples already +-- defined in 'GHC.Classes'. +class () +class (a,b) +class (a,b,c) diff --git a/testsuite/tests/rename/should_fail/T14907b.stderr b/testsuite/tests/rename/should_fail/T14907b.stderr new file mode 100644 index 0000000..b76cc11 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14907b.stderr @@ -0,0 +1,6 @@ + +T14907b.hs:5:1: error: Illegal binding of built-in syntax: () + +T14907b.hs:6:1: error: Illegal binding of built-in syntax: (,) + +T14907b.hs:7:1: error: Illegal binding of built-in syntax: (,,) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 182dc42..db0db47 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -131,6 +131,8 @@ test('T13947', normal, compile_fail, ['']) test('T13847', normal, multimod_compile_fail, ['T13847','-v0']) test('T14307', normal, compile_fail, ['']) test('T14591', normal, compile_fail, ['']) +test('T14907a', normal, compile_fail, ['']) +test('T14907b', normal, compile_fail, ['']) test('T15214', normal, compile_fail, ['']) test('T15539', normal, compile_fail, ['']) test('T15487', normal, multimod_compile_fail, ['T15487','-v0']) From git at git.haskell.org Tue Sep 25 12:40:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 25 Sep 2018 12:40:42 +0000 (UTC) Subject: [commit: ghc] master: Add regression test for #15666 (2a9cead) Message-ID: <20180925124042.6DE6A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2a9ceadfa07e2298ce934c6d304a3ba1f529ad93/ghc >--------------------------------------------------------------- commit 2a9ceadfa07e2298ce934c6d304a3ba1f529ad93 Author: Ryan Scott Date: Tue Sep 25 08:33:06 2018 -0400 Add regression test for #15666 Commit 59f38587d44efd00b10a6d98f6a7a1b22e87f13a ended up fixing #15666. Let's add a regression test to ensure that it stays fixed. >--------------------------------------------------------------- 2a9ceadfa07e2298ce934c6d304a3ba1f529ad93 testsuite/tests/dependent/should_compile/T15666.hs | 29 ++++++++++++++++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + 2 files changed, 30 insertions(+) diff --git a/testsuite/tests/dependent/should_compile/T15666.hs b/testsuite/tests/dependent/should_compile/T15666.hs new file mode 100644 index 0000000..022c3a0 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T15666.hs @@ -0,0 +1,29 @@ +{-# LANGUAGE + NoImplicitPrelude, + TypeInType, PolyKinds, DataKinds, + ScopedTypeVariables, + TypeFamilies, + UndecidableInstances +#-} + +module T15666 where + +import Data.Kind(Type) + +data PolyType k (t :: k) + +type Wrap (t :: k) = PolyType k t +type Unwrap pt = (GetType pt :: GetKind pt) + +type family GetKind (pt :: Type) :: Type where + GetKind (PolyType k t) = k + +type family GetType (pt :: Type) :: k where + GetType (PolyType k t) = t + +data Composite :: a -> b -> Type + +type family RecursiveWrap expr where + RecursiveWrap (Composite a b) = + Wrap (Composite (Unwrap (RecursiveWrap a)) (Unwrap (RecursiveWrap b))) + RecursiveWrap x = Wrap x diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 418fba2..5f6e901 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -54,3 +54,4 @@ test('DkNameRes', normal, compile, ['']) test('T15346', normal, compile, ['']) test('T15419', normal, compile, ['']) test('T14066h', normal, compile, ['']) +test('T15666', normal, compile, ['']) From git at git.haskell.org Wed Sep 26 03:42:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 26 Sep 2018 03:42:16 +0000 (UTC) Subject: [commit: ghc] master: Expand the Note on let-bound skolems (a744134) Message-ID: <20180926034216.5FC663A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a74413479cf4bf84fcacf1c5f76da1c1610d208b/ghc >--------------------------------------------------------------- commit a74413479cf4bf84fcacf1c5f76da1c1610d208b Author: Simon Peyton Jones Date: Sun Sep 23 15:23:09 2018 +0100 Expand the Note on let-bound skolems >--------------------------------------------------------------- a74413479cf4bf84fcacf1c5f76da1c1610d208b compiler/typecheck/TcSMonad.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index db29f67..3e50569 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -2215,6 +2215,31 @@ For an example, see Trac #9211. See also TcUnify Note [Deeper level on the left] for how we ensure that the right variable is on the left of the equality when both are tyvars. + +You might wonder whether the skokem really needs to be bound "in the +very same implication" as the equuality constraint. +(c.f. Trac #15009) Consider this: + + data S a where + MkS :: (a ~ Int) => S a + + g :: forall a. S a -> a -> blah + g x y = let h = \z. ( z :: Int + , case x of + MkS -> [y,z]) + in ... + +From the type signature for `g`, we get `y::a` . Then when when we +encounter the `\z`, we'll assign `z :: alpha[1]`, say. Next, from the +body of the lambda we'll get + + [W] alpha[1] ~ Int -- From z::Int + [W] forall[2]. (a ~ Int) => [W] alpha[1] ~ a -- From [y,z] + +Now, suppose we decide to float `alpha ~ a` out of the implication +and then unify `alpha := a`. Now we are stuck! But if treat +`alpha ~ Int` first, and unify `alpha := Int`, all is fine. +But we absolutely cannot float that equality or we will get stuck. -} removeInertCts :: [Ct] -> InertCans -> InertCans From git at git.haskell.org Wed Sep 26 03:42:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 26 Sep 2018 03:42:19 +0000 (UTC) Subject: [commit: ghc] master: Fix Lint of unsaturated type families (4bdb10c) Message-ID: <20180926034219.C0D083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4bdb10ca7ba14f00dd62270eadab4f93238227bc/ghc >--------------------------------------------------------------- commit 4bdb10ca7ba14f00dd62270eadab4f93238227bc Author: Simon Peyton Jones Date: Tue Sep 25 15:19:22 2018 +0100 Fix Lint of unsaturated type families GHC allows types to have unsaturated type synonyms and type families, provided they /are/ saturated if you expand all type synonyms. TcValidity carefully checked this; see check_syn_tc_app. But Lint only did half the job, adn that led to Trac #15664. This patch just teaches Core Lint to be as clever as TcValidity. >--------------------------------------------------------------- 4bdb10ca7ba14f00dd62270eadab4f93238227bc compiler/coreSyn/CoreLint.hs | 50 +++++++++++----------- .../tests/indexed-types/should_compile/T15664.hs | 13 ++++++ testsuite/tests/indexed-types/should_compile/all.T | 1 + 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index 21edba1..f879a30 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -1324,9 +1324,9 @@ lintType ty@(AppTy t1 t2) ; lint_ty_app ty k1 [(t2,k2)] } lintType ty@(TyConApp tc tys) - | isTypeSynonymTyCon tc + | isTypeSynonymTyCon tc || isTypeFamilyTyCon tc = do { report_unsat <- lf_report_unsat_syns <$> getLintFlags - ; lintTySynApp report_unsat ty tc tys } + ; lintTySynFamApp report_unsat ty tc tys } | isFunTyCon tc , tys `lengthIs` 4 @@ -1336,13 +1336,9 @@ lintType ty@(TyConApp tc tys) -- Note [Representation of function types]. = failWithL (hang (text "Saturated application of (->)") 2 (ppr ty)) - | isTypeFamilyTyCon tc -- Check for unsaturated type family - , tys `lengthLessThan` tyConArity tc - = failWithL (hang (text "Un-saturated type application") 2 (ppr ty)) - - | otherwise + | otherwise -- Data types, data families, primitive types = do { checkTyCon tc - ; ks <- setReportUnsat True (mapM lintType tys) + ; ks <- mapM lintType tys ; lint_ty_app ty (tyConKind tc) (tys `zip` ks) } -- arrows can related *unlifted* kinds, so this has to be separate from @@ -1355,7 +1351,7 @@ lintType ty@(FunTy t1 t2) lintType t@(ForAllTy (Bndr tv _vis) ty) -- forall over types | isTyVar tv - = do { lintTyBndr tv $ \tv' -> + = lintTyBndr tv $ \tv' -> do { k <- lintType ty ; checkValueKind k (text "the body of forall:" <+> ppr t) ; case occCheckExpand [tv'] k of -- See Note [Stupid type synonyms] @@ -1363,7 +1359,7 @@ lintType t@(ForAllTy (Bndr tv _vis) ty) Nothing -> failWithL (hang (text "Variable escape in forall:") 2 (vcat [ text "type:" <+> ppr t , text "kind:" <+> ppr k ])) - }} + } lintType t@(ForAllTy (Bndr cv _vis) ty) -- forall over coercions @@ -1407,27 +1403,33 @@ with the same problem. A single systematic solution eludes me. -} ----------------- -lintTySynApp :: Bool -> Type -> TyCon -> [Type] -> LintM LintedKind +lintTySynFamApp :: Bool -> Type -> TyCon -> [Type] -> LintM LintedKind +-- The TyCon is a type synonym or a type family (not a data family) -- See Note [Linting type synonym applications] -lintTySynApp report_unsat ty tc tys +-- c.f. TcValidity.check_syn_tc_app +lintTySynFamApp report_unsat ty tc tys | report_unsat -- Report unsaturated only if report_unsat is on , tys `lengthLessThan` tyConArity tc = failWithL (hang (text "Un-saturated type application") 2 (ppr ty)) - | otherwise - = do { ks <- setReportUnsat False (mapM lintType tys) + -- Deal with type synonyms + | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys + , let expanded_ty = mkAppTys (substTy (mkTvSubstPrs tenv) rhs) tys' + = do { -- Kind-check the argument types, but without reporting + -- un-saturated type families/synonyms + ks <- setReportUnsat False (mapM lintType tys) ; when report_unsat $ - case expandSynTyCon_maybe tc tys of - Nothing -> pprPanic "lintTySynApp" (ppr tc <+> ppr tys) - -- Previous guards should have made this impossible - Just (tenv, rhs, tys') -> do { _ <- lintType expanded_ty - ; return () } - where - expanded_ty = mkAppTys (substTy (mkTvSubstPrs tenv) rhs) tys' + do { _ <- lintType expanded_ty + ; return () } ; lint_ty_app ty (tyConKind tc) (tys `zip` ks) } + -- Otherwise this must be a type family + | otherwise + = do { ks <- mapM lintType tys + ; lint_ty_app ty (tyConKind tc) (tys `zip` ks) } + ----------------- lintKind :: OutKind -> LintM () -- If you edit this function, you may need to update the GHC formalism @@ -2108,12 +2110,12 @@ Here we substitute 'ty' for 'a' in 'body', on the fly. Note [Linting type synonym applications] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When lining a type-synonym application +When linting a type-synonym, or type-family, application S ty1 .. tyn -we behave as follows (Trac #15057): +we behave as follows (Trac #15057, #T15664): * If lf_report_unsat_syns = True, and S has arity < n, - complain about an unsaturated type synonym. + complain about an unsaturated type synonym or type family * Switch off lf_report_unsat_syns, and lint ty1 .. tyn. diff --git a/testsuite/tests/indexed-types/should_compile/T15664.hs b/testsuite/tests/indexed-types/should_compile/T15664.hs new file mode 100644 index 0000000..9383ea0 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T15664.hs @@ -0,0 +1,13 @@ +{-# Language RankNTypes, TypeOperators, DataKinds, PolyKinds, GADTs, TypeInType, TypeFamilies #-} + +module T15664 where + +import Data.Kind + +type family Apply (kind) (f :: kind) :: Type +data ApplyT(kind) :: kind -> Type + +type f ~> g = (forall xx. f xx -> g xx) + +unravel :: ApplyT(k) ~> Apply(k) +unravel = unravel diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index 11b7bcb..5bfbca4 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -290,3 +290,4 @@ test('T15322', normal, compile, ['']) test('T15322a', normal, compile_fail, ['']) test('T15142', normal, compile, ['']) test('T15352', normal, compile, ['']) +test('T15664', normal, compile, ['']) From git at git.haskell.org Wed Sep 26 03:42:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 26 Sep 2018 03:42:23 +0000 (UTC) Subject: [commit: ghc] master: Fix constant-folding for Integer shifts (d25fa45) Message-ID: <20180926034223.2F2503A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d25fa45e377253cfbe26e410075dda9d58bb869c/ghc >--------------------------------------------------------------- commit d25fa45e377253cfbe26e410075dda9d58bb869c Author: Simon Peyton Jones Date: Wed Sep 26 04:29:19 2018 +0100 Fix constant-folding for Integer shifts In this patch commit 869f69fd4a78371c221e6d9abd69a71440a4679a Author: Simon Peyton Jones Date: Wed Dec 11 18:19:34 2013 +0000 Guarding against silly shifts we deal with silly shifts like (Sll 1 9223372036854775807). But I only dealt with primops that Int# and Word#. Alas, the same problem affects shifts of Integer, as Trac #15673 showed. Fortunately, the problem is easy to fix. >--------------------------------------------------------------- d25fa45e377253cfbe26e410075dda9d58bb869c compiler/prelude/PrelRules.hs | 46 +++++++++++++++++----- testsuite/tests/simplCore/should_compile/T15673.hs | 6 +++ testsuite/tests/simplCore/should_compile/all.T | 1 + 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 80cfa20..e944900 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -463,7 +463,10 @@ wordOpC2 op dflags (LitNumber LitNumWord w1 _) (LitNumber LitNumWord w2 _) = wordOpC2 _ _ _ _ = Nothing -- Could find LitLit shiftRule :: (DynFlags -> Integer -> Int -> Integer) -> RuleM CoreExpr - -- Shifts take an Int; hence third arg of op is Int +-- Shifts take an Int; hence third arg of op is Int +-- Used for shift primops +-- ISllOp, ISraOp, ISrlOp :: Word# -> Int# -> Word# +-- SllOp, SrlOp :: Word# -> Int# -> Word# -- See Note [Guarding against silly shifts] shiftRule shift_op = do { dflags <- getDynFlags @@ -690,7 +693,7 @@ Shift.$wgo = \ (w_sCS :: GHC.Prim.Int#) (w1_sCT :: [GHC.Types.Bool]) -> } } } } Note the massive shift on line "!!!!". It can't happen, because we've checked -that w < 64, but the optimiser didn't spot that. We DO NO want to constant-fold this! +that w < 64, but the optimiser didn't spot that. We DO NOT want to constant-fold this! Moreover, if the programmer writes (n `uncheckedShiftL` 9223372036854775807), we can't constant fold it, but if it gets to the assember we get Error: operand type mismatch for `shl' @@ -698,6 +701,25 @@ can't constant fold it, but if it gets to the assember we get So the best thing to do is to rewrite the shift with a call to error, when the second arg is stupid. +There are two cases: + +- Shifting fixed-width things: the primops ISll, Sll, etc + These are handled by shiftRule. + + We are happy to shift by any amount up to wordSize but no more. + +- Shifting Integers: the function shiftLInteger, shiftRInteger + from the 'integer' library. These are handled by rule_shift_op, + and match_Integer_shift_op. + + Here we could in principle shift by any amount, but we arbitary + limit the shift to 4 bits; in particualr we do not want shift by a + huge amount, which can happen in code like that above. + +The two cases are more different in their code paths that is comfortable, +but that is only a historical accident. + + ************************************************************************ * * \subsection{Vaguely generic functions} @@ -1215,8 +1237,8 @@ builtinIntegerRules = rule_binop "orInteger" orIntegerName (.|.), rule_binop "xorInteger" xorIntegerName xor, rule_unop "complementInteger" complementIntegerName complement, - rule_Int_binop "shiftLInteger" shiftLIntegerName shiftL, - rule_Int_binop "shiftRInteger" shiftRIntegerName shiftR, + rule_shift_op "shiftLInteger" shiftLIntegerName shiftL, + rule_shift_op "shiftRInteger" shiftRIntegerName shiftR, rule_bitInteger "bitInteger" bitIntegerName, -- See Note [Integer division constant folding] in libraries/base/GHC/Real.hs rule_divop_one "quotInteger" quotIntegerName quot, @@ -1266,9 +1288,9 @@ builtinIntegerRules = rule_divop_one str name op = BuiltinRule { ru_name = fsLit str, ru_fn = name, ru_nargs = 2, ru_try = match_Integer_divop_one op } - rule_Int_binop str name op + rule_shift_op str name op = BuiltinRule { ru_name = fsLit str, ru_fn = name, ru_nargs = 2, - ru_try = match_Integer_Int_binop op } + ru_try = match_Integer_shift_op op } rule_binop_Prim str name op = BuiltinRule { ru_name = fsLit str, ru_fn = name, ru_nargs = 2, ru_try = match_Integer_binop_Prim op } @@ -1569,12 +1591,18 @@ match_Integer_divop_one divop _ id_unf _ [xl,yl] = Just (Lit (mkLitInteger (x `divop` y) i)) match_Integer_divop_one _ _ _ _ _ = Nothing -match_Integer_Int_binop :: (Integer -> Int -> Integer) -> RuleFun -match_Integer_Int_binop binop _ id_unf _ [xl,yl] +match_Integer_shift_op :: (Integer -> Int -> Integer) -> RuleFun +-- Used for shiftLInteger, shiftRInteger :: Integer -> Int# -> Integer +-- See Note [Guarding against silly shifts] +match_Integer_shift_op binop _ id_unf _ [xl,yl] | Just (LitNumber LitNumInteger x i) <- exprIsLiteral_maybe id_unf xl , Just (LitNumber LitNumInt y _) <- exprIsLiteral_maybe id_unf yl + , y >= 0 + , y <= 4 -- Restrict constant-folding of shifts on Integers, somewhat + -- arbitrary. We can get huge shifts in inaccessible code + -- (Trac #15673) = Just (Lit (mkLitInteger (x `binop` fromIntegral y) i)) -match_Integer_Int_binop _ _ _ _ _ = Nothing +match_Integer_shift_op _ _ _ _ _ = Nothing match_Integer_binop_Prim :: (Integer -> Integer -> Bool) -> RuleFun match_Integer_binop_Prim binop dflags id_unf _ [xl, yl] diff --git a/testsuite/tests/simplCore/should_compile/T15673.hs b/testsuite/tests/simplCore/should_compile/T15673.hs new file mode 100644 index 0000000..30baa37 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T15673.hs @@ -0,0 +1,6 @@ +module T14573 where + +import Data.Bits (shift) + +badOne :: [Int] -> Integer -- replace Integer by Int and all is good! +badOne is = sum $ zipWith (\n _->shift 1 n) [0..] is diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index d572d04..391994e 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -326,3 +326,4 @@ test('T15631', normal, run_command, ['$MAKE -s --no-print-directory T15631']) +test('T15673', normal, compile, ['-O']) From git at git.haskell.org Thu Sep 27 05:40:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 27 Sep 2018 05:40:46 +0000 (UTC) Subject: [commit: ghc] master: users' guide: document -freverse-errors (1d7b61f) Message-ID: <20180927054046.B19FB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1d7b61f97f9ec3780a1b7b5bf95a880d56224f4f/ghc >--------------------------------------------------------------- commit 1d7b61f97f9ec3780a1b7b5bf95a880d56224f4f Author: quasicomputational Date: Wed Sep 26 10:57:38 2018 +0100 users' guide: document -freverse-errors >--------------------------------------------------------------- 1d7b61f97f9ec3780a1b7b5bf95a880d56224f4f docs/users_guide/using.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 9ec26f2..4373a4a 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -998,6 +998,16 @@ messages and in GHCi: start at zero. This choice was made to follow existing convention (i.e. this is how Emacs does it). +.. ghc-flag:: -freverse-errors + :shortdesc: Output errors in reverse order + :type: dynamic + :reverse: -fno-reverse-errors + :category: verbosity + + Causes GHC to output errors in reverse line-number order, so that + the errors and warnings that originate later in the file are + displayed first. + .. ghc-flag:: -H ⟨size⟩ :shortdesc: Set the minimum size of the heap to ⟨size⟩ :type: dynamic From git at git.haskell.org Thu Sep 27 15:53:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 27 Sep 2018 15:53:42 +0000 (UTC) Subject: [commit: ghc] master: Fix for recover with -fexternal-interpreter (#15418) (d00c308) Message-ID: <20180927155342.889F13ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d00c308633fe7d216d31a1087e00e63532d87d6d/ghc >--------------------------------------------------------------- commit d00c308633fe7d216d31a1087e00e63532d87d6d Author: Simon Marlow Date: Wed Sep 26 15:32:29 2018 -0500 Fix for recover with -fexternal-interpreter (#15418) Summary: When using -fexternal-interpreter, recover was not treating a Q compuation that simply registered an error with addErrTc as failing. Test Plan: New unit tests: * T15418 is the repro from in the ticket * TH_recover_warns is a new test to ensure that we're keeping warnings when the body of recover succeeds. Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd Subscribers: rwbarton, carter GHC Trac Issues: #15418 Differential Revision: https://phabricator.haskell.org/D5185 >--------------------------------------------------------------- d00c308633fe7d216d31a1087e00e63532d87d6d compiler/typecheck/TcSplice.hs | 28 +++++++++++++++++++--------- libraries/ghci/GHCi/Message.hs | 17 ++++++++++------- libraries/ghci/GHCi/TH.hs | 13 +++++++------ testsuite/tests/th/T15481.hs | 10 ++++++++++ testsuite/tests/th/T15481.stderr | 8 ++++++++ testsuite/tests/th/TH_recover_warns.hs | 10 ++++++++++ testsuite/tests/th/TH_recover_warns.stderr | 15 +++++++++++++++ testsuite/tests/th/all.T | 2 ++ 8 files changed, 81 insertions(+), 22 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d00c308633fe7d216d31a1087e00e63532d87d6d From git at git.haskell.org Fri Sep 28 00:04:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 00:04:58 +0000 (UTC) Subject: [commit: ghc] branch 'wip/kavon-llvm-improve' created Message-ID: <20180928000458.03F913ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/kavon-llvm-improve Referencing: 800ecdb5badd0968b8422b7ab23fa404fdc55ece From git at git.haskell.org Fri Sep 28 00:05:00 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 00:05:00 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: fix for #13904: LLVM trashing caller-save global vars (f67c3bc) Message-ID: <20180928000500.CC0463ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/f67c3bc3e53a507f5c645859680ea772afb3076b/ghc >--------------------------------------------------------------- commit f67c3bc3e53a507f5c645859680ea772afb3076b Author: Kavon Farvardin Date: Fri Jun 30 16:14:25 2017 +0100 fix for #13904: LLVM trashing caller-save global vars >--------------------------------------------------------------- f67c3bc3e53a507f5c645859680ea772afb3076b compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 40 ++------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 8179162..3a56b33 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -14,7 +14,7 @@ import LlvmCodeGen.Base import LlvmCodeGen.Regs import BlockId -import CodeGen.Platform ( activeStgRegs, callerSaves ) +import CodeGen.Platform ( activeStgRegs ) import CLabel import Cmm import PprCmm @@ -211,7 +211,6 @@ genCall t@(PrimTarget (MO_Prefetch_Data localityInt)) [] args fptr <- liftExprData $ getFunPtr funTy t argVars' <- castVarsW Signed $ zip argVars argTy - doTrashStmts let argSuffix = [mkIntLit i32 0, mkIntLit i32 localityInt, mkIntLit i32 1] statement $ Expr $ Call StdCall fptr (argVars' ++ argSuffix) [] | otherwise = panic $ "prefetch locality level integer must be between 0 and 3, given: " ++ (show localityInt) @@ -294,7 +293,6 @@ genCall t@(PrimTarget op) [] args fptr <- getFunPtrW funTy t argVars' <- castVarsW Signed $ zip argVars argTy - doTrashStmts let alignVal = mkIntLit i32 align arguments = argVars' ++ (alignVal:isVolVal) statement $ Expr $ Call StdCall fptr arguments [] @@ -449,7 +447,6 @@ genCall target res args = runStmtsDecls $ do | never_returns = statement $ Unreachable | otherwise = return () - doTrashStmts -- make the actual call case retTy of @@ -1786,12 +1783,9 @@ genLit _ CmmHighStackMark funPrologue :: LiveGlobalRegs -> [CmmBlock] -> LlvmM StmtData funPrologue live cmmBlocks = do - trash <- getTrashRegs let getAssignedRegs :: CmmNode O O -> [CmmReg] getAssignedRegs (CmmAssign reg _) = [reg] - -- Calls will trash all registers. Unfortunately, this needs them to - -- be stack-allocated in the first place. - getAssignedRegs (CmmUnsafeForeignCall _ rs _) = map CmmGlobal trash ++ map CmmLocal rs + getAssignedRegs (CmmUnsafeForeignCall _ rs _) = map CmmLocal rs getAssignedRegs _ = [] getRegsBlock (_, body, _) = concatMap getAssignedRegs $ blockToList body assignedRegs = nub $ concatMap (getRegsBlock . blockSplit) cmmBlocks @@ -1848,31 +1842,6 @@ funEpilogue live = do let (vars, stmts) = unzip loads return (catMaybes vars, concatOL stmts) - --- | A series of statements to trash all the STG registers. --- --- In LLVM we pass the STG registers around everywhere in function calls. --- So this means LLVM considers them live across the entire function, when --- in reality they usually aren't. For Caller save registers across C calls --- the saving and restoring of them is done by the Cmm code generator, --- using Cmm local vars. So to stop LLVM saving them as well (and saving --- all of them since it thinks they're always live, we trash them just --- before the call by assigning the 'undef' value to them. The ones we --- need are restored from the Cmm local var and the ones we don't need --- are fine to be trashed. -getTrashStmts :: LlvmM LlvmStatements -getTrashStmts = do - regs <- getTrashRegs - stmts <- flip mapM regs $ \ r -> do - reg <- getCmmReg (CmmGlobal r) - let ty = (pLower . getVarType) reg - return $ Store (LMLitVar $ LMUndefLit ty) reg - return $ toOL stmts - -getTrashRegs :: LlvmM [GlobalReg] -getTrashRegs = do plat <- getLlvmPlatform - return $ filter (callerSaves plat) (activeStgRegs plat) - -- | Get a function pointer to the CLabel specified. -- -- This is for Haskell functions, function type is assumed, so doesn't work @@ -1994,11 +1963,6 @@ getCmmRegW = lift . getCmmReg genLoadW :: Atomic -> CmmExpr -> CmmType -> WriterT LlvmAccum LlvmM LlvmVar genLoadW atomic e ty = liftExprData $ genLoad atomic e ty -doTrashStmts :: WriterT LlvmAccum LlvmM () -doTrashStmts = do - stmts <- lift getTrashStmts - tell $ LlvmAccum stmts mempty - -- | Return element of single-element list; 'panic' if list is not a single-element list singletonPanic :: String -> [a] -> a singletonPanic _ [x] = x From git at git.haskell.org Fri Sep 28 00:05:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 00:05:03 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: fix typo in fn attribute name (38a883b) Message-ID: <20180928000503.9E86E3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/38a883bbe1d3a6182c9c2a1cd8448d2cca8b78ab/ghc >--------------------------------------------------------------- commit 38a883bbe1d3a6182c9c2a1cd8448d2cca8b78ab Author: Kavon Farvardin Date: Thu Sep 27 17:47:47 2018 -0500 fix typo in fn attribute name >--------------------------------------------------------------- 38a883bbe1d3a6182c9c2a1cd8448d2cca8b78ab compiler/llvmGen/Llvm/Types.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs index bc7bbaa..a45004d 100644 --- a/compiler/llvmGen/Llvm/Types.hs +++ b/compiler/llvmGen/Llvm/Types.hs @@ -564,7 +564,7 @@ instance Outputable LlvmFuncAttr where ppr OptSize = text "optsize" ppr NoReturn = text "noreturn" ppr NoUnwind = text "nounwind" - ppr ReadNone = text "readnon" + ppr ReadNone = text "readnone" ppr ReadOnly = text "readonly" ppr Ssp = text "ssp" ppr SspReq = text "ssqreq" From git at git.haskell.org Fri Sep 28 00:05:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 00:05:06 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: proposed patch for T14251 (800ecdb) Message-ID: <20180928000506.6FCF73ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/800ecdb5badd0968b8422b7ab23fa404fdc55ece/ghc >--------------------------------------------------------------- commit 800ecdb5badd0968b8422b7ab23fa404fdc55ece Author: Kavon Farvardin Date: Thu Sep 27 18:56:17 2018 -0500 proposed patch for T14251 >--------------------------------------------------------------- 800ecdb5badd0968b8422b7ab23fa404fdc55ece compiler/llvmGen/LlvmCodeGen/Base.hs | 66 ++++++++++++++++++++++++++++----- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 15 +++++--- 2 files changed, 67 insertions(+), 14 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 6e20da4..0e3e1b9 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -26,7 +26,7 @@ module LlvmCodeGen.Base ( cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy, llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign, - llvmPtrBits, tysToParams, llvmFunSection, + llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, sortSSERegs, strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm, getGlobalPtr, generateExternDecls, @@ -58,6 +58,7 @@ import ErrUtils import qualified Stream import Control.Monad (ap) +import Data.List (sortBy) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -147,16 +148,63 @@ llvmFunSection dflags lbl -- | A Function's arguments llvmFunArgs :: DynFlags -> LiveGlobalRegs -> [LlvmVar] llvmFunArgs dflags live = - map (lmGlobalRegArg dflags) (filter isPassed (activeStgRegs platform)) + map (lmGlobalRegArg dflags) (filter isPassed allRegs) where platform = targetPlatform dflags - isLive r = not (isSSE r) || r `elem` alwaysLive || r `elem` live + allRegs = sortSSERegs $ activeStgRegs platform + paddedLive = map (\(_,r) -> r) $ padLiveArgs live + isLive r = not (isSSE r) || r `elem` alwaysLive || r `elem` paddedLive isPassed r = not (isSSE r) || isLive r - isSSE (FloatReg _) = True - isSSE (DoubleReg _) = True - isSSE (XmmReg _) = True - isSSE (YmmReg _) = True - isSSE (ZmmReg _) = True - isSSE _ = False + isSSE r + | Just _ <- sseRegNum r = True + | otherwise = False + + +sseRegNum :: GlobalReg -> Maybe Int +sseRegNum (FloatReg i) = Just i +sseRegNum (DoubleReg i) = Just i +sseRegNum (XmmReg i) = Just i +sseRegNum (YmmReg i) = Just i +sseRegNum (ZmmReg i) = Just i +sseRegNum _ = Nothing + +-- Only sorts regs that will end up in SSE registers +-- such that the ones which are assigned to the same +-- register will be adjacent in the list. Other elements +-- are not reordered. +sortSSERegs :: [GlobalReg] -> [GlobalReg] +sortSSERegs regs = sortBy sseOrd regs + where + sseOrd a b = case (sseRegNum a, sseRegNum b) of + (Just x, Just y) -> compare x y + _ -> EQ + +-- assumes that the live list is sorted by Ord GlobalReg's compare function. +-- the bool indicates whether the global reg was added as padding. +padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] +padLiveArgs live = reverse padded + where + (_, padded) = foldl assignSlots (1, []) $ sortSSERegs live + + assignSlots (i, acc) r + | Just k <- sseRegNum r + , i < k + = let -- add k-i slots of padding + diff = k-i + acc' = genPad i diff ++ (False, r) : acc + i' = i + diff + in + (i', acc') + + | otherwise = (i, (False, r):acc) + + genPad start n = + take n $ flip map (iterate (+1) start) (\i -> + (True, FloatReg i)) + -- FIXME: perhaps we should obtain the original type, + -- instead of just picking Float here? It should be fine + -- since this argument is not live anyways, + -- and Float aliases with all the other F/D regs. + -- | Llvm standard fun attributes llvmStdFunAttrs :: [LlvmFuncAttr] diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 3a56b33..9159493 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1815,8 +1815,10 @@ funPrologue live cmmBlocks = do funEpilogue :: LiveGlobalRegs -> LlvmM ([LlvmVar], LlvmStatements) funEpilogue live = do - -- Have information and liveness optimisation is enabled? - let liveRegs = alwaysLive ++ live + -- the bool indicates whether the register is padding. + let alwaysNeeded = map (\r -> (False, r)) alwaysLive + livePadded = alwaysNeeded ++ padLiveArgs live + isSSE (FloatReg _) = True isSSE (DoubleReg _) = True isSSE (XmmReg _) = True @@ -1834,9 +1836,12 @@ funEpilogue live = do let ty = (pLower . getVarType $ lmGlobalRegVar dflags r) return (Just $ LMLitVar $ LMUndefLit ty, nilOL) platform <- getDynFlag targetPlatform - loads <- flip mapM (activeStgRegs platform) $ \r -> case () of - _ | r `elem` liveRegs -> loadExpr r - | not (isSSE r) -> loadUndef r + let allRegs = sortSSERegs $ activeStgRegs platform + loads <- flip mapM allRegs $ \r -> case () of + _ | (False, r) `elem` livePadded + -> loadExpr r -- if r is not padding, load it + | not (isSSE r) || (True, r) `elem` livePadded + -> loadUndef r | otherwise -> return (Nothing, nilOL) let (vars, stmts) = unzip loads From git at git.haskell.org Fri Sep 28 15:02:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 15:02:53 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: fix issue in patch for T14251; missed an increment (0a4d1fe) Message-ID: <20180928150253.D9D933ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/0a4d1fefc53c87ee1dceab37568d6ed3587967a5/ghc >--------------------------------------------------------------- commit 0a4d1fefc53c87ee1dceab37568d6ed3587967a5 Author: Kavon Farvardin Date: Fri Sep 28 10:02:23 2018 -0500 fix issue in patch for T14251; missed an increment >--------------------------------------------------------------- 0a4d1fefc53c87ee1dceab37568d6ed3587967a5 compiler/llvmGen/LlvmCodeGen/Base.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 0e3e1b9..f80705e 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -152,7 +152,7 @@ llvmFunArgs dflags live = where platform = targetPlatform dflags allRegs = sortSSERegs $ activeStgRegs platform paddedLive = map (\(_,r) -> r) $ padLiveArgs live - isLive r = not (isSSE r) || r `elem` alwaysLive || r `elem` paddedLive + isLive r = r `elem` alwaysLive || r `elem` paddedLive isPassed r = not (isSSE r) || isLive r isSSE r | Just _ <- sseRegNum r = True @@ -181,29 +181,30 @@ sortSSERegs regs = sortBy sseOrd regs -- assumes that the live list is sorted by Ord GlobalReg's compare function. -- the bool indicates whether the global reg was added as padding. padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] -padLiveArgs live = reverse padded +padLiveArgs live = padded where (_, padded) = foldl assignSlots (1, []) $ sortSSERegs live assignSlots (i, acc) r | Just k <- sseRegNum r , i < k - = let -- add k-i slots of padding + = let -- add k-i slots of padding before the register diff = k-i + -- NOTE: order doesn't matter in acc, since it's like a set acc' = genPad i diff ++ (False, r) : acc i' = i + diff in (i', acc') - | otherwise = (i, (False, r):acc) + | otherwise = (i+1, (False, r):acc) genPad start n = take n $ flip map (iterate (+1) start) (\i -> (True, FloatReg i)) - -- FIXME: perhaps we should obtain the original type, - -- instead of just picking Float here? It should be fine - -- since this argument is not live anyways, - -- and Float aliases with all the other F/D regs. + -- NOTE: Picking float should be fine for the following reasons: + -- (1) Float aliases with all the other SSE register types on + -- the given platform. + -- (2) The argument is not live anyways. -- | Llvm standard fun attributes From git at git.haskell.org Fri Sep 28 15:19:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 15:19:03 +0000 (UTC) Subject: [commit: ghc] master: Normalise EmptyCase types using the constraint solver (e72d788) Message-ID: <20180928151903.BE3673ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e72d7880b940881d38b8c3db9a00d5d007b1458f/ghc >--------------------------------------------------------------- commit e72d7880b940881d38b8c3db9a00d5d007b1458f Author: Ryan Scott Date: Fri Sep 28 14:22:48 2018 +0200 Normalise EmptyCase types using the constraint solver Summary: Certain `EmptyCase` expressions were mistakently producing warnings since their types did not have as many type families reduced as they could have. The most direct way to fix this is to normalise these types initially using the constraint solver to solve for any local equalities that may be in scope. Test Plan: make test TEST=T14813 Reviewers: simonpj, bgamari, goldfire Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14813 Differential Revision: https://phabricator.haskell.org/D5094 >--------------------------------------------------------------- e72d7880b940881d38b8c3db9a00d5d007b1458f compiler/deSugar/Check.hs | 89 +++++++++++++++------- compiler/typecheck/TcExpr.hs | 7 +- compiler/typecheck/TcMType.hs | 12 ++- compiler/typecheck/TcSimplify.hs | 53 ++++++++++++- compiler/utils/MonadUtils.hs | 7 ++ testsuite/tests/pmcheck/should_compile/T14813.hs | 28 +++++++ testsuite/tests/pmcheck/should_compile/T15305.hs | 5 -- .../tests/pmcheck/should_compile/T15305.stderr | 2 +- testsuite/tests/pmcheck/should_compile/all.T | 2 + 9 files changed, 162 insertions(+), 43 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e72d7880b940881d38b8c3db9a00d5d007b1458f From git at git.haskell.org Fri Sep 28 15:19:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 15:19:06 +0000 (UTC) Subject: [commit: ghc] master: Expose wopt_set/unset_fatal in DynFlags (c89297e) Message-ID: <20180928151906.964BF3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c89297ee41f218a92870563d881548754c3d89e4/ghc >--------------------------------------------------------------- commit c89297ee41f218a92870563d881548754c3d89e4 Author: Neil Mitchell Date: Wed Sep 26 10:58:38 2018 +0100 Expose wopt_set/unset_fatal in DynFlags PR: https://github.com/ghc/ghc/pull/199/ >--------------------------------------------------------------- c89297ee41f218a92870563d881548754c3d89e4 compiler/main/DynFlags.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 9f0ba57..e7e541b 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -32,7 +32,7 @@ module DynFlags ( dopt, dopt_set, dopt_unset, gopt, gopt_set, gopt_unset, setGeneralFlag', unSetGeneralFlag', wopt, wopt_set, wopt_unset, - wopt_fatal, + wopt_fatal, wopt_set_fatal, wopt_unset_fatal, xopt, xopt_set, xopt_unset, lang_set, useUnicodeSyntax, From git at git.haskell.org Fri Sep 28 15:19:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 28 Sep 2018 15:19:10 +0000 (UTC) Subject: [commit: ghc] master: Add -fkeep-cafs (df67f95) Message-ID: <20180928151910.86C4A3ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/df67f95b2fc1c8b7200d98643e76c5feab4ed876/ghc >--------------------------------------------------------------- commit df67f95b2fc1c8b7200d98643e76c5feab4ed876 Author: Simon Marlow Date: Fri Sep 28 14:27:22 2018 +0200 Add -fkeep-cafs Summary: I noticed while playing around with https://github.com/fbsamples/ghc-hotswap/ that the main binary needs to have a custom main function to set `config.keep_cafs = true` when initialising the runtime. This is pretty annoying, it means an extra C file with some cryptic incantations in it, and a `-no-hs-main` flag. So I've replaced this with a link-time flag to GHC, `-fkeep-cafs` that does the same thing. Test Plan: New unit test that tests for the RTS's GC'd CAFs assertion, and also the -keep-cafs flag. Reviewers: bgamari, osa1, erikd, noamz Reviewed By: osa1 Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5183 >--------------------------------------------------------------- df67f95b2fc1c8b7200d98643e76c5feab4ed876 compiler/main/DynFlags.hs | 4 +++- compiler/main/SysTools/ExtraObj.hs | 4 ++++ docs/users_guide/phases.rst | 14 ++++++++++++ testsuite/tests/rts/KeepCafs1.hs | 9 ++++++++ testsuite/tests/rts/KeepCafs2.hs | 9 ++++++++ testsuite/tests/rts/KeepCafsBase.hs | 4 ++++ testsuite/tests/rts/KeepCafsMain.hs | 25 ++++++++++++++++++++++ testsuite/tests/rts/Makefile | 10 +++++++++ testsuite/tests/rts/all.T | 22 +++++++++++++++++++ testsuite/tests/rts/keep-cafs-fail.stdout | 5 +++++ .../tests/rts/keep-cafs.stdout | 1 + 11 files changed, 106 insertions(+), 1 deletion(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index e7e541b..7726001 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -564,6 +564,7 @@ data GeneralFlag -- forwards all -L flags to the collect2 command without using a -- response file and as such breaking apart. | Opt_SingleLibFolder + | Opt_KeepCAFs -- output style opts | Opt_ErrorSpans -- Include full span info in error messages, @@ -4003,7 +4004,8 @@ fFlagsDeps = [ flagSpec "show-warning-groups" Opt_ShowWarnGroups, flagSpec "hide-source-paths" Opt_HideSourcePaths, flagSpec "show-loaded-modules" Opt_ShowLoadedModules, - flagSpec "whole-archive-hs-libs" Opt_WholeArchiveHsLibs + flagSpec "whole-archive-hs-libs" Opt_WholeArchiveHsLibs, + flagSpec "keep-cafs" Opt_KeepCAFs ] ++ fHoleFlags diff --git a/compiler/main/SysTools/ExtraObj.hs b/compiler/main/SysTools/ExtraObj.hs index bbcb1b6..774884a 100644 --- a/compiler/main/SysTools/ExtraObj.hs +++ b/compiler/main/SysTools/ExtraObj.hs @@ -104,6 +104,10 @@ mkExtraObjToLinkIntoBinary dflags = do <> text (if rtsOptsSuggestions dflags then "true" else "false") <> semi, + text "__conf.keep_cafs = " + <> text (if gopt Opt_KeepCAFs dflags + then "true" + else "false") <> semi, case rtsOpts dflags of Nothing -> Outputable.empty Just opts -> text " __conf.rts_opts= " <> diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index 531f8c0..788b9be 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -1169,3 +1169,17 @@ for example). Also, you may need to use the :ghc-flag:`-rdynamic` flag to ensure that that symbols are not dropped from your PIE objects. + +.. ghc-flag:: -keep-cafs + :shortdesc: Do not garbage-collect CAFs (top-level expressions) at runtime + :type: dynamic + :category: linking + + :since: 8.8.1 + + Disables the RTS's normal behaviour of garbage-collecting CAFs + (Constant Applicative Forms, in other words top-level + expressions). This option is useful for specialised applications + that do runtime dynamic linking, where code dynamically linked in + the future might require the value of a CAF that would otherwise + be garbage-collected. diff --git a/testsuite/tests/rts/KeepCafs1.hs b/testsuite/tests/rts/KeepCafs1.hs new file mode 100644 index 0000000..f654bfb --- /dev/null +++ b/testsuite/tests/rts/KeepCafs1.hs @@ -0,0 +1,9 @@ +module KeepCafs1 where + +import KeepCafsBase + +foreign export ccall "getX" + getX :: IO Int + +getX :: IO Int +getX = return x diff --git a/testsuite/tests/rts/KeepCafs2.hs b/testsuite/tests/rts/KeepCafs2.hs new file mode 100644 index 0000000..ac57430 --- /dev/null +++ b/testsuite/tests/rts/KeepCafs2.hs @@ -0,0 +1,9 @@ +module KeepCafs2 where + +import KeepCafsBase + +foreign export ccall "getX" + getX :: IO Int + +getX :: IO Int +getX = return (x + 1) diff --git a/testsuite/tests/rts/KeepCafsBase.hs b/testsuite/tests/rts/KeepCafsBase.hs new file mode 100644 index 0000000..184db3d --- /dev/null +++ b/testsuite/tests/rts/KeepCafsBase.hs @@ -0,0 +1,4 @@ +module KeepCafsBase (x) where + +x :: Int +x = last [1..1000] diff --git a/testsuite/tests/rts/KeepCafsMain.hs b/testsuite/tests/rts/KeepCafsMain.hs new file mode 100644 index 0000000..2f6ad5a --- /dev/null +++ b/testsuite/tests/rts/KeepCafsMain.hs @@ -0,0 +1,25 @@ +module Main (main) where + +import Foreign +import GHCi.ObjLink +import System.Mem +import System.Exit + +foreign import ccall "dynamic" + callGetX :: FunPtr (IO Int) -> IO Int + +main :: IO () +main = do + initObjLinker DontRetainCAFs + let + loadAndCall obj = do + loadObj obj + resolveObjs + r <- lookupSymbol "getX" + case r of + Nothing -> die "cannot find getX" + Just ptr -> callGetX (castPtrToFunPtr ptr) >>= print + unloadObj obj + performGC + loadAndCall "KeepCafs1.o" + loadAndCall "KeepCafs2.o" diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile index bf7e163..496e04e 100644 --- a/testsuite/tests/rts/Makefile +++ b/testsuite/tests/rts/Makefile @@ -190,3 +190,13 @@ T14695: InternalCounters: "$(TEST_HC)" +RTS -s --internal-counters -RTS 2>&1 | grep "Internal Counters" -"$(TEST_HC)" +RTS -s -RTS 2>&1 | grep "Internal Counters" + +.PHONY: KeepCafsFail +KeepCafsFail: + "$(TEST_HC)" -c -g -v0 KeepCafsBase.hs KeepCafs1.hs KeepCafs2.hs + "$(TEST_HC)" -g -v0 KeepCafsMain.hs KeepCafsBase.o -debug -rdynamic -fwhole-archive-hs-libs $(KEEPCAFS) + ./KeepCafsMain 2>&1 || echo "exit($$?)" + +.PHONY: KeepCafs +KeepCafs: + "${MAKE}" KeepCafsFail KEEPCAFS=-fkeep-cafs diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index eb06dcc..a537ee4 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -431,3 +431,25 @@ test('nursery-chunks1', ], compile_and_run, ['']) + +# Test for the "Evaluated a CAF that was GC'd" assertion in the debug +# runtime, by dynamically loading code that re-evaluates the CAF. +# Also tests the -rdynamic and -fwhole-archive-hs-libs flags for constructing +# binaries that support runtime dynamic loading. +test('keep-cafs-fail', + [ extra_files(['KeepCafsBase.hs', 'KeepCafs1.hs', + 'KeepCafs2.hs', 'KeepCafsMain.hs']), + filter_stdout_lines('Evaluated a CAF|exit.*'), + ignore_stderr, # on OS X the shell emits an "Abort trap" message to stderr + ], + run_command, + ['$MAKE -s --no-print-directory KeepCafsFail']) + +# Test the -fkeep-cafs flag +test('keep-cafs', + [ extra_files(['KeepCafsBase.hs', 'KeepCafs1.hs', + 'KeepCafs2.hs', 'KeepCafsMain.hs']) + ], + run_command, + ['$MAKE -s --no-print-directory KeepCafs']) + diff --git a/testsuite/tests/rts/keep-cafs-fail.stdout b/testsuite/tests/rts/keep-cafs-fail.stdout new file mode 100644 index 0000000..6eaf652 --- /dev/null +++ b/testsuite/tests/rts/keep-cafs-fail.stdout @@ -0,0 +1,5 @@ +KeepCafsMain: internal error: Evaluated a CAF (0xaac9d8) that was GC'd! + (GHC version 8.7.20180910 for x86_64_unknown_linux) + Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug +Aborted (core dumped) +exit(134) diff --git a/libraries/base/tests/dynamic004.stdout b/testsuite/tests/rts/keep-cafs.stdout similarity index 50% copy from libraries/base/tests/dynamic004.stdout copy to testsuite/tests/rts/keep-cafs.stdout index 83b33d2..b5b9afd 100644 --- a/libraries/base/tests/dynamic004.stdout +++ b/testsuite/tests/rts/keep-cafs.stdout @@ -1 +1,2 @@ 1000 +1001 From git at git.haskell.org Sat Sep 29 21:15:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 29 Sep 2018 21:15:40 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: fixed issue with bad register sorting, and bad increment while traversing (be44074) Message-ID: <20180929211540.4B3633ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/be44074ffce593a384928e2d04836ca9e8ce49c9/ghc >--------------------------------------------------------------- commit be44074ffce593a384928e2d04836ca9e8ce49c9 Author: Kavon Farvardin Date: Sat Sep 29 16:15:23 2018 -0500 fixed issue with bad register sorting, and bad increment while traversing >--------------------------------------------------------------- be44074ffce593a384928e2d04836ca9e8ce49c9 compiler/llvmGen/LlvmCodeGen/Base.hs | 39 ++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index f80705e..15629a4 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -58,7 +58,8 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sortBy) +import Data.List (sortBy, partition) +import Data.Maybe (isJust) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -178,25 +179,33 @@ sortSSERegs regs = sortBy sseOrd regs (Just x, Just y) -> compare x y _ -> EQ --- assumes that the live list is sorted by Ord GlobalReg's compare function. -- the bool indicates whether the global reg was added as padding. +-- the returned list is not sorted in any particular order, +-- but does indicate the set of live registers needed, with SSE padding. padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] -padLiveArgs live = padded +padLiveArgs live = allRegs where - (_, padded) = foldl assignSlots (1, []) $ sortSSERegs live + (sse, others) = partition (isJust . sseRegNum) live + (_, padded) = foldl assignSlots (1, []) $ sortSSERegs sse + allRegs = padded ++ map (\r -> (False, r)) others assignSlots (i, acc) r - | Just k <- sseRegNum r - , i < k - = let -- add k-i slots of padding before the register - diff = k-i - -- NOTE: order doesn't matter in acc, since it's like a set - acc' = genPad i diff ++ (False, r) : acc - i' = i + diff - in - (i', acc') - - | otherwise = (i+1, (False, r):acc) + | Just k <- sseRegNum r = + if i == k + then -- don't need padding + (i+1, (False, r):acc) + else let -- add k-i slots of padding before the register + diff = if i > k + then error "padLiveArgs -- index should not be greater!" + else k-i + + -- NOTE: order doesn't matter in acc, since it's like a set + acc' = genPad i diff ++ (False, r) : acc + i' = i + diff + in + (i', acc') + -- not an SSE reg, so just keep going + | otherwise = (i, (False, r):acc) genPad start n = take n $ flip map (iterate (+1) start) (\i -> From git at git.haskell.org Sun Sep 30 00:33:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 30 Sep 2018 00:33:20 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: rewrote patch for T14619 to fix a lingering bug, and make it clearer (e778fee) Message-ID: <20180930003320.25C243ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/e778fee5d69fca669ca6d54a67966590aac130f0/ghc >--------------------------------------------------------------- commit e778fee5d69fca669ca6d54a67966590aac130f0 Author: Kavon Farvardin Date: Sat Sep 29 19:27:07 2018 -0500 rewrote patch for T14619 to fix a lingering bug, and make it clearer >--------------------------------------------------------------- e778fee5d69fca669ca6d54a67966590aac130f0 compiler/llvmGen/LlvmCodeGen/Base.hs | 61 ++++++++++++++------------------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 9 +---- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 15629a4..d4ae43a 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -26,7 +26,7 @@ module LlvmCodeGen.Base ( cmmToLlvmType, widthToLlvmFloat, widthToLlvmInt, llvmFunTy, llvmFunSig, llvmFunArgs, llvmStdFunAttrs, llvmFunAlign, llvmInfAlign, - llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, sortSSERegs, + llvmPtrBits, tysToParams, llvmFunSection, padLiveArgs, isSSE, strCLabel_llvm, strDisplayName_llvm, strProcedureName_llvm, getGlobalPtr, generateExternDecls, @@ -58,8 +58,8 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sortBy, partition) -import Data.Maybe (isJust) +import Data.List (sort, partition) +import Data.Maybe (mapMaybe) -- ---------------------------------------------------------------------------- -- * Some Data Types @@ -151,7 +151,7 @@ llvmFunArgs :: DynFlags -> LiveGlobalRegs -> [LlvmVar] llvmFunArgs dflags live = map (lmGlobalRegArg dflags) (filter isPassed allRegs) where platform = targetPlatform dflags - allRegs = sortSSERegs $ activeStgRegs platform + allRegs = activeStgRegs platform paddedLive = map (\(_,r) -> r) $ padLiveArgs live isLive r = r `elem` alwaysLive || r `elem` paddedLive isPassed r = not (isSSE r) || isLive r @@ -160,6 +160,14 @@ llvmFunArgs dflags live = | otherwise = False +isSSE :: GlobalReg -> Bool +isSSE (FloatReg _) = True +isSSE (DoubleReg _) = True +isSSE (XmmReg _) = True +isSSE (YmmReg _) = True +isSSE (ZmmReg _) = True +isSSE _ = False + sseRegNum :: GlobalReg -> Maybe Int sseRegNum (FloatReg i) = Just i sseRegNum (DoubleReg i) = Just i @@ -168,44 +176,25 @@ sseRegNum (YmmReg i) = Just i sseRegNum (ZmmReg i) = Just i sseRegNum _ = Nothing --- Only sorts regs that will end up in SSE registers --- such that the ones which are assigned to the same --- register will be adjacent in the list. Other elements --- are not reordered. -sortSSERegs :: [GlobalReg] -> [GlobalReg] -sortSSERegs regs = sortBy sseOrd regs - where - sseOrd a b = case (sseRegNum a, sseRegNum b) of - (Just x, Just y) -> compare x y - _ -> EQ - -- the bool indicates whether the global reg was added as padding. -- the returned list is not sorted in any particular order, -- but does indicate the set of live registers needed, with SSE padding. padLiveArgs :: LiveGlobalRegs -> [(Bool, GlobalReg)] padLiveArgs live = allRegs where - (sse, others) = partition (isJust . sseRegNum) live - (_, padded) = foldl assignSlots (1, []) $ sortSSERegs sse - allRegs = padded ++ map (\r -> (False, r)) others - - assignSlots (i, acc) r - | Just k <- sseRegNum r = - if i == k - then -- don't need padding - (i+1, (False, r):acc) - else let -- add k-i slots of padding before the register - diff = if i > k - then error "padLiveArgs -- index should not be greater!" - else k-i - - -- NOTE: order doesn't matter in acc, since it's like a set - acc' = genPad i diff ++ (False, r) : acc - i' = i + diff - in - (i', acc') - -- not an SSE reg, so just keep going - | otherwise = (i, (False, r):acc) + sseRegNums = sort $ mapMaybe sseRegNum live + (_, padding) = foldl assignSlots (1, []) $ sseRegNums + allRegs = padding ++ map (\r -> (False, r)) live + + assignSlots (i, acc) regNum + | i == regNum = -- don't need padding here + (i+1, acc) + | i < regNum = let -- add padding for slots i .. regNum-1 + numNeeded = regNum-i + acc' = genPad i numNeeded ++ acc + in + (regNum+1, acc') + | otherwise = error "padLiveArgs -- i > regNum ??" genPad start n = take n $ flip map (iterate (+1) start) (\i -> diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 9159493..1873400 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1819,13 +1819,6 @@ funEpilogue live = do let alwaysNeeded = map (\r -> (False, r)) alwaysLive livePadded = alwaysNeeded ++ padLiveArgs live - isSSE (FloatReg _) = True - isSSE (DoubleReg _) = True - isSSE (XmmReg _) = True - isSSE (YmmReg _) = True - isSSE (ZmmReg _) = True - isSSE _ = False - -- Set to value or "undef" depending on whether the register is -- actually live dflags <- getDynFlags @@ -1836,7 +1829,7 @@ funEpilogue live = do let ty = (pLower . getVarType $ lmGlobalRegVar dflags r) return (Just $ LMLitVar $ LMUndefLit ty, nilOL) platform <- getDynFlag targetPlatform - let allRegs = sortSSERegs $ activeStgRegs platform + let allRegs = activeStgRegs platform loads <- flip mapM allRegs $ \r -> case () of _ | (False, r) `elem` livePadded -> loadExpr r -- if r is not padding, load it From git at git.haskell.org Sun Sep 30 01:47:30 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 30 Sep 2018 01:47:30 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: remove extra imported symbol (18c3cc9) Message-ID: <20180930014730.88C773ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/18c3cc90eead99a213880ff8cb9ecaf096efca5b/ghc >--------------------------------------------------------------- commit 18c3cc90eead99a213880ff8cb9ecaf096efca5b Author: Kavon Farvardin Date: Sat Sep 29 20:43:58 2018 -0500 remove extra imported symbol >--------------------------------------------------------------- 18c3cc90eead99a213880ff8cb9ecaf096efca5b compiler/llvmGen/LlvmCodeGen/Base.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index d4ae43a..ac75409 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -58,7 +58,7 @@ import ErrUtils import qualified Stream import Control.Monad (ap) -import Data.List (sort, partition) +import Data.List (sort) import Data.Maybe (mapMaybe) -- ---------------------------------------------------------------------------- From git at git.haskell.org Sun Sep 30 01:47:33 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 30 Sep 2018 01:47:33 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: Mark T14251 as expected to pass. (2a27581) Message-ID: <20180930014733.57B603ABBE@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/2a275810c0b53f4e3a12ab4b2abc00bba4637139/ghc >--------------------------------------------------------------- commit 2a275810c0b53f4e3a12ab4b2abc00bba4637139 Author: Kavon Farvardin Date: Sat Sep 29 20:44:21 2018 -0500 Mark T14251 as expected to pass. >--------------------------------------------------------------- 2a275810c0b53f4e3a12ab4b2abc00bba4637139 testsuite/tests/codeGen/should_run/all.T | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 4959295..bd1521d 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -172,5 +172,4 @@ test('T13825-unit', test('T14619', normal, compile_and_run, ['']) test('T14754', normal, compile_and_run, ['']) test('T14346', only_ways(['threaded1','threaded2']), compile_and_run, ['-O -threaded']) -test('T14251', [expect_broken_for(14251, ['optllvm'])], - compile_and_run, ['']) +test('T14251', normal, compile_and_run, ['']) From git at git.haskell.org Sun Sep 30 23:47:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 30 Sep 2018 23:47:58 +0000 (UTC) Subject: [commit: ghc] wip/kavon-llvm-improve: add lower-expect to lvl 0 optimization; it's basically free perf (aa362d4) Message-ID: <20180930234758.831BA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-llvm-improve Link : http://ghc.haskell.org/trac/ghc/changeset/aa362d40993e5b43df2f969d112e21eb25faaea9/ghc >--------------------------------------------------------------- commit aa362d40993e5b43df2f969d112e21eb25faaea9 Author: Kavon Farvardin Date: Sun Sep 30 18:47:39 2018 -0500 add lower-expect to lvl 0 optimization; it's basically free perf >--------------------------------------------------------------- aa362d40993e5b43df2f969d112e21eb25faaea9 llvm-passes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm-passes b/llvm-passes index 5183c9f..14eb62d 100644 --- a/llvm-passes +++ b/llvm-passes @@ -1,5 +1,5 @@ [ -(0, "-mem2reg -globalopt"), +(0, "-mem2reg -globalopt -lower-expect"), (1, "-O1 -globalopt"), (2, "-O2") ]