From git at git.haskell.org Thu Mar 1 19:07:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 1 Mar 2018 19:07:49 +0000 (UTC) Subject: [commit: ghc] master: Revert "Better stats for T5837" (2756117) Message-ID: <20180301190749.EE7113A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2756117bd26c2cb70d3f51954a88b7d7bdf3d3f2/ghc >--------------------------------------------------------------- commit 2756117bd26c2cb70d3f51954a88b7d7bdf3d3f2 Author: Ben Gamari Date: Thu Mar 1 14:06:04 2018 -0500 Revert "Better stats for T5837" This reverts commit d675a354e8db67d87d1f257c3d1d2bf2d58c2b3f. >--------------------------------------------------------------- 2756117bd26c2cb70d3f51954a88b7d7bdf3d3f2 testsuite/tests/perf/compiler/all.T | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 4c2462c..1a2413a 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -665,7 +665,7 @@ test('T5837', # 2017-04-21 54985248 (x64/Windows) - Unknown # 2017-12-24 54793816 (x64/Windows) - Unknown - (wordsize(64), 51294232, 7)]) + (wordsize(64), 55813608, 7)]) # sample: 3926235424 (amd64/Linux, 15/2/2012) # 2012-10-02 81879216 # 2012-09-20 87254264 amd64/Linux @@ -704,7 +704,6 @@ test('T5837', # 2017-09-06 56782344 amd64/Linux Drift manifest in unrelated LLVM patch # 2017-10-24 52089424 amd64/linux Fix space leak in BinIface.getSymbolTable # 2018-02-19 55813608 amd64/Linux Unknown - # 2018-02-27 51294232 amd64/Linux Better still, I'm not sure why ], compile, ['-freduction-depth=50']) From git at git.haskell.org Thu Mar 1 23:55:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 1 Mar 2018 23:55:20 +0000 (UTC) Subject: [commit: ghc] wip/T2893: Add superclasses to quantified constraints (910dfcf) Message-ID: <20180301235520.A819D3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T2893 Link : http://ghc.haskell.org/trac/ghc/changeset/910dfcfeadc4f132e887bc4adf5ac2e17a29d99b/ghc >--------------------------------------------------------------- commit 910dfcfeadc4f132e887bc4adf5ac2e17a29d99b Author: Simon Peyton Jones Date: Thu Mar 1 23:32:29 2018 +0000 Add superclasses to quantified constraints This patch adds suppport for superclasses to quantified constraints. For example (contrived): f :: (forall a. Ord a => Ord (m a)) => m a -> m a -> Bool f x y = x==y Here we need (Eq (m a)); but the quantifed constraint deals only with Ord. But we can make it work by using its superclass. This behaviour finally delivers on the promise of comment:30 of Trac #9123: we can write an implication constraint that solves the problem of higher-kinded roles. Test quantified-constraints/T8123 demonstrates this in action. >--------------------------------------------------------------- 910dfcfeadc4f132e887bc4adf5ac2e17a29d99b compiler/basicTypes/Id.hs | 2 +- compiler/typecheck/Inst.hs | 4 +- compiler/typecheck/TcCanonical.hs | 180 +++++++++++++-------- compiler/typecheck/TcErrors.hs | 4 +- compiler/typecheck/TcEvTerm.hs | 5 +- compiler/typecheck/TcEvidence.hs | 74 +++++---- compiler/typecheck/TcHsSyn.hs | 23 ++- compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcInteract.hs | 61 +++---- compiler/typecheck/TcMType.hs | 6 +- compiler/typecheck/TcPatSyn.hs | 7 +- compiler/typecheck/TcPluginM.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 62 +++++-- compiler/typecheck/TcSMonad.hs | 119 +++++++------- compiler/typecheck/TcSimplify.hs | 2 +- compiler/typecheck/TcType.hs | 2 +- compiler/types/Class.hs | 54 ++++--- compiler/types/Kind.hs | 2 + testsuite/tests/quantified-constraints/T2893c.hs | 15 ++ .../quantified-constraints/{T2893b.hs => T9123.hs} | 2 +- testsuite/tests/quantified-constraints/T9123a.hs | 26 +++ testsuite/tests/quantified-constraints/all.T | 5 + 22 files changed, 403 insertions(+), 256 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 910dfcfeadc4f132e887bc4adf5ac2e17a29d99b From git at git.haskell.org Fri Mar 2 05:02:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 05:02:55 +0000 (UTC) Subject: [commit: ghc] wip/docker-ghcci: Directory change (0c248bf) Message-ID: <20180302050255.51E793A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/docker-ghcci Link : http://ghc.haskell.org/trac/ghc/changeset/0c248bfb640aefa3fb4b8fdd740688b5ba66cea9/ghc >--------------------------------------------------------------- commit 0c248bfb640aefa3fb4b8fdd740688b5ba66cea9 Author: David Feuer Date: Fri Mar 2 00:02:27 2018 -0500 Directory change >--------------------------------------------------------------- 0c248bfb640aefa3fb4b8fdd740688b5ba66cea9 .circleci/images/x86_64-linux/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/images/x86_64-linux/Dockerfile b/.circleci/images/x86_64-linux/Dockerfile index 4630ba2..3eefa1b 100644 --- a/.circleci/images/x86_64-linux/Dockerfile +++ b/.circleci/images/x86_64-linux/Dockerfile @@ -8,6 +8,6 @@ RUN apt-get install -qy openssh-client RUN apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch -RUN ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour +RUN ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour USER ghc From git at git.haskell.org Fri Mar 2 06:13:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 06:13:56 +0000 (UTC) Subject: [commit: ghc] wip/docker-ghcci: Install more earlier (3553bf2) Message-ID: <20180302061356.B1C273A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/docker-ghcci Link : http://ghc.haskell.org/trac/ghc/changeset/3553bf2b8d5b544cd6a37ddbb65e71beebaa26e0/ghc >--------------------------------------------------------------- commit 3553bf2b8d5b544cd6a37ddbb65e71beebaa26e0 Author: David Feuer Date: Fri Mar 2 00:45:49 2018 -0500 Install more earlier >--------------------------------------------------------------- 3553bf2b8d5b544cd6a37ddbb65e71beebaa26e0 .circleci/config.yml | 2 -- .circleci/images/x86_64-linux/Dockerfile | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8507e23..fb3697e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -181,8 +181,6 @@ jobs: - run: name: Install LLVM command: | - apt-get update - apt-get install -y curl xz-utils curl http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC .. # See https://discuss.circleci.com/t/how-to-add-a-path-to-path-in-circle-2-0/11554/3 echo "export PATH=`pwd`/../clang+llvm-5.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV diff --git a/.circleci/images/x86_64-linux/Dockerfile b/.circleci/images/x86_64-linux/Dockerfile index 3eefa1b..8584e4a 100644 --- a/.circleci/images/x86_64-linux/Dockerfile +++ b/.circleci/images/x86_64-linux/Dockerfile @@ -7,6 +7,7 @@ RUN apt-get update -qq RUN apt-get install -qy openssh-client RUN apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch +RUN apt-get install -qy curl xz-utils RUN ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour From git at git.haskell.org Fri Mar 2 06:22:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 06:22:14 +0000 (UTC) Subject: [commit: ghc] wip/docker-ghcci: Version number. (ed89d8e) Message-ID: <20180302062214.99C893A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/docker-ghcci Link : http://ghc.haskell.org/trac/ghc/changeset/ed89d8eb8bda8851891c43941506a578c0653b09/ghc >--------------------------------------------------------------- commit ed89d8eb8bda8851891c43941506a578c0653b09 Author: David Feuer Date: Fri Mar 2 01:19:09 2018 -0500 Version number. >--------------------------------------------------------------- ed89d8eb8bda8851891c43941506a578c0653b09 .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb3697e..cf06942 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,7 +86,7 @@ jobs: "validate-x86_64-linux": resource_class: xlarge docker: - - image: dfeuer/ghcci:x86_64-linux-0.0.4 + - image: dfeuer/ghcci:x86_64-linux-0.0.6 environment: <<: *buildenv steps: @@ -144,7 +144,7 @@ jobs: "validate-hadrian-x86_64-linux": resource_class: xlarge docker: - - image: dfeuer/ghcci:x86_64-linux-0.0.4 + - image: dfeuer/ghcci:x86_64-linux-0.0.6 environment: <<: *buildenv steps: @@ -158,7 +158,7 @@ jobs: "validate-x86_64-linux-unreg": resource_class: xlarge docker: - - image: dfeuer/ghcci:x86_64-linux-0.0.4 + - image: dfeuer/ghcci:x86_64-linux-0.0.6 environment: <<: *buildenv steps: @@ -173,7 +173,7 @@ jobs: "validate-x86_64-linux-llvm": resource_class: xlarge docker: - - image: dfeuer/ghcci:x86_64-linux-0.0.4 + - image: dfeuer/ghcci:x86_64-linux-0.0.6 environment: <<: *buildenv BUILD_FLAVOUR: perf-llvm From git at git.haskell.org Fri Mar 2 06:28:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 06:28:47 +0000 (UTC) Subject: [commit: ghc] wip/docker-ghcci: Add another llvm version (5964d8a) Message-ID: <20180302062847.DDE683A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/docker-ghcci Link : http://ghc.haskell.org/trac/ghc/changeset/5964d8a1e6788fe0d3e367913b4254b3d5cb7022/ghc >--------------------------------------------------------------- commit 5964d8a1e6788fe0d3e367913b4254b3d5cb7022 Author: David Feuer Date: Fri Mar 2 01:28:12 2018 -0500 Add another llvm version Dunno if the paths will work out >--------------------------------------------------------------- 5964d8a1e6788fe0d3e367913b4254b3d5cb7022 .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf06942..79e8005 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -181,9 +181,11 @@ jobs: - run: name: Install LLVM command: | + curl http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC .. curl http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC .. # See https://discuss.circleci.com/t/how-to-add-a-path-to-path-in-circle-2-0/11554/3 echo "export PATH=`pwd`/../clang+llvm-5.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV + echo "export PATH=`pwd`/../clang+llvm-3.9.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV - run: name: Verify that llc works command: llc From git at git.haskell.org Fri Mar 2 06:53:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 06:53:20 +0000 (UTC) Subject: [commit: ghc] wip/docker-ghcci: Darwin Python installation (5177e14) Message-ID: <20180302065320.25E1D3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/docker-ghcci Link : http://ghc.haskell.org/trac/ghc/changeset/5177e14b47ccc4a27a38ff7108c1459c83d448ad/ghc >--------------------------------------------------------------- commit 5177e14b47ccc4a27a38ff7108c1459c83d448ad Author: David Feuer Date: Fri Mar 2 01:52:51 2018 -0500 Darwin Python installation >--------------------------------------------------------------- 5177e14b47ccc4a27a38ff7108c1459c83d448ad .circleci/prepare-system.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/prepare-system.sh b/.circleci/prepare-system.sh index 84fd513..9f9bb93 100755 --- a/.circleci/prepare-system.sh +++ b/.circleci/prepare-system.sh @@ -44,7 +44,8 @@ case "$(uname)" in if [[ -n ${TARGET:-} ]]; then fail "uname=$(uname) not supported for cross-compilation" fi - brew install ghc cabal-install python3 ncurses gmp + brew install ghc cabal-install ncurses gmp + brew upgrade python3 cabal update cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state # put them on the $PATH, don't fail if already installed From git at git.haskell.org Fri Mar 2 12:42:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 12:42:24 +0000 (UTC) Subject: [commit: ghc] master: Cache the fingerprint of sOpt_P (b8f03bb) Message-ID: <20180302124224.9FDF73A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b8f03bbe16af7a09b494a33fbbe523ecd82f1a50/ghc >--------------------------------------------------------------- commit b8f03bbe16af7a09b494a33fbbe523ecd82f1a50 Author: Bartosz Nitka Date: Thu Feb 22 06:44:59 2018 -0800 Cache the fingerprint of sOpt_P Before this change we would compute a hash of all the command line -optP flags once per file. With a lot of files and many -optP flags, that's a lot of repeated work. I added a new Note that explains the approach and rationale. Test Plan: new test Reviewers: simonmar, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14697 Differential Revision: https://phabricator.haskell.org/D4445 >--------------------------------------------------------------- b8f03bbe16af7a09b494a33fbbe523ecd82f1a50 compiler/iface/FlagChecker.hs | 37 ++++++++++++++++++++++++++++++++- compiler/main/DynFlags.hs | 19 ++++++++++++++++- compiler/main/SysTools.hs | 2 ++ testsuite/tests/perf/compiler/all.T | 13 ++++++++++++ testsuite/tests/perf/compiler/genT14697 | 17 +++++++++++++++ 5 files changed, 86 insertions(+), 2 deletions(-) diff --git a/compiler/iface/FlagChecker.hs b/compiler/iface/FlagChecker.hs index 1fc597b..2ef369a 100644 --- a/compiler/iface/FlagChecker.hs +++ b/compiler/iface/FlagChecker.hs @@ -47,8 +47,10 @@ fingerprintDynFlags dflags at DynFlags{..} this_mod nameio = -- -I, -D and -U flags affect CPP cpp = ( map normalise $ flattenIncludes includePaths - , opt_P dflags ++ picPOpts dflags) -- normalise: eliminate spurious differences due to "./foo" vs "foo" + , picPOpts dflags + , opt_P_signature dflags) + -- See Note [Repeated -optP hashing] -- Note [path flags and recompilation] paths = [ hcSuf ] @@ -144,3 +146,36 @@ executable when some of its components differ in these ways. The way we accomplish this is to leave the optimization and HPC options out of the flag hash, hashing them separately. -} + +{- Note [Repeated -optP hashing] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +We invoke fingerprintDynFlags for each compiled module to include +the hash of relevant DynFlags in the resulting interface file. +-optP (preprocessor) flags are part of that hash. +-optP flags can come from multiple places: + + 1. -optP flags directly passed on command line. + 2. -optP flags implied by other flags. Eg. -DPROFILING implied by -prof. + 3. -optP flags added with {-# OPTIONS -optP-D__F__ #-} in a file. + +When compiling many modules at once with many -optP command line arguments +the work of hashing -optP flags would be repeated. This can get expensive +and as noted on #14697 it can take 7% of time and 14% of allocations on +a real codebase. + +The obvious solution is to cache the hash of -optP flags per GHC invocation. +However, one has to be careful there, as the flags that were added in 3. way +have to be accounted for. + +The current strategy is as follows: + + 1. Lazily compute the hash of sOpt_p in sOpt_P_fingerprint whenever sOpt_p + is modified. This serves dual purpose. It ensures correctness for when + we add per file -optP flags and lets us save work for when we don't. + 2. When computing the fingerprint in fingerprintDynFlags use the cached + value *and* fingerprint the additional implied (see 2. above) -optP flags. + This is relatively cheap and saves the headache of fingerprinting all + the -optP flags and tracking all the places that could invalidate the + cache. +-} diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index b7720dd..074b7e3 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -89,6 +89,7 @@ module DynFlags ( pgm_L, pgm_P, pgm_F, pgm_c, pgm_s, pgm_a, pgm_l, pgm_dll, pgm_T, pgm_windres, pgm_libtool, pgm_ar, pgm_ranlib, pgm_lo, pgm_lc, pgm_lcc, pgm_i, opt_L, opt_P, opt_F, opt_c, opt_a, opt_l, opt_i, + opt_P_signature, opt_windres, opt_lo, opt_lc, opt_lcc, -- ** Manipulating DynFlags @@ -195,6 +196,7 @@ import qualified Pretty import SrcLoc import BasicTypes ( IntWithInf, treatZeroAsInf ) import FastString +import Fingerprint import Outputable import Foreign.C ( CInt(..) ) import System.IO.Unsafe ( unsafeDupablePerformIO ) @@ -1169,6 +1171,8 @@ data Settings = Settings { -- options for particular phases sOpt_L :: [String], sOpt_P :: [String], + sOpt_P_fingerprint :: Fingerprint, -- cached Fingerprint of sOpt_P + -- See Note [Repeated -optP hashing] sOpt_F :: [String], sOpt_c :: [String], sOpt_a :: [String], @@ -1241,6 +1245,14 @@ opt_L dflags = sOpt_L (settings dflags) opt_P :: DynFlags -> [String] opt_P dflags = concatMap (wayOptP (targetPlatform dflags)) (ways dflags) ++ sOpt_P (settings dflags) + +-- This function packages everything that's needed to fingerprint opt_P +-- flags. See Note [Repeated -optP hashing]. +opt_P_signature :: DynFlags -> ([String], Fingerprint) +opt_P_signature dflags = + ( concatMap (wayOptP (targetPlatform dflags)) (ways dflags) + , sOpt_P_fingerprint (settings dflags)) + opt_F :: DynFlags -> [String] opt_F dflags = sOpt_F (settings dflags) opt_c :: DynFlags -> [String] @@ -2434,7 +2446,12 @@ setDumpPrefixForce f d = d { dumpPrefixForce = f} setPgmP f = let (pgm:args) = words f in alterSettings (\s -> s { sPgm_P = (pgm, map Option args)}) addOptl f = alterSettings (\s -> s { sOpt_l = f : sOpt_l s}) addOptc f = alterSettings (\s -> s { sOpt_c = f : sOpt_c s}) -addOptP f = alterSettings (\s -> s { sOpt_P = f : sOpt_P s}) +addOptP f = alterSettings (\s -> s { sOpt_P = f : sOpt_P s + , sOpt_P_fingerprint = fingerprintStrings (f : sOpt_P s) + }) + -- See Note [Repeated -optP hashing] + where + fingerprintStrings ss = fingerprintFingerprints $ map fingerprintString ss setDepMakefile :: FilePath -> DynFlags -> DynFlags diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 4c16286..35935ca 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -48,6 +48,7 @@ import ErrUtils import Platform import Util import DynFlags +import Fingerprint import System.FilePath import System.IO @@ -302,6 +303,7 @@ initSysTools mbMinusB sPgm_i = iserv_prog, sOpt_L = [], sOpt_P = [], + sOpt_P_fingerprint = fingerprint0, sOpt_F = [], sOpt_c = [], sOpt_a = [], diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 1a2413a..2afa595 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -1212,6 +1212,19 @@ test('T13719', multimod_compile, ['T13719', '-v0']) +test('T14697', + [ compiler_stats_num_field('bytes allocated', + [(wordsize(64), 337290376, 10), + # initial: 635573784 + # 2018-02-23: 337290376 Cache the fingerprint of sOpt_P + ]), + pre_cmd('./genT14697'), + extra_files(['genT14697']), + extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments + ], + multimod_compile, + ['T14697', '-v0']) + test('Naperian', [ reqlib('vector'), only_ways(['optasm']), diff --git a/testsuite/tests/perf/compiler/genT14697 b/testsuite/tests/perf/compiler/genT14697 new file mode 100755 index 0000000..e3fe4f4 --- /dev/null +++ b/testsuite/tests/perf/compiler/genT14697 @@ -0,0 +1,17 @@ +#!/bin/bash +SIZE=100 +ROOT=T14697 +# Generates 100 empty modules and T14697 that imports them all +# It (along with the command line arguments) reproduces a problem where +# -optP command line flags would be hashed once per file +for i in $(seq -w 1 $SIZE); do + echo "module A$i where" > A$i.hs +done + +echo "module ${ROOT} where" > $ROOT.hs +for i in $(seq -w 1 $SIZE); do + echo "import A$i" >> $ROOT.hs; +done + +# generate flags +echo -optP-D__F{1..10000}__ > T14697-flags From git at git.haskell.org Fri Mar 2 16:17:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 16:17:04 +0000 (UTC) Subject: [commit: ghc] master: rts: Note functions which must take all_tasks_mutex. (8dab89b) Message-ID: <20180302161704.734993A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8dab89b4d148d322cd7ac8c374be3342ab017297/ghc >--------------------------------------------------------------- commit 8dab89b4d148d322cd7ac8c374be3342ab017297 Author: Ben Gamari Date: Fri Mar 2 11:13:14 2018 -0500 rts: Note functions which must take all_tasks_mutex. >--------------------------------------------------------------- 8dab89b4d148d322cd7ac8c374be3342ab017297 rts/Capability.c | 3 +++ rts/Schedule.c | 1 + rts/Task.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/rts/Capability.c b/rts/Capability.c index 03b2a86..f9141ee 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -498,6 +498,9 @@ giveCapabilityToTask (Capability *cap USED_IF_DEBUG, Task *task) * * The current Task (cap->task) releases the Capability. The Capability is * marked free, and if there is any work to do, an appropriate Task is woken up. + * + * N.B. May need to take all_tasks_mutex. + * * ------------------------------------------------------------------------- */ #if defined(THREADED_RTS) diff --git a/rts/Schedule.c b/rts/Schedule.c index cdb9659..b8306df 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2005,6 +2005,7 @@ forkProcess(HsStablePtr *entry RELEASE_LOCK(&task->lock); #if defined(THREADED_RTS) + /* N.B. releaseCapability_ below may need to take all_tasks_mutex */ RELEASE_LOCK(&all_tasks_mutex); #endif diff --git a/rts/Task.c b/rts/Task.c index fc928d5..758ae10 100644 --- a/rts/Task.c +++ b/rts/Task.c @@ -199,6 +199,7 @@ freeTask (Task *task) stgFree(task); } +/* Must take all_tasks_mutex */ static Task* newTask (bool worker) { @@ -443,6 +444,7 @@ workerStart(Task *task) scheduleWorker(cap,task); } +/* N.B. must take all_tasks_mutex */ void startWorkerTask (Capability *cap) { From git at git.haskell.org Fri Mar 2 16:17:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 16:17:07 +0000 (UTC) Subject: [commit: ghc] master: forkProcess: fix task mutex release order (e261b85) Message-ID: <20180302161707.6B65B3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e261b8523eb547b93b8b9e194bc2566350e7cc60/ghc >--------------------------------------------------------------- commit e261b8523eb547b93b8b9e194bc2566350e7cc60 Author: Ömer Sinan Ağacan Date: Fri Mar 2 11:15:03 2018 -0500 forkProcess: fix task mutex release order `all_tasks_mutex` should be released before calling `releaseCapability_` in the parent process as `releaseCapability_` spawns worker tasks in some cases. Reviewers: bgamari, erikd, simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14538 Differential Revision: https://phabricator.haskell.org/D4460 >--------------------------------------------------------------- e261b8523eb547b93b8b9e194bc2566350e7cc60 rts/Schedule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index f1363e4..cdb9659 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2004,15 +2004,15 @@ forkProcess(HsStablePtr *entry RELEASE_LOCK(&stable_mutex); RELEASE_LOCK(&task->lock); +#if defined(THREADED_RTS) + RELEASE_LOCK(&all_tasks_mutex); +#endif + for (i=0; i < n_capabilities; i++) { releaseCapability_(capabilities[i],false); RELEASE_LOCK(&capabilities[i]->lock); } -#if defined(THREADED_RTS) - RELEASE_LOCK(&all_tasks_mutex); -#endif - boundTaskExiting(task); // just return the pid From git at git.haskell.org Fri Mar 2 17:34:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 17:34:45 +0000 (UTC) Subject: [commit: ghc] wip/T2893: Add missing import (62a16bd) Message-ID: <20180302173445.258413A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T2893 Link : http://ghc.haskell.org/trac/ghc/changeset/62a16bdcdc27158ad545c744eec52cb481203323/ghc >--------------------------------------------------------------- commit 62a16bdcdc27158ad545c744eec52cb481203323 Author: Simon Peyton Jones Date: Fri Mar 2 17:34:34 2018 +0000 Add missing import >--------------------------------------------------------------- 62a16bdcdc27158ad545c744eec52cb481203323 compiler/typecheck/TcPluginM.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcPluginM.hs b/compiler/typecheck/TcPluginM.hs index 086ac26..a112003 100644 --- a/compiler/typecheck/TcPluginM.hs +++ b/compiler/typecheck/TcPluginM.hs @@ -69,7 +69,7 @@ import TcRnMonad ( TcGblEnv, TcLclEnv, Ct, CtLoc, TcPluginM , liftIO, traceTc ) import TcMType ( TcTyVar, TcType ) import TcEnv ( TcTyThing ) -import TcEvidence ( TcCoercion, CoercionHole +import TcEvidence ( TcCoercion, CoercionHole, EvTerm(..) , EvExpr, EvBind, mkGivenEvBind ) import TcRnTypes ( CtEvidence(..) ) import Var ( EvVar ) From git at git.haskell.org Fri Mar 2 18:48:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 18:48:56 +0000 (UTC) Subject: [commit: ghc] master: Only load plugins once (f8e3cd3) Message-ID: <20180302184856.BCD7A3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f8e3cd3b160d20dbd18d490b7babe43153bb3287/ghc >--------------------------------------------------------------- commit f8e3cd3b160d20dbd18d490b7babe43153bb3287 Author: Matthew Pickering Date: Fri Mar 2 18:45:47 2018 +0000 Only load plugins once Summary: This is part of D4342 which is worthwhile to merge on its own. Reviewers: nboldi, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4410 Co-authored-by: Boldizsar Nemeth >--------------------------------------------------------------- f8e3cd3b160d20dbd18d490b7babe43153bb3287 compiler/main/DynFlags.hs | 8 ++++++++ compiler/main/DynamicLoading.hs | 36 ++++++++++++++++++++++++++++++------ compiler/main/HscMain.hs | 10 +++++++--- compiler/main/Plugins.hs | 37 +++++++++++++++++++++++++++++++++---- compiler/main/Plugins.hs-boot | 9 +++++++++ compiler/simplCore/SimplCore.hs | 34 +++++++--------------------------- compiler/typecheck/TcRnDriver.hs | 21 +++++---------------- 7 files changed, 99 insertions(+), 56 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 f8e3cd3b160d20dbd18d490b7babe43153bb3287 From git at git.haskell.org Fri Mar 2 19:11:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 19:11:54 +0000 (UTC) Subject: [commit: ghc] master: Make cost centre symbol names deterministic. (d8e47a2) Message-ID: <20180302191154.99B7E3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d8e47a2ea89dbce647b06132ec10c39a2de67437/ghc >--------------------------------------------------------------- commit d8e47a2ea89dbce647b06132ec10c39a2de67437 Author: Shea Levy Date: Fri Mar 2 12:59:06 2018 -0500 Make cost centre symbol names deterministic. Previously, non-CAF cost centre symbol names contained a unique, leading to non-deterministic object files which, among other issues, can lead to an inconsistency causing linking failure when using cached builds sourced from multiple machines, such as with nix. Now, each cost centre symbol is annotated with the type of cost centre it is (CAF, expression annotation, declaration annotation, or HPC) and, when a single module has multiple cost centres with the same name and type, a 0-based index. Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: niteria, simonmar, RyanGlScott, osa1, rwbarton, thomie, carter GHC Trac Issues: #4012, #12935 Differential Revision: https://phabricator.haskell.org/D4388 >--------------------------------------------------------------- d8e47a2ea89dbce647b06132ec10c39a2de67437 compiler/deSugar/Coverage.hs | 21 +++--- compiler/deSugar/DsExpr.hs | 5 +- compiler/deSugar/DsMonad.hs | 14 ++-- compiler/ghc.cabal.in | 1 + compiler/profiling/CostCentre.hs | 131 +++++++++++++++++++++------------- compiler/profiling/CostCentreState.hs | 36 ++++++++++ compiler/stgSyn/CoreToStg.hs | 2 +- compiler/typecheck/TcBinds.hs | 16 +++-- compiler/typecheck/TcRnMonad.hs | 29 +++++++- compiler/typecheck/TcRnTypes.hs | 8 ++- 10 files changed, 188 insertions(+), 75 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 d8e47a2ea89dbce647b06132ec10c39a2de67437 From git at git.haskell.org Fri Mar 2 21:07:37 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:37 +0000 (UTC) Subject: [commit: ghc] master: Move Data.Functor.Contravariant from the contravariant package to base. (8c7a155) Message-ID: <20180302210737.581403A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8c7a1551fcd004c37f4ccd99c7c10395179519f1/ghc >--------------------------------------------------------------- commit 8c7a1551fcd004c37f4ccd99c7c10395179519f1 Author: Andrew Martin Date: Fri Mar 2 14:14:13 2018 -0500 Move Data.Functor.Contravariant from the contravariant package to base. Move Data.Functor.Contravariant from the contravariant package to base. Since base is the bottom of the dependency hierarchy, several instances have been removed. They will need to be added to the following packages: transformers, StateVar, and possibly tagged. There may not actually have been any types from tagged that previous had instanced provided by this module though, since it may have only been used for Data.Proxy. Additionally, all CPP has been removed. Derived Typeable instances have been removed (since Typeable is now automatically derived for everything). The language extension Safe is still used, although it is unclear to ATM whether or not it is necessary. This resolves trac issue #14767. Test Plan: validate Reviewers: RyanGlScott, ekmett, hvr, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, ekmett, carter, RyanGlScott GHC Trac Issues: #14767 Differential Revision: https://phabricator.haskell.org/D4399 >--------------------------------------------------------------- 8c7a1551fcd004c37f4ccd99c7c10395179519f1 docs/users_guide/8.6.1-notes.rst | 7 +- libraries/base/Data/Functor/Contravariant.hs | 295 +++++++++++++++++++++++++++ libraries/base/base.cabal | 1 + libraries/base/changelog.md | 2 + 4 files changed, 304 insertions(+), 1 deletion(-) 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 8c7a1551fcd004c37f4ccd99c7c10395179519f1 From git at git.haskell.org Fri Mar 2 21:07:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:41 +0000 (UTC) Subject: [commit: ghc] master: Improve exhaustive checking for guards in pattern bindings and MultiIf. (e8e9f6a) Message-ID: <20180302210741.1999B3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a/ghc >--------------------------------------------------------------- commit e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a Author: HE, Tao Date: Fri Mar 2 14:16:24 2018 -0500 Improve exhaustive checking for guards in pattern bindings and MultiIf. Previously we didn't do exhaustive checking on MultiIf expressions and guards in pattern bindings. We can construct the `LMatch` directly from GRHSs or [LHsExpr] (MultiIf's alts) then feed it to checkMatches, without construct the MatchGroup and using function `matchWrapper`. Signed-off-by: HE, Tao Test Plan: make test TEST="T14773a T14773b" Reviewers: bgamari, RyanGlScott, simonpj Reviewed By: bgamari, simonpj Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14773 Differential Revision: https://phabricator.haskell.org/D4400 >--------------------------------------------------------------- e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a compiler/deSugar/Check.hs | 24 +++++++++++++++--- compiler/deSugar/DsBinds.hs | 2 ++ compiler/deSugar/DsExpr.hs | 3 +++ compiler/deSugar/DsGRHSs.hs | 3 +-- compiler/hsSyn/HsExpr.hs | 29 ++++++++++++++-------- docs/users_guide/8.6.1-notes.rst | 16 ++++++++++++ testsuite/tests/deSugar/should_compile/T14773a.hs | 10 ++++++++ .../tests/deSugar/should_compile/T14773a.stderr | 5 ++++ testsuite/tests/deSugar/should_compile/T14773b.hs | 8 ++++++ .../tests/deSugar/should_compile/T14773b.stderr | 5 ++++ testsuite/tests/deSugar/should_compile/all.T | 2 ++ 11 files changed, 91 insertions(+), 16 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 e8e9f6a7a6d857efe6e3b2aec0c4964f9a8fa09a From git at git.haskell.org Fri Mar 2 21:07:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:44 +0000 (UTC) Subject: [commit: ghc] master: Add regression test for #12790 (125d151) Message-ID: <20180302210744.44B123A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/125d15181c7ac8d8fbaa43f799f9e3876dc2f57b/ghc >--------------------------------------------------------------- commit 125d15181c7ac8d8fbaa43f799f9e3876dc2f57b Author: Ryan Scott Date: Fri Mar 2 14:17:52 2018 -0500 Add regression test for #12790 Test Plan: make test TEST=T12790 Reviewers: bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, dfeuer, rwbarton, thomie, carter GHC Trac Issues: #12790 Differential Revision: https://phabricator.haskell.org/D4412 >--------------------------------------------------------------- 125d15181c7ac8d8fbaa43f799f9e3876dc2f57b testsuite/tests/profiling/should_compile/T12790.hs | 48 ++++++++++++++++++++++ testsuite/tests/profiling/should_compile/all.T | 1 + 2 files changed, 49 insertions(+) diff --git a/testsuite/tests/profiling/should_compile/T12790.hs b/testsuite/tests/profiling/should_compile/T12790.hs new file mode 100644 index 0000000..3c3f7d4 --- /dev/null +++ b/testsuite/tests/profiling/should_compile/T12790.hs @@ -0,0 +1,48 @@ +module T12790 (list) where + +import Data.Foldable (asum) +import Text.ParserCombinators.Parsec (Parser, sepBy, try) + +data Expr + = Var Fixity String + | App Expr Expr + +data Fixity = Pref | Inf + +cons, nil :: Expr +cons = Var Inf ":" +nil = Var Pref "[]" + +brackets :: Parser a -> Parser a +brackets = undefined + +symbol :: String -> Parser String +symbol = undefined + +list :: Parser Expr +list = asum (map (try . brackets) plist) where + plist = [ + foldr (\e1 e2 -> cons `App` e1 `App` e2) nil `fmap` + (myParser False `sepBy` symbol ","), + do e <- myParser False + _ <- symbol ".." + return $ Var Pref "enumFrom" `App` e, + do e <- myParser False + _ <- symbol "," + e' <- myParser False + _ <- symbol ".." + return $ Var Pref "enumFromThen" `App` e `App` e', + do e <- myParser False + _ <- symbol ".." + e' <- myParser False + return $ Var Pref "enumFromTo" `App` e `App` e', + do e <- myParser False + _ <- symbol "," + e' <- myParser False + _ <- symbol ".." + e'' <- myParser False + return $ Var Pref "enumFromThenTo" `App` e `App` e' `App` e'' + ] + +myParser :: Bool -> Parser Expr +myParser = undefined diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T index 155206a..1ebcb07 100644 --- a/testsuite/tests/profiling/should_compile/all.T +++ b/testsuite/tests/profiling/should_compile/all.T @@ -5,3 +5,4 @@ test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fprof-cafs']) test('T5889', [only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0']) +test('T12790', [only_ways(['normal']), req_profiling], compile, ['-O -prof']) From git at git.haskell.org Fri Mar 2 21:07:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:47 +0000 (UTC) Subject: [commit: ghc] master: Fix #14817 by not double-printing data family instance kind signatures (aef2b42) Message-ID: <20180302210747.C8CEA3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aef2b429072e3d3bbdbcb9e4082a0d86ba329d9e/ghc >--------------------------------------------------------------- commit aef2b429072e3d3bbdbcb9e4082a0d86ba329d9e Author: Ryan Scott Date: Fri Mar 2 14:18:15 2018 -0500 Fix #14817 by not double-printing data family instance kind signatures Within `pprDataFamInstDecl`, we were invoking `pprFamInstLHS` to pretty-print a data family instance header, and we were passing `Just` a kind signature to `pprFamInstLHS` to make it pretty-print the kind signature alongside it (this is a consequence of commit d1ef223cfebd23c25489a4b0c67fbaa2f91c1ec6). But this is silly, because then invoke `pp_data_defn`, which //also// pretty-prints the kind signature, resulting in the kind signature being printed twice by mistake. This fix is simple—pass `Nothing` to `pprFamInstLHS` instead. Test Plan: make test TEST=T14817 Reviewers: alanz, bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, thomie, carter GHC Trac Issues: #14817 Differential Revision: https://phabricator.haskell.org/D4418 >--------------------------------------------------------------- aef2b429072e3d3bbdbcb9e4082a0d86ba329d9e compiler/hsSyn/HsDecls.hs | 5 ++++- testsuite/tests/th/T14817.hs | 6 ++++++ testsuite/tests/th/T14817.stderr | 7 +++++++ testsuite/tests/th/all.T | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 8078582..475e31e 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -1555,7 +1555,10 @@ pprDataFamInstDecl top_lvl (DataFamInstDecl { dfid_eqn = HsIB { hsib_body = = pp_data_defn pp_hdr defn where pp_hdr ctxt = ppr_instance_keyword top_lvl - <+> pprFamInstLHS tycon pats fixity ctxt (dd_kindSig defn) + <+> pprFamInstLHS tycon pats fixity ctxt Nothing + -- No need to pass an explicit kind signature to + -- pprFamInstLHS here, since pp_data_defn already + -- pretty-prints that. See #14817. pprDataFamInstFlavour :: DataFamInstDecl pass -> SDoc pprDataFamInstFlavour (DataFamInstDecl { dfid_eqn = HsIB { hsib_body = diff --git a/testsuite/tests/th/T14817.hs b/testsuite/tests/th/T14817.hs new file mode 100644 index 0000000..1019dec --- /dev/null +++ b/testsuite/tests/th/T14817.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeFamilies #-} +module T14817 where + +$([d| data family Foo :: * + data instance Foo :: * |]) diff --git a/testsuite/tests/th/T14817.stderr b/testsuite/tests/th/T14817.stderr new file mode 100644 index 0000000..7c63763 --- /dev/null +++ b/testsuite/tests/th/T14817.stderr @@ -0,0 +1,7 @@ +T14817.hs:(5,3)-(6,31): Splicing declarations + [d| data family Foo :: * + + data instance Foo :: * |] + ======> + data family Foo :: GHC.Types.Type + data instance Foo :: GHC.Types.Type diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 4156716..7305800 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -399,3 +399,4 @@ test('T14204', normal, compile_fail, ['-v0']) test('T14060', normal, compile_and_run, ['-v0']) test('T14646', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T14681', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T14817', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Fri Mar 2 21:07:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:50 +0000 (UTC) Subject: [commit: ghc] master: DynFlags: Support British spelling of GeneralisedNewtypeDeriving (1773964) Message-ID: <20180302210750.9FCEF3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/17739645ce5a5d4b46b1de8d43e87b318a98ae6b/ghc >--------------------------------------------------------------- commit 17739645ce5a5d4b46b1de8d43e87b318a98ae6b Author: Ben Gamari Date: Fri Mar 2 14:18:48 2018 -0500 DynFlags: Support British spelling of GeneralisedNewtypeDeriving Reviewers: dfeuer Reviewed By: dfeuer Subscribers: dfeuer, rwbarton, thomie, carter GHC Trac Issues: #14819 Differential Revision: https://phabricator.haskell.org/D4422 >--------------------------------------------------------------- 17739645ce5a5d4b46b1de8d43e87b318a98ae6b compiler/main/DynFlags.hs | 2 ++ docs/users_guide/8.6.1-notes.rst | 2 ++ docs/users_guide/glasgow_exts.rst | 2 +- testsuite/tests/driver/T4437.hs | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 873ac3b..99a798e 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -4122,6 +4122,8 @@ xFlagsDeps = [ flagSpec "GHCForeignImportPrim" LangExt.GHCForeignImportPrim, flagSpec' "GeneralizedNewtypeDeriving" LangExt.GeneralizedNewtypeDeriving setGenDeriving, + flagSpec' "GeneralisedNewtypeDeriving" LangExt.GeneralizedNewtypeDeriving + setGenDeriving, flagSpec "ImplicitParams" LangExt.ImplicitParams, flagSpec "ImplicitPrelude" LangExt.ImplicitPrelude, flagSpec "ImpredicativeTypes" LangExt.ImpredicativeTypes, diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst index f5f2a5a..17617ac 100644 --- a/docs/users_guide/8.6.1-notes.rst +++ b/docs/users_guide/8.6.1-notes.rst @@ -54,6 +54,8 @@ Compiler calling the C compiler. Instead we use :ghc-flag:`-iquote` to only add it as an include path for `#include ""`. See :ghc-ticket:`14312`. +- GHC now supports British spelling of :extension:`GeneralizedNewtypeDeriving`. + Runtime system ~~~~~~~~~~~~~~ diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 439f4d2..40013f3 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -4586,7 +4586,7 @@ Generalised derived instances for newtypes GeneralizedNewtypeDeriving :shortdesc: Enable newtype deriving. - :since: 6.8.1 + :since: 6.8.1. British spelling since 8.6.1. Enable GHC's cunning generalised deriving mechanism for ``newtype``\s diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 6a46e52..d82e434 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -40,7 +40,8 @@ expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", "AlternativeLayoutRuleTransitional", "EmptyDataDeriving", - "NumericUnderscores"] + "NumericUnderscores", + "GeneralisedNewtypeDeriving"] expectedCabalOnlyExtensions :: [String] expectedCabalOnlyExtensions = ["Generics", From git at git.haskell.org Fri Mar 2 21:07:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:07:53 +0000 (UTC) Subject: [commit: ghc] master: Various Windows / Cross Compile to Windows fixes (4a0d0d8) Message-ID: <20180302210753.B010F3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4a0d0d8062a204b867fc510c50e69a056ce7636f/ghc >--------------------------------------------------------------- commit 4a0d0d8062a204b867fc510c50e69a056ce7636f Author: Moritz Angermann Date: Fri Mar 2 14:19:58 2018 -0500 Various Windows / Cross Compile to Windows fixes - Adds quick-cross-ncg flavour. - Fix windows wchar with `_s` for mingw - Lookup windres, dllwrap and objdump - Fix type. Reviewers: bgamari, hvr, Phyx, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, erikd, carter Differential Revision: https://phabricator.haskell.org/D4430 >--------------------------------------------------------------- 4a0d0d8062a204b867fc510c50e69a056ce7636f configure.ac | 4 ++++ libraries/base/cbits/Win32Utils.c | 2 ++ rts/PathUtils.c | 5 +++++ rts/win32/OSMem.c | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 216f43f..1d3effb 100644 --- a/configure.ac +++ b/configure.ac @@ -418,6 +418,10 @@ then AC_PATH_PROG([DllWrap],[dllwrap]) AC_PATH_PROG([Windres],[windres]) AC_PATH_PROG([Genlib],[genlib]) +else + AC_CHECK_TARGET_TOOL([Windres],[windres]) + AC_CHECK_TARGET_TOOL([DllWrap],[dllwrap]) + AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump]) fi DllWrapCmd="$DllWrap" diff --git a/libraries/base/cbits/Win32Utils.c b/libraries/base/cbits/Win32Utils.c index ce7ce97..b33db04 100644 --- a/libraries/base/cbits/Win32Utils.c +++ b/libraries/base/cbits/Win32Utils.c @@ -9,6 +9,8 @@ #include "HsBase.h" #include #include +/* Using Secure APIs */ +#define MINGW_HAS_SECURE_API 1 #include #include diff --git a/rts/PathUtils.c b/rts/PathUtils.c index 1b0b729..def3f7e 100644 --- a/rts/PathUtils.c +++ b/rts/PathUtils.c @@ -7,6 +7,11 @@ #include #include +#if defined(mingw32_HOST_OS) +/* Using Secure APIs */ +#define MINGW_HAS_SECURE_API 1 +#include +#endif pathchar* pathdup(pathchar *path) { diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index c67b95b..534cd15 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -458,7 +458,7 @@ void *osReserveHeapMemory (void *startAddress, W_ *len) sysErrorBelch( "osReserveHeapMemory: VirtualAlloc MEM_RESERVE %llu bytes \ at address %p bytes failed", - len + MBLOCK_SIZE, startAddress); + *len + MBLOCK_SIZE, startAddress); } stg_exit(EXIT_FAILURE); } From git at git.haskell.org Fri Mar 2 21:54:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:01 +0000 (UTC) Subject: [commit: ghc] master: GHCi info: Use src file for cache invalidation (969e747) Message-ID: <20180302215401.405633A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/969e747f67f57f7dd57c2e549d6a007505671158/ghc >--------------------------------------------------------------- commit 969e747f67f57f7dd57c2e549d6a007505671158 Author: alexbiehl Date: Fri Mar 2 16:11:45 2018 -0500 GHCi info: Use src file for cache invalidation Prior to this patch GHCi used the modification time of a module's object file to invalidate the info cache. We now look at the modification time of the source file, if present. This addresses part of https://ghc.haskell.org/trac/ghc/ticket/12706#comment:3. Reviewers: bgamari Reviewed By: bgamari Subscribers: lelf, alpmestan, rwbarton, thomie, carter GHC Trac Issues: #12706 Differential Revision: https://phabricator.haskell.org/D4459 >--------------------------------------------------------------- 969e747f67f57f7dd57c2e549d6a007505671158 ghc/GHCi/UI/Info.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs index fd8749a..ad390dd 100644 --- a/ghc/GHCi/UI/Info.hs +++ b/ghc/GHCi/UI/Info.hs @@ -276,7 +276,9 @@ collectInfo ms loaded = do cacheInvalid name = case M.lookup name ms of Nothing -> return True Just mi -> do - let fp = ml_obj_file (ms_location (modinfoSummary mi)) + let src_fp = ml_hs_file (ms_location (modinfoSummary mi)) + obj_fp = ml_obj_file (ms_location (modinfoSummary mi)) + fp = fromMaybe obj_fp src_fp last' = modinfoLastUpdate mi exists <- doesFileExist fp if exists From git at git.haskell.org Fri Mar 2 21:54:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:04 +0000 (UTC) Subject: [commit: ghc] master: Improve missing-home-modules warning formatting (6a7e159) Message-ID: <20180302215404.1417A3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6a7e159ce25b432824f8757e0c768f2b2e2754df/ghc >--------------------------------------------------------------- commit 6a7e159ce25b432824f8757e0c768f2b2e2754df Author: Matthew Pickering Date: Fri Mar 2 16:12:22 2018 -0500 Improve missing-home-modules warning formatting Previously the modules were smashed together at the end of the line. As the header is quite long, this meant for quite long lines which wrapped on smaller terminals. err msg: A B Now they are nested underneath the long first line of the error message. err msg: A B Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4454 >--------------------------------------------------------------- 6a7e159ce25b432824f8757e0c768f2b2e2754df compiler/main/GhcMake.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 73a7157..d399d03 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -201,11 +201,16 @@ warnMissingHomeModules hsc_env mod_graph = msg | gopt Opt_BuildingCabalPackage dflags - = text "These modules are needed for compilation but not listed in your .cabal file's other-modules: " - <> sep (map ppr missing) + = hang + (text "These modules are needed for compilation but not listed in your .cabal file's other-modules: ") + 4 + (sep (map ppr missing)) | otherwise - = text "Modules are not listed in command line but needed for compilation: " - <> sep (map ppr missing) + = + hang + (text "Modules are not listed in command line but needed for compilation: ") + 4 + (sep (map ppr missing)) warn = makeIntoWarning (Reason Opt_WarnMissingHomeModules) (mkPlainErrMsg dflags noSrcSpan msg) From git at git.haskell.org Fri Mar 2 21:54:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:06 +0000 (UTC) Subject: [commit: ghc] master: Add @since annotations for derived instances in base (5c28ee8) Message-ID: <20180302215406.E9F713A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c28ee88dd66617b0fd5dbe0d90142ce983a547e/ghc >--------------------------------------------------------------- commit 5c28ee88dd66617b0fd5dbe0d90142ce983a547e Author: Chaitanya Koparkar Date: Fri Mar 2 16:12:56 2018 -0500 Add @since annotations for derived instances in base Test Plan: ./validate Reviewers: hvr, goldfire, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11767 Differential Revision: https://phabricator.haskell.org/D4452 >--------------------------------------------------------------- 5c28ee88dd66617b0fd5dbe0d90142ce983a547e libraries/base/Control/Applicative.hs | 20 ++- libraries/base/Control/Concurrent/Chan.hs | 2 +- libraries/base/Data/Complex.hs | 12 +- libraries/base/Data/Data.hs | 14 +- libraries/base/Data/Either.hs | 7 +- libraries/base/Data/Fixed.hs | 6 +- libraries/base/Data/Foldable.hs | 27 ++++ libraries/base/Data/Functor/Compose.hs | 5 +- libraries/base/Data/Functor/Const.hs | 23 ++- libraries/base/Data/Functor/Identity.hs | 23 ++- libraries/base/Data/Functor/Product.hs | 5 +- libraries/base/Data/Functor/Sum.hs | 5 +- libraries/base/Data/Monoid.hs | 24 ++- libraries/base/Data/Ord.hs | 10 +- libraries/base/Data/Proxy.hs | 4 +- libraries/base/Data/Semigroup.hs | 70 +++++++-- libraries/base/Data/Semigroup/Internal.hs | 64 +++++++- libraries/base/Data/String.hs | 2 + libraries/base/Data/Traversable.hs | 28 ++++ libraries/base/Data/Type/Coercion.hs | 5 + libraries/base/Data/Type/Equality.hs | 5 + libraries/base/Data/Version.hs | 5 +- libraries/base/GHC/Base.hs | 8 +- libraries/base/GHC/ByteOrder.hs | 8 +- libraries/base/GHC/Conc/Sync.hs | 10 +- libraries/base/GHC/Conc/Windows.hs | 7 +- libraries/base/GHC/Event/Control.hs | 4 +- libraries/base/GHC/Event/EPoll.hsc | 7 +- libraries/base/GHC/Event/Internal.hs | 16 +- libraries/base/GHC/Event/KQueue.hsc | 25 ++- libraries/base/GHC/Event/Manager.hs | 8 +- libraries/base/GHC/Event/Poll.hsc | 10 +- libraries/base/GHC/Event/TimerManager.hs | 6 +- libraries/base/GHC/Event/Unique.hs | 5 +- libraries/base/GHC/Exception.hs | 8 +- libraries/base/GHC/Exts.hs | 4 +- libraries/base/GHC/Fingerprint/Type.hs | 4 +- libraries/base/GHC/Generics.hs | 210 ++++++++++++++++++++++--- libraries/base/GHC/IO.hs | 4 +- libraries/base/GHC/IO/Buffer.hs | 3 +- libraries/base/GHC/IO/Device.hs | 11 +- libraries/base/GHC/IO/Encoding/Failure.hs | 3 +- libraries/base/GHC/IO/Encoding/Types.hs | 4 +- libraries/base/GHC/IO/Exception.hs | 8 +- libraries/base/GHC/IO/Handle/Lock.hsc | 3 +- libraries/base/GHC/IO/Handle/Types.hs | 18 ++- libraries/base/GHC/IO/IOMode.hs | 8 +- libraries/base/GHC/IORef.hs | 2 +- libraries/base/GHC/Natural.hs | 6 +- libraries/base/GHC/Ptr.hs | 5 +- libraries/base/GHC/RTS/Flags.hsc | 42 +++-- libraries/base/GHC/Read.hs | 2 + libraries/base/GHC/Real.hs | 2 +- libraries/base/GHC/Show.hs | 15 ++ libraries/base/GHC/Stable.hs | 2 +- libraries/base/GHC/Stack/Types.hs | 2 +- libraries/base/GHC/StaticPtr.hs | 2 +- libraries/base/GHC/Stats.hsc | 8 +- libraries/base/GHC/Unicode.hs | 9 +- libraries/base/System/Timeout.hs | 4 +- libraries/base/Text/ParserCombinators/ReadP.hs | 2 +- libraries/base/Text/Read/Lex.hs | 10 +- 62 files changed, 734 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 5c28ee88dd66617b0fd5dbe0d90142ce983a547e From git at git.haskell.org Fri Mar 2 21:54:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:09 +0000 (UTC) Subject: [commit: ghc] master: rts/win32: Assert that the IO manager has been initialised (6e4fa81) Message-ID: <20180302215409.B63BC3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6e4fa8175677c39441f1502c58a832e79570cb0d/ghc >--------------------------------------------------------------- commit 6e4fa8175677c39441f1502c58a832e79570cb0d Author: Simon Jakobi Date: Fri Mar 2 16:13:26 2018 -0500 rts/win32: Assert that the IO manager has been initialised Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4450 >--------------------------------------------------------------- 6e4fa8175677c39441f1502c58a832e79570cb0d rts/win32/IOManager.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/rts/win32/IOManager.c b/rts/win32/IOManager.c index 216e725..f155180 100644 --- a/rts/win32/IOManager.c +++ b/rts/win32/IOManager.c @@ -435,13 +435,12 @@ AddIORequest ( int fd, char* buffer, CompletionProc onCompletion) { + ASSERT(ioMan); + WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem)); - unsigned int reqID; - if (!ioMan || !wItem) { - free(wItem); - return 0; - } - reqID = ioMan->requestID++; + if (!wItem) return 0; + + unsigned int reqID = ioMan->requestID++; /* Fill in the blanks */ wItem->workKind = ( isSocket ? WORKER_FOR_SOCKET : 0 ) | @@ -467,13 +466,12 @@ BOOL AddDelayRequest ( HsInt usecs, CompletionProc onCompletion) { + ASSERT(ioMan); + WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem)); - unsigned int reqID; - if (!ioMan || !wItem) { - free(wItem); - return false; - } - reqID = ioMan->requestID++; + if (!wItem) return false; + + unsigned int reqID = ioMan->requestID++; /* Fill in the blanks */ wItem->workKind = WORKER_DELAY; @@ -495,13 +493,12 @@ AddProcRequest ( void* proc, void* param, CompletionProc onCompletion) { + ASSERT(ioMan); + WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem)); - unsigned int reqID; - if (!ioMan || !wItem) { - free(wItem); - return false; - } - reqID = ioMan->requestID++; + if (!wItem) return false; + + unsigned int reqID = ioMan->requestID++; /* Fill in the blanks */ wItem->workKind = WORKER_DO_PROC; From git at git.haskell.org Fri Mar 2 21:54:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:12 +0000 (UTC) Subject: [commit: ghc] master: configure: Enable LD_NO_GOLD is set in all codepaths (bc1bcaa) Message-ID: <20180302215412.81AC43A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc1bcaa2c0c66fb247d1338d6d0055a833918a7f/ghc >--------------------------------------------------------------- commit bc1bcaa2c0c66fb247d1338d6d0055a833918a7f Author: Ben Gamari Date: Fri Mar 2 16:13:53 2018 -0500 configure: Enable LD_NO_GOLD is set in all codepaths Test Plan: `./configure --disable-ld-override; make; make install` Reviewers: trofi, hvr Reviewed By: trofi Subscribers: rwbarton, thomie, erikd, carter, simonmar GHC Trac Issues: #14675 Differential Revision: https://phabricator.haskell.org/D4448 >--------------------------------------------------------------- bc1bcaa2c0c66fb247d1338d6d0055a833918a7f aclocal.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aclocal.m4 b/aclocal.m4 index 5ad3752..a2fdbdc 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2379,12 +2379,16 @@ 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? + if test "x$LD_NO_GOLD" = "x"; then LD_NO_GOLD=$LD; fi } if test "x$enable_ld_override" = "xyes"; then find_ld else AC_CHECK_TARGET_TOOL([LD], [ld]) + if test "x$LD_NO_GOLD" = "x"; then LD_NO_GOLD=$LD; fi fi CHECK_LD_COPY_BUG([$1]) From git at git.haskell.org Fri Mar 2 21:54:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:15 +0000 (UTC) Subject: [commit: ghc] master: Add Applicative, Semigroup, and Monoid instances in GHC.Generics (7782b47) Message-ID: <20180302215415.4CF523A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7782b47c4193975123edd3af630e6fe59ac7ef73/ghc >--------------------------------------------------------------- commit 7782b47c4193975123edd3af630e6fe59ac7ef73 Author: Lysxia Date: Fri Mar 2 16:14:36 2018 -0500 Add Applicative, Semigroup, and Monoid instances in GHC.Generics Reviewers: hvr, bgamari, alpmestan, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4447 >--------------------------------------------------------------- 7782b47c4193975123edd3af630e6fe59ac7ef73 libraries/base/GHC/Generics.hs | 59 +++++++++++++++++++++++++++++++++++++++++- libraries/base/changelog.md | 3 +++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs index ff44cf8..9ac0528 100644 --- a/libraries/base/GHC/Generics.hs +++ b/libraries/base/GHC/Generics.hs @@ -740,7 +740,8 @@ import GHC.Types -- Needed for instances import GHC.Arr ( Ix ) import GHC.Base ( Alternative(..), Applicative(..), Functor(..) - , Monad(..), MonadPlus(..), NonEmpty(..), String, coerce ) + , Monad(..), MonadPlus(..), NonEmpty(..), String, coerce + , Semigroup(..), Monoid(..) ) import GHC.Classes ( Eq(..), Ord(..) ) import GHC.Enum ( Bounded, Enum ) import GHC.Read ( Read(..) ) @@ -765,6 +766,10 @@ data V1 (p :: k) , Generic1 -- ^ @since 4.9.0.0 ) +-- | @since 4.12.0.0 +instance Semigroup (V1 p) where + v <> _ = v + -- | Unit: used for constructors without arguments data U1 (p :: k) = U1 deriving ( Generic -- ^ @since 4.7.0.0 @@ -808,6 +813,14 @@ instance Monad U1 where -- | @since 4.9.0.0 instance MonadPlus U1 +-- | @since 4.12.0.0 +instance Semigroup (U1 p) where + _ <> _ = U1 + +-- | @since 4.12.0.0 +instance Monoid (U1 p) where + mempty = U1 + -- | Used for marking occurrences of the parameter newtype Par1 p = Par1 { unPar1 :: p } deriving ( Eq -- ^ @since 4.7.0.0 @@ -829,6 +842,12 @@ instance Applicative Par1 where instance Monad Par1 where Par1 x >>= f = f x +-- | @since 4.12.0.0 +deriving instance Semigroup p => Semigroup (Par1 p) + +-- | @since 4.12.0.0 +deriving instance Monoid p => Monoid (Par1 p) + -- | Recursive calls of kind @* -> *@ (or kind @k -> *@, when @PolyKinds@ -- is enabled) newtype Rec1 (f :: k -> *) (p :: k) = Rec1 { unRec1 :: f p } @@ -854,6 +873,12 @@ instance Monad f => Monad (Rec1 f) where -- | @since 4.9.0.0 deriving instance MonadPlus f => MonadPlus (Rec1 f) +-- | @since 4.12.0.0 +deriving instance Semigroup (f p) => Semigroup (Rec1 f p) + +-- | @since 4.12.0.0 +deriving instance Monoid (f p) => Monoid (Rec1 f p) + -- | Constants, additional parameters and recursion of kind @*@ newtype K1 (i :: *) c (p :: k) = K1 { unK1 :: c } deriving ( Eq -- ^ @since 4.7.0.0 @@ -865,6 +890,18 @@ newtype K1 (i :: *) c (p :: k) = K1 { unK1 :: c } , Generic1 -- ^ @since 4.9.0.0 ) +-- | @since 4.12.0.0 +instance Monoid c => Applicative (K1 i c) where + pure _ = K1 mempty + liftA2 = \_ -> coerce (mappend :: c -> c -> c) + (<*>) = coerce (mappend :: c -> c -> c) + +-- | @since 4.12.0.0 +deriving instance Semigroup c => Semigroup (K1 i c p) + +-- | @since 4.12.0.0 +deriving instance Monoid c => Monoid (K1 i c p) + -- | @since 4.9.0.0 deriving instance Applicative f => Applicative (M1 i c f) @@ -877,6 +914,12 @@ deriving instance Monad f => Monad (M1 i c f) -- | @since 4.9.0.0 deriving instance MonadPlus f => MonadPlus (M1 i c f) +-- | @since 4.12.0.0 +deriving instance Semigroup (f p) => Semigroup (M1 i c f p) + +-- | @since 4.12.0.0 +deriving instance Monoid (f p) => Monoid (M1 i c f p) + -- | Meta-information (constructor names, etc.) newtype M1 (i :: *) (c :: Meta) (f :: k -> *) (p :: k) = M1 { unM1 :: f p } deriving ( Eq -- ^ @since 4.7.0.0 @@ -933,6 +976,14 @@ instance (Monad f, Monad g) => Monad (f :*: g) where -- | @since 4.9.0.0 instance (MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) +-- | @since 4.12.0.0 +instance (Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p) where + (x1 :*: y1) <> (x2 :*: y2) = (x1 <> x2) :*: (y1 <> y2) + +-- | @since 4.12.0.0 +instance (Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) where + mempty = mempty :*: mempty + -- | Composition of functors infixr 7 :.: newtype (:.:) (f :: k2 -> *) (g :: k1 -> k2) (p :: k1) = @@ -958,6 +1009,12 @@ instance (Alternative f, Applicative g) => Alternative (f :.: g) where (<|>) = coerce ((<|>) :: f (g a) -> f (g a) -> f (g a)) :: forall a . (f :.: g) a -> (f :.: g) a -> (f :.: g) a +-- | @since 4.12.0.0 +deriving instance Semigroup (f (g p)) => Semigroup ((f :.: g) p) + +-- | @since 4.12.0.0 +deriving instance Monoid (f (g p)) => Monoid ((f :.: g) p) + -- | Constants of unlifted kinds -- -- @since 4.9.0.0 diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index fdac6f2..47fe011 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -6,6 +6,9 @@ * `($!)` is now representation-polymorphic like `($)`. + * Add `Applicative` (for `K1`), `Semigroup` and `Monoid` instances in + `GHC.Generics`. (#14849) + ## 4.11.0.0 *TBA* * Bundled with GHC 8.4.1 From git at git.haskell.org Fri Mar 2 21:54:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:18 +0000 (UTC) Subject: [commit: ghc] master: Adds *-cross-ncg flavour. (e4dcebf) Message-ID: <20180302215418.B023E3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e4dcebf899c796a13dabf8964038f78505b9f4ec/ghc >--------------------------------------------------------------- commit e4dcebf899c796a13dabf8964038f78505b9f4ec Author: Moritz Angermann Date: Fri Mar 2 16:15:09 2018 -0500 Adds *-cross-ncg flavour. Our *-cross flavours force -fllvm, this adds flavours for cross compilation to x86_64, where we can use our native code generator. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4443 >--------------------------------------------------------------- e4dcebf899c796a13dabf8964038f78505b9f4ec mk/build.mk.sample | 17 +++++++++++++---- mk/flavours/{bench-cross.mk => bench-cross-ncg.mk} | 4 ++-- mk/flavours/{perf-cross.mk => perf-cross-ncg.mk} | 4 ++-- mk/flavours/{quick-cross.mk => quick-cross-ncg.mk} | 4 ++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/mk/build.mk.sample b/mk/build.mk.sample index 958cea7..ce7b4d6 100644 --- a/mk/build.mk.sample +++ b/mk/build.mk.sample @@ -13,17 +13,23 @@ # As above but build GHC using the LLVM backend #BuildFlavour = perf-llvm -# Perf build configured for a cross-compiler +# Perf build configured for a cross-compiler (using the LLVM backend) #BuildFlavour = perf-cross +# Perf build configured for a cross-compiler (using the NCG backend) +#BuildFlavour = perf-cross-ncg + # Fast build with optimised libraries, no profiling (RECOMMENDED): #BuildFlavour = quick # Fast build with optimised libraries, no profiling, with LLVM: #BuildFlavour = quick-llvm -# Fast build configured for a cross compiler -#BuildFlavour = quick-cross +# Fast build configured for a cross compiler (using the LLVM backend) +#BuildFlavour = quick-cross + +# Fast build configured for a cross compiler (using the NCG backend) +#BuildFlavour = quick-cross-ncg # Even faster build. NOT RECOMMENDED: the libraries will be # completely unoptimised, so any code built with this compiler @@ -51,9 +57,12 @@ # As above but build GHC using the LLVM backend #BuildFlavour = bench-llvm -# Bench build configured for a cross-compiler +# Bench build configured for a cross-compiler (using the LLVM backend) #BuildFlavour = bench-cross +# Bench build configured for a cross-compiler (using the NCG backend) +#BuildFlavour = bench-cross-ncg + # Use the same settings as validate. #BuildFlavour = validate diff --git a/mk/flavours/bench-cross.mk b/mk/flavours/bench-cross-ncg.mk similarity index 85% copy from mk/flavours/bench-cross.mk copy to mk/flavours/bench-cross-ncg.mk index ae67f34..6b686af 100644 --- a/mk/flavours/bench-cross.mk +++ b/mk/flavours/bench-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O -GhcStage2HcOpts = -O0 -fllvm -GhcLibHcOpts = -O2 -fllvm +GhcStage2HcOpts = -O0 +GhcLibHcOpts = -O2 BUILD_PROF_LIBS = NO SplitObjs = NO SplitSections = NO diff --git a/mk/flavours/perf-cross.mk b/mk/flavours/perf-cross-ncg.mk similarity index 83% copy from mk/flavours/perf-cross.mk copy to mk/flavours/perf-cross-ncg.mk index f202642..4b94c48 100644 --- a/mk/flavours/perf-cross.mk +++ b/mk/flavours/perf-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O2 -GhcStage2HcOpts = -O2 -fllvm -GhcLibHcOpts = -O2 -fllvm +GhcStage2HcOpts = -O2 +GhcLibHcOpts = -O2 BUILD_PROF_LIBS = YES #SplitObjs HADDOCK_DOCS = NO diff --git a/mk/flavours/quick-cross.mk b/mk/flavours/quick-cross-ncg.mk similarity index 85% copy from mk/flavours/quick-cross.mk copy to mk/flavours/quick-cross-ncg.mk index f0f00d2..97352cc 100644 --- a/mk/flavours/quick-cross.mk +++ b/mk/flavours/quick-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O0 -H64m GhcStage1HcOpts = -O -GhcStage2HcOpts = -O0 -fllvm -GhcLibHcOpts = -O -fllvm +GhcStage2HcOpts = -O0 +GhcLibHcOpts = -O BUILD_PROF_LIBS = NO SplitObjs = NO SplitSections = NO From git at git.haskell.org Fri Mar 2 21:54:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:22 +0000 (UTC) Subject: [commit: ghc] master: Permit conversion of partially applied PromotedTupleTs (6835702) Message-ID: <20180302215422.1F6E53A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/68357020b1cf29d4306e769b3366feb9a65ae78c/ghc >--------------------------------------------------------------- commit 68357020b1cf29d4306e769b3366feb9a65ae78c Author: Ryan Scott Date: Fri Mar 2 16:15:38 2018 -0500 Permit conversion of partially applied PromotedTupleTs Summary: We were simply missing a case in `Convert` for when have a `PromotedTupleT` that wasn't fully saturated. Easily fixed. Test Plan: make test TEST=T14843 Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14843 Differential Revision: https://phabricator.haskell.org/D4442 >--------------------------------------------------------------- 68357020b1cf29d4306e769b3366feb9a65ae78c compiler/hsSyn/Convert.hs | 3 +++ testsuite/tests/th/T14843.hs | 9 +++++++++ testsuite/tests/th/all.T | 1 + 3 files changed, 13 insertions(+) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index e137b1e..c1cf77b 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -1301,6 +1301,9 @@ cvtTypeKind ty_str ty -> do { let kis = replicate m placeHolderKind ; returnL (HsExplicitTupleTy kis tys') } + | otherwise + -> mk_apps (HsTyVar NotPromoted + (noLoc (getRdrName (tupleDataCon Boxed n)))) tys' where m = length tys' diff --git a/testsuite/tests/th/T14843.hs b/testsuite/tests/th/T14843.hs new file mode 100644 index 0000000..505fa51 --- /dev/null +++ b/testsuite/tests/th/T14843.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TemplateHaskell #-} +module T14843 where + +import Language.Haskell.TH.Syntax + +type T1 = $(return (PromotedTupleT 2)) +type T2 = $([t| '(,) |]) +type T3 = $(return (PromotedT (tupleDataName 2))) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 7305800..50e7314 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -400,3 +400,4 @@ test('T14060', normal, compile_and_run, ['-v0']) test('T14646', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T14681', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T14817', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T14843', normal, compile, ['-v0']) From git at git.haskell.org Fri Mar 2 21:54:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:26 +0000 (UTC) Subject: [commit: ghc] master: Fix #14838 by marking TH-spliced code as FromSource (ffb2738) Message-ID: <20180302215426.1E0903A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383/ghc >--------------------------------------------------------------- commit ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383 Author: Ryan Scott Date: Fri Mar 2 16:16:17 2018 -0500 Fix #14838 by marking TH-spliced code as FromSource Previously, any Template Haskell code that was spliced would be marked as `Generated`, which would completely suppress pattern- match coverage warnings for it, which several folks found confusing. Indeed, Template Haskell-spliced code is "source" code in some sense, as users specifically request that it be put into their program, so changing its designation to `FromSource` makes sense from that perspective. Test Plan: make test TEST=T14838 Reviewers: goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14838 Differential Revision: https://phabricator.haskell.org/D4440 >--------------------------------------------------------------- ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383 compiler/hsSyn/Convert.hs | 4 ++-- compiler/hsSyn/HsUtils.hs | 14 +++++++------- compiler/parser/RdrHsSyn.hs | 10 +++++----- compiler/typecheck/TcGenDeriv.hs | 8 +++++--- testsuite/tests/th/T14838.hs | 14 ++++++++++++++ testsuite/tests/th/T14838.stderr | 18 ++++++++++++++++++ testsuite/tests/th/T14838Lib.hs | 14 ++++++++++++++ testsuite/tests/th/all.T | 2 ++ 8 files changed, 67 insertions(+), 17 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 ffb2738f86c4e4c3f0eaacf0a95d7326fdd2e383 From git at git.haskell.org Fri Mar 2 21:54:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:28 +0000 (UTC) Subject: [commit: ghc] master: doCorePass: Expand catch-all (44ba60f) Message-ID: <20180302215428.EB23B3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/44ba60fe9bce298cfa41c4505d029c1a2c6e5671/ghc >--------------------------------------------------------------- commit 44ba60fe9bce298cfa41c4505d029c1a2c6e5671 Author: Simon Jakobi Date: Fri Mar 2 16:17:12 2018 -0500 doCorePass: Expand catch-all This doesn't remedy problem, but at least it's more explicit than the catch-all Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14544 Differential Revision: https://phabricator.haskell.org/D4435 >--------------------------------------------------------------- 44ba60fe9bce298cfa41c4505d029c1a2c6e5671 compiler/simplCore/SimplCore.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 4dfa198..0a20eb0 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -486,9 +486,15 @@ doCorePass (CoreDoPasses passes) = runCorePasses passes #if defined(GHCI) doCorePass (CoreDoPluginPass _ pass) = {-# SCC "Plugin" #-} pass +#else +doCorePass pass at CoreDoPluginPass {} = pprPanic "doCorePass" (ppr pass) #endif -doCorePass pass = pprPanic "doCorePass" (ppr pass) +doCorePass pass at CoreDesugar = pprPanic "doCorePass" (ppr pass) +doCorePass pass at CoreDesugarOpt = pprPanic "doCorePass" (ppr pass) +doCorePass pass at CoreTidy = pprPanic "doCorePass" (ppr pass) +doCorePass pass at CorePrep = pprPanic "doCorePass" (ppr pass) +doCorePass pass at CoreOccurAnal = pprPanic "doCorePass" (ppr pass) {- ************************************************************************ From git at git.haskell.org Fri Mar 2 21:54:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:31 +0000 (UTC) Subject: [commit: ghc] master: Compile with `--via-asm` when cross compiling. (5f6fcf7) Message-ID: <20180302215431.C0C5D3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5f6fcf7808b16d066ad0fb2068225b3f2e8363f7/ghc >--------------------------------------------------------------- commit 5f6fcf7808b16d066ad0fb2068225b3f2e8363f7 Author: Moritz Angermann Date: Fri Mar 2 16:16:52 2018 -0500 Compile with `--via-asm` when cross compiling. This bumps `hsc2hs` and adds the new `--via-asm` flag, which allows to successfully cross compile the win32 lirbary. - Compile with `--via-asm` when cross compiling. This requires haskell/hsc2hs#5 (https://github.com/haskell/hsc2hs/pull/5) Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4439 >--------------------------------------------------------------- 5f6fcf7808b16d066ad0fb2068225b3f2e8363f7 mk/config.mk.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index e5ec04a..26b07f3 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -649,8 +649,12 @@ $(eval $(call set_stage_HSC2HS_OPTS,0)) $(eval $(call set_stage_HSC2HS_OPTS,1)) $(eval $(call set_stage_HSC2HS_OPTS,2)) ifeq "$(CrossCompiling)" "YES" -SRC_HSC2HS_OPTS_STAGE1 += --cross-compile -SRC_HSC2HS_OPTS_STAGE2 += --cross-compile +# We'll assume we compile with gcc or clang, and both support `-S` and can as such use the +# --via-asm pass, which should be faster and is required for cross compiling to windows, as +# the c compiler complains about non-constant expressions even though they are constant and +# end up as constants in the assembly. +SRC_HSC2HS_OPTS_STAGE1 += --cross-compile --via-asm +SRC_HSC2HS_OPTS_STAGE2 += --cross-compile --via-asm endif SRC_HSC2HS_OPTS_STAGE0 += --cflag=-D$(HostArch_CPP)_HOST_ARCH --cflag=-D$(HostOS_CPP)_HOST_OS SRC_HSC2HS_OPTS_STAGE1 += --cflag=-D$(TargetArch_CPP)_HOST_ARCH --cflag=-D$(TargetOS_CPP)_HOST_OS From git at git.haskell.org Fri Mar 2 21:54:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:35 +0000 (UTC) Subject: [commit: ghc] master: Fix the coverage checker's treatment of existential tyvars (a2d03c6) Message-ID: <20180302215435.782363A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a2d03c69b782212e6c476cfc1870bae493a4ac89/ghc >--------------------------------------------------------------- commit a2d03c69b782212e6c476cfc1870bae493a4ac89 Author: Ryan Scott Date: Fri Mar 2 16:18:04 2018 -0500 Fix the coverage checker's treatment of existential tyvars Previously, the pattern-match coverage checker was far too eager to freshen the names of existentially quantified type variables, which led to incorrect sets of type constraints that misled GHC into thinking that certain programs that involve nested GADT pattern matches were non-exhaustive (when in fact they were). Now, we generate extra equality constraints in the ConCon case of the coverage algorithm to ensure that these fresh tyvars align with existing existential tyvars. See `Note [Coverage checking and existential tyvars]` for the full story. Test Plan: make test TEST="T11984 T14098" Reviewers: gkaracha, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #11984, #14098 Differential Revision: https://phabricator.haskell.org/D4434 >--------------------------------------------------------------- a2d03c69b782212e6c476cfc1870bae493a4ac89 compiler/deSugar/Check.hs | 143 ++++++++++++++++++++++- testsuite/tests/pmcheck/should_compile/T11984.hs | 23 ++++ testsuite/tests/pmcheck/should_compile/T14098.hs | 24 ++++ testsuite/tests/pmcheck/should_compile/all.T | 4 + 4 files changed, 188 insertions(+), 6 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 a2d03c69b782212e6c476cfc1870bae493a4ac89 From git at git.haskell.org Fri Mar 2 21:54:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 21:54:38 +0000 (UTC) Subject: [commit: ghc] master: Correct default -A value in RTS flag usage info (821daad) Message-ID: <20180302215438.4EC223A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/821daadf65a3e146f8adf2802b3cb8b520d8d10e/ghc >--------------------------------------------------------------- commit 821daadf65a3e146f8adf2802b3cb8b520d8d10e Author: Simon Jakobi Date: Fri Mar 2 16:17:44 2018 -0500 Correct default -A value in RTS flag usage info Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4441 >--------------------------------------------------------------- 821daadf65a3e146f8adf2802b3cb8b520d8d10e rts/RtsFlags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 26171cf..eb33c9e 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -277,7 +277,7 @@ usage_text[] = { " -kc Sets the stack chunk size (default 32k)", " -kb Sets the stack chunk buffer size (default 1k)", "", -" -A Sets the minimum allocation area size (default 512k) Egs: -A1m -A10k", +" -A Sets the minimum allocation area size (default 1m) Egs: -A20m -A10k", " -AL Sets the amount of large-object memory that can be allocated", " before a GC is triggered (default: the value of -A)", " -n Allocation area chunk size (0 = disabled, default: 0)", From git at git.haskell.org Fri Mar 2 22:34:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:34:49 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Fix missing code example in changelog for 8.4.1 (353ed7d) Message-ID: <20180302223449.534FB3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/353ed7d7dfe08c8e9c1a4c899d10cbe258a5c031/ghc >--------------------------------------------------------------- commit 353ed7d7dfe08c8e9c1a4c899d10cbe258a5c031 Author: Sergey Vinokurov Date: Wed Feb 7 21:10:17 2018 +0000 Fix missing code example in changelog for 8.4.1 (cherry picked from commit 3ae408cf93d10b9a2e5acb4186dc8e0c62e0afb6) >--------------------------------------------------------------- 353ed7d7dfe08c8e9c1a4c899d10cbe258a5c031 docs/users_guide/8.4.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.4.1-notes.rst b/docs/users_guide/8.4.1-notes.rst index efd3b98..489f4c8 100644 --- a/docs/users_guide/8.4.1-notes.rst +++ b/docs/users_guide/8.4.1-notes.rst @@ -186,7 +186,7 @@ Compiler ``error``: :: instance Show (Empty a) where - showsPrec = "Void showsPrec" + showsPrec = error "Void showsPrec" Now, they emit code that inspects the argument. That is, if the argument diverges, then showing it will also diverge: :: From git at git.haskell.org Fri Mar 2 22:34:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:34:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Fix typo (739bb3e) Message-ID: <20180302223452.1FB313A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/739bb3ef0a3657eda637aa99a81ba11a2412a03e/ghc >--------------------------------------------------------------- commit 739bb3ef0a3657eda637aa99a81ba11a2412a03e Author: Sergey Vinokurov Date: Thu Feb 8 09:17:53 2018 +0000 Fix typo (cherry picked from commit 37e78029845a04d0ab4cc05e1790c648facdcb1f) >--------------------------------------------------------------- 739bb3ef0a3657eda637aa99a81ba11a2412a03e libraries/base/GHC/MVar.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/MVar.hs b/libraries/base/GHC/MVar.hs index d367f2b..818f6db 100644 --- a/libraries/base/GHC/MVar.hs +++ b/libraries/base/GHC/MVar.hs @@ -90,7 +90,7 @@ takeMVar :: MVar a -> IO a takeMVar (MVar mvar#) = IO $ \ s# -> takeMVar# mvar# s# -- |Atomically read the contents of an 'MVar'. If the 'MVar' is --- currently empty, 'readMVar' will wait until its full. +-- currently empty, 'readMVar' will wait until it is full. -- 'readMVar' is guaranteed to receive the next 'putMVar'. -- -- 'readMVar' is multiple-wakeup, so when multiple readers are From git at git.haskell.org Fri Mar 2 22:34:54 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:34:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: List 'setEnv' as opposite of 'getEnv' (1cd5d6c) Message-ID: <20180302223454.E39CA3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/1cd5d6cdf80280b634399849c46df8bef377c25d/ghc >--------------------------------------------------------------- commit 1cd5d6cdf80280b634399849c46df8bef377c25d Author: Sergey Vinokurov Date: Wed Feb 7 21:49:56 2018 +0000 List 'setEnv' as opposite of 'getEnv' It seems best to direct users to use 'System.Environment.setEnv' rather than 'System.Posix.Env.putEnv'. This is due to 'setEnv' being located in the same module as 'getEnv' and my virtue of working on Windows platform, whereas 'putEnv' does not have that quality because it's part of the 'unix' package. (cherry picked from commit c74fcf5d27744c67b09b29a78029c31c9371cf41) >--------------------------------------------------------------- 1cd5d6cdf80280b634399849c46df8bef377c25d libraries/base/System/Environment.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/base/System/Environment.hs b/libraries/base/System/Environment.hs index 343b772..5604ca2 100644 --- a/libraries/base/System/Environment.hs +++ b/libraries/base/System/Environment.hs @@ -123,8 +123,8 @@ basename f = go f f -- | Computation 'getEnv' @var@ returns the value --- of the environment variable @var at . For the inverse, POSIX users --- can use 'System.Posix.Env.putEnv'. +-- of the environment variable @var at . For the inverse, the +-- `System.Environment.setEnv` function can be used. -- -- This computation may fail with: -- From git at git.haskell.org Fri Mar 2 22:34:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:34:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Correct default -A value in RTS flag usage info (11ac7ae) Message-ID: <20180302223457.C45B13A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/11ac7aec4960b66d8cf18eaf731b84a2b955d4cf/ghc >--------------------------------------------------------------- commit 11ac7aec4960b66d8cf18eaf731b84a2b955d4cf Author: Simon Jakobi Date: Fri Mar 2 16:17:44 2018 -0500 Correct default -A value in RTS flag usage info Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4441 (cherry picked from commit 821daadf65a3e146f8adf2802b3cb8b520d8d10e) >--------------------------------------------------------------- 11ac7aec4960b66d8cf18eaf731b84a2b955d4cf rts/RtsFlags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 26171cf..eb33c9e 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -277,7 +277,7 @@ usage_text[] = { " -kc Sets the stack chunk size (default 32k)", " -kb Sets the stack chunk buffer size (default 1k)", "", -" -A Sets the minimum allocation area size (default 512k) Egs: -A1m -A10k", +" -A Sets the minimum allocation area size (default 1m) Egs: -A20m -A10k", " -AL Sets the amount of large-object memory that can be allocated", " before a GC is triggered (default: the value of -A)", " -n Allocation area chunk size (0 = disabled, default: 0)", From git at git.haskell.org Fri Mar 2 22:35:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:35:01 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Adds *-cross-ncg flavour. (0454408) Message-ID: <20180302223501.34E3B3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/0454408c3f64e7a8032060e71a15282c25264402/ghc >--------------------------------------------------------------- commit 0454408c3f64e7a8032060e71a15282c25264402 Author: Moritz Angermann Date: Fri Mar 2 16:15:09 2018 -0500 Adds *-cross-ncg flavour. Our *-cross flavours force -fllvm, this adds flavours for cross compilation to x86_64, where we can use our native code generator. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4443 (cherry picked from commit e4dcebf899c796a13dabf8964038f78505b9f4ec) >--------------------------------------------------------------- 0454408c3f64e7a8032060e71a15282c25264402 mk/build.mk.sample | 17 +++++++++++++---- mk/flavours/{bench-cross.mk => bench-cross-ncg.mk} | 4 ++-- mk/flavours/{perf-cross.mk => perf-cross-ncg.mk} | 4 ++-- mk/flavours/{quick-cross.mk => quick-cross-ncg.mk} | 4 ++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/mk/build.mk.sample b/mk/build.mk.sample index 958cea7..ce7b4d6 100644 --- a/mk/build.mk.sample +++ b/mk/build.mk.sample @@ -13,17 +13,23 @@ # As above but build GHC using the LLVM backend #BuildFlavour = perf-llvm -# Perf build configured for a cross-compiler +# Perf build configured for a cross-compiler (using the LLVM backend) #BuildFlavour = perf-cross +# Perf build configured for a cross-compiler (using the NCG backend) +#BuildFlavour = perf-cross-ncg + # Fast build with optimised libraries, no profiling (RECOMMENDED): #BuildFlavour = quick # Fast build with optimised libraries, no profiling, with LLVM: #BuildFlavour = quick-llvm -# Fast build configured for a cross compiler -#BuildFlavour = quick-cross +# Fast build configured for a cross compiler (using the LLVM backend) +#BuildFlavour = quick-cross + +# Fast build configured for a cross compiler (using the NCG backend) +#BuildFlavour = quick-cross-ncg # Even faster build. NOT RECOMMENDED: the libraries will be # completely unoptimised, so any code built with this compiler @@ -51,9 +57,12 @@ # As above but build GHC using the LLVM backend #BuildFlavour = bench-llvm -# Bench build configured for a cross-compiler +# Bench build configured for a cross-compiler (using the LLVM backend) #BuildFlavour = bench-cross +# Bench build configured for a cross-compiler (using the NCG backend) +#BuildFlavour = bench-cross-ncg + # Use the same settings as validate. #BuildFlavour = validate diff --git a/mk/flavours/bench-cross.mk b/mk/flavours/bench-cross-ncg.mk similarity index 85% copy from mk/flavours/bench-cross.mk copy to mk/flavours/bench-cross-ncg.mk index ae67f34..6b686af 100644 --- a/mk/flavours/bench-cross.mk +++ b/mk/flavours/bench-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O -GhcStage2HcOpts = -O0 -fllvm -GhcLibHcOpts = -O2 -fllvm +GhcStage2HcOpts = -O0 +GhcLibHcOpts = -O2 BUILD_PROF_LIBS = NO SplitObjs = NO SplitSections = NO diff --git a/mk/flavours/perf-cross.mk b/mk/flavours/perf-cross-ncg.mk similarity index 83% copy from mk/flavours/perf-cross.mk copy to mk/flavours/perf-cross-ncg.mk index f202642..4b94c48 100644 --- a/mk/flavours/perf-cross.mk +++ b/mk/flavours/perf-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O2 -GhcStage2HcOpts = -O2 -fllvm -GhcLibHcOpts = -O2 -fllvm +GhcStage2HcOpts = -O2 +GhcLibHcOpts = -O2 BUILD_PROF_LIBS = YES #SplitObjs HADDOCK_DOCS = NO diff --git a/mk/flavours/quick-cross.mk b/mk/flavours/quick-cross-ncg.mk similarity index 85% copy from mk/flavours/quick-cross.mk copy to mk/flavours/quick-cross-ncg.mk index f0f00d2..97352cc 100644 --- a/mk/flavours/quick-cross.mk +++ b/mk/flavours/quick-cross-ncg.mk @@ -1,7 +1,7 @@ SRC_HC_OPTS = -O0 -H64m GhcStage1HcOpts = -O -GhcStage2HcOpts = -O0 -fllvm -GhcLibHcOpts = -O -fllvm +GhcStage2HcOpts = -O0 +GhcLibHcOpts = -O BUILD_PROF_LIBS = NO SplitObjs = NO SplitSections = NO From git at git.haskell.org Fri Mar 2 22:35:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:35:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Update haddock submodule (004b76a) Message-ID: <20180302223504.044503A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/004b76a2da15270b9840fc381bc731694da0ec3b/ghc >--------------------------------------------------------------- commit 004b76a2da15270b9840fc381bc731694da0ec3b Author: Ben Gamari Date: Sun Feb 25 17:12:44 2018 -0500 Update haddock submodule Fixes file handle leak >--------------------------------------------------------------- 004b76a2da15270b9840fc381bc731694da0ec3b utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index d66092e..7a36a41 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit d66092ee99639de628dbc4fce8a9936875f47d8c +Subproject commit 7a36a41e154f9ff380b10584ec1a9f8bc4003be1 From git at git.haskell.org Fri Mar 2 22:35:06 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:35:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: configure: Enable LD_NO_GOLD is set in all codepaths (89c10eb) Message-ID: <20180302223506.C90083A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/89c10eb88e955b8abd28f85e342a4de501731e50/ghc >--------------------------------------------------------------- commit 89c10eb88e955b8abd28f85e342a4de501731e50 Author: Ben Gamari Date: Fri Mar 2 16:13:53 2018 -0500 configure: Enable LD_NO_GOLD is set in all codepaths Test Plan: `./configure --disable-ld-override; make; make install` Reviewers: trofi, hvr Reviewed By: trofi Subscribers: rwbarton, thomie, erikd, carter, simonmar GHC Trac Issues: #14675 Differential Revision: https://phabricator.haskell.org/D4448 (cherry picked from commit bc1bcaa2c0c66fb247d1338d6d0055a833918a7f) >--------------------------------------------------------------- 89c10eb88e955b8abd28f85e342a4de501731e50 aclocal.m4 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aclocal.m4 b/aclocal.m4 index cf93474..c02c1d1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2394,12 +2394,16 @@ 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? + if test "x$LD_NO_GOLD" = "x"; then LD_NO_GOLD=$LD; fi } if test "x$enable_ld_override" = "xyes"; then find_ld else AC_CHECK_TARGET_TOOL([LD], [ld]) + if test "x$LD_NO_GOLD" = "x"; then LD_NO_GOLD=$LD; fi fi CHECK_LD_COPY_BUG([$1]) From git at git.haskell.org Fri Mar 2 22:35:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:35:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Various documentation improvements (a666e43) Message-ID: <20180302223509.91CFE3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/a666e43200d88a847d751a62c90f502e0c90e9ff/ghc >--------------------------------------------------------------- commit a666e43200d88a847d751a62c90f502e0c90e9ff Author: Sergey Vinokurov Date: Wed Feb 7 21:10:17 2018 +0000 Various documentation improvements * Fix missing code example in changelog for 8.4.1 * List 'setEnv' as opposite of 'getEnv' It seems best to direct users to use 'System.Environment.setEnv' rather than 'System.Posix.Env.putEnv'. This is due to 'setEnv' being located in the same module as 'getEnv' and my virtue of working on Windows platform, whereas 'putEnv' does not have that quality because it's part of the 'unix' package. * Reflect in docs the fact that 'readMVar' is not a composition of 'takeMVVar' and 'putMVar' any more (cherry picked from commit df449e1744d59eef7f41e09196629bc01815e984) >--------------------------------------------------------------- a666e43200d88a847d751a62c90f502e0c90e9ff libraries/base/Control/Concurrent/MVar.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/base/Control/Concurrent/MVar.hs b/libraries/base/Control/Concurrent/MVar.hs index 393fca8..fa99361 100644 --- a/libraries/base/Control/Concurrent/MVar.hs +++ b/libraries/base/Control/Concurrent/MVar.hs @@ -41,8 +41,8 @@ -- atomic operations such as reading from multiple variables: use 'STM' -- instead. -- --- In particular, the "bigger" functions in this module ('readMVar', --- 'swapMVar', 'withMVar', 'modifyMVar_' and 'modifyMVar') are simply +-- In particular, the "bigger" functions in this module ('swapMVar', +-- 'withMVar', 'modifyMVar_' and 'modifyMVar') are simply -- the composition of a 'takeMVar' followed by a 'putMVar' with -- exception safety. -- These only have atomicity guarantees if all other threads From git at git.haskell.org Fri Mar 2 22:53:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Mar 2018 22:53:42 +0000 (UTC) Subject: [commit: ghc] wip/T2893: Test Trac #14863 (32e8499) Message-ID: <20180302225342.2BDD43A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T2893 Link : http://ghc.haskell.org/trac/ghc/changeset/32e8499889d314e9efd0747b4053290a2dc237d5/ghc >--------------------------------------------------------------- commit 32e8499889d314e9efd0747b4053290a2dc237d5 Author: Simon Peyton Jones Date: Fri Mar 2 22:53:27 2018 +0000 Test Trac #14863 >--------------------------------------------------------------- 32e8499889d314e9efd0747b4053290a2dc237d5 testsuite/tests/quantified-constraints/T14863.hs | 27 ++++++++++++++++++++++++ testsuite/tests/quantified-constraints/all.T | 1 + 2 files changed, 28 insertions(+) diff --git a/testsuite/tests/quantified-constraints/T14863.hs b/testsuite/tests/quantified-constraints/T14863.hs new file mode 100644 index 0000000..c74b818 --- /dev/null +++ b/testsuite/tests/quantified-constraints/T14863.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE ConstraintKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE ImpredicativeTypes #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE UndecidableInstances #-} +module T14863 where + +data Dict c where + Dict :: c => Dict c + +class (a => b) => Implies a b +instance (a => b) => Implies a b + +uncurryCImpredic1 :: forall a b c. Implies a (b => c) => Dict (Implies (a, b) c) +uncurryCImpredic1 = Dict + +uncurryCImpredic2 :: forall a b c. a => Implies b c => Dict (Implies (a, b) c) +uncurryCImpredic2 = Dict + +uncurryC1 :: forall a b c. (a => b => c) => Dict (Implies (a, b) c) +uncurryC1 = Dict + +uncurryC2 :: forall a b c. Implies a (Implies b c) => Dict (Implies (a, b) c) +uncurryC2 = Dict \ No newline at end of file diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T index db1c6ba..4f63911 100644 --- a/testsuite/tests/quantified-constraints/all.T +++ b/testsuite/tests/quantified-constraints/all.T @@ -5,6 +5,7 @@ test('T2893', normal, compile, ['']) test('T2893a', normal, compile, ['']) test('T2893c', normal, compile, ['']) test('T9123', normal, compile, ['']) +test('T14863', normal, compile, ['']) # Not yet # test('T9123a', normal, compile, ['']) From git at git.haskell.org Sat Mar 3 18:52:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Mar 2018 18:52:01 +0000 (UTC) Subject: [commit: ghc] master: Parenthesize (() :: Constraint) in argument position (99c556d) Message-ID: <20180303185201.C95AD3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/99c556d2bb0594fd718622906168d2ea25a0bf06/ghc >--------------------------------------------------------------- commit 99c556d2bb0594fd718622906168d2ea25a0bf06 Author: Ryan Scott Date: Sat Mar 3 13:48:38 2018 -0500 Parenthesize (() :: Constraint) in argument position Summary: A simple oversight in the pretty-printer lead to a special case for `() :: Constraint` not being parenthesized correctly when used in an argument position. Easily fixed with a `maybeParen`. Test Plan: make test TEST=T14796 Reviewers: alanz, goldfire, bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14796 Differential Revision: https://phabricator.haskell.org/D4408 >--------------------------------------------------------------- 99c556d2bb0594fd718622906168d2ea25a0bf06 compiler/iface/IfaceType.hs | 15 ++++++++------- testsuite/tests/ghci/scripts/T14796.script | 3 +++ testsuite/tests/ghci/scripts/T14796.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs index 62b33cd..0c5922e 100644 --- a/compiler/iface/IfaceType.hs +++ b/compiler/iface/IfaceType.hs @@ -595,7 +595,7 @@ ppr_ty :: TyPrec -> IfaceType -> SDoc ppr_ty _ (IfaceFreeTyVar tyvar) = ppr tyvar -- This is the main reson for IfaceFreeTyVar! ppr_ty _ (IfaceTyVar tyvar) = ppr tyvar -- See Note [TcTyVars in IfaceType] ppr_ty ctxt_prec (IfaceTyConApp tc tys) = pprTyTcApp ctxt_prec tc tys -ppr_ty _ (IfaceTupleTy i p tys) = pprTuple i p tys +ppr_ty ctxt_prec (IfaceTupleTy i p tys) = pprTuple ctxt_prec i p tys ppr_ty _ (IfaceLitTy n) = pprIfaceTyLit n -- Function types ppr_ty ctxt_prec (IfaceFunTy ty1 ty2) @@ -889,7 +889,7 @@ pprTyTcApp' ctxt_prec tc tys dflags style | IfaceTupleTyCon arity sort <- ifaceTyConSort info , not (debugStyle style) , arity == ifaceVisTcArgsLength tys - = pprTuple sort (ifaceTyConIsPromoted info) tys + = pprTuple ctxt_prec sort (ifaceTyConIsPromoted info) tys | IfaceSumTyCon arity <- ifaceTyConSort info = pprSum arity (ifaceTyConIsPromoted info) tys @@ -1017,18 +1017,19 @@ pprSum _arity is_promoted args in pprPromotionQuoteI is_promoted <> sumParens (pprWithBars (ppr_ty TopPrec) args') -pprTuple :: TupleSort -> IsPromoted -> IfaceTcArgs -> SDoc -pprTuple ConstraintTuple IsNotPromoted ITC_Nil - = text "() :: Constraint" +pprTuple :: TyPrec -> TupleSort -> IsPromoted -> IfaceTcArgs -> SDoc +pprTuple ctxt_prec ConstraintTuple IsNotPromoted ITC_Nil + = maybeParen ctxt_prec TyConPrec $ + text "() :: Constraint" -- All promoted constructors have kind arguments -pprTuple sort IsPromoted args +pprTuple _ sort IsPromoted args = let tys = tcArgsIfaceTypes args args' = drop (length tys `div` 2) tys in pprPromotionQuoteI IsPromoted <> tupleParens sort (pprWithCommas pprIfaceType args') -pprTuple sort promoted args +pprTuple _ sort promoted args = -- drop the RuntimeRep vars. -- See Note [Unboxed tuple RuntimeRep vars] in TyCon let tys = tcArgsIfaceTypes args diff --git a/testsuite/tests/ghci/scripts/T14796.script b/testsuite/tests/ghci/scripts/T14796.script new file mode 100644 index 0000000..9a85d44 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T14796.script @@ -0,0 +1,3 @@ +:set -XGADTs -XConstraintKinds -XTypeApplications +data ECC ctx f a where ECC :: ctx => f a -> ECC ctx f a +:t ECC @() @[] @() diff --git a/testsuite/tests/ghci/scripts/T14796.stdout b/testsuite/tests/ghci/scripts/T14796.stdout new file mode 100644 index 0000000..c8bb219 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T14796.stdout @@ -0,0 +1 @@ +ECC @() @[] @() :: [()] -> ECC (() :: Constraint) [] () diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 997203f..dcce723 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -264,3 +264,4 @@ test('T13963', normal, ghci_script, ['T13963.script']) test('T14342', [extra_hc_opts("-XOverloadedStrings -XRebindableSyntax")], ghci_script, ['T14342.script']) test('T14676', extra_files(['../prog002']), ghci_script, ['T14676.script']) +test('T14796', normal, ghci_script, ['T14796.script']) From git at git.haskell.org Sun Mar 4 02:39:39 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Mar 2018 02:39:39 +0000 (UTC) Subject: [commit: ghc] master: Bump hsc2hs submodule (4631ceb) Message-ID: <20180304023939.46C8F3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4631ceb261cb08756b955c6b495d5e719d35ab62/ghc >--------------------------------------------------------------- commit 4631ceb261cb08756b955c6b495d5e719d35ab62 Author: Moritz Angermann Date: Sun Mar 4 10:37:58 2018 +0800 Bump hsc2hs submodule This should have been part of 5f6fcf78. >--------------------------------------------------------------- 4631ceb261cb08756b955c6b495d5e719d35ab62 utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 738f366..b858803 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 738f3666c878ee9e79c3d5e819ef8b3460288edf +Subproject commit b8588039f3810e2d0f52e9afdb15998992ee38b1 From git at git.haskell.org Sun Mar 4 02:51:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Mar 2018 02:51:05 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal submodule to 2.2 (8f0b2f5) Message-ID: <20180304025105.3C3323A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8f0b2f5eadf0fcb47c581907205a9db686214a69/ghc >--------------------------------------------------------------- commit 8f0b2f5eadf0fcb47c581907205a9db686214a69 Author: Moritz Angermann Date: Sat Mar 3 16:16:41 2018 -0500 Bump Cabal submodule to 2.2 Requires some ghc-cabal changes as well. Test Plan: ./validate Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: hsyl20, erikd, alpmestan, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4453 >--------------------------------------------------------------- 8f0b2f5eadf0fcb47c581907205a9db686214a69 libraries/Cabal | 2 +- libraries/base/configure.ac | 4 +-- rules/build-package.mk | 2 +- testsuite/tests/driver/T4437.hs | 1 + .../check-api-annotations.cabal | 2 +- utils/check-ppr/check-ppr.cabal | 2 +- utils/ghc-cabal/Main.hs | 31 ++++++++++++++++++---- utils/ghc-cabal/ghc-cabal.cabal | 2 +- utils/ghctags/ghctags.cabal | 2 +- 9 files changed, 35 insertions(+), 13 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 8f0b2f5eadf0fcb47c581907205a9db686214a69 From git at git.haskell.org Sun Mar 4 16:16:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Mar 2018 16:16:51 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal submodule (a9f680f) Message-ID: <20180304161651.24FCA3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a9f680f631e20104661e357393f9704e2f8ba234/ghc >--------------------------------------------------------------- commit a9f680f631e20104661e357393f9704e2f8ba234 Author: Ben Gamari Date: Sat Mar 3 22:05:44 2018 -0500 Bump Cabal submodule >--------------------------------------------------------------- a9f680f631e20104661e357393f9704e2f8ba234 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index 98a72c9..7ce486e 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 98a72c9da6f56a9917b66d7532df755719ec7a25 +Subproject commit 7ce486e6553d24877ae3b23868b95d20bf83760a From git at git.haskell.org Sun Mar 4 16:16:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Mar 2018 16:16:53 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Bump Cabal submodule to 2.2 (c760ae3) Message-ID: <20180304161653.EF6023A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/c760ae373d47a16170dab0b9ed6f1680a75d4263/ghc >--------------------------------------------------------------- commit c760ae373d47a16170dab0b9ed6f1680a75d4263 Author: Moritz Angermann Date: Sat Mar 3 16:16:41 2018 -0500 Bump Cabal submodule to 2.2 Requires some ghc-cabal changes as well. Test Plan: ./validate Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: hsyl20, erikd, alpmestan, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4453 >--------------------------------------------------------------- c760ae373d47a16170dab0b9ed6f1680a75d4263 libraries/Cabal | 2 +- libraries/base/configure.ac | 4 +-- rules/build-package.mk | 2 +- .../check-api-annotations.cabal | 2 +- utils/check-ppr/check-ppr.cabal | 2 +- utils/ghc-cabal/Main.hs | 31 ++++++++++++++++++---- utils/ghc-cabal/ghc-cabal.cabal | 2 +- utils/ghctags/ghctags.cabal | 2 +- utils/haddock | 2 +- 9 files changed, 35 insertions(+), 14 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 c760ae373d47a16170dab0b9ed6f1680a75d4263 From git at git.haskell.org Mon Mar 5 07:44:04 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 07:44:04 +0000 (UTC) Subject: [commit: ghc] branch 'wip/angerman/win32-cross-2' created Message-ID: <20180305074404.821783A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/angerman/win32-cross-2 Referencing: b824438e1c6a203f7175705161852928d4315329 From git at git.haskell.org Mon Mar 5 07:44:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 07:44:17 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: adds .gitignore (9b0ac82) Message-ID: <20180305074417.385653A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/9b0ac8207c590104129c49bd10d6649ec8a58f01/ghc >--------------------------------------------------------------- commit 9b0ac8207c590104129c49bd10d6649ec8a58f01 Author: Moritz Angermann Date: Thu Feb 15 13:54:55 2018 +0800 adds .gitignore >--------------------------------------------------------------- 9b0ac8207c590104129c49bd10d6649ec8a58f01 .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 460cb68..4d815d7 100644 --- a/.gitignore +++ b/.gitignore @@ -81,8 +81,7 @@ _darcs/ /ghc/stage1/ /ghc/stage2/ /ghc/stage3/ -/iserv/stage2*/ -/iserv/dist/ +/utils/iserv/stage2*/ # ----------------------------------------------------------------------------- # specific generated files From git at git.haskell.org Mon Mar 5 07:44:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 07:44:07 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (b824438) Message-ID: <20180305074407.5CB953A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/b824438e1c6a203f7175705161852928d4315329/ghc >--------------------------------------------------------------- commit b824438e1c6a203f7175705161852928d4315329 Author: Moritz Angermann Date: Thu Feb 22 16:53:35 2018 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` Summary: This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. Test Plan: ./validate Reviewers: bgamari, goldfire, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4436 >--------------------------------------------------------------- b824438e1c6a203f7175705161852928d4315329 libraries/libiserv/src/Main.hs | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/libraries/libiserv/src/Main.hs b/libraries/libiserv/src/Main.hs deleted file mode 100644 index 858cee8..0000000 --- a/libraries/libiserv/src/Main.hs +++ /dev/null @@ -1,63 +0,0 @@ -{-# LANGUAGE CPP, GADTs #-} - --- | --- The Remote GHCi server. --- --- For details on Remote GHCi, see Note [Remote GHCi] in --- compiler/ghci/GHCi.hs. --- -module Main (main) where - -import Lib (serv) - -import GHCi.Message -import GHCi.Signals -import GHCi.Utils - -import Control.Exception -import Control.Monad -import Data.IORef -import System.Environment -import System.Exit -import Text.Printf - -dieWithUsage :: IO a -dieWithUsage = do - prog <- getProgName - die $ prog ++ ": " ++ msg - where -#ifdef WINDOWS - msg = "usage: iserv [-v]" -#else - msg = "usage: iserv [-v]" -#endif - -main :: IO () -main = do - args <- getArgs - (wfd1, rfd2, rest) <- - case args of - arg0:arg1:rest -> do - let wfd1 = read arg0 - rfd2 = read arg1 - return (wfd1, rfd2, rest) - _ -> dieWithUsage - - verbose <- case rest of - ["-v"] -> return True - [] -> return False - _ -> dieWithUsage - when verbose $ - printf "GHC iserv starting (in: %d; out: %d)\n" - (fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int) - inh <- getGhcHandle rfd2 - outh <- getGhcHandle wfd1 - installSignalHandlers - lo_ref <- newIORef Nothing - let pipe = Pipe{pipeRead = inh, pipeWrite = outh, pipeLeftovers = lo_ref} - uninterruptibleMask $ serv verbose hook pipe - - where hook = return -- empty hook - -- we cannot allow any async exceptions while communicating, because - -- we will lose sync in the protocol, hence uninterruptibleMask. - From git at git.haskell.org Mon Mar 5 07:44:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 07:44:11 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (da04151) Message-ID: <20180305074411.908B83A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/da04151672629e258a0f27134b544c8d5379fba2/ghc >--------------------------------------------------------------- commit da04151672629e258a0f27134b544c8d5379fba2 Author: Moritz Angermann Date: Sat Nov 25 15:10:52 2017 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. # Conflicts: # utils/iserv-proxy/iserv-proxy.cabal >--------------------------------------------------------------- da04151672629e258a0f27134b544c8d5379fba2 ghc.mk | 13 +-- {iserv => libraries/libiserv}/Makefile | 0 {iserv => libraries/libiserv}/cbits/iservmain.c | 0 libraries/libiserv/ghc.mk | 5 + libraries/libiserv/libiserv.cabal | 39 +++++++ {iserv => libraries/libiserv}/proxy-src/Remote.hs | 0 {iserv => libraries/libiserv}/src/GHCi/Utils.hsc | 0 {iserv => libraries/libiserv}/src/Lib.hs | 0 {iserv => libraries/libiserv}/src/Main.hs | 0 .../libiserv}/src/Remote/Message.hs | 0 {iserv => libraries/libiserv}/src/Remote/Slave.hs | 0 {iserv => utils/iserv-proxy}/Makefile | 0 utils/iserv-proxy/ghc.mk | 113 +++++++++++++++++++++ .../iserv-proxy/iserv-proxy.cabal | 72 +------------ .../Remote.hs => utils/iserv-proxy/src/Main.hs | 0 {iserv => utils/iserv}/Makefile | 0 {iserv => utils/iserv}/cbits/iservmain.c | 0 {iserv => utils/iserv}/ghc.mk | 66 ++++++------ utils/iserv/iserv.cabal | 44 ++++++++ {iserv => utils/iserv}/src/Main.hs | 0 20 files changed, 246 insertions(+), 106 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 da04151672629e258a0f27134b544c8d5379fba2 From git at git.haskell.org Mon Mar 5 07:44:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 07:44:14 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: temp fix Makefile (c2a32ce) Message-ID: <20180305074414.6341C3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/c2a32ce598b0c4df875a617f5e458b0549560eaf/ghc >--------------------------------------------------------------- commit c2a32ce598b0c4df875a617f5e458b0549560eaf Author: Moritz Angermann Date: Thu Feb 15 12:29:14 2018 +0800 temp fix Makefile >--------------------------------------------------------------- c2a32ce598b0c4df875a617f5e458b0549560eaf utils/iserv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/iserv/Makefile b/utils/iserv/Makefile index f160978..3619858 100644 --- a/utils/iserv/Makefile +++ b/utils/iserv/Makefile @@ -10,6 +10,6 @@ # # ----------------------------------------------------------------------------- -dir = iserv -TOP = .. +dir = utils/iserv +TOP = ../.. include $(TOP)/mk/sub-makefile.mk From git at git.haskell.org Mon Mar 5 08:51:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 08:51:11 +0000 (UTC) Subject: [commit: ghc] master: Wombling around in Trac #14808 (e7653bc) Message-ID: <20180305085111.2F91E3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e7653bc3c4f57d2282e982b9eb83bd1fcbae6e30/ghc >--------------------------------------------------------------- commit e7653bc3c4f57d2282e982b9eb83bd1fcbae6e30 Author: Simon Peyton Jones Date: Fri Mar 2 17:12:03 2018 +0000 Wombling around in Trac #14808 Comment:4 in Trac #14808 explains why I'm unhappy with the current state of affairs -- at least the lack of documentation. This smallpatch does nothing major: * adds comments * uses existing type synonyms more (notably FreeKiTyVarsWithDups) * adds another test case to T14808 >--------------------------------------------------------------- e7653bc3c4f57d2282e982b9eb83bd1fcbae6e30 compiler/rename/RnSource.hs | 9 ++++++--- compiler/rename/RnTypes.hs | 35 +++++++++++++++++++++-------------- testsuite/tests/gadt/T14808.hs | 6 ++++++ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 5c7f538..447871a 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -1917,9 +1917,12 @@ rnConDecl decl@(ConDeclGADT { con_names = names ; let explicit_tkvs = hsQTvExplicit qtvs theta = hsConDeclTheta mcxt arg_tys = hsConDeclArgTys args - -- We must ensure that we extract the free tkvs in the - -- order of theta, then arg_tys, then res_ty. Failing to - -- do so resulted in #14808. + + -- We must ensure that we extract the free tkvs in left-to-right + -- order of their appearance in the constructor type. + -- That order governs the order the implicitly-quantified type + -- variable, and hence the order needed for visible type application + -- See Trac #14808. ; free_tkvs <- extractHsTysRdrTyVarsDups (theta ++ arg_tys ++ [res_ty]) ; free_tkvs <- extractHsTvBndrs explicit_tkvs free_tkvs diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index cdb98fb..2305a04 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -1748,27 +1748,32 @@ extractDataDefnKindVars (HsDataDefn { dd_ctxt = ctxt, dd_kindSig = ksig extract_mlctxt ctxt =<< extract_ltys TypeLevel (hsConDeclArgTys args) emptyFKTV -extract_mlctxt :: Maybe (LHsContext GhcPs) -> FreeKiTyVars -> RnM FreeKiTyVars +extract_mlctxt :: Maybe (LHsContext GhcPs) + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_mlctxt Nothing acc = return acc extract_mlctxt (Just ctxt) acc = extract_lctxt TypeLevel ctxt acc extract_lctxt :: TypeOrKind - -> LHsContext GhcPs -> FreeKiTyVars -> RnM FreeKiTyVars + -> LHsContext GhcPs + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_lctxt t_or_k ctxt = extract_ltys t_or_k (unLoc ctxt) extract_ltys :: TypeOrKind - -> [LHsType GhcPs] -> FreeKiTyVars -> RnM FreeKiTyVars + -> [LHsType GhcPs] + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_ltys t_or_k tys acc = foldrM (extract_lty t_or_k) acc tys -extract_mb :: (a -> FreeKiTyVars -> RnM FreeKiTyVars) - -> Maybe a -> FreeKiTyVars -> RnM FreeKiTyVars +extract_mb :: (a -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups) + -> Maybe a + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_mb _ Nothing acc = return acc extract_mb f (Just x) acc = f x acc extract_lkind :: LHsType GhcPs -> FreeKiTyVars -> RnM FreeKiTyVars extract_lkind = extract_lty KindLevel -extract_lty :: TypeOrKind -> LHsType GhcPs -> FreeKiTyVars -> RnM FreeKiTyVars +extract_lty :: TypeOrKind -> LHsType GhcPs + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_lty t_or_k (L _ ty) acc = case ty of HsTyVar _ ltv -> extract_tv t_or_k ltv acc @@ -1813,19 +1818,21 @@ extract_apps :: TypeOrKind -> [LHsAppType GhcPs] -> FreeKiTyVars -> RnM FreeKiTyVars extract_apps t_or_k tys acc = foldrM (extract_app t_or_k) acc tys -extract_app :: TypeOrKind -> LHsAppType GhcPs -> FreeKiTyVars - -> RnM FreeKiTyVars +extract_app :: TypeOrKind -> LHsAppType GhcPs + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_app t_or_k (L _ (HsAppInfix tv)) acc = extract_tv t_or_k tv acc extract_app t_or_k (L _ (HsAppPrefix ty)) acc = extract_lty t_or_k ty acc extractHsTvBndrs :: [LHsTyVarBndr GhcPs] - -> FreeKiTyVars -- Free in body - -> RnM FreeKiTyVars -- Free in result + -> FreeKiTyVarsWithDups -- Free in body + -> RnM FreeKiTyVarsWithDups -- Free in result extractHsTvBndrs tv_bndrs body_fvs = extract_hs_tv_bndrs tv_bndrs emptyFKTV body_fvs -extract_hs_tv_bndrs :: [LHsTyVarBndr GhcPs] -> FreeKiTyVars - -> FreeKiTyVars -> RnM FreeKiTyVars +extract_hs_tv_bndrs :: [LHsTyVarBndr GhcPs] + -> FreeKiTyVarsWithDups -- Accumulator + -> FreeKiTyVarsWithDups -- Free in body + -> RnM FreeKiTyVarsWithDups -- In (forall (a :: Maybe e). a -> b) we have -- 'a' is bound by the forall -- 'b' is a free type variable @@ -1866,8 +1873,8 @@ extract_hs_tv_bndrs_kvs tv_bndrs ; return (freeKiTyVarsKindVars fktvs) } -- There will /be/ no free tyvars! -extract_tv :: TypeOrKind -> Located RdrName -> FreeKiTyVars - -> RnM FreeKiTyVars +extract_tv :: TypeOrKind -> Located RdrName + -> FreeKiTyVarsWithDups -> RnM FreeKiTyVarsWithDups extract_tv t_or_k ltv@(L _ tv) acc@(FKTV kvs tvs) | not (isRdrTyVar tv) = return acc | isTypeLevel t_or_k = return (FKTV kvs (ltv : tvs)) diff --git a/testsuite/tests/gadt/T14808.hs b/testsuite/tests/gadt/T14808.hs index 726f502..da3d521 100644 --- a/testsuite/tests/gadt/T14808.hs +++ b/testsuite/tests/gadt/T14808.hs @@ -10,3 +10,9 @@ data ECC ctx f a where f :: [()] -> ECC () [] () f = ECC @() @[] @() + +data ECC2 f a ctx where + ECC2 :: ctx => f a -> ECC2 f a ctx + +f2 :: [()] -> ECC2 [] () () +f2 = ECC2 @() @[] @() From git at git.haskell.org Mon Mar 5 08:51:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 08:51:14 +0000 (UTC) Subject: [commit: ghc] master: Respect Note [The tcType invariant] (3d25203) Message-ID: <20180305085114.94F733A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3d252037234ce48f9bdada7d5c9b1d8eba470829/ghc >--------------------------------------------------------------- commit 3d252037234ce48f9bdada7d5c9b1d8eba470829 Author: Simon Peyton Jones Date: Fri Mar 2 17:26:58 2018 +0000 Respect Note [The tcType invariant] I tried to do this with commit 0a12d92a8f65d374f9317af2759af2b46267ad5c Author: Simon Peyton Jones Date: Wed Dec 13 12:53:26 2017 +0000 Further improvements to well-kinded types The typechecker has the invariant that every type should be well-kinded as it stands, without zonking. See Note [The well-kinded type invariant] in TcType. That invariant was not being upheld, which led to Trac #14174. I fixed part of it, but T14174a showed that there was more. This patch finishes the job. But I didn't get it quite right as Trac #14873 showed. This patch fixes the problem; although I am still a bit unhappy. (See "A worry" in the HsApp case of tc_infer_hs_type.) >--------------------------------------------------------------- 3d252037234ce48f9bdada7d5c9b1d8eba470829 compiler/typecheck/TcHsType.hs | 59 ++++++++++++++++++++++++++++--------- testsuite/tests/polykinds/T14873.hs | 49 ++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 1 + 3 files changed, 95 insertions(+), 14 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 3d252037234ce48f9bdada7d5c9b1d8eba470829 From git at git.haskell.org Mon Mar 5 14:00:16 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 14:00:16 +0000 (UTC) Subject: [commit: ghc] master: Fix #14888 by adding more special cases for ArrowT (6ee831f) Message-ID: <20180305140016.561A33A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6ee831f279c91888ee5815f8eee473bcd6fd25c6/ghc >--------------------------------------------------------------- commit 6ee831f279c91888ee5815f8eee473bcd6fd25c6 Author: Ryan Scott Date: Mon Mar 5 08:57:04 2018 -0500 Fix #14888 by adding more special cases for ArrowT Summary: There were previously some situations where `(->)` would not be desugared or reified as `ArrowT`, leading to various oddities such as those observed in #14888. We now uniformly treat `(->)` as `ArrowT` in Template Haskell–world by checking for any tycon that has the same name as `(->)`, and converting that to `ArrowT`. Test Plan: make test TEST=T14888 Reviewers: goldfire, bgamari, simonpj Reviewed By: goldfire, simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14888 Differential Revision: https://phabricator.haskell.org/D4466 >--------------------------------------------------------------- 6ee831f279c91888ee5815f8eee473bcd6fd25c6 compiler/deSugar/DsMeta.hs | 1 + compiler/typecheck/TcSplice.hs | 1 + testsuite/tests/th/T14888.hs | 18 ++++++++++++++++++ testsuite/tests/th/T14888.stderr | 11 +++++++++++ testsuite/tests/th/all.T | 2 ++ 5 files changed, 33 insertions(+) diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index db25c55..5029f9d 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -994,6 +994,7 @@ repTy ty@(HsQualTy {}) = repForall ty repTy (HsTyVar _ (L _ n)) | isLiftedTypeKindTyConName n = repTStar | n `hasKey` constraintKindTyConKey = repTConstraint + | n `hasKey` funTyConKey = repArrowTyCon | isTvOcc occ = do tv1 <- lookupOcc n repTvar tv1 | isDataOcc occ = do tc1 <- lookupOcc n diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 45e18e6..00591d1 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -1881,6 +1881,7 @@ reify_tc_app tc tys | isTupleTyCon tc = if isPromotedDataCon tc then TH.PromotedTupleT arity else TH.TupleT arity + | tc `hasKey` funTyConKey = TH.ArrowT | tc `hasKey` listTyConKey = TH.ListT | tc `hasKey` nilDataConKey = TH.PromotedNilT | tc `hasKey` consDataConKey = TH.PromotedConsT diff --git a/testsuite/tests/th/T14888.hs b/testsuite/tests/th/T14888.hs new file mode 100644 index 0000000..e2bcec6 --- /dev/null +++ b/testsuite/tests/th/T14888.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE TemplateHaskell #-} +module T14888 where + +import Language.Haskell.TH + +foo :: $([t| (->) Bool Bool |]) +foo x = x + +class Functor' f where + fmap' :: (a -> b) -> f a -> f b + +instance Functor' ((->) r) where + fmap' = (.) + +$(return []) + +functor'Instances :: String +functor'Instances = $(reify ''Functor' >>= stringE . pprint) diff --git a/testsuite/tests/th/T14888.stderr b/testsuite/tests/th/T14888.stderr new file mode 100644 index 0000000..963937f --- /dev/null +++ b/testsuite/tests/th/T14888.stderr @@ -0,0 +1,11 @@ +T14888.hs:6:10-30: Splicing type + [t| (->) Bool Bool |] ======> Bool -> Bool +T14888.hs:15:3-11: Splicing declarations return [] ======> +T14888.hs:18:23-59: Splicing expression + reify ''Functor' >>= stringE . pprint + ======> + "class T14888.Functor' (f_0 :: * -> *) + where T14888.fmap' :: forall (f_0 :: * -> + *) . T14888.Functor' f_0 => + forall (a_1 :: *) (b_2 :: *) . (a_1 -> b_2) -> f_0 a_1 -> f_0 b_2 +instance T14888.Functor' ((->) r_3 :: * -> *)" diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 47e8a9c..e9f2838 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -403,3 +403,5 @@ test('T14838', [], multimod_compile, ['T14838.hs', '-v0 -Wincomplete-patterns ' + config.ghc_th_way_flags]) test('T14817', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) test('T14843', normal, compile, ['-v0']) +test('T14888', normal, compile, + ['-v0 -ddump-splices -dsuppress-uniques ' + config.ghc_th_way_flags]) From git at git.haskell.org Mon Mar 5 14:45:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 14:45:41 +0000 (UTC) Subject: [commit: ghc] master: Simplify rnLHsInstType (1c062b7) Message-ID: <20180305144541.CC3E43A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1c062b794bf71a329f65813ce7b72fe2bd3935f0/ghc >--------------------------------------------------------------- commit 1c062b794bf71a329f65813ce7b72fe2bd3935f0 Author: Simon Peyton Jones Date: Mon Mar 5 14:40:37 2018 +0000 Simplify rnLHsInstType This patch is preparatory for the main fix for Trac #13324 Here, we simplify rnLHsInstType so that it does not try to figure out the class name. This turns out to have a good (rather than bad) effect on error messages, and it prepares the way for the main event. Plus, less code! >--------------------------------------------------------------- 1c062b794bf71a329f65813ce7b72fe2bd3935f0 compiler/rename/RnTypes.hs | 17 +++-------------- testsuite/tests/parser/should_fail/T3811c.stderr | 5 ++++- .../should_fail/WildcardInInstanceHead.stderr | 2 +- .../should_fail/WildcardInStandaloneDeriving.stderr | 2 -- testsuite/tests/rename/should_fail/T5513.stderr | 4 +++- testsuite/tests/rename/should_fail/T5951.stderr | 15 ++++++++++++++- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 2305a04..b2dafb2 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -326,20 +326,8 @@ rnImplicitBndrs bind_free_tvs doc rnLHsInstType :: SDoc -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars) -- Rename the type in an instance or standalone deriving decl -- The 'doc_str' is "an instance declaration" or "a VECTORISE pragma" -rnLHsInstType doc_str inst_ty - | Just cls <- getLHsInstDeclClass_maybe inst_ty - , isTcOcc (rdrNameOcc (unLoc cls)) - -- The guards check that the instance type looks like - -- blah => C ty1 .. tyn - = do { let full_doc = doc_str <+> text "for" <+> quotes (ppr cls) - ; rnHsSigType (GenericCtx full_doc) inst_ty } - - | otherwise -- The instance is malformed, but we'd still like - -- to make progress rather than failing outright, so - -- we report more errors. So we rename it anyway. - = do { addErrAt (getLoc (hsSigType inst_ty)) $ - text "Malformed instance:" <+> ppr inst_ty - ; rnHsSigType (GenericCtx doc_str) inst_ty } +-- Do not try to decompose the inst_ty in case it is malformed +rnLHsInstType doc inst_ty = rnHsSigType (GenericCtx doc) inst_ty mk_implicit_bndrs :: [Name] -- implicitly bound -> a -- payload @@ -351,6 +339,7 @@ mk_implicit_bndrs vars body fvs , hsib_closed = nameSetAll (not . isTyVarName) (vars `delFVs` fvs) } + {- ****************************************************** * * LHsType and HsType diff --git a/testsuite/tests/parser/should_fail/T3811c.stderr b/testsuite/tests/parser/should_fail/T3811c.stderr index 4a37116..dd21918 100644 --- a/testsuite/tests/parser/should_fail/T3811c.stderr +++ b/testsuite/tests/parser/should_fail/T3811c.stderr @@ -1,2 +1,5 @@ -T3811c.hs:6:10: Malformed instance: !Show D +T3811c.hs:6:10: error: + • Unexpected strictness annotation: !Show + strictness annotation cannot appear nested inside a type + • In the instance declaration for ‘!Show D’ diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr index 9090475..367e10a 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInInstanceHead.stderr @@ -1,4 +1,4 @@ WildcardInInstanceHead.hs:7:14: error: Wildcard ‘_’ not allowed - in an instance declaration for ‘Foo’ + in an instance declaration diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr index 8e98910..0609021 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInStandaloneDeriving.stderr @@ -1,6 +1,4 @@ -WildcardInStandaloneDeriving.hs:4:19: error: Malformed instance: _ - WildcardInStandaloneDeriving.hs:4:19: error: Wildcard ‘_’ not allowed in a deriving declaration diff --git a/testsuite/tests/rename/should_fail/T5513.stderr b/testsuite/tests/rename/should_fail/T5513.stderr index 063f348..7e26622 100644 --- a/testsuite/tests/rename/should_fail/T5513.stderr +++ b/testsuite/tests/rename/should_fail/T5513.stderr @@ -1,2 +1,4 @@ -T5513.hs:4:19: Malformed instance: lowercase_name a +T5513.hs:4:19: error: + • Instance head is not headed by a class + • In the stand-alone deriving instance for ‘lowercase_name a’ diff --git a/testsuite/tests/rename/should_fail/T5951.stderr b/testsuite/tests/rename/should_fail/T5951.stderr index af0ee9d..8fda353 100644 --- a/testsuite/tests/rename/should_fail/T5951.stderr +++ b/testsuite/tests/rename/should_fail/T5951.stderr @@ -1,2 +1,15 @@ -T5951.hs:8:8: Malformed instance: A => B => C +T5951.hs:8:8: error: + • Expecting one more argument to ‘A’ + Expected a constraint, but ‘A’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ + +T5951.hs:9:8: error: + • Expecting one more argument to ‘B’ + Expected a constraint, but ‘B’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ + +T5951.hs:10:8: error: + • Expecting one more argument to ‘C’ + Expected a constraint, but ‘C’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ From git at git.haskell.org Mon Mar 5 14:51:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 14:51:53 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T13324' created Message-ID: <20180305145153.851433A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T13324 Referencing: 7d491ae76b32a78c1ea09a324f67937adceecfc2 From git at git.haskell.org Mon Mar 5 14:51:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 14:51:56 +0000 (UTC) Subject: [commit: ghc] wip/T13324: Use LHsSigWcType in DerivDecl (7d491ae) Message-ID: <20180305145156.81C803A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T13324 Link : http://ghc.haskell.org/trac/ghc/changeset/7d491ae76b32a78c1ea09a324f67937adceecfc2/ghc >--------------------------------------------------------------- commit 7d491ae76b32a78c1ea09a324f67937adceecfc2 Author: Simon Peyton Jones Date: Mon Mar 5 14:50:00 2018 +0000 Use LHsSigWcType in DerivDecl This prepares the way for the fix for Trac #13324, by using LHsSigWcType for the instance type in DerivDecl, but nowhere else. See comments on Phab:D4383 >--------------------------------------------------------------- 7d491ae76b32a78c1ea09a324f67937adceecfc2 compiler/deSugar/DsMeta.hs | 2 +- compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsDecls.hs | 2 +- compiler/parser/Parser.y | 7 ++++--- compiler/rename/RnSource.hs | 9 ++++++--- compiler/rename/RnTypes.hs | 7 ------- compiler/typecheck/TcDeriv.hs | 7 +++++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 5029f9d..e1eaae1 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -488,7 +488,7 @@ repStandaloneDerivD (L loc (DerivDecl { deriv_strategy = strat ; repDeriv strat' cxt' inst_ty' } ; return (loc, dec) } where - (tvs, cxt, inst_ty) = splitLHsInstDeclTy ty + (tvs, cxt, inst_ty) = splitLHsInstDeclTy (hswc_body ty) repTyFamInstD :: TyFamInstDecl GhcRn -> DsM (Core TH.DecQ) repTyFamInstD decl@(TyFamInstDecl { tfid_eqn = eqn }) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 531f146..6c2e58c 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -351,7 +351,7 @@ cvtDec (TH.StandaloneDerivD ds cxt ty) ; let inst_ty' = mkHsQualTy cxt loc cxt' $ L loc ty' ; returnJustL $ DerivD $ DerivDecl { deriv_strategy = fmap (L loc . cvtDerivStrategy) ds - , deriv_type = mkLHsSigType inst_ty' + , deriv_type = mkLHsSigWcType inst_ty' , deriv_overlap_mode = Nothing } } cvtDec (TH.DefaultSigD nm typ) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 475e31e..660fc2a 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -1659,7 +1659,7 @@ type LDerivDecl pass = Located (DerivDecl pass) -- | Deriving Declaration data DerivDecl pass = DerivDecl - { deriv_type :: LHsSigType pass + { deriv_type :: LHsSigWcType pass , deriv_strategy :: Maybe (Located DerivStrategy) , deriv_overlap_mode :: Maybe (Located OverlapMode) -- ^ - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnDeriving', diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 898ed3c..bdb5e6b 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1373,10 +1373,11 @@ capi_ctype : '{-# CTYPE' STRING STRING '#-}' -- Glasgow extension: stand-alone deriving declarations stand_alone_deriving :: { LDerivDecl GhcPs } - : 'deriving' deriv_strategy 'instance' overlap_pragma inst_type + : 'deriving' deriv_strategy 'instance' overlap_pragma sigtype {% do { let { err = text "in the stand-alone deriving instance" - <> colon <+> quotes (ppr $5) } - ; ams (sLL $1 (hsSigType $>) (DerivDecl $5 $2 $4)) + <> colon <+> quotes (ppr $5) + ; inst_ty = mkLHsSigWcType $5 } + ; ams (sLL $1 $> (DerivDecl inst_ty $2 $4)) [mj AnnDeriving $1, mj AnnInstance $3] } } ----------------------------------------------------------------------------- diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 447871a..53feacb 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -634,7 +634,8 @@ rnClsInstDecl (ClsInstDecl { cid_poly_ty = inst_ty, cid_binds = mbinds , cid_sigs = uprags, cid_tyfam_insts = ats , cid_overlap_mode = oflag , cid_datafam_insts = adts }) - = do { (inst_ty', inst_fvs) <- rnLHsInstType (text "an instance declaration") inst_ty + = do { let ctxt = GenericCtx (text "an instance declaration") + ; (inst_ty', inst_fvs) <- rnHsSigType ctxt inst_ty ; let (ktv_names, _, head_ty') = splitLHsInstDeclTy inst_ty' ; let cls = case hsTyGetAppHead_maybe head_ty' of Nothing -> mkUnboundName (mkTcOccFS (fsLit "")) @@ -945,7 +946,8 @@ rnSrcDerivDecl (DerivDecl ty deriv_strat overlap) ; unless standalone_deriv_ok (addErr standaloneDerivErr) ; failIfTc (isJust deriv_strat && not deriv_strats_ok) $ illegalDerivStrategyErr $ fmap unLoc deriv_strat - ; (ty', fvs) <- rnLHsInstType (text "a deriving declaration") ty + ; let ctxt = GenericCtx (text "a deriving declaration") + ; (ty', fvs) <- rnHsSigWcType ctxt ty ; return (DerivDecl ty' deriv_strat overlap, fvs) } standaloneDerivErr :: SDoc @@ -1124,7 +1126,8 @@ rnHsVectDecl (HsVectClassIn s cls) rnHsVectDecl (HsVectClassOut _) = panic "RnSource.rnHsVectDecl: Unexpected 'HsVectClassOut'" rnHsVectDecl (HsVectInstIn instTy) - = do { (instTy', fvs) <- rnLHsInstType (text "a VECTORISE pragma") instTy + = do { let ctxt = GenericCtx (text "a VECTORISE pragma") + ; (instTy', fvs) <- rnHsSigType ctxt instTy ; return (HsVectInstIn instTy', fvs) } rnHsVectDecl (HsVectInstOut _) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index b2dafb2..791881b 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -13,7 +13,6 @@ module RnTypes ( rnHsKind, rnLHsKind, rnHsSigType, rnHsWcType, rnHsSigWcType, rnHsSigWcTypeScoped, - rnLHsInstType, newTyVarNameRn, collectAnonWildCards, rnConDeclFields, rnLTyVar, @@ -323,12 +322,6 @@ rnImplicitBndrs bind_free_tvs doc ; bindLocalNamesFV vars $ thing_inside vars } -rnLHsInstType :: SDoc -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars) --- Rename the type in an instance or standalone deriving decl --- The 'doc_str' is "an instance declaration" or "a VECTORISE pragma" --- Do not try to decompose the inst_ty in case it is malformed -rnLHsInstType doc inst_ty = rnHsSigType (GenericCtx doc) inst_ty - mk_implicit_bndrs :: [Name] -- implicitly bound -> a -- payload -> FreeVars -- FreeVars of payload diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 294b42c..35d95b9 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -607,13 +607,16 @@ deriveStandalone :: LDerivDecl GhcRn -> TcM (Maybe EarlyDerivSpec) -- This returns a Maybe because the user might try to derive Typeable, which is -- a no-op nowadays. deriveStandalone (L loc (DerivDecl deriv_ty deriv_strat' overlap_mode)) + | let deriv_ty_no_wc = dropWildCards deriv_ty + -- dropWildCards; just awaiting the rest of Phab:D4383 = setSrcSpan loc $ - addErrCtxt (standaloneCtxt deriv_ty) $ + addErrCtxt (standaloneCtxt deriv_ty_no_wc) $ do { traceTc "Standalone deriving decl for" (ppr deriv_ty) ; let deriv_strat = fmap unLoc deriv_strat' ; traceTc "Deriving strategy (standalone deriving)" $ vcat [ppr deriv_strat, ppr deriv_ty] - ; (tvs, theta, cls, inst_tys) <- tcHsClsInstType TcType.InstDeclCtxt deriv_ty + ; (tvs, theta, cls, inst_tys) <- tcHsClsInstType TcType.InstDeclCtxt + deriv_ty_no_wc ; traceTc "Standalone deriving;" $ vcat [ text "tvs:" <+> ppr tvs , text "theta:" <+> ppr theta From git at git.haskell.org Mon Mar 5 20:34:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Mar 2018 20:34:13 +0000 (UTC) Subject: [commit: ghc] master: Fixup include of gmp/config.mk to use new location (df7ac37) Message-ID: <20180305203413.4B6993A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/df7ac37d43bdbabbde9b09344f9425e8e5a879ff/ghc >--------------------------------------------------------------- commit df7ac37d43bdbabbde9b09344f9425e8e5a879ff Author: Herbert Valerio Riedel Date: Mon Mar 5 21:13:28 2018 +0100 Fixup include of gmp/config.mk to use new location This wasn't spotted rightaway in 8f0b2f5eadf0fcb47c581907205a9db686214a69 because the include-site deliberately ignored include-errors as a Hack with the justification below: > Hack. The file gmp/config.mk doesn't exist yet after running ./configure in > the toplevel (ghc) directory. To let some toplevel make commands such as > sdist go through, right after ./configure, don't consider this an error. This may have contributed to #14891. >--------------------------------------------------------------- df7ac37d43bdbabbde9b09344f9425e8e5a879ff libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index 794942c..556a271 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -56,7 +56,7 @@ ifneq "$(CLEANING)" "YES" # Hack. The file gmp/config.mk doesn't exist yet after running ./configure in # the toplevel (ghc) directory. To let some toplevel make commands such as # sdist go through, right after ./configure, don't consider this an error. --include libraries/integer-gmp/gmp/config.mk +-include libraries/integer-gmp/dist-install/build/gmp/config.mk endif gmp_CC_OPTS += $(addprefix -I,$(GMP_INCLUDE_DIRS)) From git at git.haskell.org Tue Mar 6 01:26:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:26:15 +0000 (UTC) Subject: [commit: ghc] master: `--via-asm` only for windows targets (f6cf400) Message-ID: <20180306012615.30A3E3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f6cf4001574e789865d25f89b362a04ef1ca3df4/ghc >--------------------------------------------------------------- commit f6cf4001574e789865d25f89b362a04ef1ca3df4 Author: Moritz Angermann Date: Mon Mar 5 17:18:25 2018 +0800 `--via-asm` only for windows targets Reviewers: trofi, bgamari Reviewed By: trofi, bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4467 >--------------------------------------------------------------- f6cf4001574e789865d25f89b362a04ef1ca3df4 mk/config.mk.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index 26b07f3..92830fa 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -649,12 +649,16 @@ $(eval $(call set_stage_HSC2HS_OPTS,0)) $(eval $(call set_stage_HSC2HS_OPTS,1)) $(eval $(call set_stage_HSC2HS_OPTS,2)) ifeq "$(CrossCompiling)" "YES" +SRC_HSC2HS_OPTS_STAGE1 += --cross-compile +SRC_HSC2HS_OPTS_STAGE2 += --cross-compile +ifeq "$(Windows_Target)" "YES" # We'll assume we compile with gcc or clang, and both support `-S` and can as such use the # --via-asm pass, which should be faster and is required for cross compiling to windows, as # the c compiler complains about non-constant expressions even though they are constant and # end up as constants in the assembly. -SRC_HSC2HS_OPTS_STAGE1 += --cross-compile --via-asm -SRC_HSC2HS_OPTS_STAGE2 += --cross-compile --via-asm +SRC_HSC2HS_OPTS_STAGE1 += --via-asm +SRC_HSC2HS_OPTS_STAGE2 += --via-asm +endif endif SRC_HSC2HS_OPTS_STAGE0 += --cflag=-D$(HostArch_CPP)_HOST_ARCH --cflag=-D$(HostOS_CPP)_HOST_OS SRC_HSC2HS_OPTS_STAGE1 += --cflag=-D$(TargetArch_CPP)_HOST_ARCH --cflag=-D$(TargetOS_CPP)_HOST_OS From git at git.haskell.org Tue Mar 6 01:28:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:28:07 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: temp fix Makefile (7ca07cd) Message-ID: <20180306012807.C7F973A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/7ca07cdd2ab553989c815a8674fa337fff216ea4/ghc >--------------------------------------------------------------- commit 7ca07cdd2ab553989c815a8674fa337fff216ea4 Author: Moritz Angermann Date: Thu Feb 15 12:29:14 2018 +0800 temp fix Makefile >--------------------------------------------------------------- 7ca07cdd2ab553989c815a8674fa337fff216ea4 utils/iserv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/iserv/Makefile b/utils/iserv/Makefile index f160978..3619858 100644 --- a/utils/iserv/Makefile +++ b/utils/iserv/Makefile @@ -10,6 +10,6 @@ # # ----------------------------------------------------------------------------- -dir = iserv -TOP = .. +dir = utils/iserv +TOP = ../.. include $(TOP)/mk/sub-makefile.mk From git at git.haskell.org Tue Mar 6 01:28:10 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:28:10 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: adds .gitignore (84cc122) Message-ID: <20180306012810.966063A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/84cc1225450b631b2f0b6e574353d98c8efd7967/ghc >--------------------------------------------------------------- commit 84cc1225450b631b2f0b6e574353d98c8efd7967 Author: Moritz Angermann Date: Thu Feb 15 13:54:55 2018 +0800 adds .gitignore >--------------------------------------------------------------- 84cc1225450b631b2f0b6e574353d98c8efd7967 .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 460cb68..4d815d7 100644 --- a/.gitignore +++ b/.gitignore @@ -81,8 +81,7 @@ _darcs/ /ghc/stage1/ /ghc/stage2/ /ghc/stage3/ -/iserv/stage2*/ -/iserv/dist/ +/utils/iserv/stage2*/ # ----------------------------------------------------------------------------- # specific generated files From git at git.haskell.org Tue Mar 6 01:28:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:28:14 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (8024b87) Message-ID: <20180306012814.BE3E33A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/8024b87f7f2b769d4eaf01c872e96ea973bc46d0/ghc >--------------------------------------------------------------- commit 8024b87f7f2b769d4eaf01c872e96ea973bc46d0 Author: Moritz Angermann Date: Sat Nov 25 15:10:52 2017 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. # Conflicts: # utils/iserv-proxy/iserv-proxy.cabal >--------------------------------------------------------------- 8024b87f7f2b769d4eaf01c872e96ea973bc46d0 ghc.mk | 13 +-- {iserv => libraries/libiserv}/Makefile | 0 {iserv => libraries/libiserv}/cbits/iservmain.c | 0 libraries/libiserv/ghc.mk | 5 + libraries/libiserv/libiserv.cabal | 39 +++++++ {iserv => libraries/libiserv}/proxy-src/Remote.hs | 0 {iserv => libraries/libiserv}/src/GHCi/Utils.hsc | 0 {iserv => libraries/libiserv}/src/Lib.hs | 0 {iserv => libraries/libiserv}/src/Main.hs | 0 .../libiserv}/src/Remote/Message.hs | 0 {iserv => libraries/libiserv}/src/Remote/Slave.hs | 0 {iserv => utils/iserv-proxy}/Makefile | 0 utils/iserv-proxy/ghc.mk | 113 +++++++++++++++++++++ .../iserv-proxy/iserv-proxy.cabal | 72 +------------ .../Remote.hs => utils/iserv-proxy/src/Main.hs | 0 {iserv => utils/iserv}/Makefile | 0 {iserv => utils/iserv}/cbits/iservmain.c | 0 {iserv => utils/iserv}/ghc.mk | 66 ++++++------ utils/iserv/iserv.cabal | 44 ++++++++ {iserv => utils/iserv}/src/Main.hs | 0 20 files changed, 246 insertions(+), 106 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 8024b87f7f2b769d4eaf01c872e96ea973bc46d0 From git at git.haskell.org Tue Mar 6 01:28:17 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:28:17 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (7427d69) Message-ID: <20180306012817.8BEB73A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/7427d69403c199151f1687b851e8f006695595c3/ghc >--------------------------------------------------------------- commit 7427d69403c199151f1687b851e8f006695595c3 Author: Moritz Angermann Date: Thu Feb 22 16:53:35 2018 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` Summary: This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. Test Plan: ./validate Reviewers: bgamari, goldfire, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4436 >--------------------------------------------------------------- 7427d69403c199151f1687b851e8f006695595c3 libraries/libiserv/src/Main.hs | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/libraries/libiserv/src/Main.hs b/libraries/libiserv/src/Main.hs deleted file mode 100644 index 858cee8..0000000 --- a/libraries/libiserv/src/Main.hs +++ /dev/null @@ -1,63 +0,0 @@ -{-# LANGUAGE CPP, GADTs #-} - --- | --- The Remote GHCi server. --- --- For details on Remote GHCi, see Note [Remote GHCi] in --- compiler/ghci/GHCi.hs. --- -module Main (main) where - -import Lib (serv) - -import GHCi.Message -import GHCi.Signals -import GHCi.Utils - -import Control.Exception -import Control.Monad -import Data.IORef -import System.Environment -import System.Exit -import Text.Printf - -dieWithUsage :: IO a -dieWithUsage = do - prog <- getProgName - die $ prog ++ ": " ++ msg - where -#ifdef WINDOWS - msg = "usage: iserv [-v]" -#else - msg = "usage: iserv [-v]" -#endif - -main :: IO () -main = do - args <- getArgs - (wfd1, rfd2, rest) <- - case args of - arg0:arg1:rest -> do - let wfd1 = read arg0 - rfd2 = read arg1 - return (wfd1, rfd2, rest) - _ -> dieWithUsage - - verbose <- case rest of - ["-v"] -> return True - [] -> return False - _ -> dieWithUsage - when verbose $ - printf "GHC iserv starting (in: %d; out: %d)\n" - (fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int) - inh <- getGhcHandle rfd2 - outh <- getGhcHandle wfd1 - installSignalHandlers - lo_ref <- newIORef Nothing - let pipe = Pipe{pipeRead = inh, pipeWrite = outh, pipeLeftovers = lo_ref} - uninterruptibleMask $ serv verbose hook pipe - - where hook = return -- empty hook - -- we cannot allow any async exceptions while communicating, because - -- we will lose sync in the protocol, hence uninterruptibleMask. - From git at git.haskell.org Tue Mar 6 01:28:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 01:28:20 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2's head updated: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (7427d69) Message-ID: <20180306012820.8279C3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/angerman/win32-cross-2' now includes: 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 8024b87 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` 7ca07cd temp fix Makefile 84cc122 adds .gitignore 7427d69 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` From git at git.haskell.org Tue Mar 6 03:20:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 03:20:43 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: add CCX=$(CXX) to integer-gmp (1dfd7aa) Message-ID: <20180306032043.3B9123A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/1dfd7aa2cb06adccc9180463807e62260d66c90e/ghc >--------------------------------------------------------------- commit 1dfd7aa2cb06adccc9180463807e62260d66c90e Author: Moritz Angermann Date: Tue Mar 6 11:20:22 2018 +0800 add CCX=$(CXX) to integer-gmp >--------------------------------------------------------------- 1dfd7aa2cb06adccc9180463807e62260d66c90e libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index 556a271..f18e27d 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -131,7 +131,7 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h: # `./configure`, not `HOSTPLATFORM`: the 'host' on which GMP will # run is the 'target' platform of the compiler we're building. cd libraries/integer-gmp/gmp/gmpbuild; \ - CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ + CC=$(CCX) CXX=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ --enable-shared=no \ --host=$(TARGETPLATFORM) --build=$(BUILDPLATFORM) $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS= From git at git.haskell.org Tue Mar 6 09:52:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 09:52:24 +0000 (UTC) Subject: [commit: ghc] master: add CCX=$(CXX) to integer-gmp (cf5bc96) Message-ID: <20180306095224.E25553A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cf5bc96e1b023275ec3c0399f3345ceebbc48df0/ghc >--------------------------------------------------------------- commit cf5bc96e1b023275ec3c0399f3345ceebbc48df0 Author: Moritz Angermann Date: Tue Mar 6 11:20:22 2018 +0800 add CCX=$(CXX) to integer-gmp Summary: This came up when trying to build GHC HEAD with nix. We do not set CCX for integer-gmp when running ./configure. We do this however for libffi. The result is, that if CCX is not set, we default to the system one, of which there might be none (as in nixos's case). This will not show on a debian+nix or similar setup, where the system `cxx` is still in place, and only shows up when the system tries hard to sandbox everything (even cxx) as nixOS does. We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and also usedfor `CC`, similar to what we do for libffi.c Test Plan: ./validate Reviewers: bgamari, hvr Reviewed By: hvr Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4473 >--------------------------------------------------------------- cf5bc96e1b023275ec3c0399f3345ceebbc48df0 libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index 556a271..f18e27d 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -131,7 +131,7 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h: # `./configure`, not `HOSTPLATFORM`: the 'host' on which GMP will # run is the 'target' platform of the compiler we're building. cd libraries/integer-gmp/gmp/gmpbuild; \ - CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ + CC=$(CCX) CXX=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ --enable-shared=no \ --host=$(TARGETPLATFORM) --build=$(BUILDPLATFORM) $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS= From git at git.haskell.org Tue Mar 6 12:10:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 12:10:32 +0000 (UTC) Subject: [commit: ghc] master: Schedule.c: remove a redundant CPP guard (ee597e9) Message-ID: <20180306121032.AD2A73A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ee597e9ec78ceb1a9a208c16dbdeb0b67b4ba5ec/ghc >--------------------------------------------------------------- commit ee597e9ec78ceb1a9a208c16dbdeb0b67b4ba5ec Author: Ömer Sinan Ağacan Date: Tue Mar 6 14:16:00 2018 +0300 Schedule.c: remove a redundant CPP guard (the CPP guard is already wrapped with the same guard in line 1549) >--------------------------------------------------------------- ee597e9ec78ceb1a9a208c16dbdeb0b67b4ba5ec rts/Schedule.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index b8306df..885e737 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1738,10 +1738,8 @@ scheduleDoGC (Capability **pcap, Task *task USED_IF_THREADS, // they have stopped mutating and are standing by for GC. waitForGcThreads(cap, idle_cap); -#if defined(THREADED_RTS) // Stable point where we can do a global check on our spark counters ASSERT(checkSparkCountInvariant()); -#endif } #endif From git at git.haskell.org Tue Mar 6 13:57:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 13:57:11 +0000 (UTC) Subject: [commit: ghc] master: Allow top level ticked string literals (5bc195a) Message-ID: <20180306135711.29D283A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5bc195a2caddc5c29cf24e9c731dd8d5050f2c66/ghc >--------------------------------------------------------------- commit 5bc195a2caddc5c29cf24e9c731dd8d5050f2c66 Author: Bartosz Nitka Date: Fri Mar 2 05:33:07 2018 -0800 Allow top level ticked string literals This reverts f5b275a239d2554c4da0b7621211642bf3b10650 and changes the places that looked for `Lit (MachStr _))` to use `exprIsMbTickedLitString_maybe` to unwrap ticks as necessary. Also updated relevant comments. Test Plan: I added 3 new tests that previously reproduced. GHC HEAD now builds with -g Reviewers: simonpj, simonmar, bgamari, hvr, goldfire Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14779 Differential Revision: https://phabricator.haskell.org/D4470 >--------------------------------------------------------------- 5bc195a2caddc5c29cf24e9c731dd8d5050f2c66 compiler/coreSyn/CoreLint.hs | 6 +- compiler/coreSyn/CoreSyn.hs | 10 +-- compiler/coreSyn/CoreUtils.hs | 29 ++++++-- compiler/ghci/ByteCodeGen.hs | 4 +- compiler/simplCore/CSE.hs | 4 +- compiler/simplCore/FloatOut.hs | 32 ++++----- compiler/simplCore/SimplEnv.hs | 4 +- compiler/simplCore/Simplify.hs | 8 +-- compiler/stgSyn/CoreToStg.hs | 7 +- .../tests/simplCore/should_compile/T14779a.hs | 34 +++++++++ .../tests/simplCore/should_compile/T14779b.hs | 83 ++++++++++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 6 ++ testsuite/tests/simplCore/should_run/T14868.hs | 2 + testsuite/tests/simplCore/should_run/T14868.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 3 + 15 files changed, 183 insertions(+), 50 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 5bc195a2caddc5c29cf24e9c731dd8d5050f2c66 From git at git.haskell.org Tue Mar 6 13:59:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 13:59:43 +0000 (UTC) Subject: [commit: ghc] master: Correct -g flag description (9bccfcd) Message-ID: <20180306135943.76BD23A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9bccfcdbbf97250ede05a9351de48f8fa1788217/ghc >--------------------------------------------------------------- commit 9bccfcdbbf97250ede05a9351de48f8fa1788217 Author: Bartosz Nitka Date: Mon Mar 5 11:10:11 2018 -0800 Correct -g flag description Since 7aaeaf81ea95c36fe1dc4da449cf6092a792fd09 `-g1` and `-g2` are actually different. The tutorial below is correct. Test Plan: harbormaster Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4471 >--------------------------------------------------------------- 9bccfcdbbf97250ede05a9351de48f8fa1788217 docs/users_guide/debug-info.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/debug-info.rst b/docs/users_guide/debug-info.rst index aca3733..9a3a671 100644 --- a/docs/users_guide/debug-info.rst +++ b/docs/users_guide/debug-info.rst @@ -17,8 +17,9 @@ useable by most UNIX debugging tools. Emit debug information in object code. Currently only DWARF debug information is supported on x86-64 and i386. Currently debug levels 0 - through 3 are accepted, with 0 disabling debug information production. - Levels 1 through 3 are functionally equivalent. + through 3 are accepted, with 0 disabling debug information production + and higher numbers producing richer output. If ⟨n⟩ is omitted level 2 + is assumed. Tutorial From git at git.haskell.org Tue Mar 6 17:29:22 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:29:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: One final sweep over release notes (6540b71) Message-ID: <20180306172922.8C8F73A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/6540b7113aea04ef7feb3b849861fd4be7c38f1f/ghc >--------------------------------------------------------------- commit 6540b7113aea04ef7feb3b849861fd4be7c38f1f Author: Ben Gamari Date: Sun Mar 4 12:42:05 2018 -0500 One final sweep over release notes >--------------------------------------------------------------- 6540b7113aea04ef7feb3b849861fd4be7c38f1f docs/users_guide/8.4.1-notes.rst | 41 ++++------------------------------------ 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/docs/users_guide/8.4.1-notes.rst b/docs/users_guide/8.4.1-notes.rst index 489f4c8..b25d184 100644 --- a/docs/users_guide/8.4.1-notes.rst +++ b/docs/users_guide/8.4.1-notes.rst @@ -24,6 +24,10 @@ The highlights, since the 8.2.1 release, are: - Further improvements in code generation +- Incoporation of library changes including the Phase 2 of the Semigroup-Monoid Proposal + +- A variety of Windows compatibility improvements + - Many, many bug fixes. @@ -334,43 +338,6 @@ Template Haskell - ``Language.Haskell.TH.FamFlavour``, which was deprecated in GHC 8.2, has been removed. -``ghc`` library -~~~~~~~~~~~~~~~ - -- hsSyn Abstract Syntax Tree (AST) is now extensible via the mechanism described in `Trees that Grow `_ - - The main change for users of the GHC API is that the AST is no longer indexed - by the type used as the identifier, but by a specific index type, :: - - type GhcPs = GhcPass 'Parsed -- Old 'RdrName' type param - type GhcRn = GhcPass 'Renamed -- Old 'Name' type param - type GhcTc = GhcPass 'Typechecked -- Old 'Id' type para, - type GhcTcId = GhcTc -- Old 'TcId' type param - - The simplest way to support the current GHC as well as earlier ones is to define :: - - #if MIN_VERSION_ghc(8,3,0) - type ParseI = GhcPs - type RenameI = GhcRn - type TypecheckI = GhcTc - #else - type ParseI = RdrName - type RenameI = Name - type TypecheckI = Var - #endif - - and then replace all hardcoded index types accordingly. For polymorphic types, - the constraint :: - - #if MIN_VERSION_ghc(8,3,0) - -- |bundle up the constraints required for a trees that grow pass - type IsPass pass = (DataId pass, OutputableBndrId pass, SourceTextX pass) - else - type IsPass pass = (DataId pass, OutputableBndrId pass) - #endif - - can be used. - ``base`` library ~~~~~~~~~~~~~~~~ From git at git.haskell.org Tue Mar 6 17:29:32 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:29:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Correct -g flag description (2df499b) Message-ID: <20180306172932.57B5D3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/2df499b429fd5bbe0f72b56948b9fc2161ec9b4c/ghc >--------------------------------------------------------------- commit 2df499b429fd5bbe0f72b56948b9fc2161ec9b4c Author: Bartosz Nitka Date: Mon Mar 5 15:14:36 2018 -0500 Correct -g flag description Since 7aaeaf81ea95c36fe1dc4da449cf6092a792fd09 `-g1` and `-g2` are actually different. The tutorial below is correct. Test Plan: harbormaster Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4471 (cherry picked from commit 5b1132eefd0a75189b3527486b492c3dffc7bdf1) >--------------------------------------------------------------- 2df499b429fd5bbe0f72b56948b9fc2161ec9b4c docs/users_guide/debug-info.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/debug-info.rst b/docs/users_guide/debug-info.rst index 915591a..0b8cb5e 100644 --- a/docs/users_guide/debug-info.rst +++ b/docs/users_guide/debug-info.rst @@ -17,8 +17,9 @@ useable by most UNIX debugging tools. Emit debug information in object code. Currently only DWARF debug information is supported on x86-64 and i386. Currently debug levels 0 - through 3 are accepted, with 0 disabling debug information production. - Levels 1 through 3 are functionally equivalent. + through 3 are accepted, with 0 disabling debug information production + and higher numbers producing richer output. If ⟨n⟩ is omitted level 2 + is assumed. Tutorial From git at git.haskell.org Tue Mar 6 17:29:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:29:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Fixup include of gmp/config.mk to use new location (57b9a43) Message-ID: <20180306172942.384E23A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/57b9a433e13d7062eca4bd8fbae80019a499e973/ghc >--------------------------------------------------------------- commit 57b9a433e13d7062eca4bd8fbae80019a499e973 Author: Herbert Valerio Riedel Date: Mon Mar 5 21:13:28 2018 +0100 Fixup include of gmp/config.mk to use new location This wasn't spotted rightaway in 8f0b2f5eadf0fcb47c581907205a9db686214a69 because the include-site deliberately ignored include-errors as a Hack with the justification below: > Hack. The file gmp/config.mk doesn't exist yet after running ./configure in > the toplevel (ghc) directory. To let some toplevel make commands such as > sdist go through, right after ./configure, don't consider this an error. This may have contributed to #14891. (cherry picked from commit df7ac37d43bdbabbde9b09344f9425e8e5a879ff) >--------------------------------------------------------------- 57b9a433e13d7062eca4bd8fbae80019a499e973 libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index 794942c..556a271 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -56,7 +56,7 @@ ifneq "$(CLEANING)" "YES" # Hack. The file gmp/config.mk doesn't exist yet after running ./configure in # the toplevel (ghc) directory. To let some toplevel make commands such as # sdist go through, right after ./configure, don't consider this an error. --include libraries/integer-gmp/gmp/config.mk +-include libraries/integer-gmp/dist-install/build/gmp/config.mk endif gmp_CC_OPTS += $(addprefix -I,$(GMP_INCLUDE_DIRS)) From git at git.haskell.org Tue Mar 6 17:29:51 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:29:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Another Cabal submodule bump (201a557) Message-ID: <20180306172951.E96E13A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/201a5570bbc87ee740b63369edbd637141867144/ghc >--------------------------------------------------------------- commit 201a5570bbc87ee740b63369edbd637141867144 Author: Ben Gamari Date: Tue Mar 6 11:11:51 2018 -0500 Another Cabal submodule bump >--------------------------------------------------------------- 201a5570bbc87ee740b63369edbd637141867144 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index 728ad1a..ccd0c59 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 728ad1a1e066da453ae13ee479629c00d8c2f32d +Subproject commit ccd0c59bec88b179c06b65df3247d8664b38e44e From git at git.haskell.org Tue Mar 6 17:30:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:30:03 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Allow top level ticked string literals (2753d89) Message-ID: <20180306173003.985993A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/2753d8903129ffec94253f99c3904248274053cd/ghc >--------------------------------------------------------------- commit 2753d8903129ffec94253f99c3904248274053cd Author: Bartosz Nitka Date: Fri Mar 2 05:33:07 2018 -0800 Allow top level ticked string literals This reverts f5b275a239d2554c4da0b7621211642bf3b10650 and changes the places that looked for `Lit (MachStr _))` to use `exprIsMbTickedLitString_maybe` to unwrap ticks as necessary. Also updated relevant comments. Test Plan: I added 3 new tests that previously reproduced. GHC HEAD now builds with -g Reviewers: simonpj, simonmar, bgamari, hvr, goldfire Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14779 Differential Revision: https://phabricator.haskell.org/D4470 (cherry picked from commit 5bc195a2caddc5c29cf24e9c731dd8d5050f2c66) >--------------------------------------------------------------- 2753d8903129ffec94253f99c3904248274053cd compiler/coreSyn/CoreLint.hs | 6 +- compiler/coreSyn/CoreSyn.hs | 10 +-- compiler/coreSyn/CoreUtils.hs | 29 ++++++-- compiler/ghci/ByteCodeGen.hs | 4 +- compiler/simplCore/CSE.hs | 4 +- compiler/simplCore/FloatOut.hs | 32 ++++----- compiler/simplCore/SimplEnv.hs | 4 +- compiler/simplCore/Simplify.hs | 8 +-- compiler/stgSyn/CoreToStg.hs | 7 +- .../tests/simplCore/should_compile/T14779a.hs | 34 +++++++++ .../tests/simplCore/should_compile/T14779b.hs | 83 ++++++++++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 6 ++ testsuite/tests/simplCore/should_run/T14868.hs | 2 + testsuite/tests/simplCore/should_run/T14868.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 3 + 15 files changed, 183 insertions(+), 50 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 2753d8903129ffec94253f99c3904248274053cd From git at git.haskell.org Tue Mar 6 17:30:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:30:18 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: add CCX=$(CXX) to integer-gmp (76af028) Message-ID: <20180306173018.57A643A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/76af02833913942defee5962669ac67a8ffb1762/ghc >--------------------------------------------------------------- commit 76af02833913942defee5962669ac67a8ffb1762 Author: Moritz Angermann Date: Tue Mar 6 11:20:22 2018 +0800 add CCX=$(CXX) to integer-gmp Summary: This came up when trying to build GHC HEAD with nix. We do not set CCX for integer-gmp when running ./configure. We do this however for libffi. The result is, that if CCX is not set, we default to the system one, of which there might be none (as in nixos's case). This will not show on a debian+nix or similar setup, where the system `cxx` is still in place, and only shows up when the system tries hard to sandbox everything (even cxx) as nixOS does. We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and also usedfor `CC`, similar to what we do for libffi.c Test Plan: ./validate Reviewers: bgamari, hvr Reviewed By: hvr Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4473 (cherry picked from commit cf5bc96e1b023275ec3c0399f3345ceebbc48df0) >--------------------------------------------------------------- 76af02833913942defee5962669ac67a8ffb1762 libraries/integer-gmp/gmp/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk index 556a271..f18e27d 100644 --- a/libraries/integer-gmp/gmp/ghc.mk +++ b/libraries/integer-gmp/gmp/ghc.mk @@ -131,7 +131,7 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h: # `./configure`, not `HOSTPLATFORM`: the 'host' on which GMP will # run is the 'target' platform of the compiler we're building. cd libraries/integer-gmp/gmp/gmpbuild; \ - CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ + CC=$(CCX) CXX=$(CCX) NM=$(NM) AR=$(AR_STAGE1) ./configure \ --enable-shared=no \ --host=$(TARGETPLATFORM) --build=$(BUILDPLATFORM) $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS= From git at git.haskell.org Tue Mar 6 17:30:28 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:30:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Bump hsc2hs submodule (3ba3fa6) Message-ID: <20180306173028.515FC3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/3ba3fa6a111f0fe72a7d556d0bd76137dc8b6144/ghc >--------------------------------------------------------------- commit 3ba3fa6a111f0fe72a7d556d0bd76137dc8b6144 Author: Ben Gamari Date: Tue Mar 6 11:48:41 2018 -0500 Bump hsc2hs submodule >--------------------------------------------------------------- 3ba3fa6a111f0fe72a7d556d0bd76137dc8b6144 utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index 9483ad1..16ee80a 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit 9483ad10064fbbb97ab525280623826b1ef63959 +Subproject commit 16ee80ad2d3f6fac23bf81357a3cd2793e5a1315 From git at git.haskell.org Tue Mar 6 17:30:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 17:30:38 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Set RELEASE=YES, version 8.4.1 (4b6c3b6) Message-ID: <20180306173038.1D8123A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/4b6c3b6f15b0b4b7cee853856b45b317817e7351/ghc >--------------------------------------------------------------- commit 4b6c3b6f15b0b4b7cee853856b45b317817e7351 Author: Ben Gamari Date: Sun Mar 4 13:53:54 2018 -0500 Set RELEASE=YES, version 8.4.1 >--------------------------------------------------------------- 4b6c3b6f15b0b4b7cee853856b45b317817e7351 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 57d76b4..30241a5 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.4.0], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.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 Tue Mar 6 18:33:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 18:33:35 +0000 (UTC) Subject: [commit: ghc] master: cmm/: Avoid using lazy left folds (64c0af7) Message-ID: <20180306183335.98ECF3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/64c0af7517148316b259300b851b966cfbcf3eaf/ghc >--------------------------------------------------------------- commit 64c0af7517148316b259300b851b966cfbcf3eaf Author: Michal Terepeta Date: Mon Mar 5 15:16:02 2018 -0500 cmm/: Avoid using lazy left folds This basically replaces all uses of `foldl` with `foldl'`. I've looked at all the call sites and there doesn't seem to be any reason to prefer the lazy version. Signed-off-by: Michal Terepeta Test Plan: ./validate Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4463 >--------------------------------------------------------------- 64c0af7517148316b259300b851b966cfbcf3eaf compiler/cmm/CmmBuildInfoTables.hs | 24 +++++++++++++----------- compiler/cmm/CmmCommonBlockElim.hs | 3 ++- compiler/cmm/CmmContFlowOpt.hs | 3 ++- compiler/cmm/CmmLayoutStack.hs | 4 ++-- compiler/cmm/CmmProcPoint.hs | 9 +++++---- compiler/cmm/CmmSink.hs | 5 +++-- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index dc5cfd6..ae192e5 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -119,11 +119,13 @@ cafAnal cmmGraph = analyzeCmmBwd cafLattice cafTransfers cmmGraph mapEmpty -- Description of the SRT for a given module. -- Note that this SRT may grow as we greedily add new CAFs to it. -data TopSRT = TopSRT { lbl :: CLabel - , next_elt :: Int -- the next entry in the table - , rev_elts :: [CLabel] - , elt_map :: Map CLabel Int } - -- map: CLabel -> its last entry in the table +data TopSRT = TopSRT + { lbl :: CLabel + , next_elt :: {-# UNPACK #-} !Int -- the next entry in the table + , rev_elts :: [CLabel] + , elt_map :: !(Map CLabel Int) -- CLabel -> its last entry in the table + } + instance Outputable TopSRT where ppr (TopSRT lbl next elts eltmap) = text "TopSRT:" <+> ppr lbl @@ -176,7 +178,7 @@ buildSRT dflags topSRT cafs = do localSRTs <- procpointSRT dflags (lbl topSRT) (elt_map topSRT) cafs return (topSRT, localSRTs) in if cafs `lengthExceeds` maxBmpSize dflags then - mkSRT (foldl add_if_missing topSRT cafs) + mkSRT (foldl' add_if_missing topSRT cafs) else -- make sure all the cafs are near the bottom of the srt mkSRT (add_if_too_far topSRT cafs) add_if_missing srt caf = @@ -269,14 +271,14 @@ localCAFInfo cafEnv proc@(CmmProc _ top_l _ (CmmGraph {g_entry=entry})) = -- To do this replacement efficiently, we gather strongly connected -- components, then we sort the components in topological order. mkTopCAFInfo :: [(CAFSet, Maybe CLabel)] -> Map CLabel CAFSet -mkTopCAFInfo localCAFs = foldl addToTop Map.empty g +mkTopCAFInfo localCAFs = foldl' addToTop Map.empty g where - addToTop env (AcyclicSCC (l, cafset)) = + addToTop !env (AcyclicSCC (l, cafset)) = Map.insert l (flatten env cafset) env - addToTop env (CyclicSCC nodes) = + addToTop !env (CyclicSCC nodes) = let (lbls, cafsets) = unzip nodes - cafset = foldr Set.delete (foldl Set.union Set.empty cafsets) lbls - in foldl (\env l -> Map.insert l (flatten env cafset) env) env lbls + cafset = Set.unions cafsets `Set.difference` Set.fromList lbls + in foldl' (\env l -> Map.insert l (flatten env cafset) env) env lbls g = stronglyConnCompFromEdgedVerticesOrd [ DigraphNode (l,cafs) l (Set.elems cafs) diff --git a/compiler/cmm/CmmCommonBlockElim.hs b/compiler/cmm/CmmCommonBlockElim.hs index ba3b1c8..fce8f7d 100644 --- a/compiler/cmm/CmmCommonBlockElim.hs +++ b/compiler/cmm/CmmCommonBlockElim.hs @@ -29,6 +29,7 @@ import UniqDFM import qualified TrieMap as TM import Unique import Control.Arrow (first, second) +import Data.List (foldl') -- ----------------------------------------------------------------------------- -- Eliminate common blocks @@ -173,7 +174,7 @@ hash_block block = hash_tgt (ForeignTarget e _) = hash_e e hash_tgt (PrimTarget _) = 31 -- lots of these - hash_list f = foldl (\z x -> f x + z) (0::Word32) + hash_list f = foldl' (\z x -> f x + z) (0::Word32) cvt = fromInteger . toInteger diff --git a/compiler/cmm/CmmContFlowOpt.hs b/compiler/cmm/CmmContFlowOpt.hs index 8863012..da365cf 100644 --- a/compiler/cmm/CmmContFlowOpt.hs +++ b/compiler/cmm/CmmContFlowOpt.hs @@ -24,6 +24,7 @@ import Panic import Util import Control.Monad +import Data.List -- Note [What is shortcutting] @@ -177,7 +178,7 @@ blockConcat splitting_procs g at CmmGraph { g_entry = entry_id } -- a map of blocks. We process each element from blocks and update -- blockmap accordingly blocks = postorderDfs g - blockmap = foldr addBlock emptyBody blocks + blockmap = foldl' (flip addBlock) emptyBody blocks -- Accumulator contains three components: -- * map of blocks in a graph diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index 2602dc8..3f16334 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -37,7 +37,7 @@ import qualified Data.Set as Set import Control.Monad.Fix import Data.Array as Array import Data.Bits -import Data.List (nub) +import Data.List (nub, foldl') {- Note [Stack Layout] @@ -322,7 +322,7 @@ layout dflags procpoints liveness entry entry_args final_stackmaps final_sp_high -- Sp = Sp + sp_off -- Sp adjustment goes here -- last1 -- the last node -- - let middle_pre = blockToList $ foldl blockSnoc middle0 middle1 + let middle_pre = blockToList $ foldl' blockSnoc middle0 middle1 let final_blocks = manifestSp dflags final_stackmaps stack0 sp0 final_sp_high diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs index 3459284..eeae960 100644 --- a/compiler/cmm/CmmProcPoint.hs +++ b/compiler/cmm/CmmProcPoint.hs @@ -330,7 +330,7 @@ splitAtProcPoints dflags entry_label callPPs procPoints procMap -- replace branches to procpoints with branches to jumps blockEnv'' = toBlockMap $ replaceBranches jumpEnv $ ofBlockMap ppId blockEnv' -- add the jump blocks to the graph - blockEnv''' = foldl (flip insertBlock) blockEnv'' jumpBlocks + blockEnv''' = foldl' (flip insertBlock) blockEnv'' jumpBlocks let g' = ofBlockMap ppId blockEnv''' -- pprTrace "g' pre jumps" (ppr g') $ do return (mapInsert ppId g' newGraphEnv) @@ -373,9 +373,10 @@ splitAtProcPoints dflags entry_label callPPs procPoints procMap -- call sites. Here, we sort them in reverse order -- it gets -- reversed later. let (_, block_order) = - foldl add_block_num (0::Int, mapEmpty :: LabelMap Int) - (postorderDfs g) - add_block_num (i, map) block = (i+1, mapInsert (entryLabel block) i map) + foldl' add_block_num (0::Int, mapEmpty :: LabelMap Int) + (postorderDfs g) + add_block_num (!i, !map) block = + (i + 1, mapInsert (entryLabel block) i map) sort_fn (bid, _) (bid', _) = compare (expectJust "block_order" $ mapLookup bid block_order) (expectJust "block_order" $ mapLookup bid' block_order) diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs index 464a041..487f0bc 100644 --- a/compiler/cmm/CmmSink.hs +++ b/compiler/cmm/CmmSink.hs @@ -24,6 +24,7 @@ import PprCmm () import qualified Data.IntSet as IntSet import Data.List (partition) import qualified Data.Set as Set +import Data.List import Data.Maybe -- Compact sets for membership tests of local variables. @@ -233,7 +234,7 @@ cmmSink dflags graph = ofBlockList (g_entry graph) $ sink mapEmpty $ blocks live_rhs = foldRegsUsed dflags extendRegSet emptyRegSet rhs - final_middle = foldl blockSnoc middle' dropped_last + final_middle = foldl' blockSnoc middle' dropped_last sunk' = mapUnion sunk $ mapFromList [ (l, filterAssignments dflags (getLive l) assigs'') @@ -343,7 +344,7 @@ walk dflags nodes assigs = go nodes emptyBlock assigs (dropped, as') = dropAssignmentsSimple dflags (\a -> conflicts dflags a node2) as1 - block' = foldl blockSnoc block dropped `blockSnoc` node2 + block' = foldl' blockSnoc block dropped `blockSnoc` node2 -- From git at git.haskell.org Tue Mar 6 18:33:50 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 18:33:50 +0000 (UTC) Subject: [commit: ghc] master: Make accumArray and accum stricter (08345bd) Message-ID: <20180306183350.2DB0A3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/08345bd0e8d237ec3929aaee7613c4f76e07e131/ghc >--------------------------------------------------------------- commit 08345bd0e8d237ec3929aaee7613c4f76e07e131 Author: David Feuer Date: Mon Mar 5 15:18:05 2018 -0500 Make accumArray and accum stricter `accumArray` was lazier than documented. `accum` did not have documented strictness. The extra laziness allowed thunks to build up in the array. Force the results of applying the accumulating function to resolve. Reviewers: hvr, bgamari Reviewed By: bgamari Subscribers: alpmestan, rwbarton, thomie, carter GHC Trac Issues: #14785 Differential Revision: https://phabricator.haskell.org/D4403 >--------------------------------------------------------------- 08345bd0e8d237ec3929aaee7613c4f76e07e131 libraries/base/GHC/Arr.hs | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libraries/base/GHC/Arr.hs b/libraries/base/GHC/Arr.hs index adfd602..3698852 100644 --- a/libraries/base/GHC/Arr.hs +++ b/libraries/base/GHC/Arr.hs @@ -1,5 +1,6 @@ {-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, RoleAnnotations #-} +{-# LANGUAGE BangPatterns #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- @@ -505,7 +506,7 @@ listArray (l,u) es = runST (ST $ \s1# -> -- | The value at the given index in an array. {-# INLINE (!) #-} (!) :: Ix i => Array i e -> i -> e -arr@(Array l u n _) ! i = unsafeAt arr $ safeIndex (l,u) n i +(!) arr@(Array l u n _) i = unsafeAt arr $ safeIndex (l,u) n i {-# INLINE safeRangeSize #-} safeRangeSize :: Ix i => (i, i) -> Int @@ -636,6 +637,7 @@ assocs arr@(Array l u _ _) = -- | The 'accumArray' function deals with repeated indices in the association -- list using an /accumulating function/ which combines the values of -- associations with the same index. +-- -- For example, given a list of values of some index type, @hist@ -- produces a histogram of the number of occurrences of each index within -- a specified range: @@ -643,10 +645,10 @@ assocs arr@(Array l u _ _) = -- > hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b -- > hist bnds is = accumArray (+) 0 bnds [(i, 1) | i<-is, inRange bnds i] -- --- If the accumulating function is strict, then 'accumArray' is strict in --- the values, as well as the indices, in the association list. Thus, --- unlike ordinary arrays built with 'array', accumulated arrays should --- not in general be recursive. +-- @accumArray@ is strict in each result of applying the accumulating +-- function, although it is lazy in the initial value. Thus, unlike +-- arrays built with 'array', accumulated arrays should not in general +-- be recursive. {-# INLINE accumArray #-} accumArray :: Ix i => (e -> a -> e) -- ^ accumulating function @@ -667,7 +669,7 @@ unsafeAccumArray f initial b ies = unsafeAccumArray' f initial b (rangeSize b) i unsafeAccumArray' :: (e -> a -> e) -> e -> (i,i) -> Int -> [(Int, a)] -> Array i e unsafeAccumArray' f initial (l,u) n@(I# n#) ies = runST (ST $ \s1# -> case newArray# n# initial s1# of { (# s2#, marr# #) -> - foldr (adjust f marr#) (done l u n marr#) ies s2# }) + foldr (adjust' f marr#) (done l u n marr#) ies s2# }) {-# INLINE adjust #-} adjust :: (e -> a -> e) -> MutableArray# s e -> (Int, a) -> STRep s b -> STRep s b @@ -678,6 +680,18 @@ adjust f marr# (I# i#, new) next case writeArray# marr# i# (f old new) s2# of s3# -> next s3# +{-# INLINE adjust' #-} +adjust' :: (e -> a -> e) + -> MutableArray# s e + -> (Int, a) + -> STRep s b -> STRep s b +adjust' f marr# (I# i#, new) next + = \s1# -> case readArray# marr# i# s1# of + (# s2#, old #) -> + let !combined = f old new + in next (writeArray# marr# i# combined s2#) + + -- | Constructs an array identical to the first argument except that it has -- been updated by the associations in the right argument. -- For example, if @m@ is a 1-origin, @n@ by @n@ matrix, then @@ -706,6 +720,8 @@ unsafeReplace arr ies = runST (do -- -- > accumArray f z b = accum f (array b [(i, z) | i <- range b]) -- +-- @accum@ is strict in all the results of applying the accumulation. +-- However, it is lazy in the initial values of the array. {-# INLINE accum #-} accum :: Ix i => (e -> a -> e) -> Array i e -> [(i, a)] -> Array i e accum f arr@(Array l u n _) ies = @@ -715,7 +731,7 @@ accum f arr@(Array l u n _) ies = unsafeAccum :: (e -> a -> e) -> Array i e -> [(Int, a)] -> Array i e unsafeAccum f arr ies = runST (do STArray l u n marr# <- thawSTArray arr - ST (foldr (adjust f marr#) (done l u n marr#) ies)) + ST (foldr (adjust' f marr#) (done l u n marr#) ies)) {-# INLINE [1] amap #-} -- See Note [amap] amap :: (a -> b) -> Array i a -> Array i b From git at git.haskell.org Tue Mar 6 18:34:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 18:34:05 +0000 (UTC) Subject: [commit: ghc] master: Bump nofib submodule (1488591) Message-ID: <20180306183405.929F53A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1488591ac595d1b7be39345cc390737ea9a65fe3/ghc >--------------------------------------------------------------- commit 1488591ac595d1b7be39345cc390737ea9a65fe3 Author: Ben Gamari Date: Mon Mar 5 15:30:25 2018 -0500 Bump nofib submodule >--------------------------------------------------------------- 1488591ac595d1b7be39345cc390737ea9a65fe3 nofib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nofib b/nofib index ef4f8dc..1364fe6 160000 --- a/nofib +++ b/nofib @@ -1 +1 @@ -Subproject commit ef4f8dc8ef51ce3353b76a0761c1a09e5ff30b67 +Subproject commit 1364fe623f9216108a285a8804a27bdd8dfea3c4 From git at git.haskell.org Tue Mar 6 18:34:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 18:34:21 +0000 (UTC) Subject: [commit: ghc] master: Fix interpreter with profiling (488d63d) Message-ID: <20180306183421.11B673A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/488d63d6899d223ef87c26c218f0cf81ac670a90/ghc >--------------------------------------------------------------- commit 488d63d6899d223ef87c26c218f0cf81ac670a90 Author: Simon Marlow Date: Mon Mar 5 15:12:57 2018 -0500 Fix interpreter with profiling This was broken by D3746 and/or D3809, but unfortunately we didn't notice because CI at the time wasn't building the profiling way. Test Plan: ``` cd testsuite/test/profiling/should_run make WAY=ghci-ext-prof ``` Reviewers: bgamari, michalt, hvr, erikd Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14705 Differential Revision: https://phabricator.haskell.org/D4437 >--------------------------------------------------------------- 488d63d6899d223ef87c26c218f0cf81ac670a90 compiler/codeGen/StgCmmBind.hs | 14 +++++++----- compiler/codeGen/StgCmmCon.hs | 3 +-- compiler/codeGen/StgCmmLayout.hs | 27 ++++++++++++++++------- compiler/ghci/ByteCodeGen.hs | 11 ++++----- testsuite/tests/codeGen/should_run/T13825-unit.hs | 2 +- testsuite/tests/profiling/should_run/all.T | 6 ++--- 6 files changed, 35 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 488d63d6899d223ef87c26c218f0cf81ac670a90 From git at git.haskell.org Tue Mar 6 19:02:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 19:02:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: forkProcess: fix task mutex release order (0dc2a35) Message-ID: <20180306190214.11F543A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/0dc2a358a954b0b858e91843ade52bb0a28c392d/ghc >--------------------------------------------------------------- commit 0dc2a358a954b0b858e91843ade52bb0a28c392d Author: Ömer Sinan Ağacan Date: Fri Mar 2 11:15:03 2018 -0500 forkProcess: fix task mutex release order `all_tasks_mutex` should be released before calling `releaseCapability_` in the parent process as `releaseCapability_` spawns worker tasks in some cases. Reviewers: bgamari, erikd, simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14538 Differential Revision: https://phabricator.haskell.org/D4460 (cherry picked from commit e261b8523eb547b93b8b9e194bc2566350e7cc60) >--------------------------------------------------------------- 0dc2a358a954b0b858e91843ade52bb0a28c392d rts/Schedule.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index 8002ac3..828a35f 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2004,15 +2004,15 @@ forkProcess(HsStablePtr *entry RELEASE_LOCK(&stable_mutex); RELEASE_LOCK(&task->lock); +#if defined(THREADED_RTS) + RELEASE_LOCK(&all_tasks_mutex); +#endif + for (i=0; i < n_capabilities; i++) { releaseCapability_(capabilities[i],false); RELEASE_LOCK(&capabilities[i]->lock); } -#if defined(THREADED_RTS) - RELEASE_LOCK(&all_tasks_mutex); -#endif - boundTaskExiting(task); // just return the pid From git at git.haskell.org Tue Mar 6 19:02:23 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Mar 2018 19:02:23 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: Fix interpreter with profiling (0a3e2f3) Message-ID: <20180306190223.EF6313A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/0a3e2f324dbd525d626ebd3d97e8ffa1cf2f0ffb/ghc >--------------------------------------------------------------- commit 0a3e2f324dbd525d626ebd3d97e8ffa1cf2f0ffb Author: Simon Marlow Date: Mon Mar 5 15:12:57 2018 -0500 Fix interpreter with profiling This was broken by D3746 and/or D3809, but unfortunately we didn't notice because CI at the time wasn't building the profiling way. Test Plan: ``` cd testsuite/test/profiling/should_run make WAY=ghci-ext-prof ``` Reviewers: bgamari, michalt, hvr, erikd Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14705 Differential Revision: https://phabricator.haskell.org/D4437 (cherry picked from commit 488d63d6899d223ef87c26c218f0cf81ac670a90) >--------------------------------------------------------------- 0a3e2f324dbd525d626ebd3d97e8ffa1cf2f0ffb compiler/codeGen/StgCmmBind.hs | 14 +++++++----- compiler/codeGen/StgCmmCon.hs | 3 +-- compiler/codeGen/StgCmmLayout.hs | 27 ++++++++++++++++------- compiler/ghci/ByteCodeGen.hs | 11 ++++----- testsuite/tests/codeGen/should_run/T13825-unit.hs | 2 +- 5 files changed, 33 insertions(+), 24 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 0a3e2f324dbd525d626ebd3d97e8ffa1cf2f0ffb From git at git.haskell.org Wed Mar 7 05:39:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 05:39:09 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Adds iserv-proxy/cabal.project (31a01e7) Message-ID: <20180307053909.6B6AC3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/31a01e7e71c6dd4a59d3d44ad09e5e1e157dee8c/ghc >--------------------------------------------------------------- commit 31a01e7e71c6dd4a59d3d44ad09e5e1e157dee8c Author: Moritz Angermann Date: Wed Mar 7 11:01:23 2018 +0800 Adds iserv-proxy/cabal.project >--------------------------------------------------------------- 31a01e7e71c6dd4a59d3d44ad09e5e1e157dee8c utils/iserv-proxy/cabal.project | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/iserv-proxy/cabal.project b/utils/iserv-proxy/cabal.project new file mode 100644 index 0000000..2e6cd12 --- /dev/null +++ b/utils/iserv-proxy/cabal.project @@ -0,0 +1,4 @@ +packages: . ../../libraries/libiserv + +package libiserv + flags: +network From git at git.haskell.org Wed Mar 7 05:39:12 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 05:39:12 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Adds iserv-slave (via CLI) (8fc0614) Message-ID: <20180307053912.D598A3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/8fc0614f46434b786cc3a746e329ccc403bff72f/ghc >--------------------------------------------------------------- commit 8fc0614f46434b786cc3a746e329ccc403bff72f Author: Moritz Angermann Date: Wed Mar 7 13:38:09 2018 +0800 Adds iserv-slave (via CLI) >--------------------------------------------------------------- 8fc0614f46434b786cc3a746e329ccc403bff72f utils/{iserv-proxy => iserv-slave}/cabal.project | 0 utils/iserv-slave/iserv-slave.cabal | 20 ++++++++++++++++ utils/iserv-slave/src/Cli.hs | 30 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/utils/iserv-proxy/cabal.project b/utils/iserv-slave/cabal.project similarity index 100% copy from utils/iserv-proxy/cabal.project copy to utils/iserv-slave/cabal.project diff --git a/utils/iserv-slave/iserv-slave.cabal b/utils/iserv-slave/iserv-slave.cabal new file mode 100644 index 0000000..66a2a32 --- /dev/null +++ b/utils/iserv-slave/iserv-slave.cabal @@ -0,0 +1,20 @@ +Name: iserv-slave +Version: 8.5 +Copyright: XXX +License: BSD3 +-- XXX License-File: LICENSE +Author: XXX +Maintainer: XXX +Synopsis: iserv allows GHC to delegate Tempalte Haskell computations +Description: +Category: Development +build-type: Simple +cabal-version: >=1.10 + +Executable iserv-slave + Default-Language: Haskell2010 + Main-Is: Cli.hs + Hs-Source-Dirs: src + Build-Depends: + base >= 4 && < 5, + libiserv == 8.5 diff --git a/utils/iserv-slave/src/Cli.hs b/utils/iserv-slave/src/Cli.hs new file mode 100644 index 0000000..8a3a34f --- /dev/null +++ b/utils/iserv-slave/src/Cli.hs @@ -0,0 +1,30 @@ +module Main where + +import System.Environment (getProgName, getArgs) +import System.Exit (die) +import Remote.Slave (startSlave') + +main :: IO () +main = getArgs >>= startSlave + +dieWithUsage :: IO a +dieWithUsage = do + prog <- getProgName + die $ prog ++ ": " ++ msg + where + msg = "usage: iserv-slave /path/to/storage PORT [-v]" + +startSlave :: [String] -> IO () +startSlave args0 + | "--help" `elem` args0 = dieWithUsage + | otherwise = do + (path, port, rest) <- case args0 of + arg0:arg1:rest -> return (arg0, read arg1, rest) + _ -> dieWithUsage + verbose <- case rest of + ["-v"] -> return True + [] -> return False + _ -> dieWithUsage + + startSlave' verbose path port + From git at git.haskell.org Wed Mar 7 05:39:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 05:39:15 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Better logging in iserv-remote (c5fd54a) Message-ID: <20180307053915.A57963A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/c5fd54a15c919a4515aefb045271be1042d35772/ghc >--------------------------------------------------------------- commit c5fd54a15c919a4515aefb045271be1042d35772 Author: Moritz Angermann Date: Wed Mar 7 13:38:28 2018 +0800 Better logging in iserv-remote >--------------------------------------------------------------- c5fd54a15c919a4515aefb045271be1042d35772 libraries/libiserv/src/Remote/Slave.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs index b80d095..9387db1 100644 --- a/libraries/libiserv/src/Remote/Slave.hs +++ b/libraries/libiserv/src/Remote/Slave.hs @@ -112,6 +112,7 @@ hook verbose base_path pipe m = case m of handleLoad pipe path (base_path path) return $ Msg (LoadObj (base_path path)) Msg (LoadArchive path) -> do + when verbose $ putStrLn ("Need Archieve: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) return $ Msg (LoadArchive (base_path path)) -- when loading DLLs (.so, .dylib, .dll, ...) and these are provided @@ -119,7 +120,7 @@ hook verbose base_path pipe m = case m of -- therefore we hook the LoadDLL call only for absolute paths to ship the -- dll from the host to the target. Msg (LoadDLL path) | isAbsolute path -> do - when verbose $ putStrLn ("Need DLL: " ++ (base_path path)) + when verbose $ putStrLn ("Need DLL: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) return $ Msg (LoadDLL (base_path path)) _other -> return m From git at git.haskell.org Wed Mar 7 05:39:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 05:39:18 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Assume `C:` to be system libraries on windows. (d12d240) Message-ID: <20180307053918.7AA973A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/d12d2409cee20c2fb4d1d3b9f7ae4e63ec7977b9/ghc >--------------------------------------------------------------- commit d12d2409cee20c2fb4d1d3b9f7ae4e63ec7977b9 Author: Moritz Angermann Date: Wed Mar 7 13:38:44 2018 +0800 Assume `C:` to be system libraries on windows. >--------------------------------------------------------------- d12d2409cee20c2fb4d1d3b9f7ae4e63ec7977b9 libraries/libiserv/src/Remote/Slave.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs index 9387db1..701e7d2 100644 --- a/libraries/libiserv/src/Remote/Slave.hs +++ b/libraries/libiserv/src/Remote/Slave.hs @@ -119,6 +119,9 @@ hook verbose base_path pipe m = case m of -- as relative paths, the intention is to load a pre-existing system library, -- therefore we hook the LoadDLL call only for absolute paths to ship the -- dll from the host to the target. + Msg (LoadDLL path@('C':':':_)) -> do + when verbose $ putStrLn ("Need DLL: " ++ path) + return $ Msg (LoadDLL path) Msg (LoadDLL path) | isAbsolute path -> do when verbose $ putStrLn ("Need DLL: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) From git at git.haskell.org Wed Mar 7 09:14:41 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 09:14:41 +0000 (UTC) Subject: [commit: ghc] master: Add perf test for #14052 (40c4313) Message-ID: <20180307091441.5ED573A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/40c4313a8729cbd0873c16ae69434919343b551f/ghc >--------------------------------------------------------------- commit 40c4313a8729cbd0873c16ae69434919343b551f Author: Ömer Sinan Ağacan Date: Wed Mar 7 11:52:05 2018 +0300 Add perf test for #14052 >--------------------------------------------------------------- 40c4313a8729cbd0873c16ae69434919343b551f testsuite/tests/perf/should_run/T14052.hs | 4 + testsuite/tests/perf/should_run/T14052.script | 2501 +++++++++++++++++++++++++ testsuite/tests/perf/should_run/T14052.stdout | 1000 ++++++++++ testsuite/tests/perf/should_run/all.T | 7 + 4 files changed, 3512 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 40c4313a8729cbd0873c16ae69434919343b551f From git at git.haskell.org Wed Mar 7 10:01:58 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 10:01:58 +0000 (UTC) Subject: [commit: ghc] master: Add bindist-list.uniq to .gitignore (b120e64) Message-ID: <20180307100158.A15BC3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b120e649b7b13ee2a2c1bfe568a91bea9d271fba/ghc >--------------------------------------------------------------- commit b120e649b7b13ee2a2c1bfe568a91bea9d271fba Author: Ömer Sinan Ağacan Date: Wed Mar 7 13:01:20 2018 +0300 Add bindist-list.uniq to .gitignore >--------------------------------------------------------------- b120e649b7b13ee2a2c1bfe568a91bea9d271fba .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 460cb68..efc7a89 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,7 @@ _darcs/ # specific generated files /bindist-list +/bindist-list.uniq /bindistprep/ /bindisttest/HelloWorld /bindisttest/ From git at git.haskell.org Wed Mar 7 11:36:08 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 11:36:08 +0000 (UTC) Subject: [commit: ghc] master: Schedule.c: remove unreachable code block (d9d4632) Message-ID: <20180307113608.C1E5C3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d9d463289fe20316cff12a8f0dbf414db678fa72/ghc >--------------------------------------------------------------- commit d9d463289fe20316cff12a8f0dbf414db678fa72 Author: Ömer Sinan Ağacan Date: Wed Mar 7 14:34:46 2018 +0300 Schedule.c: remove unreachable code block >--------------------------------------------------------------- d9d463289fe20316cff12a8f0dbf414db678fa72 rts/Schedule.c | 7 ------- rts/Sparks.c | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index 885e737..5160cb4 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1918,13 +1918,6 @@ delete_threads_and_gc: throwToSelf(cap, main_thread, heapOverflow_closure); } } -#if defined(SPARKBALANCE) - /* JB - Once we are all together... this would be the place to balance all - spark pools. No concurrent stealing or adding of new sparks can - occur. Should be defined in Sparks.c. */ - balanceSparkPoolsCaps(n_capabilities, capabilities); -#endif #if defined(THREADED_RTS) stgFree(idle_cap); diff --git a/rts/Sparks.c b/rts/Sparks.c index a31a5df..bd5e120 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -284,21 +284,6 @@ traverseSparkQueue (evac_fn evac, void *user, Capability *cap) sparkPoolSize(pool), pool->bottom, pool->top); } -/* ---------------------------------------------------------------------------- - * balanceSparkPoolsCaps: takes an array of capabilities (usually: all - * capabilities) and its size. Accesses all spark pools and equally - * distributes the sparks among them. - * - * Could be called after GC, before Cap. release, from scheduler. - * -------------------------------------------------------------------------- */ -void balanceSparkPoolsCaps(uint32_t n_caps, Capability caps[]) - GNUC3_ATTRIBUTE(__noreturn__); - -void balanceSparkPoolsCaps(uint32_t n_caps STG_UNUSED, - Capability caps[] STG_UNUSED) { - barf("not implemented"); -} - #else StgInt From git at git.haskell.org Wed Mar 7 16:33:44 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Mar 2018 16:33:44 +0000 (UTC) Subject: [commit: ghc] tag 'ghc-8.4.1-release' created Message-ID: <20180307163344.3D9D63A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New tag : ghc-8.4.1-release Referencing: f9817b5d8995bd5425e6d115962f6365c15880b2 From git at git.haskell.org Thu Mar 8 01:51:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 01:51:55 +0000 (UTC) Subject: [commit: ghc] master: Use docker images with non-root user (648cb28) Message-ID: <20180308015155.CE1033A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/648cb28f51593658176f83e8417a5b1f921f9df6/ghc >--------------------------------------------------------------- commit 648cb28f51593658176f83e8417a5b1f921f9df6 Author: mrkkrp Date: Wed Feb 28 16:33:59 2018 +0700 Use docker images with non-root user That image creates an unprivileged user to run the test suite under. >--------------------------------------------------------------- 648cb28f51593658176f83e8417a5b1f921f9df6 .circleci/config.yml | 31 ++++++------------------------- .circleci/images/x86_64-linux/Dockerfile | 15 ++++++++++++++- .circleci/prepare-system.sh | 12 +++++++----- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 295d803..b4a9947 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,16 +3,6 @@ version: 2 aliases: - &defaults working_directory: ~/ghc - - # Make sure we have proper openssh before checkout: CircleCI git - # does not check the repository out properly without it and also - # takes 20 times longer than it should be. - - &precheckout - run: - name: Install OpenSSH client - command: | - apt-get update -qq - apt-get install -qy openssh-client - &prepare run: name: prepare-system @@ -92,11 +82,10 @@ jobs: "validate-x86_64-linux": resource_class: xlarge docker: - - image: haskell:8.2 + - image: mrkkrp/ghcci-x86_64-linux:0.0.4 environment: <<: *buildenv steps: - - *precheckout - checkout - *prepare - *submodules @@ -111,12 +100,11 @@ jobs: "validate-x86_64-freebsd": resource_class: xlarge docker: - - image: tweag/toolchain-x86_64-freebsd + - image: mrkkrp/ghcci-x86_64-freebsd environment: TARGET: FreeBSD <<: *buildenv steps: - - *precheckout - checkout - *prepare - *submodules @@ -152,11 +140,10 @@ jobs: "validate-hadrian-x86_64-linux": resource_class: xlarge docker: - - image: haskell:8.2 + - image: mrkkrp/ghcci-x86_64-linux:0.0.4 environment: <<: *buildenv steps: - - *precheckout - checkout - *prepare - *submodules @@ -167,11 +154,10 @@ jobs: "validate-x86_64-linux-unreg": resource_class: xlarge docker: - - image: haskell:8.2 + - image: mrkkrp/ghcci-x86_64-linux:0.0.4 environment: <<: *buildenv steps: - - *precheckout - checkout - *prepare - *submodules @@ -183,7 +169,7 @@ jobs: "validate-x86_64-linux-llvm": resource_class: xlarge docker: - - image: haskell:8.2 + - image: mrkkrp/ghcci-x86_64-linux:0.0.4 environment: <<: *buildenv BUILD_FLAVOUR: perf-llvm @@ -191,15 +177,11 @@ jobs: - run: name: Install LLVM command: | - apt-get update - apt-get install -y curl xz-utils curl http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-linux-gnu-debian8.tar.xz | tar -xJC .. - # See https://discuss.circleci.com/t/how-to-add-a-path-to-path-in-circle-2-0/11554/3 echo "export PATH=`pwd`/../clang+llvm-5.0.0-x86_64-linux-gnu-debian8/bin:\$PATH" >> $BASH_ENV - run: name: Verify that llc works command: llc - - *precheckout - checkout - *prepare - *submodules @@ -212,12 +194,11 @@ jobs: "validate-x86_64-linux-debug": resource_class: xlarge docker: - - image: haskell:8.2 + - image: mrkkrp/ghcci-x86_64-linux:0.0.4 environment: BUILD_FLAVOUR: devel2 <<: *buildenv steps: - - *precheckout - checkout - *prepare - *submodules diff --git a/.circleci/images/x86_64-linux/Dockerfile b/.circleci/images/x86_64-linux/Dockerfile index aa8813f..d20f5ba 100644 --- a/.circleci/images/x86_64-linux/Dockerfile +++ b/.circleci/images/x86_64-linux/Dockerfile @@ -1,3 +1,16 @@ FROM haskell:8.2 -RUN adduser ghc --gecos 'GHC builds' --disabled-password + +# Make sure we have proper openssh before checkout: CircleCI git +# does not check the repository out properly without it and also +# takes 20 times longer than it should be. +RUN apt-get update -qq +RUN apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo -qq curl + +# Create a normal user. +RUN adduser ghc --gecos "GHC builds" --disabled-password +RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc USER ghc + +WORKDIR /home/ghc/ + +CMD ["bash"] diff --git a/.circleci/prepare-system.sh b/.circleci/prepare-system.sh index 193fac9..61396c8 100755 --- a/.circleci/prepare-system.sh +++ b/.circleci/prepare-system.sh @@ -42,23 +42,25 @@ case "$(uname)" in fail "TARGET=$target not supported" fi else - # assuming Ubuntu - apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch cabal update - cabal install --reinstall hscolour --index-state=$hackage_index_state + cabal install --reinstall hscolour + sudo ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour || true fi ;; Darwin) if [[ -n ${TARGET:-} ]]; then fail "uname=$(uname) not supported for cross-compilation" fi - brew install ghc cabal-install python3 ncurses gmp + # It looks like we already have python2 here and just installing python3 + # does not work. + brew upgrade python + brew install ghc cabal-install ncurses gmp cabal update cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state # put them on the $PATH, don't fail if already installed ln -s $HOME/.cabal/bin/alex /usr/local/bin/alex || true ln -s $HOME/.cabal/bin/happy /usr/local/bin/happy || true - ln -s $HOME/.cabal/bin/hscolour /usr/local/bin/hscolour || true + ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour || true ;; *) fail "uname=$(uname) not supported" From git at git.haskell.org Thu Mar 8 01:52:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 01:52:11 +0000 (UTC) Subject: [commit: ghc] master: Fix a typo about pattern synonyms in documentation. (b320ba8) Message-ID: <20180308015211.9812E3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b320ba82e8ae3784d2c509e6a8aae4f4d03ef210/ghc >--------------------------------------------------------------- commit b320ba82e8ae3784d2c509e6a8aae4f4d03ef210 Author: HE, Tao Date: Mon Mar 5 23:52:29 2018 +0800 Fix a typo about pattern synonyms in documentation. >--------------------------------------------------------------- b320ba82e8ae3784d2c509e6a8aae4f4d03ef210 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 40013f3..5bcd67e 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -5155,7 +5155,7 @@ Pattern synonyms Pattern synonyms are enabled by the language extension :extension:`PatternSynonyms`, which is required for defining them, but *not* for using them. More information and -examples of view patterns can be found on the `Wiki page `. +examples of pattern synonyms can be found on the :ghc-wiki:`Wiki page `. Pattern synonyms enable giving names to parametrized pattern schemes. They can also be thought of as abstract constructors that don't have a From git at git.haskell.org Thu Mar 8 01:52:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 01:52:25 +0000 (UTC) Subject: [commit: ghc] master: Users Guide: Add that --numa is available on Windows too (b3bfbed) Message-ID: <20180308015225.4A8173A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b3bfbedc106a50eacc635f8ec7ad130ce6e43617/ghc >--------------------------------------------------------------- commit b3bfbedc106a50eacc635f8ec7ad130ce6e43617 Author: Simon Jakobi Date: Mon Mar 5 06:19:20 2018 +0100 Users Guide: Add that --numa is available on Windows too Windows support was added in c93813d96b1da53a2ebd9c9ac5af6cc3e3443c43 >--------------------------------------------------------------- b3bfbedc106a50eacc635f8ec7ad130ce6e43617 docs/users_guide/runtime_control.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index f8e0ce0..009e3ae 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -685,7 +685,7 @@ performance. single: NUMA, enabling in the runtime Enable NUMA-aware memory allocation in the runtime (only available - with ``-threaded``, and only on Linux currently). + with ``-threaded``, and only on Linux and Windows currently). Background: some systems have a Non-Uniform Memory Architecture, whereby main memory is split into banks which are "local" to From git at git.haskell.org Thu Mar 8 01:52:38 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 01:52:38 +0000 (UTC) Subject: [commit: ghc] master: Fix typo in description of -V RTS flag (43fbb90) Message-ID: <20180308015238.C3D003A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/43fbb905eade2e3e3af67ce944262709763b6578/ghc >--------------------------------------------------------------- commit 43fbb905eade2e3e3af67ce944262709763b6578 Author: Tej Chajed Date: Tue Mar 6 13:46:01 2018 -0500 Fix typo in description of -V RTS flag >--------------------------------------------------------------- 43fbb905eade2e3e3af67ce944262709763b6578 rts/RtsFlags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index eb33c9e..7b38bbd 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -377,7 +377,7 @@ usage_text[] = { " Default: 0.02 sec.", " -V Master tick interval in seconds (0 == disable timer).", " This sets the resolution for -C and the heap profile timer -i,", -" and is the frequence of time profile samples.", +" and is the frequency of time profile samples.", #if defined(PROFILING) " Default: 0.001 sec.", #else From git at git.haskell.org Thu Mar 8 03:58:21 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 03:58:21 +0000 (UTC) Subject: [commit: ghc] wip/kavon-nosplit-llvm: Merge branch 'master' into wip/kavon-nosplit-llvm (4a6eb16) Message-ID: <20180308035821.960CD3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-nosplit-llvm Link : http://ghc.haskell.org/trac/ghc/changeset/4a6eb165ba46f3447d44f1550c9e5e2e2d4bc421/ghc >--------------------------------------------------------------- commit 4a6eb165ba46f3447d44f1550c9e5e2e2d4bc421 Merge: 5eae140 d9d4632 Author: Kavon Farvardin Date: Wed Mar 7 18:17:21 2018 -0600 Merge branch 'master' into wip/kavon-nosplit-llvm Resolved Conflicts in: compiler/cmm/CmmCommonBlockElim.hs Merged up to: d9d463289fe20316cff12a8f0dbf414db678fa72 >--------------------------------------------------------------- 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 4a6eb165ba46f3447d44f1550c9e5e2e2d4bc421 From git at git.haskell.org Thu Mar 8 03:58:24 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 03:58:24 +0000 (UTC) Subject: [commit: ghc] wip/kavon-nosplit-llvm: fix build due to the removal of Hoopl.Unique (54321d5) Message-ID: <20180308035824.617993A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-nosplit-llvm Link : http://ghc.haskell.org/trac/ghc/changeset/54321d57aa315046b7690d1d6aa9cf08750f1ef3/ghc >--------------------------------------------------------------- commit 54321d57aa315046b7690d1d6aa9cf08750f1ef3 Author: Kavon Farvardin Date: Wed Mar 7 20:27:43 2018 -0600 fix build due to the removal of Hoopl.Unique >--------------------------------------------------------------- 54321d57aa315046b7690d1d6aa9cf08750f1ef3 compiler/llvmGen/LlvmMangler.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/llvmGen/LlvmMangler.hs b/compiler/llvmGen/LlvmMangler.hs index e905fe0..4d2d461 100644 --- a/compiler/llvmGen/LlvmMangler.hs +++ b/compiler/llvmGen/LlvmMangler.hs @@ -23,7 +23,6 @@ import qualified Data.ByteString.Char8 as B import System.IO import Hoopl.Label import Hoopl.Collections -import Hoopl.Unique ( intToUnique ) import Data.Maybe ( fromMaybe ) -- note [mangler string func] @@ -85,7 +84,7 @@ addInfoTable :: LabelMap ManglerStr -> LabRewrite addInfoTable info FirstLabel dflags line = do retPt <- stripPrefix labPrefix line (i, _) <- B.readInt retPt - statics <- mapLookup (toKey i) info + statics <- mapLookup (mkHooplLabel i) info fullName <- stripSuffix colon line return $ B.concat $ (map (\f -> f fullName) statics) ++ [line] where @@ -99,7 +98,6 @@ addInfoTable info FirstLabel dflags line = do otherwise -> panic "Please update LLVM Mangler for this OS." colon = B.pack ":" - toKey = uniqueToLbl . intToUnique -- TODO(kavon): on Travis CI, it seems the bytestring package is out of date, and -- we're missing B.stripSuffix and B.stripPrefix. I've reimplemented them here. From git at git.haskell.org Thu Mar 8 03:58:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 03:58:29 +0000 (UTC) Subject: [commit: ghc] wip/kavon-nosplit-llvm's head updated: fix build due to the removal of Hoopl.Unique (54321d5) Message-ID: <20180308035829.423983A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/kavon-nosplit-llvm' now includes: 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 4a6eb16 Merge branch 'master' into wip/kavon-nosplit-llvm 54321d5 fix build due to the removal of Hoopl.Unique From git at git.haskell.org Thu Mar 8 06:01:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 06:01:01 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Cleanup LD detection. (cc438e0) Message-ID: <20180308060101.32EFC3A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/cc438e0aba6003da5891267e373686eff25a8dbf/ghc >--------------------------------------------------------------- commit cc438e0aba6003da5891267e373686eff25a8dbf Author: Moritz Angermann Date: Thu Mar 8 11:12:46 2018 +0800 Cleanup LD detection. >--------------------------------------------------------------- cc438e0aba6003da5891267e373686eff25a8dbf aclocal.m4 | 3 ++- mk/config.mk.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index a2fdbdc..cc25517 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2359,7 +2359,8 @@ AC_DEFUN([FIND_LD],[ FP_CC_LINKER_FLAG_TRY(bfd, $2) ;; "GNU gold"*) FP_CC_LINKER_FLAG_TRY(gold, $2) - LD_NO_GOLD=ld + LD_NO_GOLD= + AC_CHECK_TARGET_TOOL([LD_NO_GOLD],[ld]) ;; "LLD"*) FP_CC_LINKER_FLAG_TRY(lld, $2) ;; diff --git a/mk/config.mk.in b/mk/config.mk.in index 92830fa..846857d 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -537,7 +537,7 @@ AS_STAGE1 = $(AS) AS_STAGE2 = $(AS) AS_STAGE3 = $(AS) -# why no LD=@LD@ ? +LD = @LD@ LD_STAGE0 = @LD_STAGE0@ LD_STAGE1 = $(LD) LD_STAGE2 = $(LD) From git at git.haskell.org Thu Mar 8 06:01:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 06:01:05 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross-2: Rename iserv-slave to remote-iserv (5ef6e56) Message-ID: <20180308060105.2FDA43A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross-2 Link : http://ghc.haskell.org/trac/ghc/changeset/5ef6e5683e9700e04c7dfab5f61f0d01bdc8538d/ghc >--------------------------------------------------------------- commit 5ef6e5683e9700e04c7dfab5f61f0d01bdc8538d Author: Moritz Angermann Date: Thu Mar 8 14:00:44 2018 +0800 Rename iserv-slave to remote-iserv >--------------------------------------------------------------- 5ef6e5683e9700e04c7dfab5f61f0d01bdc8538d .../.ghc.environment.arm-linux-8.5.20180307 | 31 ++++++++++++++++++++++ utils/{iserv-slave => remote-iserv}/cabal.project | 0 .../remote-iserv.cabal} | 7 +++-- utils/{iserv-slave => remote-iserv}/src/Cli.hs | 0 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 b/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 new file mode 100644 index 0000000..a0a38d3 --- /dev/null +++ b/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 @@ -0,0 +1,31 @@ +-- This is a GHC environment file written by cabal. This means you can +-- run ghc or ghci and get the environment of the project as a whole. +-- But you still need to use cabal repl $target to get the environment +-- of specific components (libs, exes, tests etc) because each one can +-- have its own source dirs, cpp flags etc. +-- +clear-package-db +global-package-db +package-db /Users/angerman/.cabal/store/ghc-8.5.20180307/package.db +package-db dist-newstyle/packagedb/ghc-8.5.20180307 +package-id libiserv-8.5-inplace +package-id base-4.11.0.0 +package-id rts +package-id ghc-prim-0.5.2.0 +package-id integer-simple-0.1.1.1 +package-id binary-0.8.5.1 +package-id bytestring-0.10.8.2 +package-id deepseq-1.4.3.0 +package-id array-0.5.2.0 +package-id containers-0.5.11.0 +package-id directory-1.3.1.5 +package-id time-1.8.0.2 +package-id filepath-1.4.2 +package-id unix-2.7.2.2 +package-id ghci-8.5 +package-id ghc-boot-8.5 +package-id ghc-boot-th-8.5 +package-id template-haskell-2.13.0.0 +package-id pretty-1.1.3.6 +package-id transformers-0.5.5.0 +package-id ntwrk-2.6.3.4-c7c07d3b diff --git a/utils/iserv-slave/cabal.project b/utils/remote-iserv/cabal.project similarity index 100% rename from utils/iserv-slave/cabal.project rename to utils/remote-iserv/cabal.project diff --git a/utils/iserv-slave/iserv-slave.cabal b/utils/remote-iserv/remote-iserv.cabal similarity index 77% rename from utils/iserv-slave/iserv-slave.cabal rename to utils/remote-iserv/remote-iserv.cabal index 66a2a32..2dc599e 100644 --- a/utils/iserv-slave/iserv-slave.cabal +++ b/utils/remote-iserv/remote-iserv.cabal @@ -1,4 +1,4 @@ -Name: iserv-slave +Name: remote-iserv Version: 8.5 Copyright: XXX License: BSD3 @@ -11,10 +11,9 @@ Category: Development build-type: Simple cabal-version: >=1.10 -Executable iserv-slave +Executable remote-iserv Default-Language: Haskell2010 Main-Is: Cli.hs Hs-Source-Dirs: src - Build-Depends: - base >= 4 && < 5, + Build-Depends: base >= 4 && < 5, libiserv == 8.5 diff --git a/utils/iserv-slave/src/Cli.hs b/utils/remote-iserv/src/Cli.hs similarity index 100% rename from utils/iserv-slave/src/Cli.hs rename to utils/remote-iserv/src/Cli.hs From git at git.haskell.org Thu Mar 8 08:36:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 08:36:34 +0000 (UTC) Subject: [commit: ghc] master: Add -fexternal-dynamic-refs (d99a65a) Message-ID: <20180308083634.948233A5F6@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d99a65a80cb671363fa41c826b95b9a89de60878/ghc >--------------------------------------------------------------- commit d99a65a80cb671363fa41c826b95b9a89de60878 Author: Simon Marlow Date: Wed Feb 28 11:03:37 2018 -0800 Add -fexternal-dynamic-refs Summary: The `-dynamic` flag does two things: * In the code generator, it generates code designed to link against external shared libraries. References outside of the current module go through platform-specific indirection tables (e.g. the GOT on ELF). * It enables a "way", which changes which hi files we look for (`Foo.dyn_hi`) and which libraries we link against. Some specialised applications want the first of these without the second. (I could go into detail here but it's probably not all that important). This diff splits out the code-generation effects of `-dynamic` from the "way" parts of its behaviour, via a new flag `-fexternal-dynamic-refs`. Test Plan: validate Reviewers: niteria, bgamari, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4477 >--------------------------------------------------------------- d99a65a80cb671363fa41c826b95b9a89de60878 compiler/cmm/CLabel.hs | 15 +++++++++------ compiler/main/DynFlags.hs | 4 +++- compiler/nativeGen/PIC.hs | 13 ++++++++----- docs/users_guide/8.6.1-notes.rst | 5 +++++ docs/users_guide/phases.rst | 20 ++++++++++++++------ testsuite/tests/ghci/scripts/T9293.stdout | 4 ++++ testsuite/tests/ghci/scripts/ghci024.stdout | 1 + testsuite/tests/ghci/scripts/ghci057.stdout | 4 ++++ 8 files changed, 48 insertions(+), 18 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 d99a65a80cb671363fa41c826b95b9a89de60878 From git at git.haskell.org Thu Mar 8 19:35:03 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 19:35:03 +0000 (UTC) Subject: [commit: ghc] master: Revert "GHCi: Don't remove shadowed bindings from typechecker scope." (98c7749) Message-ID: <20180308193503.C21EE3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/98c7749cd360293bee96034056e260d70224cef6/ghc >--------------------------------------------------------------- commit 98c7749cd360293bee96034056e260d70224cef6 Author: Ömer Sinan Ağacan Date: Thu Mar 8 21:42:22 2018 +0300 Revert "GHCi: Don't remove shadowed bindings from typechecker scope." This reverts commit 59d7ee53906b9cee7f279c1f9567af7b930f8636 and enables the test for #14052. (See #14052 for the discussion) Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14052 Differential Revision: https://phabricator.haskell.org/D4478 >--------------------------------------------------------------- 98c7749cd360293bee96034056e260d70224cef6 compiler/main/HscTypes.hs | 13 +++++++++++-- testsuite/tests/ghci.debugger/scripts/break011.stdout | 7 ------- testsuite/tests/ghci.debugger/scripts/hist001.stdout | 4 ---- testsuite/tests/ghci.debugger/scripts/hist002.stdout | 4 ---- testsuite/tests/ghci/scripts/T11547.script | 9 --------- testsuite/tests/ghci/scripts/T11547.stdout | 5 ----- testsuite/tests/ghci/scripts/T2976.stdout | 2 -- testsuite/tests/ghci/scripts/all.T | 1 - testsuite/tests/perf/should_run/all.T | 3 +-- 9 files changed, 12 insertions(+), 36 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 165f860..cc72752 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1641,7 +1641,7 @@ extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults = ictxt { ic_mod_index = ic_mod_index ictxt + 1 -- Always bump this; even instances should create -- a new mod_index (Trac #9426) - , ic_tythings = new_tythings ++ ic_tythings ictxt + , ic_tythings = new_tythings ++ old_tythings , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings , ic_instances = ( new_cls_insts ++ old_cls_insts , new_fam_insts ++ fam_insts ) @@ -1651,6 +1651,8 @@ extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults , ic_fix_env = fix_env -- See Note [Fixity declarations in GHCi] } where + new_ids = [id | AnId id <- new_tythings] + old_tythings = filterOut (shadowed_by new_ids) (ic_tythings ictxt) -- Discard old instances that have been fully overridden -- See Note [Override identical instances in GHCi] @@ -1662,10 +1664,17 @@ extendInteractiveContextWithIds :: InteractiveContext -> [Id] -> InteractiveCont extendInteractiveContextWithIds ictxt new_ids | null new_ids = ictxt | otherwise = ictxt { ic_mod_index = ic_mod_index ictxt + 1 - , ic_tythings = new_tythings ++ ic_tythings ictxt + , ic_tythings = new_tythings ++ old_tythings , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings } where new_tythings = map AnId new_ids + old_tythings = filterOut (shadowed_by new_ids) (ic_tythings ictxt) + +shadowed_by :: [Id] -> TyThing -> Bool +shadowed_by ids = shadowed + where + shadowed id = getOccName id `elemOccSet` new_occs + new_occs = mkOccSet (map getOccName ids) setInteractivePackage :: HscEnv -> HscEnv -- Set the 'thisPackage' DynFlag to 'interactive' diff --git a/testsuite/tests/ghci.debugger/scripts/break011.stdout b/testsuite/tests/ghci.debugger/scripts/break011.stdout index ac5b7e3..47fb7b1 100644 --- a/testsuite/tests/ghci.debugger/scripts/break011.stdout +++ b/testsuite/tests/ghci.debugger/scripts/break011.stdout @@ -23,13 +23,6 @@ _exception = SomeException "foo" "CallStack (from HasCallStack): error, called at Test7.hs:2:18 in main:Main") -Ghci1._exception :: SomeException = SomeException - (ErrorCallWithLocation - "foo" - "CallStack (from HasCallStack): - error, called at Test7.hs:: in :Main") -Ghci2._result :: a = _ -Ghci3._result :: IO a = _ _result :: a = _ _exception :: SomeException = SomeException (ErrorCallWithLocation diff --git a/testsuite/tests/ghci.debugger/scripts/hist001.stdout b/testsuite/tests/ghci.debugger/scripts/hist001.stdout index 523605b..a19a34f 100644 --- a/testsuite/tests/ghci.debugger/scripts/hist001.stdout +++ b/testsuite/tests/ghci.debugger/scripts/hist001.stdout @@ -12,7 +12,6 @@ Logged breakpoint at Test3.hs:2:22-31 _result :: [a] f :: t -> a xs :: [t] -Ghci1._result :: [a] = _ xs :: [t] = [] f :: t -> a = _ _result :: [a] = _ @@ -20,10 +19,7 @@ Logged breakpoint at Test3.hs:2:18-20 _result :: a f :: Integer -> a x :: Integer -Ghci1._result :: [a] = _ xs :: [t] = [] -Ghci2.f :: t -> a = _ -Ghci2._result :: [a] = _ x :: Integer = 2 f :: Integer -> a = _ _result :: a = _ diff --git a/testsuite/tests/ghci.debugger/scripts/hist002.stdout b/testsuite/tests/ghci.debugger/scripts/hist002.stdout index 523605b..a19a34f 100644 --- a/testsuite/tests/ghci.debugger/scripts/hist002.stdout +++ b/testsuite/tests/ghci.debugger/scripts/hist002.stdout @@ -12,7 +12,6 @@ Logged breakpoint at Test3.hs:2:22-31 _result :: [a] f :: t -> a xs :: [t] -Ghci1._result :: [a] = _ xs :: [t] = [] f :: t -> a = _ _result :: [a] = _ @@ -20,10 +19,7 @@ Logged breakpoint at Test3.hs:2:18-20 _result :: a f :: Integer -> a x :: Integer -Ghci1._result :: [a] = _ xs :: [t] = [] -Ghci2.f :: t -> a = _ -Ghci2._result :: [a] = _ x :: Integer = 2 f :: Integer -> a = _ _result :: a = _ diff --git a/testsuite/tests/ghci/scripts/T11547.script b/testsuite/tests/ghci/scripts/T11547.script deleted file mode 100644 index c4c15d6..0000000 --- a/testsuite/tests/ghci/scripts/T11547.script +++ /dev/null @@ -1,9 +0,0 @@ -foo = foo -:t Ghci1.foo -foo = foo -:t Ghci2.foo -:t Ghci1.foo -data Foo = Foo | Bar -data Foo = Bar -:t Foo -:t Ghci3.Bar diff --git a/testsuite/tests/ghci/scripts/T11547.stdout b/testsuite/tests/ghci/scripts/T11547.stdout deleted file mode 100644 index 6f2a833..0000000 --- a/testsuite/tests/ghci/scripts/T11547.stdout +++ /dev/null @@ -1,5 +0,0 @@ -Ghci1.foo :: t -Ghci2.foo :: t -Ghci1.foo :: t -Foo :: Ghci3.Foo -Ghci3.Bar :: Ghci3.Foo diff --git a/testsuite/tests/ghci/scripts/T2976.stdout b/testsuite/tests/ghci/scripts/T2976.stdout index de31112..9fdc110 100644 --- a/testsuite/tests/ghci/scripts/T2976.stdout +++ b/testsuite/tests/ghci/scripts/T2976.stdout @@ -1,8 +1,6 @@ test :: Integer = 0 test = 0 test :: Integer = 0 -Ghci1.test :: Integer = 0 test :: [Char] = _ test = "test" -Ghci1.test :: Integer = 0 test :: [Char] = "test" diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index dcce723..f0d90b6 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -238,7 +238,6 @@ test('T11376', normal, ghci_script, ['T11376.script']) test('T12007', normal, ghci_script, ['T12007.script']) test('T11975', normal, ghci_script, ['T11975.script']) test('T10963', normal, ghci_script, ['T10963.script']) -test('T11547', normal, ghci_script, ['T11547.script']) test('T11721', normal, ghci_script, ['T11721.script']) test('T12520', normal, ghci_script, ['T12520.script']) test('T12091', [extra_run_opts('-fobject-code')], ghci_script, diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 50ccac0..d5261b8 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -553,7 +553,6 @@ test('T13623', test('T14052', [stats_num_field('bytes allocated', - [ (wordsize(64), 2785811496, 10) ]), - expect_broken(14052)], + [ (wordsize(64), 2346183840, 10) ])], ghci_script, ['T14052.script']) From git at git.haskell.org Thu Mar 8 22:05:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 22:05:27 +0000 (UTC) Subject: [commit: ghc] master: Error message and doc improvements for #14335 (bc95fed) Message-ID: <20180308220527.37C713A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc95fedc0b1f45b62ba279f7df834c490c2e53b6/ghc >--------------------------------------------------------------- commit bc95fedc0b1f45b62ba279f7df834c490c2e53b6 Author: Ömer Sinan Ağacan Date: Thu Mar 8 13:19:33 2018 -0500 Error message and doc improvements for #14335 - Show a more friendly error message when -fplugin is used with -fexternal-interpreter - Add a few words to users guide about the interaction with -fplugin and -fexternal-interpreter - Update test for #14335 Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14335 Differential Revision: https://phabricator.haskell.org/D4456 >--------------------------------------------------------------- bc95fedc0b1f45b62ba279f7df834c490c2e53b6 compiler/main/DynamicLoading.hs | 22 ++++++++++++++++++---- docs/users_guide/extending_ghc.rst | 3 +++ testsuite/tests/plugins/Makefile | 5 ----- testsuite/tests/plugins/T14335.hs | 1 + testsuite/tests/plugins/T14335.stderr | 1 + testsuite/tests/plugins/all.T | 7 ++++--- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs index 3dc4981..90a099f 100644 --- a/compiler/main/DynamicLoading.hs +++ b/compiler/main/DynamicLoading.hs @@ -57,6 +57,7 @@ import Outputable import Exception import Hooks +import Control.Monad ( when, unless ) import Data.Maybe ( mapMaybe ) import GHC.Exts ( unsafeCoerce# ) @@ -96,7 +97,9 @@ initializePlugins hsc_env df loadPlugins :: HscEnv -> IO [LoadedPlugin] loadPlugins hsc_env - = do { plugins <- mapM (loadPlugin hsc_env) to_load + = do { unless (null to_load) $ + checkExternalInterpreter hsc_env + ; plugins <- mapM loadPlugin to_load ; return $ zipWith attachOptions to_load plugins } where dflags = hsc_dflags hsc_env @@ -107,11 +110,22 @@ loadPlugins hsc_env options = [ option | (opt_mod_nm, option) <- pluginModNameOpts dflags , opt_mod_nm == mod_nm ] -loadPlugin :: HscEnv -> ModuleName -> IO Plugin -loadPlugin = loadPlugin' (mkVarOcc "plugin") pluginTyConName + loadPlugin = loadPlugin' (mkVarOcc "plugin") pluginTyConName hsc_env loadFrontendPlugin :: HscEnv -> ModuleName -> IO FrontendPlugin -loadFrontendPlugin = loadPlugin' (mkVarOcc "frontendPlugin") frontendPluginTyConName +loadFrontendPlugin hsc_env mod_name = do + checkExternalInterpreter hsc_env + loadPlugin' (mkVarOcc "frontendPlugin") frontendPluginTyConName + hsc_env mod_name + +-- #14335 +checkExternalInterpreter :: HscEnv -> IO () +checkExternalInterpreter hsc_env = + when (gopt Opt_ExternalInterpreter dflags) $ + throwCmdLineError $ showSDoc dflags $ + text "Plugins require -fno-external-interpreter" + where + dflags = hsc_dflags hsc_env loadPlugin' :: OccName -> Name -> HscEnv -> ModuleName -> IO a loadPlugin' occ_name plugin_name hsc_env mod_name diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index e49effb..12043a0 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -185,6 +185,9 @@ the constraint solver. If you feel strongly that any of these restrictions are too onerous, :ghc-wiki:`please give the GHC team a shout `. +Plugins do not work with ``-fexternal-interpreter``. If you need to run plugins +with ``-fexternal-interpreter`` let GHC developers know in :ghc-ticket:`14335`. + .. _using-compiler-plugins: Using compiler plugins diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile index 96443c9..1ff8d40 100644 --- a/testsuite/tests/plugins/Makefile +++ b/testsuite/tests/plugins/Makefile @@ -52,8 +52,3 @@ T12567a: "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make T12567a.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 1>&2 "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make T12567a.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 2>&1 | grep "T12567a.hs, T12567a.o" 1>&2 "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) --make T12567b.hs -package-db simple-plugin/pkg.T12567a/local.package.conf -hide-all-plugin-packages -plugin-package simple-plugin 1>&2 - -.PHONY: T14335 -T14335: - "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -fexternal-interpreter --make -v0 plugins01.hs -package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin -fplugin-opt Simple.Plugin:Irrelevant_Option -hide-all-plugin-packages -plugin-package simple-plugin - ./plugins01 diff --git a/testsuite/tests/plugins/T14335.hs b/testsuite/tests/plugins/T14335.hs new file mode 100644 index 0000000..49a0085 --- /dev/null +++ b/testsuite/tests/plugins/T14335.hs @@ -0,0 +1 @@ +module T14335 where diff --git a/testsuite/tests/plugins/T14335.stderr b/testsuite/tests/plugins/T14335.stderr new file mode 100644 index 0000000..1f051a7 --- /dev/null +++ b/testsuite/tests/plugins/T14335.stderr @@ -0,0 +1 @@ +: Plugins require -fno-external-interpreter diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 0e523f0..5786637 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -70,6 +70,7 @@ test('T12567a', test('T14335', [extra_files(['simple-plugin/', 'plugins01.hs']), - pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}'), - expect_broken(14335)], - run_command, ['$MAKE -s --no-print-directory T14335']) + pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')], + compile_fail, + ['-package-db simple-plugin/pkg.plugins01/local.package.conf -fplugin Simple.Plugin \ + -fexternal-interpreter -package simple-plugin ' + config.plugin_way_flags]) From git at git.haskell.org Thu Mar 8 22:05:40 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 22:05:40 +0000 (UTC) Subject: [commit: ghc] master: ghc-prim: Reduce scope of Clang sync_fetch_and_nand workaround (ed6f9fb) Message-ID: <20180308220540.C78F83A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ed6f9fb9d5a684d2159c29633159c3254cf04deb/ghc >--------------------------------------------------------------- commit ed6f9fb9d5a684d2159c29633159c3254cf04deb Author: Ben Gamari Date: Thu Mar 8 13:22:22 2018 -0500 ghc-prim: Reduce scope of Clang sync_fetch_and_nand workaround As described in https://bugs.llvm.org/show_bug.cgi?id=8842, Clang removed the __sync_fetch_and_nand builtins due to inconsistency in GCC's behavior in 2010. However, GCC has since clarified the behavior of their builtins and consequently Clang re-added them in 2014. Consequently this workaround should no longer be necessary. Test Plan: Validate building with Clang Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4480 >--------------------------------------------------------------- ed6f9fb9d5a684d2159c29633159c3254cf04deb libraries/ghc-prim/cbits/atomic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libraries/ghc-prim/cbits/atomic.c b/libraries/ghc-prim/cbits/atomic.c index 2ded465..722d261 100644 --- a/libraries/ghc-prim/cbits/atomic.c +++ b/libraries/ghc-prim/cbits/atomic.c @@ -117,11 +117,16 @@ hs_atomic_and64(StgWord x, StgWord64 val) return tmp; \ } +// This is only provided by clang +#if !defined(__has_builtin) +#define __has_builtin(x) 0 +#endif + extern StgWord hs_atomic_nand8(StgWord x, StgWord val); StgWord hs_atomic_nand8(StgWord x, StgWord val) { -#ifdef __clang__ +#if defined(__clang__) && __has_builtin(__sync_fetch_and_nand) CAS_NAND((volatile StgWord8 *) x, (StgWord8) val) #else return __sync_fetch_and_nand((volatile StgWord8 *) x, (StgWord8) val); @@ -132,7 +137,7 @@ extern StgWord hs_atomic_nand16(StgWord x, StgWord val); StgWord hs_atomic_nand16(StgWord x, StgWord val) { -#ifdef __clang__ +#if defined(__clang__) && __has_builtin(__sync_fetch_and_nand) CAS_NAND((volatile StgWord16 *) x, (StgWord16) val); #else return __sync_fetch_and_nand((volatile StgWord16 *) x, (StgWord16) val); @@ -143,7 +148,7 @@ extern StgWord hs_atomic_nand32(StgWord x, StgWord val); StgWord hs_atomic_nand32(StgWord x, StgWord val) { -#ifdef __clang__ +#if defined(__clang__) && __has_builtin(__sync_fetch_and_nand) CAS_NAND((volatile StgWord32 *) x, (StgWord32) val); #else return __sync_fetch_and_nand((volatile StgWord32 *) x, (StgWord32) val); @@ -155,7 +160,7 @@ extern StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val); StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val) { -#ifdef __clang__ +#if defined(__clang__) && __has_builtin(__sync_fetch_and_nand) CAS_NAND((volatile StgWord64 *) x, val); #else return __sync_fetch_and_nand((volatile StgWord64 *) x, val); From git at git.haskell.org Thu Mar 8 22:05:55 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 22:05:55 +0000 (UTC) Subject: [commit: ghc] master: ghc-prim: Silence -Wsync-nand warning in atomic.c (94f0254) Message-ID: <20180308220555.2D1B33A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/94f02547083cf6df686ea0b95fed050184c533de/ghc >--------------------------------------------------------------- commit 94f02547083cf6df686ea0b95fed050184c533de Author: Ben Gamari Date: Thu Mar 8 13:22:37 2018 -0500 ghc-prim: Silence -Wsync-nand warning in atomic.c GCC throws this warning to inform us that __sync_fetch_and_nand's behavior changed in GCC 4.4. However, this causes the build to fail when -Werror is used. Test Plan: Validate with -Werror Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4481 >--------------------------------------------------------------- 94f02547083cf6df686ea0b95fed050184c533de libraries/ghc-prim/cbits/atomic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/ghc-prim/cbits/atomic.c b/libraries/ghc-prim/cbits/atomic.c index 722d261..80d4f39 100644 --- a/libraries/ghc-prim/cbits/atomic.c +++ b/libraries/ghc-prim/cbits/atomic.c @@ -122,6 +122,10 @@ hs_atomic_and64(StgWord x, StgWord64 val) #define __has_builtin(x) 0 #endif +// Otherwise this fails with -Werror +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsync-nand" + extern StgWord hs_atomic_nand8(StgWord x, StgWord val); StgWord hs_atomic_nand8(StgWord x, StgWord val) @@ -168,6 +172,8 @@ hs_atomic_nand64(StgWord x, StgWord64 val) } #endif +#pragma GCC diagnostic pop + // FetchOrByteArrayOp_Int extern StgWord hs_atomic_or8(StgWord x, StgWord val); From git at git.haskell.org Thu Mar 8 22:06:13 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 22:06:13 +0000 (UTC) Subject: [commit: ghc] master: Remove outdated documentation bits concerning -Wmissing-methods (47e2a28) Message-ID: <20180308220613.4DABB3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47e2a28d8c8c80aa9309ceb195ee8671b5a76d3e/ghc >--------------------------------------------------------------- commit 47e2a28d8c8c80aa9309ceb195ee8671b5a76d3e Author: Ryan Scott Date: Thu Mar 8 13:23:27 2018 -0500 Remove outdated documentation bits concerning -Wmissing-methods In commit 503219e3e1667ac39607021b2d9586260fbab32b, we stopped suppressing `-Wmissing-methods` warnings on class methods whose names begin with an underscore. However, it seems the users' guide documentation concerning this was never updated. Let's do so. Test Plan: Read it Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #12959 Differential Revision: https://phabricator.haskell.org/D4476 >--------------------------------------------------------------- 47e2a28d8c8c80aa9309ceb195ee8671b5a76d3e docs/users_guide/glasgow_exts.rst | 5 ++--- docs/users_guide/using-warnings.rst | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 5bcd67e..c6cff92 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -13778,9 +13778,8 @@ Conjunction binds stronger than disjunction. If no ``MINIMAL`` pragma is given in the class declaration, it is just as if a pragma ``{-# MINIMAL op1, op2, ..., opn #-}`` was given, where the -``opi`` are the methods (a) that lack a default method in the class -declaration, and (b) whose name that does not start with an underscore -(c.f. :ghc-flag:`-Wmissing-methods`, :ref:`options-sanity`). +``opi`` are the methods that lack a default method in the class +declaration (c.f. :ghc-flag:`-Wmissing-methods`, :ref:`options-sanity`). This warning can be turned off with the flag :ghc-flag:`-Wno-missing-methods <-Wmissing-methods>`. diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 8106003..aeb402d 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -925,18 +925,6 @@ of ``-W(no-)*``. declaration is missing one or more methods, and the corresponding class declaration has no default declaration for them. - The warning is suppressed if the method name begins with an - underscore. Here's an example where this is useful: :: - - class C a where - _simpleFn :: a -> String - complexFn :: a -> a -> String - complexFn x y = ... _simpleFn ... - - The idea is that: (a) users of the class will only call - ``complexFn``; never ``_simpleFn``; and (b) instance declarations - can define either ``complexFn`` or ``_simpleFn``. - The ``MINIMAL`` pragma can be used to change which combination of methods will be required for instances of a particular class. See :ref:`minimal-pragma`. From git at git.haskell.org Thu Mar 8 22:06:26 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Mar 2018 22:06:26 +0000 (UTC) Subject: [commit: ghc] master: configure: Accept suffix in OpenBSD triple's OS name (a25b763) Message-ID: <20180308220626.DD4DD3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a25b763fa9e09d3bf7c82fef1eaed89a7afc54f7/ghc >--------------------------------------------------------------- commit a25b763fa9e09d3bf7c82fef1eaed89a7afc54f7 Author: Ben Gamari Date: Thu Mar 8 13:29:01 2018 -0500 configure: Accept suffix in OpenBSD triple's OS name Reviewers: hvr Subscribers: rwbarton, thomie, erikd, carter Differential Revision: https://phabricator.haskell.org/D4483 >--------------------------------------------------------------- a25b763fa9e09d3bf7c82fef1eaed89a7afc54f7 aclocal.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index a2fdbdc..528fd0c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1960,8 +1960,11 @@ AC_DEFUN([GHC_CONVERT_OS],[ linux-*|linux) $3="linux" ;; + openbsd*) + $3="openbsd" + ;; # As far as I'm aware, none of these have relevant variants - freebsd|netbsd|openbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|haiku) + freebsd|netbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|haiku) $3="$1" ;; aix*) # e.g. powerpc-ibm-aix7.1.3.0 From git at git.haskell.org Fri Mar 9 09:27:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Mar 2018 09:27:52 +0000 (UTC) Subject: [commit: ghc] master: Compacted arrays are pinned for isByteArrayPinned# (df2ea10) Message-ID: <20180309092752.8C2883A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/df2ea10655984234924ad9f2c237289ab8f4baa6/ghc >--------------------------------------------------------------- commit df2ea10655984234924ad9f2c237289ab8f4baa6 Author: Simon Marlow Date: Thu Mar 8 08:54:01 2018 +0000 Compacted arrays are pinned for isByteArrayPinned# Test Plan: New unit test Reviewers: andrewthad, niteria, bgamari, erikd Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14900 Differential Revision: https://phabricator.haskell.org/D4485 >--------------------------------------------------------------- df2ea10655984234924ad9f2c237289ab8f4baa6 rts/PrimOps.cmm | 3 ++- testsuite/tests/rts/T14900.hs | 22 ++++++++++++++++++++++ testsuite/tests/rts/T14900.stdout | 3 +++ testsuite/tests/rts/all.T | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 6d57fd8..67a2384 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -160,8 +160,9 @@ stg_isByteArrayPinnedzh ( gcptr ba ) // Pinned byte arrays live in blocks with the BF_PINNED flag set. // We also consider BF_LARGE objects to be immovable. See #13894. // See the comment in Storage.c:allocatePinned. + // We also consider BF_COMPACT objects to be immovable. See #14900. flags = TO_W_(bdescr_flags(bd)); - return (flags & (BF_PINNED | BF_LARGE) != 0); + return (flags & (BF_PINNED | BF_LARGE | BF_COMPACT) != 0); } stg_isMutableByteArrayPinnedzh ( gcptr mba ) diff --git a/testsuite/tests/rts/T14900.hs b/testsuite/tests/rts/T14900.hs new file mode 100644 index 0000000..bd29289 --- /dev/null +++ b/testsuite/tests/rts/T14900.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE MagicHash, UnboxedTuples #-} + +import GHC.Compact +import GHC.Int +import GHC.Prim +import GHC.IO +import GHC.Exts + +data BA = ByteArray ByteArray# + +newByteArray :: Int -> IO BA +newByteArray (I# sz) = IO $ \s -> case newByteArray# sz s of { + (# s', arr# #) -> case unsafeFreezeByteArray# arr# s of { + (# s'', barr# #) -> (# s', ByteArray barr# #) }} + +main :: IO () +main = do + ByteArray arr1# <- fmap getCompact $ newByteArray 65000 >>= compact + ByteArray arr2# <- newByteArray 65000 + print (I# (isByteArrayPinned# arr1#)) + print (I# (isByteArrayPinned# arr2#)) + putStrLn "Finished" diff --git a/testsuite/tests/rts/T14900.stdout b/testsuite/tests/rts/T14900.stdout new file mode 100644 index 0000000..fdc259d --- /dev/null +++ b/testsuite/tests/rts/T14900.stdout @@ -0,0 +1,3 @@ +1 +1 +Finished diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index ef77d57..5000a91 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -388,3 +388,5 @@ test('T14702', [ ignore_stdout , extra_run_opts('+RTS -A32m -N8 -T -RTS') ] , compile_and_run, ['']) + +test('T14900', normal, compile_and_run, ['-package ghc-compact']) From git at git.haskell.org Fri Mar 9 17:57:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Mar 2018 17:57:31 +0000 (UTC) Subject: [commit: ghc] master: UNREG: fix implicit declarations from pdep and pext (dd3906b) Message-ID: <20180309175731.D0F3F3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dd3906bf5debdb74bb8e356cede7f6ac6d770007/ghc >--------------------------------------------------------------- commit dd3906bf5debdb74bb8e356cede7f6ac6d770007 Author: Sergei Trofimovich Date: Fri Mar 9 17:43:01 2018 +0000 UNREG: fix implicit declarations from pdep and pext Unreg build failed as: $ ./configure --enable-unregisterised $ make HC [stage 1] libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.o ghc_1.hc: In function 'ghczmprim_GHCziPrimopWrappers_pdep8zh_entry': ghc_1.hc:1810:9: error: error: implicit declaration of function 'hs_pdep8'; did you mean 'hs_ctz8'? [-Werror=implicit-function-declaration] _c3jz = hs_pdep8(*Sp, Sp[1]); ^~~~~~~~ hs_ctz8 | 1810 | _c3jz = hs_pdep8(*Sp, Sp[1]); | ^ Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- dd3906bf5debdb74bb8e356cede7f6ac6d770007 includes/stg/Prim.h | 12 ++++++++++++ libraries/ghc-prim/cbits/pdep.c | 5 ----- libraries/ghc-prim/cbits/pext.c | 5 ----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index fa3a3ec..a18e02c 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -58,6 +58,18 @@ StgWord64 hs_bswap64(StgWord64 x); /* TODO: longlong.c */ +/* libraries/ghc-prim/cbits/pdep.c */ +StgWord64 hs_pdep64(StgWord64 src, StgWord64 mask); +StgWord hs_pdep32(StgWord src, StgWord mask); +StgWord hs_pdep16(StgWord src, StgWord mask); +StgWord hs_pdep8(StgWord src, StgWord mask); + +/* libraries/ghc-prim/cbits/pext.c */ +StgWord64 hs_pext64(StgWord64 src, StgWord64 mask); +StgWord hs_pext32(StgWord src, StgWord mask); +StgWord hs_pext16(StgWord src, StgWord mask); +StgWord hs_pext8(StgWord src, StgWord mask); + /* libraries/ghc-prim/cbits/popcnt.c */ StgWord hs_popcnt8(StgWord x); StgWord hs_popcnt16(StgWord x); diff --git a/libraries/ghc-prim/cbits/pdep.c b/libraries/ghc-prim/cbits/pdep.c index 8435ffe..58e8611 100644 --- a/libraries/ghc-prim/cbits/pdep.c +++ b/libraries/ghc-prim/cbits/pdep.c @@ -1,8 +1,6 @@ #include "Rts.h" #include "MachDeps.h" -extern StgWord64 hs_pdep64(StgWord64 src, StgWord64 mask); - StgWord64 hs_pdep64(StgWord64 src, StgWord64 mask) { @@ -26,21 +24,18 @@ hs_pdep64(StgWord64 src, StgWord64 mask) return result; } -extern StgWord hs_pdep32(StgWord src, StgWord mask); StgWord hs_pdep32(StgWord src, StgWord mask) { return hs_pdep64(src, mask); } -extern StgWord hs_pdep16(StgWord src, StgWord mask); StgWord hs_pdep16(StgWord src, StgWord mask) { return hs_pdep64(src, mask); } -extern StgWord hs_pdep8(StgWord src, StgWord mask); StgWord hs_pdep8(StgWord src, StgWord mask) { diff --git a/libraries/ghc-prim/cbits/pext.c b/libraries/ghc-prim/cbits/pext.c index fe960b1..9cddede 100644 --- a/libraries/ghc-prim/cbits/pext.c +++ b/libraries/ghc-prim/cbits/pext.c @@ -1,8 +1,6 @@ #include "Rts.h" #include "MachDeps.h" -extern StgWord64 hs_pext64(StgWord64 src, StgWord64 mask); - StgWord64 hs_pext64(StgWord64 src, StgWord64 mask) { @@ -22,21 +20,18 @@ hs_pext64(StgWord64 src, StgWord64 mask) return result; } -extern StgWord hs_pext32(StgWord src, StgWord mask); StgWord hs_pext32(StgWord src, StgWord mask) { return hs_pext64(src, mask); } -extern StgWord hs_pext16(StgWord src, StgWord mask); StgWord hs_pext16(StgWord src, StgWord mask) { return hs_pext64(src, mask); } -extern StgWord hs_pext8(StgWord src, StgWord mask); StgWord hs_pext8(StgWord src, StgWord mask) { From git at git.haskell.org Sat Mar 10 07:00:07 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Mar 2018 07:00:07 +0000 (UTC) Subject: [commit: ghc] master: Fix a debug print in disassembler (#14905) (8e34101) Message-ID: <20180310070007.072603A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e3410134bd7419db638988d74fcc600b03e2a1a/ghc >--------------------------------------------------------------- commit 8e3410134bd7419db638988d74fcc600b03e2a1a Author: Ömer Sinan Ağacan Date: Fri Mar 9 15:38:58 2018 +0300 Fix a debug print in disassembler (#14905) When interpreter is not profiled (see `interpreterProfiled` in `DynFlags`) bytecode generator generates a NULL pointer as the cost centre of a `BRK_FUN` instruction: let cc | interpreterProfiled dflags = cc_arr ! tick_no | otherwise = toRemotePtr nullPtr let breakInstr = BRK_FUN (fromIntegral tick_no) (getUnique this_mod) cc return $ breakInstr `consOL` code We now take this into account when disassembling `BRK_FUN`. Reviewers: bgamari, simonmar, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4490 >--------------------------------------------------------------- 8e3410134bd7419db638988d74fcc600b03e2a1a rts/Disassembler.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rts/Disassembler.c b/rts/Disassembler.c index 8c84e13..01d6c3b 100644 --- a/rts/Disassembler.c +++ b/rts/Disassembler.c @@ -68,7 +68,11 @@ disInstr ( StgBCO *bco, int pc ) case bci_BRK_FUN: debugBelch ("BRK_FUN " ); printPtr( ptrs[instrs[pc]] ); debugBelch (" %d ", instrs[pc+1]); printPtr( ptrs[instrs[pc+2]] ); - debugBelch(" %s\n", ((CostCentre*)(literals[instrs[pc+3]]))->label); + CostCentre* cc = (CostCentre*)literals[instrs[pc+3]]; + if (cc) { + debugBelch(" %s", cc->label); + } + debugBelch("\n"); pc += 4; break; case bci_SWIZZLE: From git at git.haskell.org Sat Mar 10 12:46:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Mar 2018 12:46:52 +0000 (UTC) Subject: [commit: ghc] master: testsuite: disable T13615 on non-smp targets (e3ae0eb) Message-ID: <20180310124652.1CCD83A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e3ae0eb8e13adbbbec163d65c3b6e613666c56c9/ghc >--------------------------------------------------------------- commit e3ae0eb8e13adbbbec163d65c3b6e613666c56c9 Author: Sergei Trofimovich Date: Sat Mar 10 12:33:59 2018 +0000 testsuite: disable T13615 on non-smp targets T13615 needs multicore support from RTS: T13615: unknown RTS option: -N15 Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- e3ae0eb8e13adbbbec163d65c3b6e613666c56c9 testsuite/tests/concurrent/T13615/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/concurrent/T13615/all.T b/testsuite/tests/concurrent/T13615/all.T index bac4d01..681f7b0 100644 --- a/testsuite/tests/concurrent/T13615/all.T +++ b/testsuite/tests/concurrent/T13615/all.T @@ -1,5 +1,6 @@ test('T13615', [when(fast(), skip), + req_smp, # needs -N support only_ways(threaded_ways), extra_files(['Parallel.hs', 'Memo.hs']), # Decrease stack chunk size and lots of capabilities to increase failure From git at git.haskell.org Mon Mar 12 07:56:35 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Mar 2018 07:56:35 +0000 (UTC) Subject: [commit: ghc] master: Remove splitEithers, use partitionEithers from base (5c804e5) Message-ID: <20180312075635.53D3C3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c804e5de11c71e84e81c40a10c11baba04b15e1/ghc >--------------------------------------------------------------- commit 5c804e5de11c71e84e81c40a10c11baba04b15e1 Author: Ömer Sinan Ağacan Date: Mon Mar 12 10:54:17 2018 +0300 Remove splitEithers, use partitionEithers from base >--------------------------------------------------------------- 5c804e5de11c71e84e81c40a10c11baba04b15e1 compiler/cmm/Debug.hs | 5 +++-- compiler/ghci/ByteCodeGen.hs | 3 ++- compiler/main/DriverPipeline.hs | 5 +++-- compiler/rename/RnEnv.hs | 3 ++- compiler/utils/Util.hs | 10 +--------- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/compiler/cmm/Debug.hs b/compiler/cmm/Debug.hs index c6aae69..044a000 100644 --- a/compiler/cmm/Debug.hs +++ b/compiler/cmm/Debug.hs @@ -35,7 +35,7 @@ import Outputable import PprCore () import PprCmmExpr ( pprExpr ) import SrcLoc -import Util +import Util ( seqList ) import Hoopl.Block import Hoopl.Collections @@ -46,6 +46,7 @@ import Data.Maybe import Data.List ( minimumBy, nubBy ) import Data.Ord ( comparing ) import qualified Data.Map as Map +import Data.Either ( partitionEithers ) -- | Debug information about a block of code. Ticks scope over nested -- blocks. @@ -100,7 +101,7 @@ cmmDebugGen modLoc decls = map (blocksForScope Nothing) topScopes -- Analyse tick scope structure: Each one is either a top-level -- tick scope, or the child of another. (topScopes, childScopes) - = splitEithers $ map (\a -> findP a a) $ Map.keys blockCtxs + = partitionEithers $ map (\a -> findP a a) $ Map.keys blockCtxs findP tsc GlobalScope = Left tsc -- top scope findP tsc scp | scp' `Map.member` blockCtxs = Right (scp', tsc) | otherwise = findP tsc scp' diff --git a/compiler/ghci/ByteCodeGen.hs b/compiler/ghci/ByteCodeGen.hs index 90fcb6d..74168ac 100644 --- a/compiler/ghci/ByteCodeGen.hs +++ b/compiler/ghci/ByteCodeGen.hs @@ -73,6 +73,7 @@ import qualified Data.IntMap as IntMap import qualified FiniteMap as Map import Data.Ord import GHC.Stack.CCS +import Data.Either ( partitionEithers ) -- ----------------------------------------------------------------------------- -- Generating byte code for a complete module @@ -89,7 +90,7 @@ byteCodeGen hsc_env this_mod binds tycs mb_modBreaks (const ()) $ do -- Split top-level binds into strings and others. -- See Note [generating code for top-level string literal bindings]. - let (strings, flatBinds) = splitEithers $ do + let (strings, flatBinds) = partitionEithers $ do (bndr, rhs) <- flattenBinds binds return $ case exprIsTickedString_maybe rhs of Just str -> Left (bndr, str) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 839f6d0..e631cbb 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -73,6 +73,7 @@ import Control.Monad import Data.List ( isSuffixOf, intercalate ) import Data.Maybe import Data.Version +import Data.Either ( partitionEithers ) -- --------------------------------------------------------------------------- -- Pre-process @@ -453,7 +454,7 @@ linkingNeeded dflags staticLink linkables pkg_deps = do -- first check object files and extra_ld_inputs let extra_ld_inputs = [ f | FileOption _ f <- ldInputs dflags ] e_extra_times <- mapM (tryIO . getModificationUTCTime) extra_ld_inputs - let (errs,extra_times) = splitEithers e_extra_times + let (errs,extra_times) = partitionEithers e_extra_times let obj_times = map linkableTime linkables ++ extra_times if not (null errs) || any (t <) obj_times then return True @@ -469,7 +470,7 @@ linkingNeeded dflags staticLink linkables pkg_deps = do if any isNothing pkg_libfiles then return True else do e_lib_times <- mapM (tryIO . getModificationUTCTime) (catMaybes pkg_libfiles) - let (lib_errs,lib_times) = splitEithers e_lib_times + let (lib_errs,lib_times) = partitionEithers e_lib_times if not (null lib_errs) || any (t <) lib_times then return True else checkLinkInfo dflags pkg_deps exe_file diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 1d9dcfa..600b564 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -79,6 +79,7 @@ import RnUnbound import RnUtils import Data.Maybe (isJust) import qualified Data.Semigroup as Semi +import Data.Either ( partitionEithers ) {- ********************************************************* @@ -1436,7 +1437,7 @@ lookupLocalTcNames :: HsSigCtxt -> SDoc -> RdrName -> RnM [(RdrName, Name)] -- See Note [Fixity signature lookup] lookupLocalTcNames ctxt what rdr_name = do { mb_gres <- mapM lookup (dataTcOccs rdr_name) - ; let (errs, names) = splitEithers mb_gres + ; let (errs, names) = partitionEithers mb_gres ; when (null names) $ addErr (head errs) -- Bleat about one only ; return names } where diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index a4520ed..d0a38ec 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -25,7 +25,7 @@ module Util ( mapFst, mapSnd, chkAppend, mapAndUnzip, mapAndUnzip3, mapAccumL2, - nOfThem, filterOut, partitionWith, splitEithers, + nOfThem, filterOut, partitionWith, dropWhileEndLE, spanEnd, @@ -296,14 +296,6 @@ partitionWith f (x:xs) = case f x of Right c -> (bs, c:cs) where (bs,cs) = partitionWith f xs -splitEithers :: [Either a b] -> ([a], [b]) --- ^ Teases a list of 'Either's apart into two lists -splitEithers [] = ([],[]) -splitEithers (e : es) = case e of - Left x -> (x:xs, ys) - Right y -> (xs, y:ys) - where (xs,ys) = splitEithers es - chkAppend :: [a] -> [a] -> [a] -- Checks for the second argument being empty -- Used in situations where that situation is common From git at git.haskell.org Mon Mar 12 17:02:19 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Mar 2018 17:02:19 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal submodule (02b3dad) Message-ID: <20180312170219.80ED33A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02b3dad195488c9b0f7457e46319cb3f485570ca/ghc >--------------------------------------------------------------- commit 02b3dad195488c9b0f7457e46319cb3f485570ca Author: Ben Gamari Date: Sat Mar 10 13:47:51 2018 -0500 Bump Cabal submodule >--------------------------------------------------------------- 02b3dad195488c9b0f7457e46319cb3f485570ca libraries/Cabal | 2 +- testsuite/tests/driver/T4437.hs | 2 -- utils/check-api-annotations/check-api-annotations.cabal | 2 +- utils/check-ppr/check-ppr.cabal | 2 +- utils/ghc-cabal/ghc-cabal.cabal | 2 +- utils/ghctags/ghctags.cabal | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libraries/Cabal b/libraries/Cabal index 7ce486e..c219cd3 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 7ce486e6553d24877ae3b23868b95d20bf83760a +Subproject commit c219cd3f31c8e4e4bc71f93bbcd4de87830a986d diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 9f892c9..5ae4230 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -40,8 +40,6 @@ expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", "AlternativeLayoutRuleTransitional", "EmptyDataDeriving", - "NumericUnderscores", - "BlockArguments", "GeneralisedNewtypeDeriving"] expectedCabalOnlyExtensions :: [String] diff --git a/utils/check-api-annotations/check-api-annotations.cabal b/utils/check-api-annotations/check-api-annotations.cabal index 3cdb378..3a014a6 100644 --- a/utils/check-api-annotations/check-api-annotations.cabal +++ b/utils/check-api-annotations/check-api-annotations.cabal @@ -24,6 +24,6 @@ Executable check-api-annotations Build-Depends: base >= 4 && < 5, containers, - Cabal >= 2.2 && < 2.3, + Cabal >= 2.3 && < 2.4, directory, ghc diff --git a/utils/check-ppr/check-ppr.cabal b/utils/check-ppr/check-ppr.cabal index d7429c8..e0d8b9d 100644 --- a/utils/check-ppr/check-ppr.cabal +++ b/utils/check-ppr/check-ppr.cabal @@ -25,7 +25,7 @@ Executable check-ppr Build-Depends: base >= 4 && < 5, bytestring, containers, - Cabal >= 2.2 && < 2.3, + Cabal >= 2.3 && < 2.4, directory, filepath, ghc diff --git a/utils/ghc-cabal/ghc-cabal.cabal b/utils/ghc-cabal/ghc-cabal.cabal index 4b19116..cc0d98d 100644 --- a/utils/ghc-cabal/ghc-cabal.cabal +++ b/utils/ghc-cabal/ghc-cabal.cabal @@ -21,7 +21,7 @@ Executable ghc-cabal Build-Depends: base >= 3 && < 5, bytestring >= 0.10 && < 0.11, - Cabal >= 2.2 && < 2.3, + Cabal >= 2.3 && < 2.4, directory >= 1.1 && < 1.4, filepath >= 1.2 && < 1.5 diff --git a/utils/ghctags/ghctags.cabal b/utils/ghctags/ghctags.cabal index c798a93..391eb7a 100644 --- a/utils/ghctags/ghctags.cabal +++ b/utils/ghctags/ghctags.cabal @@ -18,6 +18,6 @@ Executable ghctags Build-Depends: base >= 4 && < 5, containers, - Cabal >= 2.2 && <2.3, + Cabal >= 2.3 && <2.4, ghc From git at git.haskell.org Tue Mar 13 03:44:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 03:44:53 +0000 (UTC) Subject: [commit: ghc] wip/kavon-nosplit-llvm: addressing a TODO related to FFI calls (be00cf3) Message-ID: <20180313034453.323743A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-nosplit-llvm Link : http://ghc.haskell.org/trac/ghc/changeset/be00cf3a98f256c8cfa56715c187138d586d0118/ghc >--------------------------------------------------------------- commit be00cf3a98f256c8cfa56715c187138d586d0118 Author: Kavon Farvardin Date: Sun Mar 11 17:23:34 2018 -0500 addressing a TODO related to FFI calls >--------------------------------------------------------------- be00cf3a98f256c8cfa56715c187138d586d0118 compiler/codeGen/StgCmmForeign.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index 9666643..8fd2903 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -225,7 +225,7 @@ emitForeignCall safety results target args target' <- load_target_into_temp target args' <- mapM maybe_assign_temp args k <- newBlockId - let (off, _, copyout) = copyInOflow dflags NativeReturn (Young k) results [] + let (off, retRegs, copyout) = copyInOflow dflags NativeReturn (Young k) results [] -- see Note [safe foreign call convention] tscope <- getTickScope emit $ @@ -241,7 +241,7 @@ emitForeignCall safety results target args <*> mkLabel k tscope <*> copyout ) - return (ReturnedTo k off []) -- TODO(kavon) this will need to change once you get to foreign calls + return (ReturnedTo k off retRegs) load_target_into_temp :: ForeignTarget -> FCode ForeignTarget load_target_into_temp (ForeignTarget expr conv) = do From git at git.haskell.org Tue Mar 13 03:44:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 03:44:56 +0000 (UTC) Subject: [commit: ghc] wip/kavon-nosplit-llvm: when compiling a .cmm file, carry any ManglerInfo through to the next phase (4790509) Message-ID: <20180313034456.04CB93A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/kavon-nosplit-llvm Link : http://ghc.haskell.org/trac/ghc/changeset/4790509e7b52f5904d50ac937998b47b347fedac/ghc >--------------------------------------------------------------- commit 4790509e7b52f5904d50ac937998b47b347fedac Author: Kavon Farvardin Date: Mon Mar 12 22:43:41 2018 -0500 when compiling a .cmm file, carry any ManglerInfo through to the next phase >--------------------------------------------------------------- 4790509e7b52f5904d50ac937998b47b347fedac compiler/main/DriverPipeline.hs | 8 ++++++-- compiler/main/HscMain.hs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index acf1d04..902086d 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1140,9 +1140,13 @@ runPhase (RealPhase Cmm) input_fn dflags PipeState{hsc_env} <- getPipeState - liftIO $ hscCompileCmmFile hsc_env input_fn output_fn + mangInfo <- liftIO $ hscCompileCmmFile hsc_env input_fn output_fn - return (RealPhase next_phase, output_fn) + let kind = case next_phase of + LlvmOpt -> RealPhaseWithInfo + _ -> \ _ p -> RealPhase p + + return (kind mangInfo next_phase, output_fn) ----------------------------------------------------------------------------- -- Cc phase diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 6ad0b7c..3dd16f9 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -1392,7 +1392,7 @@ hscInteractive hsc_env cgguts mod_summary = do ------------------------------ -hscCompileCmmFile :: HscEnv -> FilePath -> FilePath -> IO () +hscCompileCmmFile :: HscEnv -> FilePath -> FilePath -> IO ManglerInfo hscCompileCmmFile hsc_env filename output_filename = runHsc hsc_env $ do let dflags = hsc_dflags hsc_env cmm <- ioMsgMaybe $ parseCmmFile dflags filename @@ -1406,9 +1406,9 @@ hscCompileCmmFile hsc_env filename output_filename = runHsc hsc_env $ do -- lest we reproduce #11784. mod_name = mkModuleName $ "Cmm$" ++ FilePath.takeFileName filename cmm_mod = mkModule (thisPackage dflags) mod_name - _ <- codeOutput dflags cmm_mod output_filename no_loc NoStubs [] [] + (_,_,_,info) <- codeOutput dflags cmm_mod output_filename no_loc NoStubs [] [] rawCmms - return () + return info where no_loc = ModLocation{ ml_hs_file = Just filename, ml_hi_file = panic "hscCompileCmmFile: no hi file", From git at git.haskell.org Tue Mar 13 04:14:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:43 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: temp fix Makefile (a66332f) Message-ID: <20180313041443.8A0F63A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/a66332fdebcf1266f9c0410ef7b3619daf3ef8e7/ghc >--------------------------------------------------------------- commit a66332fdebcf1266f9c0410ef7b3619daf3ef8e7 Author: Moritz Angermann Date: Thu Feb 15 12:29:14 2018 +0800 temp fix Makefile >--------------------------------------------------------------- a66332fdebcf1266f9c0410ef7b3619daf3ef8e7 utils/iserv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/iserv/Makefile b/utils/iserv/Makefile index f160978..3619858 100644 --- a/utils/iserv/Makefile +++ b/utils/iserv/Makefile @@ -10,6 +10,6 @@ # # ----------------------------------------------------------------------------- -dir = iserv -TOP = .. +dir = utils/iserv +TOP = ../.. include $(TOP)/mk/sub-makefile.mk From git at git.haskell.org Tue Mar 13 04:14:49 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:49 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Adds iserv-proxy/cabal.project (a334af8) Message-ID: <20180313041449.8075D3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/a334af8e31319b0572c0d8d7f89088bc893ae9c4/ghc >--------------------------------------------------------------- commit a334af8e31319b0572c0d8d7f89088bc893ae9c4 Author: Moritz Angermann Date: Wed Mar 7 11:01:23 2018 +0800 Adds iserv-proxy/cabal.project >--------------------------------------------------------------- a334af8e31319b0572c0d8d7f89088bc893ae9c4 utils/iserv-proxy/cabal.project | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/iserv-proxy/cabal.project b/utils/iserv-proxy/cabal.project new file mode 100644 index 0000000..2e6cd12 --- /dev/null +++ b/utils/iserv-proxy/cabal.project @@ -0,0 +1,4 @@ +packages: . ../../libraries/libiserv + +package libiserv + flags: +network From git at git.haskell.org Tue Mar 13 04:14:46 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:46 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: adds .gitignore (44ce888) Message-ID: <20180313041446.5BB313A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/44ce888e334067d79e14ba3468568950fcc08072/ghc >--------------------------------------------------------------- commit 44ce888e334067d79e14ba3468568950fcc08072 Author: Moritz Angermann Date: Thu Feb 15 13:54:55 2018 +0800 adds .gitignore >--------------------------------------------------------------- 44ce888e334067d79e14ba3468568950fcc08072 .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index efc7a89..a5a36ea 100644 --- a/.gitignore +++ b/.gitignore @@ -81,8 +81,7 @@ _darcs/ /ghc/stage1/ /ghc/stage2/ /ghc/stage3/ -/iserv/stage2*/ -/iserv/dist/ +/utils/iserv/stage2*/ # ----------------------------------------------------------------------------- # specific generated files From git at git.haskell.org Tue Mar 13 04:14:53 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:53 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (f9bebf5) Message-ID: <20180313041453.9C5FC3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/f9bebf53f549216a53fd96f6f803a4501140a24f/ghc >--------------------------------------------------------------- commit f9bebf53f549216a53fd96f6f803a4501140a24f Author: Moritz Angermann Date: Sat Nov 25 15:10:52 2017 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. # Conflicts: # utils/iserv-proxy/iserv-proxy.cabal >--------------------------------------------------------------- f9bebf53f549216a53fd96f6f803a4501140a24f ghc.mk | 13 +-- {iserv => libraries/libiserv}/Makefile | 0 {iserv => libraries/libiserv}/cbits/iservmain.c | 0 libraries/libiserv/ghc.mk | 5 + libraries/libiserv/libiserv.cabal | 39 +++++++ {iserv => libraries/libiserv}/proxy-src/Remote.hs | 0 {iserv => libraries/libiserv}/src/GHCi/Utils.hsc | 0 {iserv => libraries/libiserv}/src/Lib.hs | 0 {iserv => libraries/libiserv}/src/Main.hs | 0 .../libiserv}/src/Remote/Message.hs | 0 {iserv => libraries/libiserv}/src/Remote/Slave.hs | 0 {iserv => utils/iserv-proxy}/Makefile | 0 utils/iserv-proxy/ghc.mk | 113 +++++++++++++++++++++ .../iserv-proxy/iserv-proxy.cabal | 72 +------------ .../Remote.hs => utils/iserv-proxy/src/Main.hs | 0 {iserv => utils/iserv}/Makefile | 0 {iserv => utils/iserv}/cbits/iservmain.c | 0 {iserv => utils/iserv}/ghc.mk | 66 ++++++------ utils/iserv/iserv.cabal | 44 ++++++++ {iserv => utils/iserv}/src/Main.hs | 0 20 files changed, 246 insertions(+), 106 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 f9bebf53f549216a53fd96f6f803a4501140a24f From git at git.haskell.org Tue Mar 13 04:14:56 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:56 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` (d94a941) Message-ID: <20180313041456.6F1F43A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/d94a9418ae6141fb6e4e766d9fbf89fb3a744dc1/ghc >--------------------------------------------------------------- commit d94a9418ae6141fb6e4e766d9fbf89fb3a744dc1 Author: Moritz Angermann Date: Thu Feb 22 16:53:35 2018 +0800 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` Summary: This is done for consistency. We usually call the package file the same name the folder has. The move into `utils` is done so that we can move the library into `libraries/iserv` and the proxy into `utils/iserv-proxy` and then break the `iserv.cabal` apart. This will make building the cross compiler with TH simpler, because we can build the library and proxy as separate packages. Test Plan: ./validate Reviewers: bgamari, goldfire, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4436 >--------------------------------------------------------------- d94a9418ae6141fb6e4e766d9fbf89fb3a744dc1 libraries/libiserv/src/Main.hs | 63 ------------------------------------------ 1 file changed, 63 deletions(-) diff --git a/libraries/libiserv/src/Main.hs b/libraries/libiserv/src/Main.hs deleted file mode 100644 index 858cee8..0000000 --- a/libraries/libiserv/src/Main.hs +++ /dev/null @@ -1,63 +0,0 @@ -{-# LANGUAGE CPP, GADTs #-} - --- | --- The Remote GHCi server. --- --- For details on Remote GHCi, see Note [Remote GHCi] in --- compiler/ghci/GHCi.hs. --- -module Main (main) where - -import Lib (serv) - -import GHCi.Message -import GHCi.Signals -import GHCi.Utils - -import Control.Exception -import Control.Monad -import Data.IORef -import System.Environment -import System.Exit -import Text.Printf - -dieWithUsage :: IO a -dieWithUsage = do - prog <- getProgName - die $ prog ++ ": " ++ msg - where -#ifdef WINDOWS - msg = "usage: iserv [-v]" -#else - msg = "usage: iserv [-v]" -#endif - -main :: IO () -main = do - args <- getArgs - (wfd1, rfd2, rest) <- - case args of - arg0:arg1:rest -> do - let wfd1 = read arg0 - rfd2 = read arg1 - return (wfd1, rfd2, rest) - _ -> dieWithUsage - - verbose <- case rest of - ["-v"] -> return True - [] -> return False - _ -> dieWithUsage - when verbose $ - printf "GHC iserv starting (in: %d; out: %d)\n" - (fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int) - inh <- getGhcHandle rfd2 - outh <- getGhcHandle wfd1 - installSignalHandlers - lo_ref <- newIORef Nothing - let pipe = Pipe{pipeRead = inh, pipeWrite = outh, pipeLeftovers = lo_ref} - uninterruptibleMask $ serv verbose hook pipe - - where hook = return -- empty hook - -- we cannot allow any async exceptions while communicating, because - -- we will lose sync in the protocol, hence uninterruptibleMask. - From git at git.haskell.org Tue Mar 13 04:15:05 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:15:05 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Better logging in iserv-remote (7c8ad02) Message-ID: <20180313041505.AC2483A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/7c8ad02f4ac5c2ed5508081a1024bcd8a060ef33/ghc >--------------------------------------------------------------- commit 7c8ad02f4ac5c2ed5508081a1024bcd8a060ef33 Author: Moritz Angermann Date: Wed Mar 7 13:38:28 2018 +0800 Better logging in iserv-remote >--------------------------------------------------------------- 7c8ad02f4ac5c2ed5508081a1024bcd8a060ef33 libraries/libiserv/src/Remote/Slave.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs index b80d095..9387db1 100644 --- a/libraries/libiserv/src/Remote/Slave.hs +++ b/libraries/libiserv/src/Remote/Slave.hs @@ -112,6 +112,7 @@ hook verbose base_path pipe m = case m of handleLoad pipe path (base_path path) return $ Msg (LoadObj (base_path path)) Msg (LoadArchive path) -> do + when verbose $ putStrLn ("Need Archieve: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) return $ Msg (LoadArchive (base_path path)) -- when loading DLLs (.so, .dylib, .dll, ...) and these are provided @@ -119,7 +120,7 @@ hook verbose base_path pipe m = case m of -- therefore we hook the LoadDLL call only for absolute paths to ship the -- dll from the host to the target. Msg (LoadDLL path) | isAbsolute path -> do - when verbose $ putStrLn ("Need DLL: " ++ (base_path path)) + when verbose $ putStrLn ("Need DLL: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) return $ Msg (LoadDLL (base_path path)) _other -> return m From git at git.haskell.org Tue Mar 13 04:15:02 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:15:02 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Cleanup LD detection. (8aca758) Message-ID: <20180313041502.C38093A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/8aca7585d4da0e808fe1947b86f2c301ba050ee6/ghc >--------------------------------------------------------------- commit 8aca7585d4da0e808fe1947b86f2c301ba050ee6 Author: Moritz Angermann Date: Thu Mar 8 11:12:46 2018 +0800 Cleanup LD detection. >--------------------------------------------------------------- 8aca7585d4da0e808fe1947b86f2c301ba050ee6 aclocal.m4 | 3 ++- mk/config.mk.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 528fd0c..92f542d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2362,7 +2362,8 @@ AC_DEFUN([FIND_LD],[ FP_CC_LINKER_FLAG_TRY(bfd, $2) ;; "GNU gold"*) FP_CC_LINKER_FLAG_TRY(gold, $2) - LD_NO_GOLD=ld + LD_NO_GOLD= + AC_CHECK_TARGET_TOOL([LD_NO_GOLD],[ld]) ;; "LLD"*) FP_CC_LINKER_FLAG_TRY(lld, $2) ;; diff --git a/mk/config.mk.in b/mk/config.mk.in index 92830fa..846857d 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -537,7 +537,7 @@ AS_STAGE1 = $(AS) AS_STAGE2 = $(AS) AS_STAGE3 = $(AS) -# why no LD=@LD@ ? +LD = @LD@ LD_STAGE0 = @LD_STAGE0@ LD_STAGE1 = $(LD) LD_STAGE2 = $(LD) From git at git.haskell.org Tue Mar 13 04:15:09 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:15:09 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Adds iserv-slave (via CLI) (6faf0e6) Message-ID: <20180313041509.187963A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/6faf0e6650bc9b8217d541be32f01dc2b092ab8e/ghc >--------------------------------------------------------------- commit 6faf0e6650bc9b8217d541be32f01dc2b092ab8e Author: Moritz Angermann Date: Wed Mar 7 13:38:09 2018 +0800 Adds iserv-slave (via CLI) >--------------------------------------------------------------- 6faf0e6650bc9b8217d541be32f01dc2b092ab8e utils/{iserv-proxy => iserv-slave}/cabal.project | 0 utils/iserv-slave/iserv-slave.cabal | 20 ++++++++++++++++ utils/iserv-slave/src/Cli.hs | 30 ++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/utils/iserv-proxy/cabal.project b/utils/iserv-slave/cabal.project similarity index 100% copy from utils/iserv-proxy/cabal.project copy to utils/iserv-slave/cabal.project diff --git a/utils/iserv-slave/iserv-slave.cabal b/utils/iserv-slave/iserv-slave.cabal new file mode 100644 index 0000000..66a2a32 --- /dev/null +++ b/utils/iserv-slave/iserv-slave.cabal @@ -0,0 +1,20 @@ +Name: iserv-slave +Version: 8.5 +Copyright: XXX +License: BSD3 +-- XXX License-File: LICENSE +Author: XXX +Maintainer: XXX +Synopsis: iserv allows GHC to delegate Tempalte Haskell computations +Description: +Category: Development +build-type: Simple +cabal-version: >=1.10 + +Executable iserv-slave + Default-Language: Haskell2010 + Main-Is: Cli.hs + Hs-Source-Dirs: src + Build-Depends: + base >= 4 && < 5, + libiserv == 8.5 diff --git a/utils/iserv-slave/src/Cli.hs b/utils/iserv-slave/src/Cli.hs new file mode 100644 index 0000000..8a3a34f --- /dev/null +++ b/utils/iserv-slave/src/Cli.hs @@ -0,0 +1,30 @@ +module Main where + +import System.Environment (getProgName, getArgs) +import System.Exit (die) +import Remote.Slave (startSlave') + +main :: IO () +main = getArgs >>= startSlave + +dieWithUsage :: IO a +dieWithUsage = do + prog <- getProgName + die $ prog ++ ": " ++ msg + where + msg = "usage: iserv-slave /path/to/storage PORT [-v]" + +startSlave :: [String] -> IO () +startSlave args0 + | "--help" `elem` args0 = dieWithUsage + | otherwise = do + (path, port, rest) <- case args0 of + arg0:arg1:rest -> return (arg0, read arg1, rest) + _ -> dieWithUsage + verbose <- case rest of + ["-v"] -> return True + [] -> return False + _ -> dieWithUsage + + startSlave' verbose path port + From git at git.haskell.org Tue Mar 13 04:14:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:14:59 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Rename iserv-slave to remote-iserv (d0d02e2) Message-ID: <20180313041459.E98CF3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/d0d02e2887ccdc3563661410c5fdc897fa6ba074/ghc >--------------------------------------------------------------- commit d0d02e2887ccdc3563661410c5fdc897fa6ba074 Author: Moritz Angermann Date: Thu Mar 8 14:00:44 2018 +0800 Rename iserv-slave to remote-iserv >--------------------------------------------------------------- d0d02e2887ccdc3563661410c5fdc897fa6ba074 .../.ghc.environment.arm-linux-8.5.20180307 | 31 ++++++++++++++++++++++ utils/{iserv-slave => remote-iserv}/cabal.project | 0 .../remote-iserv.cabal} | 7 +++-- utils/{iserv-slave => remote-iserv}/src/Cli.hs | 0 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 b/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 new file mode 100644 index 0000000..a0a38d3 --- /dev/null +++ b/utils/remote-iserv/.ghc.environment.arm-linux-8.5.20180307 @@ -0,0 +1,31 @@ +-- This is a GHC environment file written by cabal. This means you can +-- run ghc or ghci and get the environment of the project as a whole. +-- But you still need to use cabal repl $target to get the environment +-- of specific components (libs, exes, tests etc) because each one can +-- have its own source dirs, cpp flags etc. +-- +clear-package-db +global-package-db +package-db /Users/angerman/.cabal/store/ghc-8.5.20180307/package.db +package-db dist-newstyle/packagedb/ghc-8.5.20180307 +package-id libiserv-8.5-inplace +package-id base-4.11.0.0 +package-id rts +package-id ghc-prim-0.5.2.0 +package-id integer-simple-0.1.1.1 +package-id binary-0.8.5.1 +package-id bytestring-0.10.8.2 +package-id deepseq-1.4.3.0 +package-id array-0.5.2.0 +package-id containers-0.5.11.0 +package-id directory-1.3.1.5 +package-id time-1.8.0.2 +package-id filepath-1.4.2 +package-id unix-2.7.2.2 +package-id ghci-8.5 +package-id ghc-boot-8.5 +package-id ghc-boot-th-8.5 +package-id template-haskell-2.13.0.0 +package-id pretty-1.1.3.6 +package-id transformers-0.5.5.0 +package-id ntwrk-2.6.3.4-c7c07d3b diff --git a/utils/iserv-slave/cabal.project b/utils/remote-iserv/cabal.project similarity index 100% rename from utils/iserv-slave/cabal.project rename to utils/remote-iserv/cabal.project diff --git a/utils/iserv-slave/iserv-slave.cabal b/utils/remote-iserv/remote-iserv.cabal similarity index 77% rename from utils/iserv-slave/iserv-slave.cabal rename to utils/remote-iserv/remote-iserv.cabal index 66a2a32..2dc599e 100644 --- a/utils/iserv-slave/iserv-slave.cabal +++ b/utils/remote-iserv/remote-iserv.cabal @@ -1,4 +1,4 @@ -Name: iserv-slave +Name: remote-iserv Version: 8.5 Copyright: XXX License: BSD3 @@ -11,10 +11,9 @@ Category: Development build-type: Simple cabal-version: >=1.10 -Executable iserv-slave +Executable remote-iserv Default-Language: Haskell2010 Main-Is: Cli.hs Hs-Source-Dirs: src - Build-Depends: - base >= 4 && < 5, + Build-Depends: base >= 4 && < 5, libiserv == 8.5 diff --git a/utils/iserv-slave/src/Cli.hs b/utils/remote-iserv/src/Cli.hs similarity index 100% rename from utils/iserv-slave/src/Cli.hs rename to utils/remote-iserv/src/Cli.hs From git at git.haskell.org Tue Mar 13 04:15:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:15:11 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross: Assume `C:` to be system libraries on windows. (8638eb5) Message-ID: <20180313041511.D698F3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/angerman/win32-cross Link : http://ghc.haskell.org/trac/ghc/changeset/8638eb548c082a11ba3f0967ec223346e19b4031/ghc >--------------------------------------------------------------- commit 8638eb548c082a11ba3f0967ec223346e19b4031 Author: Moritz Angermann Date: Wed Mar 7 13:38:44 2018 +0800 Assume `C:` to be system libraries on windows. >--------------------------------------------------------------- 8638eb548c082a11ba3f0967ec223346e19b4031 libraries/libiserv/src/Remote/Slave.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/libiserv/src/Remote/Slave.hs b/libraries/libiserv/src/Remote/Slave.hs index 9387db1..701e7d2 100644 --- a/libraries/libiserv/src/Remote/Slave.hs +++ b/libraries/libiserv/src/Remote/Slave.hs @@ -119,6 +119,9 @@ hook verbose base_path pipe m = case m of -- as relative paths, the intention is to load a pre-existing system library, -- therefore we hook the LoadDLL call only for absolute paths to ship the -- dll from the host to the target. + Msg (LoadDLL path@('C':':':_)) -> do + when verbose $ putStrLn ("Need DLL: " ++ path) + return $ Msg (LoadDLL path) Msg (LoadDLL path) | isAbsolute path -> do when verbose $ putStrLn ("Need DLL: " ++ path ++ " at " ++ (base_path path)) handleLoad pipe path (base_path path) From git at git.haskell.org Tue Mar 13 04:15:14 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 04:15:14 +0000 (UTC) Subject: [commit: ghc] wip/angerman/win32-cross's head updated: Rename iserv-slave to remote-iserv (d0d02e2) Message-ID: <20180313041514.E33D93A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/angerman/win32-cross' now includes: 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 f9bebf5 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` a66332f temp fix Makefile 44ce888 adds .gitignore d94a941 Move `iserv` into `utils` and change package name from `iserv-bin` to `iserv` a334af8 Adds iserv-proxy/cabal.project 6faf0e6 Adds iserv-slave (via CLI) 7c8ad02 Better logging in iserv-remote 8638eb5 Assume `C:` to be system libraries on windows. 8aca758 Cleanup LD detection. d0d02e2 Rename iserv-slave to remote-iserv From git at git.haskell.org Tue Mar 13 12:26:52 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 12:26:52 +0000 (UTC) Subject: [commit: ghc] master: Comment improvements on interpreter breakpoint IO action (50972d6) Message-ID: <20180313122652.E18B83A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/50972d6f7c53d32d324eb5ca96d0a3f8794bdb38/ghc >--------------------------------------------------------------- commit 50972d6f7c53d32d324eb5ca96d0a3f8794bdb38 Author: Ömer Sinan Ağacan Date: Tue Mar 13 15:25:53 2018 +0300 Comment improvements on interpreter breakpoint IO action [skip ci] >--------------------------------------------------------------- 50972d6f7c53d32d324eb5ca96d0a3f8794bdb38 libraries/ghci/GHCi/Run.hs | 7 ++++++- rts/Interpreter.c | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs index d058775..2988ec2 100644 --- a/libraries/ghci/GHCi/Run.hs +++ b/libraries/ghci/GHCi/Run.hs @@ -298,7 +298,12 @@ setStepFlag = poke stepFlag 1 resetStepFlag :: IO () resetStepFlag = poke stepFlag 0 -type BreakpointCallback = Int# -> Int# -> Bool -> HValue -> IO () +type BreakpointCallback + = Int# -- the breakpoint index + -> Int# -- the module uniq + -> Bool -- exception? + -> HValue -- the AP_STACK, or exception + -> IO () foreign import ccall "&rts_breakpoint_io_action" breakPointIOAction :: Ptr (StablePtr BreakpointCallback) diff --git a/rts/Interpreter.c b/rts/Interpreter.c index 0e80593..9eb6560 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -289,7 +289,7 @@ static StgWord app_ptrs_itbl[] = { }; HsStablePtr rts_breakpoint_io_action; // points to the IO action which is executed on a breakpoint - // it is set in main/GHC.hs:runStmt + // it is set in main/GHC.hs:runStmt Capability * interpretBCO (Capability* cap) @@ -1098,10 +1098,10 @@ run_BCO: // Arrange the stack to call the breakpoint IO action, and // continue execution of this BCO when the IO action returns. // - // ioAction :: Bool -- exception? + // ioAction :: Int# -- the breakpoint index + // -> Int# -- the module uniq + // -> Bool -- exception? // -> HValue -- the AP_STACK, or exception - // -> Int -- the breakpoint index (arg2) - // -> Int -- the module uniq (arg3) // -> IO () // ioAction = (StgClosure *) deRefStablePtr ( @@ -1111,7 +1111,7 @@ run_BCO: SpW(10) = (W_)obj; SpW(9) = (W_)&stg_apply_interp_info; SpW(8) = (W_)new_aps; - SpW(7) = (W_)False_closure; // True <=> a breakpoint + SpW(7) = (W_)False_closure; // True <=> an exception SpW(6) = (W_)&stg_ap_ppv_info; SpW(5) = (W_)BCO_LIT(arg3_module_uniq); SpW(4) = (W_)&stg_ap_n_info; From git at git.haskell.org Tue Mar 13 12:58:59 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 12:58:59 +0000 (UTC) Subject: [commit: ghc] master: Update a comment in Exception.cmm (ba57979) Message-ID: <20180313125859.C34633A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ba5797937e575ce6119de6c07703e90dda2557e8/ghc >--------------------------------------------------------------- commit ba5797937e575ce6119de6c07703e90dda2557e8 Author: Ömer Sinan Ağacan Date: Tue Mar 13 15:34:21 2018 +0300 Update a comment in Exception.cmm [skip ci] >--------------------------------------------------------------- ba5797937e575ce6119de6c07703e90dda2557e8 rts/Exception.cmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Exception.cmm b/rts/Exception.cmm index 9661c23..96d95e6 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -532,7 +532,7 @@ retry_pop_stack: Sp(8) = exception; Sp(7) = stg_raise_ret_info; Sp(6) = exception; - Sp(5) = ghczmprim_GHCziTypes_True_closure; // True <=> a breakpoint + Sp(5) = ghczmprim_GHCziTypes_True_closure; // True <=> an exception Sp(4) = stg_ap_ppv_info; Sp(3) = 0; Sp(2) = stg_ap_n_info; From git at git.haskell.org Tue Mar 13 17:38:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 17:38:27 +0000 (UTC) Subject: [commit: ghc] master: Drop GHC 8.0 compatibility (152055a) Message-ID: <20180313173827.6FD473A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/152055a19cf368439c8450040b68142f8e7d0346/ghc >--------------------------------------------------------------- commit 152055a19cf368439c8450040b68142f8e7d0346 Author: Ryan Scott Date: Tue Mar 13 13:36:38 2018 -0400 Drop GHC 8.0 compatibility GHC 8.4.1 is out, so now GHC's support window only extends back to GHC 8.2. This means we can delete gobs of code that were only used for GHC 8.0 support. Hooray! Test Plan: ./validate Reviewers: bgamari, erikd, dfeuer Reviewed By: bgamari, dfeuer Subscribers: alexbiehl, dfeuer, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4492 >--------------------------------------------------------------- 152055a19cf368439c8450040b68142f8e7d0346 compiler/basicTypes/BasicTypes.hs | 2 +- compiler/basicTypes/Module.hs | 8 +++----- compiler/basicTypes/RdrName.hs | 2 +- compiler/hsSyn/HsExpr.hs | 2 -- compiler/main/SysTools/BaseDir.hs | 4 ---- compiler/utils/Binary.hs | 26 -------------------------- compiler/utils/UniqFM.hs | 10 +--------- compiler/utils/UniqMap.hs | 3 +-- libraries/ghc-boot/GHC/PackageDb.hs | 22 ++-------------------- libraries/ghc-boot/GHC/Serialized.hs | 7 ------- libraries/ghci/GHCi/Message.hs | 6 +----- libraries/ghci/GHCi/TH/Binary.hs | 17 ----------------- testsuite/timeout/WinCBindings.hsc | 3 --- 13 files changed, 10 insertions(+), 102 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 152055a19cf368439c8450040b68142f8e7d0346 From git at git.haskell.org Tue Mar 13 17:57:31 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 17:57:31 +0000 (UTC) Subject: [commit: ghc] branch 'wip/D4327' created Message-ID: <20180313175731.DDD473A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/D4327 Referencing: adc3415f14aa090c54c68149dcb1d99f19132a83 From git at git.haskell.org Tue Mar 13 17:57:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 13 Mar 2018 17:57:34 +0000 (UTC) Subject: [commit: ghc] wip/D4327: WIP: Add likelyhood to alternatives from stg onwards (adc3415) Message-ID: <20180313175734.C70BF3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/D4327 Link : http://ghc.haskell.org/trac/ghc/changeset/adc3415f14aa090c54c68149dcb1d99f19132a83/ghc >--------------------------------------------------------------- commit adc3415f14aa090c54c68149dcb1d99f19132a83 Author: Andreas Klebinger Date: Tue Mar 13 13:54:53 2018 -0400 WIP: Add likelyhood to alternatives from stg onwards Summary: Adds a Freq value to Stg/Cmm cases/switches/conditionals. Currently only generates these values by checking alternatives for bottom expressions. They are passed along to the backend where they affect conditional generation slightly. As it stands runtime improvements seem to be less than expected. This might only be worth merging once we have more branch weights available. Reviewers: hvr, goldfire, bgamari, simonmar, simonpj, erikd Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14672 Differential Revision: https://phabricator.haskell.org/D4327 >--------------------------------------------------------------- adc3415f14aa090c54c68149dcb1d99f19132a83 compiler/basicTypes/BasicTypes.hs | 107 ++++++++++++++++- compiler/basicTypes/MkId.hs | 18 +-- compiler/cmm/CmmImplementSwitchPlans.hs | 19 +-- compiler/cmm/CmmParse.y | 9 +- compiler/cmm/CmmSwitch.hs | 201 +++++++++++++++++++++++--------- compiler/cmm/PprC.hs | 10 +- compiler/cmm/PprCmm.hs | 29 +++-- compiler/codeGen/StgCmmBind.hs | 2 +- compiler/codeGen/StgCmmExpr.hs | 49 ++++---- compiler/codeGen/StgCmmMonad.hs | 6 +- compiler/codeGen/StgCmmPrim.hs | 28 +++-- compiler/codeGen/StgCmmProf.hs | 1 + compiler/codeGen/StgCmmUtils.hs | 118 ++++++++++++------- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 27 ++++- compiler/main/DynFlags.hs | 16 ++- compiler/main/ErrUtils.hs | 9 +- compiler/nativeGen/PPC/CodeGen.hs | 6 +- compiler/nativeGen/SPARC/CodeGen.hs | 6 +- compiler/nativeGen/X86/CodeGen.hs | 6 +- compiler/simplStg/StgCse.hs | 12 +- compiler/simplStg/StgStats.hs | 2 +- compiler/simplStg/UnariseStg.hs | 38 +++--- compiler/stgSyn/CoreToStg.hs | 111 ++++++++++-------- compiler/stgSyn/StgLint.hs | 12 +- compiler/stgSyn/StgSyn.hs | 14 ++- docs/users_guide/debugging.rst | 9 +- docs/users_guide/using-optimisation.rst | 16 +++ 27 files changed, 615 insertions(+), 266 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 adc3415f14aa090c54c68149dcb1d99f19132a83 From git at git.haskell.org Wed Mar 14 06:17:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 14 Mar 2018 06:17:43 +0000 (UTC) Subject: [commit: ghc] master: Slighly improve infix con app pattern errors (cb6d858) Message-ID: <20180314061743.C82433A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cb6d8589c83247ec96d5faa82df3e93f419bbfe0/ghc >--------------------------------------------------------------- commit cb6d8589c83247ec96d5faa82df3e93f419bbfe0 Author: Ömer Sinan Ağacan Date: Wed Mar 14 09:16:51 2018 +0300 Slighly improve infix con app pattern errors Given this program: main = do f $ do a <- return 3 c <- do return 5 GHC previously gave this error message: Main.hs:2:7: error: Parse error in pattern: do a <- return 3 c Possibly caused by a missing 'do'? | 2 | f $ do | ^^... What happened is GHC considered the whole `f $ do a <- return 3 c` as a pattern. When parsed as an expression it becomes an infix application of `($)`, and GHC checks left and right hand sides before checking if `($)` is a valid infix constructor name, and shows the first error it got. If instead we first check if the infix op is valid in pattern context, the error message becomes much clearer: Main.hs:2:3: error: Parse error in pattern: f $ do a <- return 3 c Possibly caused by a missing 'do'? | 2 | f $ do | ^^^^^^... This may not entirely fix #11188 but I think it's an improvement. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11188 Differential Revision: https://phabricator.haskell.org/D4497 >--------------------------------------------------------------- cb6d8589c83247ec96d5faa82df3e93f419bbfe0 compiler/parser/RdrHsSyn.hs | 13 +++++++------ testsuite/tests/parser/should_fail/InfixAppPatErr.hs | 5 +++++ testsuite/tests/parser/should_fail/InfixAppPatErr.stderr | 4 ++++ testsuite/tests/parser/should_fail/all.T | 2 ++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index e2943c8..dc35c12 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -984,12 +984,13 @@ checkAPat msg loc e0 = do | extopt LangExt.NPlusKPatterns opts && (plus == plus_RDR) -> return (mkNPlusKPat (L nloc n) (L lloc lit)) - OpApp l op _fix r -> do l <- checkLPat msg l - r <- checkLPat msg r - case op of - L cl (HsVar (L _ c)) | isDataOcc (rdrNameOcc c) - -> return (ConPatIn (L cl c) (InfixCon l r)) - _ -> patFail msg loc e0 + OpApp l (L cl (HsVar (L _ c))) _fix r + | isDataOcc (rdrNameOcc c) -> do + l <- checkLPat msg l + r <- checkLPat msg r + return (ConPatIn (L cl c) (InfixCon l r)) + + OpApp _l _op _fix _r -> patFail msg loc e0 HsPar e -> checkLPat msg e >>= (return . ParPat) ExplicitList _ _ es -> do ps <- mapM (checkLPat msg) es diff --git a/testsuite/tests/parser/should_fail/InfixAppPatErr.hs b/testsuite/tests/parser/should_fail/InfixAppPatErr.hs new file mode 100644 index 0000000..5a56f71 --- /dev/null +++ b/testsuite/tests/parser/should_fail/InfixAppPatErr.hs @@ -0,0 +1,5 @@ +main = do + f $ do + a <- return 3 + c <- do + return 5 diff --git a/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr b/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr new file mode 100644 index 0000000..69839e3 --- /dev/null +++ b/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr @@ -0,0 +1,4 @@ + +InfixAppPatErr.hs:2:3: error: + Parse error in pattern: f $ do a <- return 3 c + Possibly caused by a missing 'do'? diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 2cb9c49..d47e0f5 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -115,3 +115,5 @@ test('NumericUnderscoresFail0', grep_errmsg(r'^NumericUnderscoresFail0.hs:'), compile_fail, ['']) test('NumericUnderscoresFail1', grep_errmsg(r'^NumericUnderscoresFail1.hs:'), compile_fail, ['']) + +test('InfixAppPatErr', normal, compile_fail, ['']) From git at git.haskell.org Sat Mar 17 12:22:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 17 Mar 2018 12:22:47 +0000 (UTC) Subject: [commit: ghc] master: aclocal.m4: allow more GNU/Hurd tuples (1522cf0) Message-ID: <20180317122247.80CD73A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1522cf05c9c3e9afd3ef9c7f3f419460c41488d9/ghc >--------------------------------------------------------------- commit 1522cf05c9c3e9afd3ef9c7f3f419460c41488d9 Author: Sergei Trofimovich Date: Sat Mar 17 12:12:43 2018 +0000 aclocal.m4: allow more GNU/Hurd tuples Running plain ./configure fails on hurd because ./config.guess reports unrecognised tuple: $ ./config.guess i686-unknown-gnu0.9 The change makes the following target configure: $ ./configure --target=i686-unknown-gnu0.9 Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 1522cf05c9c3e9afd3ef9c7f3f419460c41488d9 aclocal.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 528fd0c..04a6bf5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1950,6 +1950,9 @@ AC_DEFUN([GHC_CONVERT_VENDOR],[ # converts os from gnu to ghc naming, and assigns the result to $target_var AC_DEFUN([GHC_CONVERT_OS],[ case "$1" in + gnu*) # e.g. i686-unknown-gnu0.9 + $3="gnu" + ;; # watchos and tvos are ios variants as of May 2017. ios|watchos|tvos) $3="ios" @@ -1964,7 +1967,7 @@ AC_DEFUN([GHC_CONVERT_OS],[ $3="openbsd" ;; # As far as I'm aware, none of these have relevant variants - freebsd|netbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|haiku) + freebsd|netbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|nextstep2|nextstep3|sunos4|ultrix|haiku) $3="$1" ;; aix*) # e.g. powerpc-ibm-aix7.1.3.0 From git at git.haskell.org Sat Mar 17 17:20:18 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 17 Mar 2018 17:20:18 +0000 (UTC) Subject: [commit: ghc] master: aclocal.m4: add OSHurd (debian patch) (0693b0b) Message-ID: <20180317172018.142D83A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0693b0b0500236a3dec933350a13f1b0e8c1cb54/ghc >--------------------------------------------------------------- commit 0693b0b0500236a3dec933350a13f1b0e8c1cb54 Author: Sergei Trofimovich Date: Sat Mar 17 17:12:04 2018 +0000 aclocal.m4: add OSHurd (debian patch) ghc treats OSUnknown (and GNU/Hurd) as non-ELF target. This causes panic in native codegenerator when trying to build PIC code: ``` ... -- all other platforms howToAccessLabel dflags _ _ _ _ _ | not (positionIndependent dflags) = AccessDirectly | otherwise = panic "howToAccessLabel: PIC not defined for this platform" ``` This change declares new 'OSHurd' and marks it as an ELF target. Fixes building ghc-stage2 on i686-unknown-gnu0.9. Patch provided by "Pino" via Samuel Thibault and taken from debian. Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 0693b0b0500236a3dec933350a13f1b0e8c1cb54 aclocal.m4 | 5 ++++- compiler/utils/Platform.hs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 04a6bf5..58d43e1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -272,12 +272,15 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS], nto-qnx) test -z "[$]2" || eval "[$]2=OSQNXNTO" ;; - dragonfly|hpux|linuxaout|freebsd2|gnu|nextstep2|nextstep3|sunos4|ultrix) + dragonfly|hpux|linuxaout|freebsd2|nextstep2|nextstep3|sunos4|ultrix) test -z "[$]2" || eval "[$]2=OSUnknown" ;; aix) test -z "[$]2" || eval "[$]2=OSAIX" ;; + gnu) + test -z "[$]2" || eval "[$]2=OSHurd" + ;; *) echo "Unknown OS '[$]1'" exit 1 diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs index c313870..449a62a 100644 --- a/compiler/utils/Platform.hs +++ b/compiler/utils/Platform.hs @@ -87,6 +87,7 @@ data OS | OSHaiku | OSQNXNTO | OSAIX + | OSHurd deriving (Read, Show, Eq) -- | ARM Instruction Set Architecture, Extensions and ABI @@ -136,6 +137,7 @@ osElfTarget OSKFreeBSD = True osElfTarget OSHaiku = True osElfTarget OSQNXNTO = False osElfTarget OSAIX = False +osElfTarget OSHurd = True osElfTarget OSUnknown = False -- Defaulting to False is safe; it means don't rely on any -- ELF-specific functionality. It is important to have a default for From git at git.haskell.org Mon Mar 19 00:21:25 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 00:21:25 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T14068-inline' deleted Message-ID: <20180319002125.36F143A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/T14068-inline From git at git.haskell.org Mon Mar 19 00:21:27 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 00:21:27 +0000 (UTC) Subject: [commit: ghc] wip/T14068's head updated: Revert "Prevent inlining of loopified programs" (20b00bd) Message-ID: <20180319002127.6486F3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/T14068' now includes: 20b00bd Revert "Prevent inlining of loopified programs" From git at git.haskell.org Mon Mar 19 11:32:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 11:32:45 +0000 (UTC) Subject: [commit: ghc] master: Comments and tiny refactor (2a3702d) Message-ID: <20180319113245.493413A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2a3702d8950ebdec27357e08caae3b1cd4f8b00d/ghc >--------------------------------------------------------------- commit 2a3702d8950ebdec27357e08caae3b1cd4f8b00d Author: Simon Peyton Jones Date: Mon Mar 19 09:39:58 2018 +0000 Comments and tiny refactor Related to Ryan's upcoming patch for Trac #14933 >--------------------------------------------------------------- 2a3702d8950ebdec27357e08caae3b1cd4f8b00d compiler/iface/IfaceType.hs | 5 ++++- compiler/iface/TcIface.hs | 18 +++++++++++------- compiler/typecheck/TcTypeNats.hs | 9 +++++++++ compiler/types/TyCoRep.hs | 9 +++++---- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs index 0c5922e..d0adce9 100644 --- a/compiler/iface/IfaceType.hs +++ b/compiler/iface/IfaceType.hs @@ -257,6 +257,10 @@ data IfaceCoercion | IfaceForAllCo IfaceTvBndr IfaceCoercion IfaceCoercion | IfaceCoVarCo IfLclName | IfaceAxiomInstCo IfExtName BranchIndex [IfaceCoercion] + | IfaceAxiomRuleCo IfLclName [IfaceCoercion] + -- There are only a fixed number of CoAxiomRules, so it suffices + -- to use an IfaceLclName to distinguish them. + -- See Note [Adding built-in type families] in TcTypeNats | IfaceUnivCo IfaceUnivCoProv Role IfaceType IfaceType | IfaceSymCo IfaceCoercion | IfaceTransCo IfaceCoercion IfaceCoercion @@ -266,7 +270,6 @@ data IfaceCoercion | IfaceCoherenceCo IfaceCoercion IfaceCoercion | IfaceKindCo IfaceCoercion | IfaceSubCo IfaceCoercion - | IfaceAxiomRuleCo IfLclName [IfaceCoercion] | IfaceFreeCoVar CoVar -- See Note [Free tyvars in IfaceType] | IfaceHoleCo CoVar -- ^ See Note [Holes in IfaceCoercion] diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index 70438f6..7d69436 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -1359,7 +1359,7 @@ tcIfaceCo = go <*> go c2 go (IfaceKindCo c) = KindCo <$> go c go (IfaceSubCo c) = SubCo <$> go c - go (IfaceAxiomRuleCo ax cos) = AxiomRuleCo <$> go_axiom_rule ax + go (IfaceAxiomRuleCo ax cos) = AxiomRuleCo <$> tcIfaceCoAxiomRule ax <*> mapM go cos go (IfaceFreeCoVar c) = pprPanic "tcIfaceCo:IfaceFreeCoVar" (ppr c) go (IfaceHoleCo c) = pprPanic "tcIfaceCo:IfaceHoleCo" (ppr c) @@ -1367,12 +1367,6 @@ tcIfaceCo = go go_var :: FastString -> IfL CoVar go_var = tcIfaceLclId - go_axiom_rule :: FastString -> IfL CoAxiomRule - go_axiom_rule n = - case Map.lookup n typeNatCoAxiomRules of - Just ax -> return ax - _ -> pprPanic "go_axiom_rule" (ppr n) - tcIfaceUnivCoProv :: IfaceUnivCoProv -> IfL UnivCoProvenance tcIfaceUnivCoProv IfaceUnsafeCoerceProv = return UnsafeCoerceProv tcIfaceUnivCoProv (IfacePhantomProv kco) = PhantomProv <$> tcIfaceCo kco @@ -1808,6 +1802,16 @@ tcIfaceCoAxiom :: Name -> IfL (CoAxiom Branched) tcIfaceCoAxiom name = do { thing <- tcIfaceImplicit name ; return (tyThingCoAxiom thing) } + +tcIfaceCoAxiomRule :: IfLclName -> IfL CoAxiomRule +-- Unlike CoAxioms, which arise form user 'type instance' declarations, +-- there are a fixed set of CoAxiomRules, +-- currently enumerated in typeNatCoAxiomRules +tcIfaceCoAxiomRule n + = case Map.lookup n typeNatCoAxiomRules of + Just ax -> return ax + _ -> pprPanic "go_axiom_rule" (ppr n) + tcIfaceDataCon :: Name -> IfL DataCon tcIfaceDataCon name = do { thing <- tcIfaceGlobal name ; case thing of diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 78e0b96..139f624 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -1,5 +1,14 @@ {-# LANGUAGE LambdaCase #-} +{- Note [Type-level natural numbers] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See the Wiki page: + + https://ghc.haskell.org/trac/ghc/wiki/TypeNats + +and Note [Adding built-in type families] +-} + module TcTypeNats ( typeNatTyCons , typeNatCoAxiomRules diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 588963d..cc42599 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -814,16 +814,17 @@ data Coercion -- any left over, we use AppCo. -- See [Coercion axioms applied to coercions] + | AxiomRuleCo CoAxiomRule [Coercion] + -- AxiomRuleCo is very like AxiomInstCo, but for a CoAxiomRule + -- The number coercions should match exactly the expectations + -- of the CoAxiomRule (i.e., the rule is fully saturated). + | UnivCo UnivCoProvenance Role Type Type -- :: _ -> "e" -> _ -> _ -> e | SymCo Coercion -- :: e -> e | TransCo Coercion Coercion -- :: e -> e -> e - -- The number coercions should match exactly the expectations - -- of the CoAxiomRule (i.e., the rule is fully saturated). - | AxiomRuleCo CoAxiomRule [Coercion] - | NthCo Int Coercion -- Zero-indexed; decomposes (T t0 ... tn) -- :: _ -> e -> ?? (inverse of TyConAppCo, see Note [TyConAppCo roles]) -- Using NthCo on a ForAllCo gives an N coercion always From git at git.haskell.org Mon Mar 19 12:38:42 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 12:38:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: rel-notes: Fix typo (5a1cfa6) Message-ID: <20180319123842.CE2743A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/5a1cfa650e0af4d87aecd6aa6d9685a5fc021ee6/ghc >--------------------------------------------------------------- commit 5a1cfa650e0af4d87aecd6aa6d9685a5fc021ee6 Author: Ben Gamari Date: Wed Mar 7 22:17:18 2018 -0500 rel-notes: Fix typo Thanks to Gabor for pointing this out. >--------------------------------------------------------------- 5a1cfa650e0af4d87aecd6aa6d9685a5fc021ee6 docs/users_guide/8.4.1-notes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/8.4.1-notes.rst b/docs/users_guide/8.4.1-notes.rst index b25d184..182ba07 100644 --- a/docs/users_guide/8.4.1-notes.rst +++ b/docs/users_guide/8.4.1-notes.rst @@ -24,7 +24,8 @@ The highlights, since the 8.2.1 release, are: - Further improvements in code generation -- Incoporation of library changes including the Phase 2 of the Semigroup-Monoid Proposal +- Incorporation of library changes including the Phase 2 of the Semigroup-Monoid + Proposal - A variety of Windows compatibility improvements From git at git.haskell.org Mon Mar 19 12:38:45 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 12:38:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: configure: Set RELEASE=NO (e1b2bd0) Message-ID: <20180319123845.98A463A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/e1b2bd01433c07e5ee87185b73b74932127d9248/ghc >--------------------------------------------------------------- commit e1b2bd01433c07e5ee87185b73b74932127d9248 Author: Ben Gamari Date: Thu Mar 8 14:09:36 2018 -0500 configure: Set RELEASE=NO >--------------------------------------------------------------- e1b2bd01433c07e5ee87185b73b74932127d9248 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 30241a5..77a22b7 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.1], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO -: ${RELEASE=YES} +: ${RELEASE=NO} # 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 Mon Mar 19 12:38:48 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 12:38:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.4: configure: Accept version suffix in solaris name (d7c5ec0) Message-ID: <20180319123848.6052C3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.4 Link : http://ghc.haskell.org/trac/ghc/changeset/d7c5ec0c28a45ea22c5901a152cbc9123a07564c/ghc >--------------------------------------------------------------- commit d7c5ec0c28a45ea22c5901a152cbc9123a07564c Author: Ben Gamari Date: Thu Mar 8 15:26:09 2018 -0500 configure: Accept version suffix in solaris name OpenIndiana apparently reports a triple of i386-pc-solaris2.11. >--------------------------------------------------------------- d7c5ec0c28a45ea22c5901a152cbc9123a07564c aclocal.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index c02c1d1..91cdd40 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1976,7 +1976,7 @@ AC_DEFUN([GHC_CONVERT_OS],[ $3="linux" ;; # As far as I'm aware, none of these have relevant variants - freebsd|netbsd|openbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|haiku) + freebsd|netbsd|openbsd|dragonfly|hpux|linuxaout|kfreebsdgnu|freebsd2|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|haiku) $3="$1" ;; aix*) # e.g. powerpc-ibm-aix7.1.3.0 @@ -1985,6 +1985,9 @@ AC_DEFUN([GHC_CONVERT_OS],[ darwin*) # e.g. aarch64-apple-darwin14 $3="darwin" ;; + solaris2*) + $3="solaris2" + ;; freebsd*) # like i686-gentoo-freebsd7 # i686-gentoo-freebsd8 # i686-gentoo-freebsd8.2 From git at git.haskell.org Mon Mar 19 12:49:11 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 12:49:11 +0000 (UTC) Subject: [commit: ghc] master: Update test for #5129: (5a1ad23) Message-ID: <20180319124911.B4A603A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5a1ad231fc871f27f2811ae46285a79573d8dfae/ghc >--------------------------------------------------------------- commit 5a1ad231fc871f27f2811ae46285a79573d8dfae Author: Ömer Sinan Ağacan Date: Mon Mar 19 15:46:44 2018 +0300 Update test for #5129: Make sure it runs with --fast validate with correct optimisation settings (-O1 or above) so that it actually tests the bug. Because the bug is in the simplifier running it with -O0 doesn't test it. >--------------------------------------------------------------- 5a1ad231fc871f27f2811ae46285a79573d8dfae testsuite/tests/codeGen/should_run/all.T | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 9403c4b..cf4904e 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -90,7 +90,13 @@ test('T3677', extra_run_opts('+RTS -K8k -RTS'), compile_and_run, ['']) test('T4441', normal, compile_and_run, ['']) test('T5149', omit_ways(['ghci']), multi_compile_and_run, ['T5149', [('T5149_cmm.cmm', '')], '']) -test('T5129', normal, compile_and_run, ['']) + +test('T5129', + # The bug is in simplifier when run with -O1 and above, so only run it + # optimised, using any backend. + [ only_ways(['optasm']), expect_broken(5129) ], + compile_and_run, ['']) + test('T5626', exit_code(1), compile_and_run, ['']) test('T5747', when(arch('i386'), extra_hc_opts('-msse2')), compile_and_run, ['-O2']) test('T5785', normal, compile_and_run, ['']) From git at git.haskell.org Mon Mar 19 12:51:57 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 12:51:57 +0000 (UTC) Subject: [commit: ghc] : Set RELEASE=YES, version 8.4.1 (f31c40e) Message-ID: <20180319125157.B14633A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : Link : http://ghc.haskell.org/trac/ghc/changeset/f31c40efdc918bc9da8a325327ba5a472bd6ea9e/ghc >--------------------------------------------------------------- commit f31c40efdc918bc9da8a325327ba5a472bd6ea9e Author: Ben Gamari Date: Sun Mar 4 13:53:54 2018 -0500 Set RELEASE=YES, version 8.4.1 >--------------------------------------------------------------- f31c40efdc918bc9da8a325327ba5a472bd6ea9e configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 57d76b4..30241a5 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.4.0], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.4.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 Mon Mar 19 16:37:20 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:37:20 +0000 (UTC) Subject: [commit: ghc] master: Add a build with 32bit Ubuntu container (f9a6d42) Message-ID: <20180319163720.669CA3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f9a6d4207fb0e551821fee847ac064ac31d96bba/ghc >--------------------------------------------------------------- commit f9a6d4207fb0e551821fee847ac064ac31d96bba Author: mrkkrp Date: Wed Feb 28 18:18:58 2018 +0700 Add a build with 32bit Ubuntu container >--------------------------------------------------------------- f9a6d4207fb0e551821fee847ac064ac31d96bba .circleci/config.yml | 24 ++++++++++++++++++++++++ .circleci/images/i386-linux/Dockerfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b4a9947..2868f8d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,11 @@ aliases: run: name: Configure command: ./configure + - &configure_unix_32 + run: + name: Configure + command: | + setarch i386 ./configure --with-ghc=/opt/ghc-i386/8.2.2/bin/ghc - &configure_bsd run: name: Configure @@ -207,6 +212,24 @@ jobs: - *make - *test + "validate-i386-linux": + resource_class: xlarge + docker: + - image: mrkkrp/ghcci-i386-linux:0.0.1 + environment: + <<: *buildenv + steps: + - checkout + - *prepare + - *submodules + - *boot + - *configure_unix_32 + - *make + - *test + - *bindist + - *collectartifacts + - *storeartifacts + workflows: version: 2 validate: @@ -216,6 +239,7 @@ workflows: # - validate-x86_64-freebsd - validate-x86_64-darwin - validate-x86_64-linux-llvm + - validate-i386-linux - validate-hadrian-x86_64-linux nightly: diff --git a/.circleci/images/i386-linux/Dockerfile b/.circleci/images/i386-linux/Dockerfile new file mode 100644 index 0000000..7d3e968 --- /dev/null +++ b/.circleci/images/i386-linux/Dockerfile @@ -0,0 +1,30 @@ +# This Dockerfile tries to replicate haskell:8.2 a bit, but it does so on +# top of i368/debian:jessie instead of debian:jessie because I had troubles +# making i386 GHC bindist working there. + +FROM i386/debian:jessie + +ENV LANG C.UTF-8 + +# Install the necessary packages, including HVR stuff. +RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 +RUN apt-get update -qq +RUN apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo curl zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ cabal-install-2.0 ghc-8.2.2 happy-1.19.5 alex-3.1.7 +ENV PATH /opt/cabal/2.0/bin:/opt/ghc/8.2.2/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH + +# Get i386 GHC bindist for 32 bit CI builds. +RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-i386-deb8-linux.tar.xz | tar -Jx +RUN cd /tmp/ghc-8.2.2 && setarch i386 ./configure --prefix=/opt/ghc-i386/8.2.2 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux +RUN cd /tmp/ghc-8.2.2 && make install +RUN rm -rf /tmp/ghc-8.2.2 +ENV PATH /opt/ghc-i386/8.2.2/bin:$PATH + +# Create a normal user. +RUN adduser ghc --gecos "GHC builds" --disabled-password +RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc +USER ghc + +WORKDIR /home/ghc/ + +CMD ["bash"] From git at git.haskell.org Mon Mar 19 16:37:34 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:37:34 +0000 (UTC) Subject: [commit: ghc] master: rts: Add --internal-counters RTS flag and several counters (2918abf) Message-ID: <20180319163734.A07613A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2918abf75594001deed51ee252a05b146f844489/ghc >--------------------------------------------------------------- commit 2918abf75594001deed51ee252a05b146f844489 Author: Douglas Wilson Date: Mon Mar 19 11:55:37 2018 -0400 rts: Add --internal-counters RTS flag and several counters The existing internal counters: * gc_alloc_block_sync * whitehole_spin * gen[g].sync * gen[1].sync are now not shown in the -s report unless --internal-counters is also passed. If --internal-counters is passed we now show the counters above, reformatted, as well as several other counters. In particular, we now count the yieldThread() calls that SpinLocks do as well as their spins. The added counters are: * gc_spin (spin and yield) * mut_spin (spin and yield) * whitehole_threadPaused (spin only) * whitehole_executeMessage (spin only) * whitehole_lockClosure (spin only) * waitForGcThreadsd (spin and yield) As well as the following, which are not SpinLock-like things: * any_work * do_work * scav_find_work See the Note for descriptions of what these counters are. We add busy_wait_nops in these loops along with the counter increment where it was absent. Old internal counters output: ``` gc_alloc_block_sync: 0 whitehole_gc_spin: 0 gen[0].sync: 0 gen[1].sync: 0 ``` New internal counters output: ``` Internal Counters: Spins Yields gc_alloc_block_sync 323 0 gc_spin 9016713 752 mut_spin 57360944 47716 whitehole_gc 0 n/a whitehole_threadPaused 0 n/a whitehole_executeMessage 0 n/a whitehole_lockClosure 0 0 waitForGcThreads 2 415 gen[0].sync 6 0 gen[1].sync 1 0 any_work 2017 no_work 2014 scav_find_work 1004 ``` Test Plan: ./validate Check it builds with #define PROF_SPIN removed from includes/rts/Config.h Reviewers: bgamari, erikd, simonmar, hvr Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #3553, #9221 Differential Revision: https://phabricator.haskell.org/D4302 >--------------------------------------------------------------- 2918abf75594001deed51ee252a05b146f844489 docs/users_guide/runtime_control.rst | 6 +- includes/RtsAPI.h | 24 ++++ includes/rts/Flags.h | 1 + includes/rts/SpinLock.h | 5 +- includes/rts/storage/GC.h | 2 +- libraries/base/GHC/RTS/Flags.hsc | 3 + rts/Messages.c | 3 + rts/Messages.h | 4 + rts/RtsFlags.c | 6 + rts/SMPClosureOps.h | 12 ++ rts/Stats.c | 189 ++++++++++++++++++++++++++-- rts/Stats.h | 5 +- rts/StgMiscClosures.cmm | 10 ++ rts/ThreadPaused.c | 4 + rts/ThreadPaused.h | 8 ++ rts/sm/Evac.c | 9 +- rts/sm/GC.c | 71 ++++++++--- rts/sm/GC.h | 2 + testsuite/tests/rts/InternalCounters.stdout | 1 + testsuite/tests/rts/Makefile | 19 +-- testsuite/tests/rts/all.T | 2 + 21 files changed, 346 insertions(+), 40 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 2918abf75594001deed51ee252a05b146f844489 From git at git.haskell.org Mon Mar 19 16:37:47 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:37:47 +0000 (UTC) Subject: [commit: ghc] master: Also check local rules with -frules-check (3d378d9) Message-ID: <20180319163747.EE11B3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3d378d983a28d3650220180e1524c63fb2f4c747/ghc >--------------------------------------------------------------- commit 3d378d983a28d3650220180e1524c63fb2f4c747 Author: Matthew Pickering Date: Mon Mar 19 11:57:06 2018 -0400 Also check local rules with -frules-check Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4255 >--------------------------------------------------------------- 3d378d983a28d3650220180e1524c63fb2f4c747 compiler/simplCore/SimplCore.hs | 7 +++++-- compiler/specialise/Rules.hs | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 0a20eb0..bf69964 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -17,7 +17,8 @@ import CoreSyn import HscTypes import CSE ( cseProgram ) import Rules ( mkRuleBase, unionRuleBase, - extendRuleBaseList, ruleCheckProgram, addRuleInfo, ) + extendRuleBaseList, ruleCheckProgram, addRuleInfo, + getRules ) import PprCore ( pprCoreBindings, pprCoreExpr ) import OccurAnal ( occurAnalysePgm, occurAnalyseExpr ) import IdInfo @@ -516,10 +517,12 @@ ruleCheckPass current_phase pat guts = { rb <- getRuleBase ; dflags <- getDynFlags ; vis_orphs <- getVisibleOrphanMods + ; let rule_fn fn = getRules (RuleEnv rb vis_orphs) fn + ++ (mg_rules guts) ; liftIO $ putLogMsg dflags NoReason Err.SevDump noSrcSpan (defaultDumpStyle dflags) (ruleCheckProgram current_phase pat - (RuleEnv rb vis_orphs) (mg_binds guts)) + rule_fn (mg_binds guts)) ; return guts } doPassDUM :: (DynFlags -> UniqSupply -> CoreProgram -> IO CoreProgram) -> ModGuts -> CoreM ModGuts diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index 319404e..b602595 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -1148,10 +1148,10 @@ is so important. -- string for the purposes of error reporting ruleCheckProgram :: CompilerPhase -- ^ Rule activation test -> String -- ^ Rule pattern - -> RuleEnv -- ^ Database of rules + -> (Id -> [CoreRule]) -- ^ Rules for an Id -> CoreProgram -- ^ Bindings to check in -> SDoc -- ^ Resulting check message -ruleCheckProgram phase rule_pat rule_base binds +ruleCheckProgram phase rule_pat rules binds | isEmptyBag results = text "Rule check results: no rule application sites" | otherwise @@ -1164,7 +1164,7 @@ ruleCheckProgram phase rule_pat rule_base binds , rc_id_unf = idUnfolding -- Not quite right -- Should use activeUnfolding , rc_pattern = rule_pat - , rc_rule_base = rule_base } + , rc_rules = rules } results = unionManyBags (map (ruleCheckBind env) binds) line = text (replicate 20 '-') @@ -1172,7 +1172,7 @@ data RuleCheckEnv = RuleCheckEnv { rc_is_active :: Activation -> Bool, rc_id_unf :: IdUnfoldingFun, rc_pattern :: String, - rc_rule_base :: RuleEnv + rc_rules :: Id -> [CoreRule] } ruleCheckBind :: RuleCheckEnv -> CoreBind -> Bag SDoc @@ -1206,7 +1206,7 @@ ruleCheckFun env fn args | null name_match_rules = emptyBag | otherwise = unitBag (ruleAppCheck_help env fn args name_match_rules) where - name_match_rules = filter match (getRules (rc_rule_base env) fn) + name_match_rules = filter match (rc_rules env fn) match rule = (rc_pattern env) `isPrefixOf` unpackFS (ruleName rule) ruleAppCheck_help :: RuleCheckEnv -> Id -> [CoreExpr] -> [CoreRule] -> SDoc From git at git.haskell.org Mon Mar 19 16:38:01 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:38:01 +0000 (UTC) Subject: [commit: ghc] master: Be more selective in which conditionals we invert (39c7406) Message-ID: <20180319163801.48CDF3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39c740636dfc7ce4b5590fa60adc6d5ecf5a79b6/ghc >--------------------------------------------------------------- commit 39c740636dfc7ce4b5590fa60adc6d5ecf5a79b6 Author: Simon Marlow Date: Mon Mar 19 11:57:27 2018 -0400 Be more selective in which conditionals we invert Test Plan: validate Reviewers: bgamari, AndreasK, erikd Reviewed By: AndreasK Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4398 >--------------------------------------------------------------- 39c740636dfc7ce4b5590fa60adc6d5ecf5a79b6 compiler/cmm/CmmOpt.hs | 8 ------- compiler/cmm/CmmSink.hs | 55 +++++++++++++++++++++++++++++------------------- compiler/cmm/CmmUtils.hs | 10 ++++++++- 3 files changed, 42 insertions(+), 31 deletions(-) diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index 6b4d792..e837d29 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -422,14 +422,6 @@ That's what the constant-folding operations on comparison operators do above. -- ----------------------------------------------------------------------------- -- Utils -isLit :: CmmExpr -> Bool -isLit (CmmLit _) = True -isLit _ = False - -isComparisonExpr :: CmmExpr -> Bool -isComparisonExpr (CmmMachOp op _) = isComparisonMachOp op -isComparisonExpr _ = False - isPicReg :: CmmExpr -> Bool isPicReg (CmmReg (CmmGlobal PicBaseReg)) = True isPicReg _ = False diff --git a/compiler/cmm/CmmSink.hs b/compiler/cmm/CmmSink.hs index 487f0bc..c939736 100644 --- a/compiler/cmm/CmmSink.hs +++ b/compiler/cmm/CmmSink.hs @@ -458,17 +458,7 @@ tryToInline dflags live node assigs = go usages node emptyLRegSet assigs occurs_once = not l_live && l_usages == Just 1 occurs_none = not l_live && l_usages == Nothing - inl_node = case mapExpDeep inl_exp node of - -- See Note [Improving conditionals] - CmmCondBranch (CmmMachOp (MO_Ne w) args) - ti fi l - -> CmmCondBranch (cmmMachOpFold dflags (MO_Eq w) args) - fi ti (inv_likeliness l) - node' -> node' - - inv_likeliness :: Maybe Bool -> Maybe Bool - inv_likeliness Nothing = Nothing - inv_likeliness (Just l) = Just (not l) + inl_node = improveConditional (mapExpDeep inl_exp node) inl_exp :: CmmExpr -> CmmExpr -- inl_exp is where the inlining actually takes place! @@ -479,22 +469,43 @@ tryToInline dflags live node assigs = go usages node emptyLRegSet assigs inl_exp (CmmMachOp op args) = cmmMachOpFold dflags op args inl_exp other = other -{- Note [Improving conditionals] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Given - CmmCondBranch ((a >## b) != 1) t f -where a,b, are Floats, the constant folder /cannot/ turn it into - CmmCondBranch (a <=## b) t f -because comparison on floats are not invertible -(see CmmMachOp.maybeInvertComparison). -What we want instead is simply to reverse the true/false branches thus +{- Note [improveConditional] + +cmmMachOpFold tries to simplify conditionals to turn things like + (a == b) != 1 +into + (a != b) +but there's one case it can't handle: when the comparison is over +floating-point values, we can't invert it, because floating-point +comparisions aren't invertible (because NaN). + +But we *can* optimise this conditional by swapping the true and false +branches. Given CmmCondBranch ((a >## b) != 1) t f ---> +we can turn it into CmmCondBranch (a >## b) f t -And we do that right here in tryToInline, just as we do cmmMachOpFold. +So here we catch conditionals that weren't optimised by cmmMachOpFold, +and apply above transformation to eliminate the comparison against 1. + +It's tempting to just turn every != into == and then let cmmMachOpFold +do its thing, but that risks changing a nice fall-through conditional +into one that requires two jumps. (see swapcond_last in +CmmContFlowOpt), so instead we carefully look for just the cases where +we can eliminate a comparison. -} +improveConditional :: CmmNode O x -> CmmNode O x +improveConditional + (CmmCondBranch (CmmMachOp mop [x, CmmLit (CmmInt 1 _)]) t f l) + | neLike mop, isComparisonExpr x + = CmmCondBranch x f t (fmap not l) + where + neLike (MO_Ne _) = True + neLike (MO_U_Lt _) = True -- (x Bool +isLit (CmmLit _) = True +isLit _ = False + +isComparisonExpr :: CmmExpr -> Bool +isComparisonExpr (CmmMachOp op _) = isComparisonMachOp op +isComparisonExpr _ = False + --------------------------------------------------- -- -- Tagging From git at git.haskell.org Mon Mar 19 16:38:15 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:38:15 +0000 (UTC) Subject: [commit: ghc] master: Improve the warning message of qualified unused imports. (fad822e) Message-ID: <20180319163815.B7C7D3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fad822e2a5aa4373c3aa64e913e51fd5509c3f67/ghc >--------------------------------------------------------------- commit fad822e2a5aa4373c3aa64e913e51fd5509c3f67 Author: HE, Tao Date: Mon Mar 19 11:58:26 2018 -0400 Improve the warning message of qualified unused imports. Pretty-print unused imported names unqualified unconditionally to make the warning message consistent for ambiguous/unambiguous identifiers. Signed-off-by: HE, Tao Test Plan: make test TEST="T14881" Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, carter GHC Trac Issues: #14881 Differential Revision: https://phabricator.haskell.org/D4461 >--------------------------------------------------------------- fad822e2a5aa4373c3aa64e913e51fd5509c3f67 compiler/basicTypes/Name.hs | 6 +++++- compiler/rename/RnNames.hs | 7 +++++-- testsuite/tests/rename/should_compile/T14881.hs | 5 +++++ testsuite/tests/rename/should_compile/T14881.stderr | 6 ++++++ testsuite/tests/rename/should_compile/T14881Aux.hs | 13 +++++++++++++ testsuite/tests/rename/should_compile/all.T | 1 + 6 files changed, 35 insertions(+), 3 deletions(-) diff --git a/compiler/basicTypes/Name.hs b/compiler/basicTypes/Name.hs index 02eb067..6941dd9 100644 --- a/compiler/basicTypes/Name.hs +++ b/compiler/basicTypes/Name.hs @@ -70,7 +70,7 @@ module Name ( NamedThing(..), getSrcLoc, getSrcSpan, getOccString, getOccFS, - pprInfixName, pprPrefixName, pprModulePrefix, + pprInfixName, pprPrefixName, pprModulePrefix, pprNameUnqualified, nameStableString, -- Re-export the OccName stuff @@ -535,6 +535,10 @@ pprName (Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) System -> pprSystem sty uniq occ Internal -> pprInternal sty uniq occ +-- | Print the string of Name unqualifiedly directly. +pprNameUnqualified :: Name -> SDoc +pprNameUnqualified Name { n_occ = occ } = ppr_occ_name occ + pprExternal :: PprStyle -> Unique -> Module -> OccName -> Bool -> BuiltInSyntax -> SDoc pprExternal sty uniq mod occ is_wired is_builtin | codeStyle sty = ppr mod <> char '_' <> ppr_z_occ_name occ diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 769b34e..af00056 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1401,9 +1401,12 @@ warnUnusedImport flag fld_env (L loc decl, used, unused) pp_mod = ppr (unLoc (ideclName decl)) pp_not_used = text "is redundant" + -- In warning message, pretty-print identifiers unqualified unconditionally + -- to improve the consistent for ambiguous/unambiguous identifiers. + -- See trac#14881. ppr_possible_field n = case lookupNameEnv fld_env n of - Just (fld, p) -> ppr p <> parens (ppr fld) - Nothing -> ppr n + Just (fld, p) -> pprNameUnqualified p <> parens (ppr fld) + Nothing -> pprNameUnqualified n -- Print unused names in a deterministic (lexicographic) order sort_unused = pprWithCommas ppr_possible_field $ diff --git a/testsuite/tests/rename/should_compile/T14881.hs b/testsuite/tests/rename/should_compile/T14881.hs new file mode 100644 index 0000000..c1b955c --- /dev/null +++ b/testsuite/tests/rename/should_compile/T14881.hs @@ -0,0 +1,5 @@ +module T14881 where + +import qualified T14881Aux as Aux (L(Cons), x, tail, adjust, length) + +x = Aux.Cons diff --git a/testsuite/tests/rename/should_compile/T14881.stderr b/testsuite/tests/rename/should_compile/T14881.stderr new file mode 100644 index 0000000..bfb6ca9 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T14881.stderr @@ -0,0 +1,6 @@ +[1 of 2] Compiling T14881Aux ( T14881Aux.hs, T14881Aux.o ) +[2 of 2] Compiling T14881 ( T14881.hs, T14881.o ) + +T14881.hs:3:1: warning: [-Wunused-imports (in -Wextra)] + The qualified import of ‘adjust, length, L(tail), L(x)’ + from module ‘T14881Aux’ is redundant diff --git a/testsuite/tests/rename/should_compile/T14881Aux.hs b/testsuite/tests/rename/should_compile/T14881Aux.hs new file mode 100644 index 0000000..13b8f31 --- /dev/null +++ b/testsuite/tests/rename/should_compile/T14881Aux.hs @@ -0,0 +1,13 @@ +module T14881Aux where + +-- unambiguous function name. +adjust :: () +adjust = undefined + +-- ambiguous function name. +length :: () +length = undefined + +data L = Cons { x :: Int -- unambiguous field selector + , tail :: [Int] -- ambiguous field selector + } diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 4eb584f..80bcb09 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -153,3 +153,4 @@ test('T12548', normal, compile, ['']) test('T13132', normal, compile, ['']) test('T13646', normal, compile, ['']) test('LookupSub', [], multimod_compile, ['LookupSub', '-v0']) +test('T14881', [], multimod_compile, ['T14881', '-W']) From git at git.haskell.org Mon Mar 19 16:38:29 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:38:29 +0000 (UTC) Subject: [commit: ghc] master: Get rid of more CPP in cmm/ and codeGen/ (0db0e46) Message-ID: <20180319163829.332EC3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0db0e46c40a3a2af71f23033aa09a142d43b8538/ghc >--------------------------------------------------------------- commit 0db0e46c40a3a2af71f23033aa09a142d43b8538 Author: Michal Terepeta Date: Mon Mar 19 11:58:39 2018 -0400 Get rid of more CPP in cmm/ and codeGen/ This removes a bunch of unnecessary includes of `HsVersions.h` along with unnecessary CPP (e.g., due to checking for DEBUG which can be achieved by looking at `debugIsOn`) Signed-off-by: Michal Terepeta Test Plan: ./validate Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4462 >--------------------------------------------------------------- 0db0e46c40a3a2af71f23033aa09a142d43b8538 compiler/cmm/Cmm.hs | 2 +- compiler/cmm/CmmExpr.hs | 1 - compiler/cmm/MkGraph.hs | 19 +++++++------------ compiler/cmm/PprCmmDecl.hs | 3 --- compiler/codeGen/CgUtils.hs | 4 +--- compiler/codeGen/StgCmmBind.hs | 4 ---- compiler/codeGen/StgCmmExpr.hs | 7 ++++--- compiler/codeGen/StgCmmForeign.hs | 4 ---- compiler/codeGen/StgCmmHeap.hs | 4 ---- compiler/codeGen/StgCmmMonad.hs | 13 +++++-------- compiler/codeGen/StgCmmProf.hs | 4 ---- compiler/codeGen/StgCmmTicky.hs | 4 +--- 12 files changed, 19 insertions(+), 50 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 0db0e46c40a3a2af71f23033aa09a142d43b8538 From git at git.haskell.org Mon Mar 19 16:38:43 2018 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 19 Mar 2018 16:38:43 +0000 (UTC) Subject: [commit: ghc] master: Hoopl: improve postorder calculation (bbcea13) Message-ID: <20180319163843.D224D3A5F7@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbcea13af845d41a9d51a932476eb841ba182ea5/ghc >--------------------------------------------------------------- commit bbcea13af845d41a9d51a932476eb841ba182ea5 Author: Michal Terepeta Date: Mon Mar 19 11:58:54 2018 -0400 Hoopl: improve postorder calculation - Fix the naming and comments to indicate that we are calculating *reverse* postorder (and not the standard postorder). - Rewrite the calculation to avoid CPS code. I found it fairly difficult to understand and the new one seems faster (according to nofib, decreases compiler allocations by 0.2%) - Remove `LabelsPtr`, which seems unnecessary and could be *really* confusing. For instance, previously: `postorder_dfs_from ` and `postorder_dfs_from