From git at git.haskell.org Thu Oct 1 21:22:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 1 Oct 2015 21:22:21 +0000 (UTC) Subject: [commit: ghc] master: Typos in comments (e3ab25a) Message-ID: <20151001212221.4526F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e3ab25a4d2e159d7c83de7e94252cace2e76d2a1/ghc >--------------------------------------------------------------- commit e3ab25a4d2e159d7c83de7e94252cace2e76d2a1 Author: Joachim Breitner Date: Thu Oct 1 21:55:57 2015 +0200 Typos in comments >--------------------------------------------------------------- e3ab25a4d2e159d7c83de7e94252cace2e76d2a1 compiler/simplCore/SimplUtils.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index db74855..effd212 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -996,14 +996,14 @@ Example ...fInt...fInt...fInt... -Here f occurs just once, in the RHS of f1. But if we inline it there +Here f occurs just once, in the RHS of fInt. But if we inline it there we'll lose the opportunity to inline at each of fInt's call sites. The INLINE pragma will only inline when the application is saturated for exactly this reason; and we don't want PreInlineUnconditionally to second-guess it. A live example is Trac #3736. c.f. Note [Stable unfoldings and postInlineUnconditionally] -Note [Top-level botomming Ids] +Note [Top-level bottoming Ids] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Don't inline top-level Ids that are bottoming, even if they are used just once, because FloatOut has gone to some trouble to extract them out. From git at git.haskell.org Fri Oct 2 06:23:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 06:23:24 +0000 (UTC) Subject: [commit: ghc] master: Add Data.Semigroup and Data.List.NonEmpty (re #10365) (03b3804) Message-ID: <20151002062324.F19D03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/03b380428c128b12aef07a9b67341803ef0bea76/ghc >--------------------------------------------------------------- commit 03b380428c128b12aef07a9b67341803ef0bea76 Author: Herbert Valerio Riedel Date: Sun Sep 27 12:01:41 2015 +0200 Add Data.Semigroup and Data.List.NonEmpty (re #10365) This implements phase 1 of the semigroup-as-monoid-superclass proposal (https://ghc.haskell.org/wiki/Proposal/SemigroupMonoid). The modules were migrated from the `semigroups-0.17` release mostly as-is, except for dropping several trivial `{-# INLINE #-}`s, removing CPP usage, and instances for types & classes provided outside of `base` (e.g. `containers`, `deepseq`, `hashable`, `tagged`, `bytestring`, `text`) Differential Revision: https://phabricator.haskell.org/D1284 >--------------------------------------------------------------- 03b380428c128b12aef07a9b67341803ef0bea76 libraries/base/Data/List/NonEmpty.hs | 522 ++++++++++++++++++++++++++++ libraries/base/Data/Semigroup.hs | 640 +++++++++++++++++++++++++++++++++++ libraries/base/base.cabal | 2 + libraries/base/changelog.md | 4 + 4 files changed, 1168 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 03b380428c128b12aef07a9b67341803ef0bea76 From git at git.haskell.org Fri Oct 2 09:29:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 09:29:31 +0000 (UTC) Subject: [commit: nofib] master: Expected output of mandel when run under valgrind (6480538) Message-ID: <20151002092931.DF5803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6480538c4665ad8f3863b1587bf83689dec25422/nofib >--------------------------------------------------------------- commit 6480538c4665ad8f3863b1587bf83689dec25422 Author: Joachim Breitner Date: Fri Oct 2 10:09:17 2015 +0200 Expected output of mandel when run under valgrind probably due to rounding/floating point precision numbers. It looks broken, but so does the existing file spectral/mandel/mandel.stdout-mingw. >--------------------------------------------------------------- 6480538c4665ad8f3863b1587bf83689dec25422 ...mandel.slowstdout => mandel.slowstdout-valgrind} | Bin 67602 -> 67566 bytes .../{mandel.stdout => mandel.stdout-valgrind} | Bin 67601 -> 67561 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/spectral/mandel/mandel.slowstdout b/spectral/mandel/mandel.slowstdout-valgrind similarity index 83% copy from spectral/mandel/mandel.slowstdout copy to spectral/mandel/mandel.slowstdout-valgrind index 2d8d6d7..944c5f5 100644 Binary files a/spectral/mandel/mandel.slowstdout and b/spectral/mandel/mandel.slowstdout-valgrind differ diff --git a/spectral/mandel/mandel.stdout b/spectral/mandel/mandel.stdout-valgrind similarity index 83% copy from spectral/mandel/mandel.stdout copy to spectral/mandel/mandel.stdout-valgrind index 9515039..ff97e56 100644 Binary files a/spectral/mandel/mandel.stdout and b/spectral/mandel/mandel.stdout-valgrind differ From git at git.haskell.org Fri Oct 2 09:29:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 09:29:50 +0000 (UTC) Subject: [commit: ghc] master: Update nofib submodule (f2a174a) Message-ID: <20151002092950.737AE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f2a174ae54b60d151af206c1b7a275bbd6518e75/ghc >--------------------------------------------------------------- commit f2a174ae54b60d151af206c1b7a275bbd6518e75 Author: Joachim Breitner Date: Fri Oct 2 11:09:31 2015 +0200 Update nofib submodule to contain these commits: commit 8bffe3cb01ce404ab493de2b4316f2c1c4a9bda9 Author: Joachim Breitner Date: Fri Oct 2 10:09:17 2015 +0200 Expected output of mandel when run under valgrind probably due to rounding/floating point precision numbers. It looks broken, but so does the existing file spectral/mandel/mandel.stdout-mingw. commit f9a577973edf6976e4c0703bf2afac900d7b6fd8 Author: Gabor Greif Date: Fri Jul 31 00:43:38 2015 +0200 Typos in comments commit 20ae9113ad31eca426883544f597a3cae9b60d94 Author: Simon Peyton Jones Date: Fri Apr 24 15:10:02 2015 +0100 Add exact-real-arithmetic benchmark from David Lester >--------------------------------------------------------------- f2a174ae54b60d151af206c1b7a275bbd6518e75 nofib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nofib b/nofib index 85d10a4..6480538 160000 --- a/nofib +++ b/nofib @@ -1 +1 @@ -Subproject commit 85d10a442ccc36b953cabe300ae7c2cd0dae9a97 +Subproject commit 6480538c4665ad8f3863b1587bf83689dec25422 From git at git.haskell.org Fri Oct 2 11:18:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 11:18:26 +0000 (UTC) Subject: [commit: nofib] master: Revert "Expected output of mandel when run under valgrind" (a599585) Message-ID: <20151002111826.64CFC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a5995850221d2808cf3f71965f0e8df0f2908ca1/nofib >--------------------------------------------------------------- commit a5995850221d2808cf3f71965f0e8df0f2908ca1 Author: Joachim Breitner Date: Fri Oct 2 13:19:18 2015 +0200 Revert "Expected output of mandel when run under valgrind" This reverts commit 6480538c4665ad8f3863b1587bf83689dec25422. The problem was that by setting SRC_RUNTEST_OPTS=-cachegrind, the setting SRC_RUNTEST_OPTS += -stdout-binary in mandel/Makefile was overridden, and the binary output was mangled. The proper thing to do is to enable cachegrind using EXTRA_RUNTEST_OPTS=-cachegrind. I have updated https://ghc.haskell.org/trac/ghc/wiki/Building/RunningNoFib accordingly. >--------------------------------------------------------------- a5995850221d2808cf3f71965f0e8df0f2908ca1 spectral/mandel/mandel.slowstdout-valgrind | Bin 67566 -> 0 bytes spectral/mandel/mandel.stdout-valgrind | Bin 67561 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/spectral/mandel/mandel.slowstdout-valgrind b/spectral/mandel/mandel.slowstdout-valgrind deleted file mode 100644 index 944c5f5..0000000 Binary files a/spectral/mandel/mandel.slowstdout-valgrind and /dev/null differ diff --git a/spectral/mandel/mandel.stdout-valgrind b/spectral/mandel/mandel.stdout-valgrind deleted file mode 100644 index ff97e56..0000000 Binary files a/spectral/mandel/mandel.stdout-valgrind and /dev/null differ From git at git.haskell.org Fri Oct 2 11:18:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 11:18:56 +0000 (UTC) Subject: [commit: ghc] master: Update nofib submodule again (a52db23) Message-ID: <20151002111856.B68763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a52db23198708984885fe43f14570a8912583f3e/ghc >--------------------------------------------------------------- commit a52db23198708984885fe43f14570a8912583f3e Author: Joachim Breitner Date: Fri Oct 2 13:20:59 2015 +0200 Update nofib submodule again reverting my bogus commit there. >--------------------------------------------------------------- a52db23198708984885fe43f14570a8912583f3e nofib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nofib b/nofib index 6480538..a599585 160000 --- a/nofib +++ b/nofib @@ -1 +1 @@ -Subproject commit 6480538c4665ad8f3863b1587bf83689dec25422 +Subproject commit a5995850221d2808cf3f71965f0e8df0f2908ca1 From git at git.haskell.org Fri Oct 2 14:32:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:30 +0000 (UTC) Subject: [commit: ghc] master: LLVM: Implement atomic operations in terms of LLVM primitives (bd41eb2) Message-ID: <20151002143230.047543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bd41eb2ad9507d3f408e25c8dece61f389f11a2a/ghc >--------------------------------------------------------------- commit bd41eb2ad9507d3f408e25c8dece61f389f11a2a Author: Ben Gamari Date: Fri Oct 2 15:48:55 2015 +0200 LLVM: Implement atomic operations in terms of LLVM primitives This fixes Trac #7883. This adds proper support for, * `MO_AtomicRMW` * `MO_AtomicWrite` * `MO_CmpXChg` Test Plan: Validate Reviewers: rrnewton, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1282 GHC Trac Issues: #7883 >--------------------------------------------------------------- bd41eb2ad9507d3f408e25c8dece61f389f11a2a compiler/llvmGen/Llvm.hs | 3 ++ compiler/llvmGen/Llvm/AbsSyn.hs | 42 +++++++++++++++++++- compiler/llvmGen/Llvm/PpLlvm.hs | 26 +++++++++++++ compiler/llvmGen/Llvm/Types.hs | 2 +- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 68 ++++++++++++++++++++++++++------- 5 files changed, 124 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 bd41eb2ad9507d3f408e25c8dece61f389f11a2a From git at git.haskell.org Fri Oct 2 14:32:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:32 +0000 (UTC) Subject: [commit: ghc] master: nativeGen PPC: fix > 16 bit offsets in stack handling (b29f20e) Message-ID: <20151002143232.BF01E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b29f20edb1ca7f1763ceb001e2bb2d5f2f11bec3/ghc >--------------------------------------------------------------- commit b29f20edb1ca7f1763ceb001e2bb2d5f2f11bec3 Author: Peter Trommler Date: Fri Oct 2 15:48:30 2015 +0200 nativeGen PPC: fix > 16 bit offsets in stack handling Implement access to spill slots at offsets larger than 16 bits. Also allocation and deallocation of spill slots was restricted to 16 bit offsets. Now 32 bit offsets are supported on all PowerPC platforms. The implementation of 32 bit offsets requires more than one instruction but the native code generator wants one instruction. So we implement pseudo-instructions that are pretty printed into multiple assembly instructions. With pseudo-instructions for spill slot allocation and deallocation we can also implement handling of the back chain pointer according to the ELF ABIs. Test Plan: validate (especially on powerpc (32 bit)) Reviewers: bgamari, austin, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1296 GHC Trac Issues: #7830 >--------------------------------------------------------------- b29f20edb1ca7f1763ceb001e2bb2d5f2f11bec3 compiler/nativeGen/PPC/Instr.hs | 39 ++++++++++++++++++++++++++++----------- compiler/nativeGen/PPC/Ppr.hs | 33 +++++++++++++++++++++++++++++++++ compiler/nativeGen/PPC/Regs.hs | 14 ++++++++++++-- includes/CodeGen.Platform.hs | 18 +++++++++++++----- 4 files changed, 86 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 b29f20edb1ca7f1763ceb001e2bb2d5f2f11bec3 From git at git.haskell.org Fri Oct 2 14:32:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:35 +0000 (UTC) Subject: [commit: ghc] master: Document peculiarities of `traceM`. (57e3742) Message-ID: <20151002143235.B1DC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/57e3742c20fcc55f21634b6a43fbee47bc053775/ghc >--------------------------------------------------------------- commit 57e3742c20fcc55f21634b6a43fbee47bc053775 Author: Matthias Fischmann Date: Fri Oct 2 15:48:08 2015 +0200 Document peculiarities of `traceM`. Reviewers: bgamari, hvr, austin Reviewed By: bgamari, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1289 >--------------------------------------------------------------- 57e3742c20fcc55f21634b6a43fbee47bc053775 libraries/base/Debug/Trace.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs index 26a19d8..653dcab 100644 --- a/libraries/base/Debug/Trace.hs +++ b/libraries/base/Debug/Trace.hs @@ -150,8 +150,14 @@ traceShowId a = trace (show a) a {-| Like 'trace' but returning unit in an arbitrary 'Applicative' context. Allows -for convenient use in do-notation. Note that the application of 'trace' is not -an action in the 'Applicative' context, as 'traceIO' is in the 'IO' type. +for convenient use in do-notation. + +Note that the application of 'traceM' is not an action in the 'Applicative' +context, as 'traceIO' is in the 'IO' type. While the fresh bindings in the +following example will force the 'traceM' expressions to be reduced every time +the @do at -block is executed, @traceM "not crashed"@ would only be reduced once, +and the message would only be printed once. If your monad is in 'MonadIO', + at liftIO . traceIO@ may be a better option. > ... = do > x <- ... From git at git.haskell.org Fri Oct 2 14:32:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:39 +0000 (UTC) Subject: [commit: ghc] master: Fix treatment of -0.0 (eb975d2) Message-ID: <20151002143239.C61CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/eb975d2eec349429e735c272d46a7becccf393c6/ghc >--------------------------------------------------------------- commit eb975d2eec349429e735c272d46a7becccf393c6 Author: Ben Gamari Date: Fri Oct 2 15:40:43 2015 +0200 Fix treatment of -0.0 Here we fix a few mis-optimizations that could occur in code with floating point comparisons with -0.0. These issues arose from our insistence on rewriting equalities into case analyses and the simplifier's ignorance of floating-point semantics. For instance, in Trac #10215 (and the similar issue Trac #9238) we turned `ds == 0.0` into a case analysis, ``` case ds of __DEFAULT -> ... 0.0 -> ... ``` Where the second alternative matches where `ds` is +0.0 and *also* -0.0. However, the simplifier doesn't realize this and will introduce a local inlining of `ds = -- +0.0` as it believes this is the only value that matches this pattern. Instead of teaching the simplifier about floating-point semantics we simply prohibit case analysis on floating-point scrutinees and keep this logic in the comparison primops, where it belongs. We do several things here, - Add test cases from relevant tickets - Clean up a bit of documentation - Desugar literal matches against floats into applications of the appropriate equality primitive instead of case analysis - Add a CoreLint to ensure we don't pattern match on floats in Core Test Plan: validate with included testcases Reviewers: goldfire, simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1061 GHC Trac Issues: #10215, #9238 >--------------------------------------------------------------- eb975d2eec349429e735c272d46a7becccf393c6 compiler/coreSyn/CoreLint.hs | 10 ++ compiler/coreSyn/CoreSyn.hs | 7 ++ compiler/deSugar/MatchLit.hs | 15 +-- compiler/prelude/PrelRules.hs | 125 ++++++++++++--------- compiler/typecheck/TcType.hs | 7 +- testsuite/tests/deSugar/should_run/T10215.hs | 9 ++ .../should_run/T10215.stdout} | 1 + testsuite/tests/deSugar/should_run/T9238.hs | 16 +++ testsuite/tests/deSugar/should_run/T9238.stdout | 2 + testsuite/tests/deSugar/should_run/all.T | 2 + 10 files changed, 131 insertions(+), 63 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 eb975d2eec349429e735c272d46a7becccf393c6 From git at git.haskell.org Fri Oct 2 14:32:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:42 +0000 (UTC) Subject: [commit: ghc] master: LLVM: Factor out accumulation of LLVM statements and variables (9539408) Message-ID: <20151002143242.9C6D93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/953940850f7f2aaf53d91e882a3216bfcf30c8f5/ghc >--------------------------------------------------------------- commit 953940850f7f2aaf53d91e882a3216bfcf30c8f5 Author: Ben Gamari Date: Fri Oct 2 15:49:24 2015 +0200 LLVM: Factor out accumulation of LLVM statements and variables The LLVM code generator currently has a rather large amount of boilerplate devoted to piping around and building up various AST elements. This is rather unfortunate for a language which prides itself on ease of abstraction and detracts from readability. Here I continue a refactoring that I originally suggested in D991, using `WriterT` to factor out this pattern. `WriterT` is in general a bit problematic from an evaluation perspective, but the expressions here are small enough that it should be a problem in practice. Test Plan: Validate Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1286 >--------------------------------------------------------------- 953940850f7f2aaf53d91e882a3216bfcf30c8f5 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 386 ++++++++++++++++---------------- 1 file changed, 189 insertions(+), 197 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 953940850f7f2aaf53d91e882a3216bfcf30c8f5 From git at git.haskell.org Fri Oct 2 14:32:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 14:32:45 +0000 (UTC) Subject: [commit: ghc] master: Move CallStack back to base (7442434) Message-ID: <20151002143245.D17CE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/74424346415f4e3a4d888236b3eb993f8aef4c6b/ghc >--------------------------------------------------------------- commit 74424346415f4e3a4d888236b3eb993f8aef4c6b Author: Ben Gamari Date: Fri Oct 2 15:50:34 2015 +0200 Move CallStack back to base CallStack requires tuples, instances of which are defined in GHC.Tuple. Unfortunately the change made in D757 to the `Typeable` deriving mechanism means that `GHC.Tuple` must import `GHC.Types` for types necessary to generate type representations. This results in a cycle. Test Plan: Validate Reviewers: gridaphobe, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1298 >--------------------------------------------------------------- 74424346415f4e3a4d888236b3eb993f8aef4c6b compiler/prelude/PrelNames.hs | 9 +++-- libraries/base/GHC/Err.hs | 3 +- libraries/base/GHC/Exception.hs | 1 + libraries/base/GHC/Exception.hs-boot | 3 +- libraries/base/GHC/Stack.hsc | 3 ++ libraries/base/GHC/Stack/Types.hs | 76 ++++++++++++++++++++++++++++++++++++ libraries/base/base.cabal | 1 + libraries/ghc-prim/GHC/Types.hs | 51 +----------------------- 8 files changed, 91 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 74424346415f4e3a4d888236b3eb993f8aef4c6b From git at git.haskell.org Fri Oct 2 21:03:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 21:03:05 +0000 (UTC) Subject: [commit: ghc] master: Fix signature of atomic builtins (e3d2bab) Message-ID: <20151002210305.E6AEB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e3d2bab86fc89113f8ee65800fdfac81d8d54851/ghc >--------------------------------------------------------------- commit e3d2bab86fc89113f8ee65800fdfac81d8d54851 Author: Andreas Schwab Date: Fri Oct 2 23:03:12 2015 +0200 Fix signature of atomic builtins This patch is due to Andreas Schwab. This fixes #10926, which reports (on AArch64) errors of the form, ``` /tmp/ghc1492_0/ghc_1.hc:2844:25: warning: passing argument 1 of 'hs_atomic_xor64' makes pointer from integer without a cast [-Wint-conversion] _c1Ho = hs_atomic_xor64((*Sp) + (((Sp[1]) << 0x3UL) + 0x10UL), Sp[2]); ^ In file included from /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/Stg.h:273:0: 0, from /tmp/ghc1492_0/ghc_1.hc:3: /home/abuild/rpmbuild/BUILD/ghc-7.10.2/includes/stg/Prim.h:41:11: note: expected 'volatile StgWord64 * {aka volatile long unsigned int *}' but argument is of type 'long unsigned int' StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val); ^ ``` Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1300 GHC Trac Issues: #10926 >--------------------------------------------------------------- e3d2bab86fc89113f8ee65800fdfac81d8d54851 includes/stg/Prim.h | 72 ++++++------ libraries/ghc-prim/cbits/atomic.c | 224 +++++++++++++++++++------------------- 2 files changed, 148 insertions(+), 148 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 e3d2bab86fc89113f8ee65800fdfac81d8d54851 From git at git.haskell.org Fri Oct 2 21:11:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 2 Oct 2015 21:11:19 +0000 (UTC) Subject: [commit: ghc] master: Don't use old linkable for hs-boot files. (9ed700b) Message-ID: <20151002211119.CAB803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9ed700bb4128b1cbf59d99d725c44d7a0bfb1de6/ghc >--------------------------------------------------------------- commit 9ed700bb4128b1cbf59d99d725c44d7a0bfb1de6 Author: Edward Z. Yang Date: Fri Oct 2 23:13:03 2015 +0200 Don't use old linkable for hs-boot files. We should only use the old linkable when the really is nothing to be done. In the case of hs-boot, there should just not be a linkable. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1301 >--------------------------------------------------------------- 9ed700bb4128b1cbf59d99d725c44d7a0bfb1de6 compiler/main/DriverPipeline.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index a45507e..9523e87 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -224,7 +224,7 @@ compileOne' m_tc_result mHscMessage do (iface, _changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash return (HomeModInfo{ hm_details = details, hm_iface = iface, - hm_linkable = maybe_old_linkable }) + hm_linkable = Nothing }) _ -> do guts0 <- hscDesugar hsc_env summary tc_result guts <- hscSimplify hsc_env guts0 (iface, _changed, details, cgguts) <- hscNormalIface hsc_env guts mb_old_hash @@ -255,7 +255,7 @@ compileOne' m_tc_result mHscMessage when (gopt Opt_WriteInterface dflags) $ hscWriteIface dflags iface changed summary let linkable = if isHsBoot src_flavour - then maybe_old_linkable + then Nothing else Just (LM (ms_hs_date summary) this_mod []) return (HomeModInfo{ hm_details = details, hm_iface = iface, @@ -273,7 +273,7 @@ compileOne' m_tc_result mHscMessage return (HomeModInfo{ hm_details = details, hm_iface = iface, - hm_linkable = maybe_old_linkable }) + hm_linkable = Nothing }) HsSrcFile -> do guts0 <- hscDesugar hsc_env summary tc_result From git at git.haskell.org Sat Oct 3 07:40:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:40:12 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix treatment of -0.0 (293bf83) Message-ID: <20151003074012.A56923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/293bf83f209ed6202a131456bf93fd472a790b13/ghc >--------------------------------------------------------------- commit 293bf83f209ed6202a131456bf93fd472a790b13 Author: Ben Gamari Date: Fri Oct 2 15:40:43 2015 +0200 Fix treatment of -0.0 Here we fix a few mis-optimizations that could occur in code with floating point comparisons with -0.0. These issues arose from our insistence on rewriting equalities into case analyses and the simplifier's ignorance of floating-point semantics. For instance, in Trac #10215 (and the similar issue Trac #9238) we turned `ds == 0.0` into a case analysis, ``` case ds of __DEFAULT -> ... 0.0 -> ... ``` Where the second alternative matches where `ds` is +0.0 and *also* -0.0. However, the simplifier doesn't realize this and will introduce a local inlining of `ds = -- +0.0` as it believes this is the only value that matches this pattern. Instead of teaching the simplifier about floating-point semantics we simply prohibit case analysis on floating-point scrutinees and keep this logic in the comparison primops, where it belongs. We do several things here, - Add test cases from relevant tickets - Clean up a bit of documentation - Desugar literal matches against floats into applications of the appropriate equality primitive instead of case analysis - Add a CoreLint to ensure we don't pattern match on floats in Core Test Plan: validate with included testcases Reviewers: goldfire, simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1061 GHC Trac Issues: #10215, #9238 >--------------------------------------------------------------- 293bf83f209ed6202a131456bf93fd472a790b13 compiler/coreSyn/CoreLint.hs | 30 +++++ compiler/coreSyn/CoreSyn.hs | 7 ++ compiler/deSugar/MatchLit.hs | 15 +-- compiler/prelude/PrelRules.hs | 125 ++++++++++++--------- compiler/typecheck/TcType.hs | 7 +- testsuite/tests/deSugar/should_run/T10215.hs | 9 ++ .../should_run/T10215.stdout} | 1 + testsuite/tests/deSugar/should_run/T9238.hs | 16 +++ testsuite/tests/deSugar/should_run/T9238.stdout | 2 + testsuite/tests/deSugar/should_run/all.T | 2 + 10 files changed, 151 insertions(+), 63 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 293bf83f209ed6202a131456bf93fd472a790b13 From git at git.haskell.org Sat Oct 3 07:40:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:40:15 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix up trivial testsuite failures (5cba858) Message-ID: <20151003074015.6BB0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/5cba8582af1525abac8df657722b216edd9d2a53/ghc >--------------------------------------------------------------- commit 5cba8582af1525abac8df657722b216edd9d2a53 Author: Ben Gamari Date: Fri Oct 2 16:56:17 2015 -0400 Fix up trivial testsuite failures These are fallout from da9b2ec3e19edb1de0e73e8f32aa0443743f072c and 3340d3035afdc128e12fc64d3af97d76d19edda1. >--------------------------------------------------------------- 5cba8582af1525abac8df657722b216edd9d2a53 testsuite/tests/annotations/should_fail/T10826.stderr | 2 +- testsuite/tests/deSugar/should_run/T10215.stdout | 1 - testsuite/tests/deSugar/should_run/T9238.stdout | 1 - testsuite/tests/deriving/should_fail/T5287.stderr | 2 +- testsuite/tests/gadt/gadt21.stderr | 2 +- .../tests/indexed-types/should_compile/T3208b.stderr | 8 ++++---- testsuite/tests/indexed-types/should_fail/T2664.stderr | 4 ++-- testsuite/tests/indexed-types/should_fail/T3440.stderr | 4 ++-- .../tests/indexed-types/should_fail/T4093a.stderr | 4 ++-- .../tests/indexed-types/should_fail/T4093b.stderr | 6 +++--- testsuite/tests/indexed-types/should_fail/T8155.stderr | 2 +- testsuite/tests/module/mod47.stderr | 2 +- testsuite/tests/polykinds/T7230.stderr | 8 ++++---- testsuite/tests/polykinds/T8566.stderr | 4 ++-- testsuite/tests/rename/should_fail/T10668.stderr | 2 +- testsuite/tests/typecheck/should_compile/T7220a.stderr | 2 +- testsuite/tests/typecheck/should_compile/tc168.stderr | 2 +- testsuite/tests/typecheck/should_fail/IPFail.stderr | 2 +- testsuite/tests/typecheck/should_fail/T10495.stderr | 2 +- testsuite/tests/typecheck/should_fail/T10534.stderr | 4 ++-- testsuite/tests/typecheck/should_fail/T1897a.stderr | 2 +- testsuite/tests/typecheck/should_fail/T5300.stderr | 4 ++-- testsuite/tests/typecheck/should_fail/T5853.stderr | 18 +++++++++--------- testsuite/tests/typecheck/should_fail/T7279.stderr | 2 +- testsuite/tests/typecheck/should_fail/T7857.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail017.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail020.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail034.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail042.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail067.stderr | 8 ++++---- testsuite/tests/typecheck/should_fail/tcfail072.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail080.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail097.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail098.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail102.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail142.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail181.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail208.stderr | 2 +- 38 files changed, 61 insertions(+), 63 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 5cba8582af1525abac8df657722b216edd9d2a53 From git at git.haskell.org Sat Oct 3 07:40:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:40:18 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: More trivial test fixes (2685f08) Message-ID: <20151003074018.2B6453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/2685f08459c8ad227d40e267b782619a936a8aac/ghc >--------------------------------------------------------------- commit 2685f08459c8ad227d40e267b782619a936a8aac Author: Ben Gamari Date: Fri Oct 2 23:17:50 2015 +0200 More trivial test fixes >--------------------------------------------------------------- 2685f08459c8ad227d40e267b782619a936a8aac testsuite/tests/typecheck/should_fail/T10285.stderr | 7 +++++-- testsuite/tests/typecheck/should_fail/T10715.stderr | 12 +++++------- testsuite/tests/typecheck/should_fail/T7525.stderr | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr index 47cfbec..e9bb56e 100644 --- a/testsuite/tests/typecheck/should_fail/T10285.stderr +++ b/testsuite/tests/typecheck/should_fail/T10285.stderr @@ -1,7 +1,10 @@ T10285.hs:8:17: - Could not deduce (a ~ b) - from the context (Coercible (N a) (N b)) + Could not deduce: (Coercible a b) + arising from trying to show that the representations of + ?a? and + ?b? are the same + from the context: (Coercible (N a) (N b)) bound by a pattern with constructor Coercion :: forall (k :: BOX) (a :: k) (b :: k). Coercible a b => diff --git a/testsuite/tests/typecheck/should_fail/T10715.stderr b/testsuite/tests/typecheck/should_fail/T10715.stderr index e6f85a5..0f47b40 100644 --- a/testsuite/tests/typecheck/should_fail/T10715.stderr +++ b/testsuite/tests/typecheck/should_fail/T10715.stderr @@ -1,13 +1,11 @@ -T10715.hs:9:13: error: +T10715.hs:9:13: Couldn't match representation of type ?a? with that of ?X a? - ?a? is a rigid type variable bound by - the type signature for: - doCoerce :: Coercible a (X a) => a -> X a - at T10715.hs:9:13 + ?a? is a rigid type variable bound by + the type signature for doCoerce :: Coercible a (X a) => a -> X a + at T10715.hs:9:13 Inaccessible code in - the type signature for: - doCoerce :: Coercible a (X a) => a -> X a + the type signature for doCoerce :: Coercible a (X a) => a -> X a In the ambiguity check for the type signature for ?doCoerce?: doCoerce :: forall a. Coercible a (X a) => a -> X a To defer the ambiguity check to use sites, enable AllowAmbiguousTypes diff --git a/testsuite/tests/typecheck/should_fail/T7525.stderr b/testsuite/tests/typecheck/should_fail/T7525.stderr index ecf3eb1..e80e3dc 100644 --- a/testsuite/tests/typecheck/should_fail/T7525.stderr +++ b/testsuite/tests/typecheck/should_fail/T7525.stderr @@ -1,8 +1,8 @@ T7525.hs:5:30: - Could not deduce (?b::Bool) + Could not deduce: (?b::Bool) arising from a use of implicit parameter ??b? - from the context (?a::Bool) + from the context: (?a::Bool) bound by the implicit-parameter binding for ?a at T7525.hs:5:7-31 In the second argument of ?(&&)?, namely ??b? In the expression: ?a && ?b From git at git.haskell.org Sat Oct 3 07:42:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:42:52 +0000 (UTC) Subject: [commit: ghc] master: Move user's guide to ReStructuredText (4fd6207) Message-ID: <20151003074252.AEB7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4fd6207ec6960c429e6a1bcbe0282f625010f52a/ghc >--------------------------------------------------------------- commit 4fd6207ec6960c429e6a1bcbe0282f625010f52a Author: Ben Gamari Date: Thu Oct 1 01:08:41 2015 +0200 Move user's guide to ReStructuredText >--------------------------------------------------------------- 4fd6207ec6960c429e6a1bcbe0282f625010f52a .gitignore | 18 +- .travis.yml | 5 +- INSTALL.md | 4 +- README.md | 4 +- aclocal.m4 | 118 - configure.ac | 51 +- docs/man/gen_flags.xsl.sh | 290 - docs/man/ghc.mk | 58 - docs/users_guide/7.12.1-notes.rst | 332 + docs/users_guide/7.12.1-notes.xml | 628 - docs/users_guide/bugs.rst | 492 + docs/users_guide/bugs.xml | 638 - docs/users_guide/codegens.rst | 115 + docs/users_guide/codegens.xml | 125 - docs/users_guide/conf.py | 112 + docs/users_guide/debugging.rst | 431 + docs/users_guide/debugging.xml | 681 - docs/users_guide/editing-guide.rst | 334 + docs/users_guide/extending_ghc.rst | 535 + docs/users_guide/extending_ghc.xml | 350 - docs/users_guide/ffi-chap.rst | 658 + docs/users_guide/ffi-chap.xml | 818 -- docs/users_guide/flags.rst | 212 + docs/users_guide/flags.xml | 3564 ----- docs/users_guide/ghc-theme/layout.html | 21 + docs/users_guide/ghc-theme/static/ghc-theme.css | 375 + docs/users_guide/ghc-theme/theme.conf | 4 + docs/users_guide/ghc.mk | 49 +- docs/users_guide/ghc.rst | 69 + docs/users_guide/ghc_config.py.in | 9 + docs/users_guide/ghci.rst | 3014 ++++ docs/users_guide/ghci.xml | 3709 ----- docs/users_guide/glasgow_exts.rst | 12326 ++++++++++++++++ docs/users_guide/glasgow_exts.xml | 13867 ------------------- docs/users_guide/gone_wrong.rst | 138 + docs/users_guide/gone_wrong.xml | 213 - docs/users_guide/images/logo.pdf | Bin 0 -> 15443 bytes docs/users_guide/images/prof_scc.pdf | Bin 0 -> 15847 bytes docs/users_guide/images/prof_scc.svg | 800 ++ docs/users_guide/index.rst | 36 + docs/users_guide/intro.rst | 177 + docs/users_guide/intro.xml | 319 - docs/users_guide/lang.rst | 10 + docs/users_guide/lang.xml | 16 - docs/users_guide/license.rst | 35 + docs/users_guide/license.xml | 65 - docs/users_guide/packages.rst | 1359 ++ docs/users_guide/packages.xml | 1939 --- docs/users_guide/parallel.rst | 169 + docs/users_guide/parallel.xml | 203 - docs/users_guide/phases.rst | 903 ++ docs/users_guide/phases.xml | 1373 -- docs/users_guide/prof_scc.eps | Bin 17580 -> 0 bytes docs/users_guide/profiling.rst | 1390 ++ docs/users_guide/profiling.xml | 1787 --- docs/users_guide/runghc.rst | 36 + docs/users_guide/runghc.xml | 47 - docs/users_guide/runtime_control.rst | 1070 ++ docs/users_guide/runtime_control.xml | 1605 --- docs/users_guide/safe_haskell.rst | 748 + docs/users_guide/safe_haskell.xml | 964 -- docs/users_guide/separate_compilation.rst | 1085 ++ docs/users_guide/separate_compilation.xml | 1351 -- docs/users_guide/shared_libs.rst | 226 + docs/users_guide/shared_libs.xml | 269 - docs/users_guide/sooner.rst | 361 + docs/users_guide/sooner.xml | 549 - docs/users_guide/ug-book.xml.in | 31 - docs/users_guide/ug-ent.xml.in | 31 - docs/users_guide/usage.rst | 16 + docs/users_guide/using-concurrent.rst | 196 + docs/users_guide/using-optimisation.rst | 780 ++ docs/users_guide/using-warnings.rst | 861 ++ docs/users_guide/using.rst | 778 ++ docs/users_guide/using.xml | 3648 ----- docs/users_guide/utils.rst | 278 + docs/users_guide/utils.xml | 607 - docs/users_guide/win32-dlls.rst | 388 + docs/users_guide/win32-dlls.xml | 575 - ghc.mk | 41 +- mk/config.mk.in | 23 +- mk/flavours/bench-cross.mk | 6 +- mk/flavours/bench-llvm.mk | 6 +- mk/flavours/bench.mk | 6 +- mk/flavours/devel1.mk | 6 +- mk/flavours/devel2.mk | 6 +- mk/flavours/perf-cross.mk | 6 +- mk/flavours/perf-llvm.mk | 6 +- mk/flavours/perf.mk | 6 +- mk/flavours/prof.mk | 6 +- mk/flavours/quick-cross.mk | 6 +- mk/flavours/quick-llvm.mk | 6 +- mk/flavours/quick.mk | 6 +- mk/flavours/quickest.mk | 6 +- mk/flavours/validate.mk | 6 +- rules/docbook.mk | 86 - rules/sphinx.mk | 65 + utils/mkUserGuidePart/DList.hs | 13 + utils/mkUserGuidePart/Main.hs | 151 +- utils/mkUserGuidePart/Options.hs | 66 + utils/mkUserGuidePart/Options/CodeGen.hs | 35 + utils/mkUserGuidePart/Options/CompilerDebugging.hs | 272 + utils/mkUserGuidePart/Options/Cpp.hs | 25 + utils/mkUserGuidePart/Options/FindingImports.hs | 15 + utils/mkUserGuidePart/Options/Interactive.hs | 65 + utils/mkUserGuidePart/Options/InterfaceFiles.hs | 23 + .../Options/KeepingIntermediates.hs | 23 + utils/mkUserGuidePart/Options/Language.hs | 735 + utils/mkUserGuidePart/Options/Linking.hs | 162 + utils/mkUserGuidePart/Options/Misc.hs | 32 + utils/mkUserGuidePart/Options/Modes.hs | 63 + .../mkUserGuidePart/Options/OptimizationLevels.hs | 29 + utils/mkUserGuidePart/Options/Optimizations.hs | 344 + utils/mkUserGuidePart/Options/Packages.hs | 67 + utils/mkUserGuidePart/Options/PhasePrograms.hs | 58 + utils/mkUserGuidePart/Options/PhaseSpecific.hs | 47 + utils/mkUserGuidePart/Options/Phases.hs | 33 + utils/mkUserGuidePart/Options/PlatformSpecific.hs | 15 + utils/mkUserGuidePart/Options/Plugin.hs | 17 + utils/mkUserGuidePart/Options/Profiling.hs | 44 + utils/mkUserGuidePart/Options/ProgramCoverage.hs | 18 + .../Options/RecompilationChecking.hs | 15 + utils/mkUserGuidePart/Options/RedirectingOutput.hs | 47 + utils/mkUserGuidePart/Options/TemporaryFiles.hs | 11 + utils/mkUserGuidePart/Options/Verbosity.hs | 58 + utils/mkUserGuidePart/Options/Warnings.hs | 317 + utils/mkUserGuidePart/Table.hs | 75 + utils/mkUserGuidePart/Types.hs | 20 + utils/mkUserGuidePart/ghc.mk | 40 + utils/mkUserGuidePart/mkUserGuidePart.cabal | 31 + utils/vagrant/bootstrap-rhel.sh | 2 +- 131 files changed, 33995 insertions(+), 40720 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 4fd6207ec6960c429e6a1bcbe0282f625010f52a From git at git.haskell.org Sat Oct 3 07:50:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:50:40 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make headers C++ compatible (fixes #10700) (5c1fff2) Message-ID: <20151003075040.56D8D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/5c1fff2acdb57300411c3e803fbf6a9caaf2580b/ghc >--------------------------------------------------------------- commit 5c1fff2acdb57300411c3e803fbf6a9caaf2580b Author: Alexey Shmalko Date: Thu Jul 30 10:37:05 2015 +0200 Make headers C++ compatible (fixes #10700) Some headers used `new` as parameter name, which is reserved word in C++. This patch changes these names to `new_`. Test Plan: validate Reviewers: austin, ezyang, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1107 GHC Trac Issues: #10700 >--------------------------------------------------------------- 5c1fff2acdb57300411c3e803fbf6a9caaf2580b includes/stg/Prim.h | 8 ++++---- includes/stg/SMP.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index 80f4f8e..b07e177 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -39,10 +39,10 @@ StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val); StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val); StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val); StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val); -StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new); +StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new_); StgWord hs_atomicread8(volatile StgWord8 *x); StgWord hs_atomicread16(volatile StgWord16 *x); StgWord hs_atomicread32(volatile StgWord32 *x); diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index 156ee42..eace694 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -280,12 +280,12 @@ atomic_inc(StgVolatilePtr p, StgWord incr) ); return r + incr; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old + incr; - } while (cas(p, old, new) != old); - return new; + new_ = old + incr; + } while (cas(p, old, new_) != old); + return new_; #endif } @@ -301,12 +301,12 @@ atomic_dec(StgVolatilePtr p) ); return r-1; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old - 1; - } while (cas(p, old, new) != old); - return new; + new_ = old - 1; + } while (cas(p, old, new_) != old); + return new_; #endif } From git at git.haskell.org Sat Oct 3 07:50:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 07:50:43 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Small improvement in pretty-printing constructors. (cbd1ccb) Message-ID: <20151003075043.856803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/cbd1ccbebd830476119e46330096c8bc38bfbfa0/ghc >--------------------------------------------------------------- commit cbd1ccbebd830476119e46330096c8bc38bfbfa0 Author: Richard Eisenberg Date: Sun Sep 20 16:03:07 2015 -0400 Small improvement in pretty-printing constructors. This fixes #10810 by cleaning up pretty-printing of constructor declarations. This change also removes a (in my opinion) deeply bogus orphan instance OutputableBndr [Located name], making HsDecls now a non-orphan module. Yay all around. Test case: th/T10810 >--------------------------------------------------------------- cbd1ccbebd830476119e46330096c8bc38bfbfa0 compiler/hsSyn/HsDecls.hs | 26 ++++++++++---------------- testsuite/tests/th/T10810.hs | 6 ++++++ testsuite/tests/th/T10810.stderr | 2 ++ testsuite/tests/th/all.T | 1 + 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 4e94b3e..4840768 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -12,7 +12,6 @@ -- in module PlaceHolder {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleInstances #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} -- | Abstract syntax of global declarations. -- @@ -971,15 +970,16 @@ instance (OutputableBndr name) => Outputable (ConDecl name) where ppr = pprConDecl pprConDecl :: OutputableBndr name => ConDecl name -> SDoc -pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs +pprConDecl (ConDecl { con_names = [L _ con] -- NB: non-GADT means 1 con + , con_explicit = expl, con_qvars = tvs , con_cxt = cxt, con_details = details , con_res = ResTyH98, con_doc = doc }) = sep [ppr_mbDoc doc, pprHsForAll expl tvs cxt, ppr_details details] where - ppr_details (InfixCon t1 t2) = hsep [ppr t1, pprInfixOcc cons, ppr t2] - ppr_details (PrefixCon tys) = hsep (pprPrefixOcc cons + ppr_details (InfixCon t1 t2) = hsep [ppr t1, pprInfixOcc con, ppr t2] + ppr_details (PrefixCon tys) = hsep (pprPrefixOcc con : map (pprParendHsType . unLoc) tys) - ppr_details (RecCon fields) = ppr_con_names cons + ppr_details (RecCon fields) = pprPrefixOcc con <+> pprConDeclFields (unLoc fields) pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs @@ -1002,18 +1002,12 @@ pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT { -- so if we ever trip over one (albeit I can't see how that -- can happen) print it like a prefix one -ppr_con_names :: (OutputableBndr name) => [Located name] -> SDoc -ppr_con_names [x] = ppr x -ppr_con_names xs = interpp'SP xs - -instance (Outputable name) => OutputableBndr [Located name] where - pprBndr _bs xs = cat $ punctuate comma (map ppr xs) +-- this fallthrough would happen with a non-GADT-syntax ConDecl with more +-- than one constructor, which should indeed be impossible +pprConDecl (ConDecl { con_names = cons }) = pprPanic "pprConDecl" (ppr cons) - pprPrefixOcc [x] = ppr x - pprPrefixOcc xs = cat $ punctuate comma (map ppr xs) - - pprInfixOcc [x] = ppr x - pprInfixOcc xs = cat $ punctuate comma (map ppr xs) +ppr_con_names :: (OutputableBndr name) => [Located name] -> SDoc +ppr_con_names = pprWithCommas (pprPrefixOcc . unLoc) {- ************************************************************************ diff --git a/testsuite/tests/th/T10810.hs b/testsuite/tests/th/T10810.hs new file mode 100644 index 0000000..328c3e9 --- /dev/null +++ b/testsuite/tests/th/T10810.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-} + +module T10810 where + +$([d| data Foo = (:!) |]) diff --git a/testsuite/tests/th/T10810.stderr b/testsuite/tests/th/T10810.stderr new file mode 100644 index 0000000..c960fe1 --- /dev/null +++ b/testsuite/tests/th/T10810.stderr @@ -0,0 +1,2 @@ +T10810.hs:6:3-24: Splicing declarations + [d| data Foo = (:!) |] ======> data Foo = (:!) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index ff0bc9b..59b6668 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -361,3 +361,4 @@ test('TH_Lift', normal, compile, ['-v0']) test('T10019', normal, ghci_script, ['T10019.script']) test('T10279', normal, compile_fail, ['-v0']) test('T10596', normal, compile, ['-v0']) +test('T10810', normal, compile, ['-v0']) From git at git.haskell.org Sat Oct 3 09:09:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 09:09:44 +0000 (UTC) Subject: [commit: ghc] master: docs: Fix ghc_config.py.in (93e21b9) Message-ID: <20151003090944.4D70A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/93e21b96f94556dc3f0bcee7615cb7f31444bd99/ghc >--------------------------------------------------------------- commit 93e21b96f94556dc3f0bcee7615cb7f31444bd99 Author: Ben Gamari Date: Sat Oct 3 10:30:20 2015 +0200 docs: Fix ghc_config.py.in >--------------------------------------------------------------- 93e21b96f94556dc3f0bcee7615cb7f31444bd99 docs/users_guide/ghc_config.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/ghc_config.py.in b/docs/users_guide/ghc_config.py.in index 8ff4aa9..0f15d3f 100644 --- a/docs/users_guide/ghc_config.py.in +++ b/docs/users_guide/ghc_config.py.in @@ -6,4 +6,4 @@ extlinks = { 'ghc-wiki': ('http://ghc.haskell.org/trac/ghc/wiki/%s', 'Trac #'), } -version = @GhcVersion@ +version = '@GhcVersion@' From git at git.haskell.org Sat Oct 3 11:04:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 11:04:23 +0000 (UTC) Subject: [commit: ghc] master: Prevent GHC from silently dying when preprocessor is not found (b6f76b9) Message-ID: <20151003110423.8FF623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b6f76b9aaca49df0fb06d8bad2f7edc5b5b8c095/ghc >--------------------------------------------------------------- commit b6f76b9aaca49df0fb06d8bad2f7edc5b5b8c095 Author: Tamar Christina Date: Sat Oct 3 12:37:00 2015 +0200 Prevent GHC from silently dying when preprocessor is not found The Windows preprocessor code calls `runInteractiveProcess` but does not check if an exception is thrown. `runInteractiveProcess` calls `CreateProcess` which when given a format the system loader does not know about will throw an exception. This is what makes #9399 fail. Ultimately we should not use any `CreateProcess` based calls but instead `ShellExecuteEx` as this would allow us to run applications that the shell knows about instead of just the loader. More details on #365. This patch removes `PhaseFailed` and throws `ProgramError` instead. `PhaseFailed` was largely unneeded since it never gave very useful information aside from the `errorcode` which was almost always `1`. `IOErrors` have also been eliminated and `GhcExceptions` thrown in their place wherever possible. Updates haddock submodule. Test Plan: `./validate` to make sure anything didn't break and `make TESTS="T365"` to test that an error is now properly thrown Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1256 GHC Trac Issues: #365 >--------------------------------------------------------------- b6f76b9aaca49df0fb06d8bad2f7edc5b5b8c095 compiler/main/GHC.hs | 1 - compiler/main/SysTools.hs | 16 ++++++---------- compiler/utils/Panic.hs | 16 +--------------- ghc/InteractiveUI.hs | 1 - testsuite/tests/driver/T365.hs | 4 ++++ testsuite/tests/driver/T365.stderr | 1 + testsuite/tests/driver/all.T | 7 +++++++ testsuite/tests/parser/should_fail/T8430.stderr | 1 + utils/haddock | 2 +- 9 files changed, 21 insertions(+), 28 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 883cd2c..17e0359 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -398,7 +398,6 @@ defaultErrorHandler fm (FlushOut flushOut) inner = (\ge -> liftIO $ do flushOut case ge of - PhaseFailed _ code -> exitWith code Signal _ -> exitWith (ExitFailure 1) _ -> do fatalErrorMsg'' fm (show ge) exitWith (ExitFailure 1) diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 15baa38..1efb67a 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -1327,19 +1327,15 @@ handleProc pgm phase_name proc = do (rc, r) <- proc `catchIO` handler case rc of ExitSuccess{} -> return r - ExitFailure n - -- rawSystem returns (ExitFailure 127) if the exec failed for any - -- reason (eg. the program doesn't exist). This is the only clue - -- we have, but we need to report something to the user because in - -- the case of a missing program there will otherwise be no output - -- at all. - | n == 127 -> does_not_exist - | otherwise -> throwGhcExceptionIO (PhaseFailed phase_name rc) + ExitFailure n -> throwGhcExceptionIO ( + ProgramError ("`" ++ pgm ++ "'" ++ + " failed in phase `" ++ phase_name ++ "'." ++ + " (Exit code: " ++ show n ++ ")")) where handler err = if IO.isDoesNotExistError err then does_not_exist - else IO.ioError err + else throwGhcExceptionIO (ProgramError $ show err) does_not_exist = throwGhcExceptionIO (InstallationError ("could not execute: " ++ pgm)) @@ -1473,7 +1469,7 @@ traceCmd dflags phase_name cmd_line action where handle_exn _verb exn = do { debugTraceMsg dflags 2 (char '\n') ; debugTraceMsg dflags 2 (ptext (sLit "Failed:") <+> text cmd_line <+> text (show exn)) - ; throwGhcExceptionIO (PhaseFailed phase_name (ExitFailure 1)) } + ; throwGhcExceptionIO (ProgramError (show exn))} {- ************************************************************************ diff --git a/compiler/utils/Panic.hs b/compiler/utils/Panic.hs index e1c848d..7823336 100644 --- a/compiler/utils/Panic.hs +++ b/compiler/utils/Panic.hs @@ -36,7 +36,6 @@ import Control.Concurrent import Data.Dynamic import Debug.Trace ( trace ) import System.IO.Unsafe -import System.Exit import System.Environment #ifndef mingw32_HOST_OS @@ -63,11 +62,8 @@ import System.Mem.Weak ( Weak, deRefWeak ) -- assumed to contain a location already, so we don't print one). data GhcException - = PhaseFailed String -- name of phase - ExitCode -- an external phase (eg. cpp) failed - -- | Some other fatal signal (SIGHUP,SIGTERM) - | Signal Int + = Signal Int -- | Prints the short usage msg after the error | UsageError String @@ -135,11 +131,6 @@ showGhcException exception UsageError str -> showString str . showChar '\n' . showString short_usage - PhaseFailed phase code - -> showString "phase `" . showString phase . - showString "' failed (exitcode = " . shows (int_code code) . - showString ")" - CmdLineError str -> showString str PprProgramError str _ -> showGhcException (ProgramError (str ++ "\n<
>")) @@ -164,11 +155,6 @@ showGhcException exception ++ " (GHC version " ++ cProjectVersion ++ " for " ++ TargetPlatform_NAME ++ "):\n\t" ++ s ++ "\n" - where int_code code = - case code of - ExitSuccess -> (0::Int) - ExitFailure x -> x - throwGhcException :: GhcException -> a throwGhcException = Exception.throw diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 2dcedb0..80c1483 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -3214,7 +3214,6 @@ showException se = -- omit the location for CmdLineError: Just (CmdLineError s) -> putException s -- ditto: - Just ph@(PhaseFailed {}) -> putException (showGhcException ph "") Just other_ghc_ex -> putException (show other_ghc_ex) Nothing -> case fromException se of diff --git a/testsuite/tests/driver/T365.hs b/testsuite/tests/driver/T365.hs new file mode 100644 index 0000000..fe09bb2 --- /dev/null +++ b/testsuite/tests/driver/T365.hs @@ -0,0 +1,4 @@ +{-# OPTIONS_GHC -F -pgmF ./test_preprocessor.txt #-} +module Main where + +main = print "Hello World" diff --git a/testsuite/tests/driver/T365.stderr b/testsuite/tests/driver/T365.stderr new file mode 100644 index 0000000..560217e --- /dev/null +++ b/testsuite/tests/driver/T365.stderr @@ -0,0 +1 @@ +./test_preprocessor.txt: runInteractiveProcess: invalid argument (Exec format error) diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 4a4f930..cbfbd02 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -446,3 +446,10 @@ test('T10182', extra_clean(['T10182.o', 'T10182a.o', 'T10182.o-boot', 'T10182.hi', 'T10182a.hi', 'T10182.hi-boot']), run_command, ['$MAKE -s --no-print-directory T10182']) + +test('T365', + [extra_clean(['test_preprocessor.txt']), + pre_cmd('touch test_preprocessor.txt'), + unless(opsys('mingw32'), skip)], + compile_fail, + ['']) diff --git a/testsuite/tests/parser/should_fail/T8430.stderr b/testsuite/tests/parser/should_fail/T8430.stderr index 2d7b703..31e69ba 100644 --- a/testsuite/tests/parser/should_fail/T8430.stderr +++ b/testsuite/tests/parser/should_fail/T8430.stderr @@ -1,2 +1,3 @@ T8430.lhs line 3: unlit: spurious \end{code} +`/mnt/work/ghc/ghc-testing/inplace/lib/unlit' failed in phase `Literate pre-processor'. (Exit code: 1) diff --git a/utils/haddock b/utils/haddock index 5890a2d..e083daa 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 5890a2d503b3200e9897ce331ad61d808a67fca3 +Subproject commit e083daa4a46ae2f9a244b6bcedc5951b3a78f260 From git at git.haskell.org Sat Oct 3 16:35:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 16:35:18 +0000 (UTC) Subject: [commit: ghc] master: Fix broken validation Build 6564 and accepting a few other test results (c4d7df0) Message-ID: <20151003163518.839303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c4d7df04aa8b7270759f4c39dceadfd26339b6a6/ghc >--------------------------------------------------------------- commit c4d7df04aa8b7270759f4c39dceadfd26339b6a6 Author: Tamar Christina Date: Sat Oct 3 18:37:29 2015 +0200 Fix broken validation Build 6564 and accepting a few other test results Test Plan: ./validate Reviewers: thomie, austin, bgamari Reviewed By: bgamari Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1304 >--------------------------------------------------------------- c4d7df04aa8b7270759f4c39dceadfd26339b6a6 compiler/main/SysTools.hs | 2 +- testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 | 7 ++++--- testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 | 8 +++++--- testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 | 10 ++++++---- testsuite/tests/parser/should_fail/T8430.stderr | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 1efb67a..77dbcea 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -1328,7 +1328,7 @@ handleProc pgm phase_name proc = do case rc of ExitSuccess{} -> return r ExitFailure n -> throwGhcExceptionIO ( - ProgramError ("`" ++ pgm ++ "'" ++ + ProgramError ("`" ++ takeBaseName pgm ++ "'" ++ " failed in phase `" ++ phase_name ++ "'." ++ " (Exit code: " ++ show n ++ ")")) where diff --git a/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 b/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 index 9fe3257..898dc7a 100644 --- a/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 +++ b/testsuite/tests/driver/sigof01/sigof01m.stdout-mingw32 @@ -1,6 +1,7 @@ -[1 of 3] Compiling A ( A.hs, tmp_sigof01m\A.o ) -[2 of 3] Compiling B[sig of A] ( B.hsig, nothing ) -[3 of 3] Compiling Main ( Main.hs, tmp_sigof01m\Main.o ) +[1 of 4] Compiling A ( A.hs, tmp_sigof01m\A.o ) +[2 of 4] Compiling B[boot] ( B.hs-boot, tmp_sigof01m\B.o-boot ) +[3 of 4] Compiling B[merge] ( B.hi, tmp_sigof01m\B.o ) +[4 of 4] Compiling Main ( Main.hs, tmp_sigof01m\Main.o ) Linking tmp_sigof01m/Main.exe ... False T diff --git a/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 b/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 index 3c8a1fa..7fde989 100644 --- a/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 +++ b/testsuite/tests/driver/sigof02/sigof02dm.stdout-mingw32 @@ -1,6 +1,8 @@ -[1 of 3] Compiling MapAsSet[sig of Data.Map.Lazy] ( MapAsSet.hsig, nothing ) -[2 of 3] Compiling Map[sig of Data.Map.Lazy] ( Map.hsig, nothing ) -[3 of 3] Compiling Main ( Double.hs, tmp_sigof02dm\Main.o ) +[1 of 5] Compiling MapAsSet[boot] ( MapAsSet.hs-boot, tmp_sigof02dm\MapAsSet.o-boot ) +[2 of 5] Compiling MapAsSet[merge] ( MapAsSet.hi, tmp_sigof02dm\MapAsSet.o ) +[3 of 5] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02dm\Map.o-boot ) +[4 of 5] Compiling Map[merge] ( Map.hi, tmp_sigof02dm\Map.o ) +[5 of 5] Compiling Main ( Double.hs, tmp_sigof02dm\Main.o ) Linking tmp_sigof02dm/Double.exe ... False fromList [0,6] diff --git a/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 b/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 index 65b1857..f7cca89 100644 --- a/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 +++ b/testsuite/tests/driver/sigof02/sigof02m.stdout-mingw32 @@ -1,8 +1,10 @@ -[1 of 2] Compiling Map[sig of Data.Map.Strict] ( Map.hsig, nothing ) -[2 of 2] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) +[1 of 3] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02m\Map.o-boot ) +[2 of 3] Compiling Map[merge] ( Map.hi, tmp_sigof02m\Map.o ) +[3 of 3] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) Linking tmp_sigof02m/StrictMain.exe ... -[1 of 2] Compiling Map[sig of Data.Map.Lazy] ( Map.hsig, nothing ) [sig-of changed] -[2 of 2] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) [Map changed] +[1 of 3] Compiling Map[boot] ( Map.hs-boot, tmp_sigof02m\Map.o-boot ) [sig-of changed] +[2 of 3] Compiling Map[merge] ( Map.hi, tmp_sigof02m\Map.o ) [sig-of changed] +[3 of 3] Compiling Main ( Main.hs, tmp_sigof02m\Main.o ) [Map changed] Linking tmp_sigof02m/LazyMain.exe ... False [(0,"foo"),(6,"foo")] diff --git a/testsuite/tests/parser/should_fail/T8430.stderr b/testsuite/tests/parser/should_fail/T8430.stderr index 31e69ba..5bfc8a4 100644 --- a/testsuite/tests/parser/should_fail/T8430.stderr +++ b/testsuite/tests/parser/should_fail/T8430.stderr @@ -1,3 +1,3 @@ T8430.lhs line 3: unlit: spurious \end{code} -`/mnt/work/ghc/ghc-testing/inplace/lib/unlit' failed in phase `Literate pre-processor'. (Exit code: 1) +`unlit' failed in phase `Literate pre-processor'. (Exit code: 1) From git at git.haskell.org Sat Oct 3 17:00:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 17:00:43 +0000 (UTC) Subject: [commit: ghc] master: Build system: add mk/validate.mk.sample (a3c78ab) Message-ID: <20151003170043.E2D373A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a3c78abcbdfe5025dc704acdcd0a85c78cabbd6b/ghc >--------------------------------------------------------------- commit a3c78abcbdfe5025dc704acdcd0a85c78cabbd6b Author: Thomas Miedema Date: Sat Oct 3 19:02:37 2015 +0200 Build system: add mk/validate.mk.sample Reviewers: austin, bgamari Subscribers: erikd Differential Revision: https://phabricator.haskell.org/D1303 modified: configure.ac >--------------------------------------------------------------- a3c78abcbdfe5025dc704acdcd0a85c78cabbd6b configure.ac | 4 ++-- ghc.mk | 3 ++- mk/validate.mk.sample | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index d890a6f..c9a6ed0 100644 --- a/configure.ac +++ b/configure.ac @@ -1197,8 +1197,8 @@ echo ["\ fi echo ["\ - Building Sphinx HTML documentation : $BUILD_SPHINX_HTML - Building Sphinx PDF documentation : $BUILD_SPHINX_PDF"] + Tools to build Sphinx HTML documentation available: $BUILD_SPHINX_HTML + Tools to build Sphinx PDF documentation available: $BUILD_SPHINX_PDF"] echo ["---------------------------------------------------------------------- "] diff --git a/ghc.mk b/ghc.mk index a76e7fc..9660215 100644 --- a/ghc.mk +++ b/ghc.mk @@ -171,7 +171,8 @@ endif ifeq "$(BUILD_SPHINX_HTML)" "YES" ifeq "$(SPHINXBUILD)" "" $(error BUILD_SPHINX_HTML=YES, but `sphinx-build` was not found. \ - Install `sphinx-build`, then rerun `./configure`. \ + Create a file `mk/validate.mk` containing `BUILD_SPHINX_HTML=NO` \ + (when validating), or install `sphinx-build` and rerun `./configure`. \ See https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation) endif endif diff --git a/mk/validate.mk.sample b/mk/validate.mk.sample new file mode 100644 index 0000000..83c2c40 --- /dev/null +++ b/mk/validate.mk.sample @@ -0,0 +1,4 @@ +# These settings override mk/flavours/validate.mk (see +# mk/custom-settings.mk). +#HADDOCK_DOCS = NO +#BUILD_SPHINX_HTML = NO From git at git.haskell.org Sat Oct 3 17:20:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 17:20:37 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: update expected output for T8602 (a96f1ac) Message-ID: <20151003172037.5B8B23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a96f1acc59f425062e6192b4cd2a19e1ef987f4a/ghc >--------------------------------------------------------------- commit a96f1acc59f425062e6192b4cd2a19e1ef987f4a Author: Thomas Miedema Date: Sat Oct 3 19:15:20 2015 +0200 Testsuite: update expected output for T8602 >--------------------------------------------------------------- a96f1acc59f425062e6192b4cd2a19e1ef987f4a testsuite/tests/driver/T8602/T8602.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/driver/T8602/T8602.stderr b/testsuite/tests/driver/T8602/T8602.stderr index 3bbfa20..f3bb7e1 100644 --- a/testsuite/tests/driver/T8602/T8602.stderr +++ b/testsuite/tests/driver/T8602/T8602.stderr @@ -1,2 +1,2 @@ A B C -phase `Haskell pre-processor' failed (exitcode = 1) +`t8602' failed in phase `Haskell pre-processor'. (Exit code: 1) From git at git.haskell.org Sat Oct 3 18:01:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 18:01:27 +0000 (UTC) Subject: [commit: ghc] master: Make GHC generics capable of handling unboxed types (6cde981) Message-ID: <20151003180127.ECDCD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6cde981a8788b225819be28659caddc35b77972d/ghc >--------------------------------------------------------------- commit 6cde981a8788b225819be28659caddc35b77972d Author: RyanGlScott Date: Sat Oct 3 19:21:37 2015 +0200 Make GHC generics capable of handling unboxed types This adds a data family (`URec`) and six data family instances (`UAddr`, `UChar`, `UDouble`, `UFloat`, `UInt`, and `UWord`) which a `deriving Generic(1)` clause will generate if it sees `Addr#`, `Char#`, `Double#`, `Float#`, `Int#`, or `Word#`, respectively. The programmer can then provide instances for these data family instances to provide custom implementations for unboxed types, similar to how derived `Eq`, `Ord`, and `Show` instances currently special-case unboxed types. Fixes #10868. Test Plan: ./validate Reviewers: goldfire, dreixel, bgamari, austin, hvr, kosmikus Reviewed By: dreixel, kosmikus Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1239 GHC Trac Issues: #10868 >--------------------------------------------------------------- 6cde981a8788b225819be28659caddc35b77972d compiler/prelude/PrelNames.hs | 65 ++++++++++--- compiler/typecheck/TcGenGenerics.hs | 132 ++++++++++++++++++++------- docs/users_guide/7.12.1-notes.rst | 3 + docs/users_guide/glasgow_exts.rst | 42 +++++++++ libraries/base/GHC/Generics.hs | 108 +++++++++++++++++++++- libraries/base/changelog.md | 4 + testsuite/tests/generics/GEq/GEq1.hs | 33 +++++-- testsuite/tests/generics/GEq/GEq1.stdout | 2 + testsuite/tests/generics/GEq/GEq1A.hs | 18 +++- testsuite/tests/generics/GShow/GShow.hs | 16 +++- testsuite/tests/generics/GShow/GShow1.stdout | 1 + testsuite/tests/generics/GShow/Main.hs | 10 +- testsuite/tests/generics/T8468.stderr | 2 +- 13 files changed, 377 insertions(+), 59 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6cde981a8788b225819be28659caddc35b77972d From git at git.haskell.org Sat Oct 3 18:44:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 18:44:58 +0000 (UTC) Subject: [commit: ghc] master: Enable `Enumeration is empty` warnings for `Integer` (0eb8fcd) Message-ID: <20151003184458.629543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0eb8fcd94b29ee9997b386e64203037bdf2aaa04/ghc >--------------------------------------------------------------- commit 0eb8fcd94b29ee9997b386e64203037bdf2aaa04 Author: Herbert Valerio Riedel Date: Sat Oct 3 20:05:11 2015 +0200 Enable `Enumeration is empty` warnings for `Integer` This warning was implemented via abb3a9faa88fad3562ac41a148dd683765f47565 for addressing #7881. The bounded H2010 integral types were handled, but the `Integer` type was missed for the enumeration warning. Fixes #10929 Test Plan: reused T7881 testcase Reviewers: thomie, bgamari, austin Reviewed By: thomie, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1305 GHC Trac Issues: #10929 >--------------------------------------------------------------- 0eb8fcd94b29ee9997b386e64203037bdf2aaa04 compiler/deSugar/MatchLit.hs | 1 + .../numeric/should_compile/{T7881.hs => T10929.hs} | 25 ++++++++++------------ .../tests/numeric/should_compile/T10929.stderr | 6 ++++++ testsuite/tests/numeric/should_compile/all.T | 1 + 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/compiler/deSugar/MatchLit.hs b/compiler/deSugar/MatchLit.hs index fddfa80..4e6b8aa 100644 --- a/compiler/deSugar/MatchLit.hs +++ b/compiler/deSugar/MatchLit.hs @@ -228,6 +228,7 @@ warnAboutEmptyEnumerations dflags fromExpr mThnExpr toExpr else if tc == word16TyConName then check (undefined :: Word16) else if tc == word32TyConName then check (undefined :: Word32) else if tc == word64TyConName then check (undefined :: Word64) + else if tc == integerTyConName then check (undefined :: Integer) else return () | otherwise = return () diff --git a/testsuite/tests/numeric/should_compile/T7881.hs b/testsuite/tests/numeric/should_compile/T10929.hs similarity index 51% copy from testsuite/tests/numeric/should_compile/T7881.hs copy to testsuite/tests/numeric/should_compile/T10929.hs index 73d8452..47e0071 100644 --- a/testsuite/tests/numeric/should_compile/T7881.hs +++ b/testsuite/tests/numeric/should_compile/T10929.hs @@ -1,34 +1,31 @@ +module T10929 where -module T7881 where - -import Data.Int - -x1 :: [Int8] +x1 :: [Integer] x1 = [5 .. 3] -x2 :: [Int8] +x2 :: [Integer] x2 = [3 .. 5] -x3 :: [Int8] +x3 :: [Integer] x3 = [5, 3 .. 1] -x4 :: [Int8] +x4 :: [Integer] x4 = [5, (3+0) .. 1] -x5 :: [Int8] +x5 :: [Integer] x5 = [1, 3 .. 5] -x6 :: [Int8] +x6 :: [Integer] x6 = [1, (3+0) .. 5] -x7 :: [Int8] +x7 :: [Integer] x7 = [5, 7 .. 1] -x8 :: [Int8] +x8 :: [Integer] x8 = [5, (7+0) .. 1] -x9 :: [Int8] +x9 :: [Integer] x9 = [3, 1 .. 5] -x10 :: [Int8] +x10 :: [Integer] x10 = [3, (1+0) .. 5] diff --git a/testsuite/tests/numeric/should_compile/T10929.stderr b/testsuite/tests/numeric/should_compile/T10929.stderr new file mode 100644 index 0000000..8723c42 --- /dev/null +++ b/testsuite/tests/numeric/should_compile/T10929.stderr @@ -0,0 +1,6 @@ + +T10929.hs:4:6: warning: Enumeration is empty + +T10929.hs:22:6: warning: Enumeration is empty + +T10929.hs:28:6: warning: Enumeration is empty diff --git a/testsuite/tests/numeric/should_compile/all.T b/testsuite/tests/numeric/should_compile/all.T index 246642f..ea42aad 100644 --- a/testsuite/tests/numeric/should_compile/all.T +++ b/testsuite/tests/numeric/should_compile/all.T @@ -2,3 +2,4 @@ test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116']) test('T7895', normal, compile, ['']) test('T7881', normal, compile, ['']) test('T8542', normal, compile, ['']) +test('T10929', normal, compile, ['']) From git at git.haskell.org Sat Oct 3 18:45:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 18:45:02 +0000 (UTC) Subject: [commit: ghc] master: Fill in associated type defaults with DeriveAnyClass (2f74be9) Message-ID: <20151003184502.67EF03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f74be9c8af1e167b21df1a27b96b6626cd446a9/ghc >--------------------------------------------------------------- commit 2f74be9c8af1e167b21df1a27b96b6626cd446a9 Author: RyanGlScott Date: Sat Oct 3 20:06:48 2015 +0200 Fill in associated type defaults with DeriveAnyClass Summary: Unlike `-XDefaultSignatures`, `-XDeriveAnyClass` would not fill in associated type family defaults when deriving a class which contained them. In order to fix this properly, `tcATDefault` needed to be used from `TcGenDeriv`. To avoid a module import cycle, `tcATDefault` was moved from `TcInstDcls` to `TcClsDcl`. Fixes #10361. Test Plan: ./validate Reviewers: kosmikus, dreixel, bgamari, austin, simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1283 GHC Trac Issues: #10361 >--------------------------------------------------------------- 2f74be9c8af1e167b21df1a27b96b6626cd446a9 compiler/typecheck/TcClassDcl.hs | 73 ++++++++++++++++++++++++++++++++++++- compiler/typecheck/TcDeriv.hs | 67 +++++++++++++++++++++++++++++++--- compiler/typecheck/TcGenDeriv.hs | 34 ++++++++--------- compiler/typecheck/TcInstDcls.hs | 62 ++----------------------------- docs/users_guide/7.12.1-notes.rst | 3 ++ docs/users_guide/glasgow_exts.rst | 46 ++++++++++++++++++++++- testsuite/tests/generics/T10361a.hs | 32 ++++++++++++++++ testsuite/tests/generics/T10361b.hs | 58 +++++++++++++++++++++++++++++ testsuite/tests/generics/all.T | 2 + 9 files changed, 291 insertions(+), 86 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 2f74be9c8af1e167b21df1a27b96b6626cd446a9 From git at git.haskell.org Sat Oct 3 18:45:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 18:45:05 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Bump up haddock.base expected allocations (d2fb532) Message-ID: <20151003184505.7806C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d2fb53281da4cf9131cb0937fc66933ede8b6b85/ghc >--------------------------------------------------------------- commit d2fb53281da4cf9131cb0937fc66933ede8b6b85 Author: Ben Gamari Date: Sat Oct 3 20:45:32 2015 +0200 testsuite: Bump up haddock.base expected allocations This started intermittently failing as a result of D1239. I suspect this was just the straw that broke the camel's back however. >--------------------------------------------------------------- d2fb53281da4cf9131cb0937fc66933ede8b6b85 testsuite/tests/perf/haddock/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index 1e5a16c..c7a60e3 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -5,7 +5,7 @@ test('haddock.base', [unless(in_tree_compiler(), skip), req_haddock ,stats_num_field('bytes allocated', - [(wordsize(64), 9418857192, 5) + [(wordsize(64), 9894189856, 5) # 2012-08-14: 5920822352 (amd64/Linux) # 2012-09-20: 5829972376 (amd64/Linux) # 2012-10-08: 5902601224 (amd64/Linux) @@ -24,6 +24,7 @@ test('haddock.base', # 2014-12-14: 9502647104 (x86_64/Linux) - Update to Haddock 2.16 # 2014-01-08: 9014511528 (x86_64/Linux) - Eliminate so-called "silent superclass parameters" (and others) # 2015-07-22: 9418857192 (x86_64/Linux) - Just slowly creeping up. + # 2015-10-03: 9894189856 (x86_64/Linux) - Still creeping ,(platform('i386-unknown-mingw32'), 4434804940, 5) # 2013-02-10: 3358693084 (x86/Windows) From git at git.haskell.org Sat Oct 3 20:33:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 3 Oct 2015 20:33:48 +0000 (UTC) Subject: [commit: ghc] master: Make Windows linker more robust to unknown sections (620fc6f) Message-ID: <20151003203348.DE3543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/620fc6f909cd6e51b5613454097ec1c9f323839a/ghc >--------------------------------------------------------------- commit 620fc6f909cd6e51b5613454097ec1c9f323839a Author: Tamar Christina Date: Sat Oct 3 22:28:07 2015 +0200 Make Windows linker more robust to unknown sections The Windows Linker has 3 main parts that this patch changes. 1) Identification and classification of sections 2) Adding of symbols to the symbols tables 3) Reallocation of sections 1. Previously section identification used to be done on a whitelisted basis. It was also exclusively being done based on the names of the sections. This meant that there was a bit of a cat and mouse game between `GCC` and `GHC`. Every time `GCC` added new sections there was a good chance `GHC` would break. Luckily this hasn't happened much in the past because the `GCC` versions `GHC` used were largely unchanged. The new code instead treats all new section as `CODE` or `DATA` sections, and changes the classifications based on the `Characteristics` flag in the PE header. By doing so we no longer have the fragility of changing section names. The one exception to this is the `.ctors` section, which has no differentiating flag in the PE header, but we know we need to treat it as initialization data. The check to see if the sections are aligned by `4` has been removed. The reason is that debug sections often time are `1 aligned` but do have relocation symbols. In order to support relocations of `.debug` sections this check needs to be gone. Crucially this assumption doesn't seem to be in the rest of the code. We only check if there are at least 4 bytes to realign further down the road. 2. The second loop is iterating of all the symbols in the file and trying to add them to the symbols table. Because the classification of the sections we did previously are (currently) not available in this phase we still have to exclude the sections by hand. If they don't we will load in symbols from sections we've explicitly ignored the in # 1. This whole part should rewritten to avoid this. But didn't want to do it in this commit. 3. Finally the sections are relocated. But for some reason the PE files contain a Linux relocation constant in them `0x0011` This constant as far as I can tell does not come from GHC (or I couldn't find where it's being set). I believe this is probably a bug in GAS. But because the constant is in the output we have to handle it. I am thus mapping it to the constant I think it should be `0x0003`. Finally, static linking *should* work, but won't. At least not if you want to statically link `libgcc` with exceptions support. Doing so would require you to link `libgcc` and `libstd++` but also `libmingwex`. The problem is that `libmingwex` also defines a lot of symbols that the RTS automatically injects into the symbol table. Presumably because they're symbols that it needs. like `coshf`. The these symbols are not in a section that is declared with weak symbols support. So if we ever want to get this working, we should either a) Ask mingw to declare the section as such, or b) treat all a imported symbols as being weak. Though this doesn't seem like it's a good idea.. Test Plan: Running ./validate for both x86 and x86_64 Also running the specific test case for #10672 make TESTS="T10672_x86 T10672_x64" Reviewed By: ezyang, thomie, austin Differential Revision: https://phabricator.haskell.org/D1244 GHC Trac Issues: #9907, #10672, #10563 >--------------------------------------------------------------- 620fc6f909cd6e51b5613454097ec1c9f323839a rts/Linker.c | 207 +++++++++++++++-------------------- testsuite/driver/runtests.py | 3 + testsuite/tests/rts/T10672/Main.hs | 14 +++ testsuite/tests/rts/T10672/Makefile | 11 ++ testsuite/tests/rts/T10672/Printf.hs | 34 ++++++ testsuite/tests/rts/T10672/all.T | 11 ++ testsuite/tests/rts/T10672/cxxy.cpp | 23 ++++ 7 files changed, 182 insertions(+), 121 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 620fc6f909cd6e51b5613454097ec1c9f323839a From git at git.haskell.org Sun Oct 4 21:29:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Oct 2015 21:29:06 +0000 (UTC) Subject: [commit: ghc] master: Build system: don't create mk/are-validating.mk (aecf4a5) Message-ID: <20151004212906.72E083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aecf4a5f96d0d3ffcf4cb2c67a20a610d7c64486/ghc >--------------------------------------------------------------- commit aecf4a5f96d0d3ffcf4cb2c67a20a610d7c64486 Author: Thomas Miedema Date: Sat Oct 3 21:42:52 2015 +0200 Build system: don't create mk/are-validating.mk A `make` build after running `./validate` earlier should use the normal mk/build.mk settings, without having to manually delete the leftover file mk/are-validating or run `make clean` first. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1307 >--------------------------------------------------------------- aecf4a5f96d0d3ffcf4cb2c67a20a610d7c64486 .gitignore | 1 - ghc.mk | 3 --- mk/custom-settings.mk | 3 --- validate | 18 +++++++----------- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 48ab194..e61c47e 100644 --- a/.gitignore +++ b/.gitignore @@ -130,7 +130,6 @@ _darcs/ /libraries/plus.gif /libraries/synopsis.png /libraries/stamp/ -/mk/are-validating.mk /mk/build.mk /mk/config.h /mk/config.h.in diff --git a/ghc.mk b/ghc.mk index 9660215..6a294ac 100644 --- a/ghc.mk +++ b/ghc.mk @@ -1324,9 +1324,6 @@ clean_bindistprep: $(call removeTrees,bindistprep/) distclean : clean -# Clean the files that ./validate creates. - $(call removeFiles,mk/are-validating.mk) - # Clean the files that we ask ./configure to create. $(call removeFiles,mk/config.mk) $(call removeFiles,mk/install.mk) diff --git a/mk/custom-settings.mk b/mk/custom-settings.mk index 2b4b127..5f9814b 100644 --- a/mk/custom-settings.mk +++ b/mk/custom-settings.mk @@ -1,6 +1,3 @@ - --include mk/are-validating.mk - ifeq "$(Validating)" "YES" include mk/flavours/validate.mk -include mk/validate.mk diff --git a/validate b/validate index 4c123fe..827815f 100755 --- a/validate +++ b/validate @@ -174,9 +174,7 @@ fi thisdir=`utils/ghc-pwd/dist-boot/ghc-pwd` -echo "Validating=YES" > mk/are-validating.mk -echo "ValidateSpeed=$speed" >> mk/are-validating.mk -echo "ValidateHpc=$hpc" >> mk/are-validating.mk +make_settings="Validating=YES ValidateSpeed=$speed ValidateHpc=$hpc" # Note [Default build system verbosity]. # @@ -190,16 +188,14 @@ echo "ValidateHpc=$hpc" >> mk/are-validating.mk # `make -s`, when user explicitly asks for it with `./validate --quiet`. if [ $be_quiet -eq 1 ]; then # See Note [Default build system verbosity]. - echo "V=0" >> mk/are-validating.mk # Less gunk + make_settings="$make_settings V=0" fi if [ $use_dph -eq 1 ]; then - echo "BUILD_DPH=YES" >> mk/are-validating.mk -else - echo "BUILD_DPH=NO" >> mk/are-validating.mk + make_settings="$make_settings BUILD_DPH=YES" fi -$make -j$threads +$make -j$threads $make_settings # For a "debug make", add "--debug=b --debug=m" check_packages post-build @@ -209,8 +205,8 @@ check_packages post-build if [ $speed != "FAST" ]; then - $make binary-dist-prep - $make test_bindist TEST_PREP=YES + $make binary-dist-prep $make_settings + $make test_bindist TEST_PREP=YES $make_settings # # Install the xhtml package into the bindist. @@ -221,7 +217,7 @@ if [ $speed != "FAST" ]; then check_packages post-install - $make validate_build_xhtml BINDIST_PREFIX="$thisdir/$bindistdir" + $make validate_build_xhtml BINDIST_PREFIX="$thisdir/$bindistdir" $make_settings check_packages post-xhtml fi From git at git.haskell.org Sun Oct 4 21:29:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 4 Oct 2015 21:29:09 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: only add -fno-warn-missed-specialisations for ghc>=7.11 (c0bdfee) Message-ID: <20151004212909.2C2E53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c0bdfee72de789d0cfbd8d93a2111f348660cfbc/ghc >--------------------------------------------------------------- commit c0bdfee72de789d0cfbd8d93a2111f348660cfbc Author: Thomas Miedema Date: Sun Oct 4 18:46:12 2015 +0200 Testsuite: only add -fno-warn-missed-specialisations for ghc>=7.11 It should be possible to run the testsuite with older versions of GHC. Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1308 >--------------------------------------------------------------- c0bdfee72de789d0cfbd8d93a2111f348660cfbc testsuite/mk/ghc-config.hs | 6 ++++++ testsuite/mk/test.mk | 2 ++ 2 files changed, 8 insertions(+) diff --git a/testsuite/mk/ghc-config.hs b/testsuite/mk/ghc-config.hs index 9a6a5e7..c5ad5ff 100644 --- a/testsuite/mk/ghc-config.hs +++ b/testsuite/mk/ghc-config.hs @@ -34,6 +34,12 @@ main = do _ -> "package-conf" putStrLn $ "GhcPackageDbFlag" ++ '=':pkgdb_flag + let minGhcVersion711 = case lookup "Project version" fields of + Just v + | parseVersion v >= [7,11] -> "YES" + _ -> "NO" + putStrLn $ "MinGhcVersion711" ++ '=':minGhcVersion711 + getGhcFieldOrFail :: [(String,String)] -> String -> String -> IO () getGhcFieldOrFail fields mkvar key diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 27d7f73..e20a522 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -44,9 +44,11 @@ TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user- # TEST_HC_OPTS += -fno-warn-tabs +ifeq "$(MinGhcVersion711)" "YES" # Don't warn about missing specialisations. They can only occur with `-O`, but # we want tests to produce the same output for all test ways. TEST_HC_OPTS += -fno-warn-missed-specialisations +endif RUNTEST_OPTS = From git at git.haskell.org Mon Oct 5 09:11:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Oct 2015 09:11:08 +0000 (UTC) Subject: [commit: nofib] master: Add a new GHC status line pattern (faad2cd) Message-ID: <20151005091108.ED13A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/faad2cd7a1803f762f5d9d2995f7ea64fcc06f19/nofib >--------------------------------------------------------------- commit faad2cd7a1803f762f5d9d2995f7ea64fcc06f19 Author: Joachim Breitner Date: Mon Oct 5 11:13:02 2015 +0200 Add a new GHC status line pattern for when a recent version of the runtime is used together with cachegrind. >--------------------------------------------------------------- faad2cd7a1803f762f5d9d2995f7ea64fcc06f19 nofib-analyse/Slurp.hs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nofib-analyse/Slurp.hs b/nofib-analyse/Slurp.hs index a895ea3..20cdcec 100644 --- a/nofib-analyse/Slurp.hs +++ b/nofib-analyse/Slurp.hs @@ -198,6 +198,14 @@ ghc6_re s = case matchRegex re s of Nothing -> Nothing where re = mkRegex "^<>" +ghc7_re :: String -> Maybe (Integer, Integer, Integer, Integer, Integer, Integer, Integer, Float, Float, Float, Float, Float, Float,Int,Float,Float,Int,Float,Float,Float, Integer, Integer, Integer, Integer) +ghc7_re s = case matchRegex re s of + Just [allocations, gcs, gc0_count, gc1_count, avg_residency, max_residency, samples, gc_work', in_use, initialisation, initialisation_elapsed, mut, mut_elapsed, gc, gc_elapsed, gc0, gc0_elapsed, gc1, gc1_elapsed, bal, instructions, memory_reads, memory_writes, l2_cache_misses] -> + Just (read allocations, read gcs, read avg_residency, read max_residency, read samples, read gc_work', 1048576 * read in_use, read initialisation, read initialisation_elapsed, read mut, read mut_elapsed, read gc, read gc_elapsed, read gc0_count, read gc0, read gc0_elapsed, read gc1_count, read gc1, read gc1_elapsed, read bal, read instructions, read memory_reads, read memory_writes, read l2_cache_misses) + Just _ -> error "ghc3_re: Can't happen" + Nothing -> Nothing + where re = mkRegex "^<>" + wrong_exit_status, wrong_output, out_of_heap, out_of_stack :: Regex wrong_exit_status = mkRegex "^\\**[ \t]*expected exit status ([0-9]+) not seen ; got ([0-9]+)" wrong_output = mkRegex "^expected (stdout|stderr) not matched by reality$" @@ -399,6 +407,14 @@ parse_run_time prog (l:ls) res ex = [gc0_count] [gc0] [gc0_elapsed] [gc1_count] [gc1] [gc1_elapsed] [bal] [gc_work'] Nothing Nothing Nothing Nothing [in_use]; + Nothing -> + + case ghc7_re l of { + Just (allocations, _, _, _, _, gc_work', in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed, gc0_count, gc0, gc0_elapsed, gc1_count, gc1, gc1_elapsed, bal, is, mem_rs, mem_ws, cache_misses') -> + got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed + [gc0_count] [gc0] [gc0_elapsed] [gc1_count] [gc1] [gc1_elapsed] [bal] + [gc_work'] (Just is) (Just mem_rs) (Just mem_ws) (Just cache_misses') [in_use]; + Nothing | "< error $ "Failed to parse GHC output " ++ show l | otherwise -> @@ -427,7 +443,7 @@ parse_run_time prog (l:ls) res ex = Nothing -> parse_run_time prog ls res ex; - }}}}}}}}}} + }}}}}}}}}}} where got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed gc0_count gc0 gc0_elapsed gc1_count gc1 gc1_elapsed bal gc_work' instrs' mem_rs mem_ws cache_misses' in_use = -- trace ("got_run_result: " ++ initialisation ++ ", " ++ mut ++ ", " ++ gc) $ From git at git.haskell.org Mon Oct 5 12:05:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Oct 2015 12:05:39 +0000 (UTC) Subject: [commit: ghc] master: A few typos in comments (7fcfee1) Message-ID: <20151005120539.A5F513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7fcfee1c6d2199a422d47e9d4cdcd4b24f48ba4f/ghc >--------------------------------------------------------------- commit 7fcfee1c6d2199a422d47e9d4cdcd4b24f48ba4f Author: Gabor Greif Date: Mon Oct 5 14:05:56 2015 +0200 A few typos in comments >--------------------------------------------------------------- 7fcfee1c6d2199a422d47e9d4cdcd4b24f48ba4f compiler/coreSyn/CoreUnfold.hs | 2 +- compiler/typecheck/TcUnify.hs | 4 ++-- testsuite/tests/gadt/records-fail1.hs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index b04c13d..edbe503 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -1239,7 +1239,7 @@ CONLIKE thing (modulo lets). Note [Lone variables] See also Note [Interaction of exprIsWorkFree and lone variables] ~~~~~~~~~~~~~~~~~~~~~ which appears below The "lone-variable" case is important. I spent ages messing about -with unsatisfactory varaints, but this is nice. The idea is that if a +with unsatisfactory variants, but this is nice. The idea is that if a variable appears all alone as an arg of lazy fn, or rhs BoringCtxt diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs index 2e3834e..8042cc5 100644 --- a/compiler/typecheck/TcUnify.hs +++ b/compiler/typecheck/TcUnify.hs @@ -850,7 +850,7 @@ We may encounter a unification ty1 ~ ty2 that cannot be performed syntactically, and yet its consistency is undetermined. Previously, there was no way to still make it consistent. So a mismatch error was issued. -Now these unfications are deferred until constraint simplification, where type +Now these unifications are deferred until constraint simplification, where type family instances and given equations may (or may not) establish the consistency. Deferred unifications are of the form F ... ~ ... @@ -860,7 +860,7 @@ E.g. id :: x ~ y => x -> y id e = e -involves the unfication x = y. It is deferred until we bring into account the +involves the unification x = y. It is deferred until we bring into account the context x ~ y to establish that it holds. If available, we defer original types (rather than those where closed type diff --git a/testsuite/tests/gadt/records-fail1.hs b/testsuite/tests/gadt/records-fail1.hs index b26404a..12bb3e0 100644 --- a/testsuite/tests/gadt/records-fail1.hs +++ b/testsuite/tests/gadt/records-fail1.hs @@ -10,7 +10,7 @@ -- It's been removed in August 2015 -- see Phab D1118 --- test should result into parse error +-- test should result in a parse error module ShouldFail where From git at git.haskell.org Mon Oct 5 17:38:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 5 Oct 2015 17:38:49 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: make driver python 2.6 compatible again (5ca1d31) Message-ID: <20151005173849.08C2E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5ca1d312b4a0a4a118b476d8ed18d4769d205415/ghc >--------------------------------------------------------------- commit 5ca1d312b4a0a4a118b476d8ed18d4769d205415 Author: Thomas Miedema Date: Mon Oct 5 17:32:02 2015 +0200 Testsuite: make driver python 2.6 compatible again Reviewed by: kgardas Differential Revision: https://phabricator.haskell.org/D1311 >--------------------------------------------------------------- 5ca1d312b4a0a4a118b476d8ed18d4769d205415 testsuite/driver/testlib.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 5ca17f2..3ca5d02 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1646,14 +1646,14 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file, if config.verbose >= 1 and _expect_pass(way): # See Note [Output comparison]. - r = os.system('diff -uw {} {}'.format(expected_normalised_path, - actual_normalised_path)) + r = os.system('diff -uw {0} {1}'.format(expected_normalised_path, + actual_normalised_path)) # If for some reason there were no non-whitespace differences, # then do a full diff if r == 0: - r = os.system('diff -u {} {}'.format(expected_normalised_path, - actual_normalised_path)) + r = os.system('diff -u {0} {1}'.format(expected_normalised_path, + actual_normalised_path)) if config.accept and (getTestOpts().expect == 'fail' or way in getTestOpts().expect_fail_for): @@ -1691,7 +1691,7 @@ def normalise_callstacks(str): def repl(matches): location = matches.group(1) location = normalise_slashes_(location) - return ', called at {}:: in :'.format(location) + return ', called at {0}:: in :'.format(location) # Ignore line number differences in call stacks (#10834). return re.sub(', called at (.+):[\\d]+:[\\d]+ in [\\w\-\.]+:', repl, str) @@ -1818,7 +1818,7 @@ def rawSystemWithTimeout(cmd_and_args): if r == 99 and getTestOpts().exit_code != 99: # Only print a message when timeout killed the process unexpectedly. cmd = cmd_and_args[-1] - if_verbose(1, 'Timeout happened...killed process "{}"...\n'.format(cmd)) + if_verbose(1, 'Timeout happened...killed process "{0}"...\n'.format(cmd)) return r # cmd is a complex command in Bourne-shell syntax From git at git.haskell.org Tue Oct 6 02:16:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 02:16:17 +0000 (UTC) Subject: [commit: ghc] master: Deduplicate one-shot/make compile paths. (427f8a1) Message-ID: <20151006021617.599B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/427f8a15c385de486d479989ecfbb6f82699f405/ghc >--------------------------------------------------------------- commit 427f8a15c385de486d479989ecfbb6f82699f405 Author: Edward Z. Yang Date: Fri Oct 2 22:05:24 2015 -0700 Deduplicate one-shot/make compile paths. Summary: We had a duplicate copy of the code for --make and for -c which was a pain. The call graph looked something like this: compileOne -> genericHscCompileGetFrontendResult -> genericHscFrontend hscCompileOneShot ---^ with genericHscCompileGetFrontendResult and hscCompileOneShot duplicating logic for deciding whether or not recompilation was needed. This patchset fixes it, so now everything goes through this call-chain: compileOne (--make entry point) Calls hscIncrementCompile, invokes the pipeline to do codegen and sets up linkables. hscIncrementalCompile (-c entry point) Calls hscIncrementalFrontend, and then simplifying, desugaring, and writing out the interface. hscIncrementalFrontend Performs recompilation avoidance, if recompilation needed, does parses typechecking. I also cleaned up some of the MergeBoot nonsense by introducing a FrontendResult type. NB: this BREAKS #8101 again, because I can't unconditionally desugar due to Haddock barfing on lint, see #10600 Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonpj, bgamari, simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1302 >--------------------------------------------------------------- 427f8a15c385de486d479989ecfbb6f82699f405 compiler/main/DriverPipeline.hs | 257 ++++++++++++--------------------- compiler/main/Hooks.hs | 5 +- compiler/main/HscMain.hs | 310 +++++++++++++++++++++------------------- compiler/typecheck/TcRnTypes.hs | 7 + testsuite/tests/driver/all.T | 2 +- 5 files changed, 261 insertions(+), 320 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 427f8a15c385de486d479989ecfbb6f82699f405 From git at git.haskell.org Tue Oct 6 10:38:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 10:38:20 +0000 (UTC) Subject: [commit: ghc] master: Remove dead code: ruleLhsOrphNames (ca816c6) Message-ID: <20151006103820.E2B603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ca816c6db6c9cbce4cf1670a791dd541c3edf771/ghc >--------------------------------------------------------------- commit ca816c6db6c9cbce4cf1670a791dd541c3edf771 Author: Simon Peyton Jones Date: Tue Oct 6 09:53:07 2015 +0100 Remove dead code: ruleLhsOrphNames >--------------------------------------------------------------- ca816c6db6c9cbce4cf1670a791dd541c3edf771 compiler/coreSyn/CoreFVs.hs | 17 +---------------- compiler/specialise/Rules.hs | 1 - 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs index f5f58dc..af4197e 100644 --- a/compiler/coreSyn/CoreFVs.hs +++ b/compiler/coreSyn/CoreFVs.hs @@ -24,7 +24,7 @@ module CoreFVs ( idUnfoldingVars, idFreeVars, idRuleAndUnfoldingVars, idRuleVars, idRuleRhsVars, stableUnfoldingVars, ruleRhsFreeVars, ruleFreeVars, rulesFreeVars, - ruleLhsOrphNames, ruleLhsFreeIds, exprsOrphNames, + ruleLhsFreeIds, exprsOrphNames, vectsFreeVars, -- * Core syntax tree annotation with free variables @@ -215,21 +215,6 @@ tickish_fvs _ = noVars ************************************************************************ -} --- | ruleLhsOrphNames is used when deciding whether --- a rule is an orphan. In particular, suppose that T is defined in this --- module; we want to avoid declaring that a rule like: --- --- > fromIntegral T = fromIntegral_T --- --- is an orphan. Of course it isn't, and declaring it an orphan would --- make the whole module an orphan module, which is bad. -ruleLhsOrphNames :: CoreRule -> NameSet -ruleLhsOrphNames (BuiltinRule { ru_fn = fn }) = unitNameSet fn -ruleLhsOrphNames (Rule { ru_fn = fn, ru_args = tpl_args }) - = extendNameSet (exprsOrphNames tpl_args) fn - -- No need to delete bndrs, because - -- exprsOrphNames finds only External names - -- | Finds the free /external/ names of an expression, notably -- including the names of type constructors (which of course do not show -- up in 'exprFreeVars'). diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index dd48832..d6a56d6 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -180,7 +180,6 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs -- A rule is an orphan only if none of the variables -- mentioned on its left-hand side are locally defined lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn) - -- TODO: copied from ruleLhsOrphNames -- Since rules get eventually attached to one of the free names -- from the definition when compiling the ABI hash, we should make From git at git.haskell.org Tue Oct 6 10:38:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 10:38:23 +0000 (UTC) Subject: [commit: ghc] master: Comments only (8c1866a) Message-ID: <20151006103823.9ABEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8c1866adcb393d911e53214d39193de205ca6395/ghc >--------------------------------------------------------------- commit 8c1866adcb393d911e53214d39193de205ca6395 Author: Simon Peyton Jones Date: Fri Oct 2 08:39:26 2015 +0100 Comments only >--------------------------------------------------------------- 8c1866adcb393d911e53214d39193de205ca6395 compiler/typecheck/TcMatches.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs index ebb7797..70afae4 100644 --- a/compiler/typecheck/TcMatches.hs +++ b/compiler/typecheck/TcMatches.hs @@ -890,6 +890,8 @@ tcApplicativeStmts ctxt pairs rhs_ty thing_inside ; let fun_ty = mkFunTys pat_tys body_ty -- NB. do the <$>,<*> operators first, we don't want type errors here + -- i.e. goOps before goArgs + -- See Note [Treat rebindable syntax first] ; let (ops, args) = unzip pairs ; ops' <- goOps fun_ty (zip3 ops (ts ++ [rhs_ty]) exp_tys) From git at git.haskell.org Tue Oct 6 10:38:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 10:38:26 +0000 (UTC) Subject: [commit: ghc] master: Fix kind-var abstraction in SimplUtils.abstractFloats (0e169a8) Message-ID: <20151006103826.A940B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0e169a8b2b672ca95aad72511865c0b3fca458d3/ghc >--------------------------------------------------------------- commit 0e169a8b2b672ca95aad72511865c0b3fca458d3 Author: Simon Peyton Jones Date: Tue Oct 6 09:52:21 2015 +0100 Fix kind-var abstraction in SimplUtils.abstractFloats A missing 'closeOverKinds' triggered Trac #10934. Happily the fix is simple. Merge to 7.10.3 >--------------------------------------------------------------- 0e169a8b2b672ca95aad72511865c0b3fca458d3 compiler/simplCore/SimplUtils.hs | 47 +++++++++++++++++++++++-------------- testsuite/tests/polykinds/T10934.hs | 38 ++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 1 + 3 files changed, 69 insertions(+), 17 deletions(-) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index effd212..59d3a05 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1522,6 +1522,30 @@ as we would normally do. That's why the whole transformation is part of the same process that floats let-bindings and constructor arguments out of RHSs. In particular, it is guarded by the doFloatFromRhs call in simplLazyBind. + +Note [Which type variables to abstract over] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Abstract only over the type variables free in the rhs wrt which the +new binding is abstracted. Note that + + * The naive approach of abstracting wrt the + tyvars free in the Id's /type/ fails. Consider: + /\ a b -> let t :: (a,b) = (e1, e2) + x :: a = fst t + in ... + Here, b isn't free in x's type, but we must nevertheless + abstract wrt b as well, because t's type mentions b. + Since t is floated too, we'd end up with the bogus: + poly_t = /\ a b -> (e1, e2) + poly_x = /\ a -> fst (poly_t a *b*) + + * We must do closeOverKinds. Example (Trac #10934): + f = /\k (f:k->*) (a:k). let t = AccFailure @ (f a) in ... + Here we want to float 't', but we must remember to abstract over + 'k' as well, even though it is not explicitly mentioned in the RHS, + otherwise we get + t = /\ (f:k->*) (a:k). AccFailure @ (f a) + which is obviously bogus. -} abstractFloats :: [OutTyVar] -> SimplEnv -> OutExpr -> SimplM ([OutBind], OutExpr) @@ -1542,23 +1566,12 @@ abstractFloats main_tvs body_env body ; return (subst', (NonRec poly_id poly_rhs)) } where rhs' = CoreSubst.substExpr (text "abstract_floats2") subst rhs - tvs_here = varSetElemsKvsFirst (main_tv_set `intersectVarSet` exprSomeFreeVars isTyVar rhs') - - -- Abstract only over the type variables free in the rhs - -- wrt which the new binding is abstracted. But the naive - -- approach of abstract wrt the tyvars free in the Id's type - -- fails. Consider: - -- /\ a b -> let t :: (a,b) = (e1, e2) - -- x :: a = fst t - -- in ... - -- Here, b isn't free in x's type, but we must nevertheless - -- abstract wrt b as well, because t's type mentions b. - -- Since t is floated too, we'd end up with the bogus: - -- poly_t = /\ a b -> (e1, e2) - -- poly_x = /\ a -> fst (poly_t a *b*) - -- So for now we adopt the even more naive approach of - -- abstracting wrt *all* the tyvars. We'll see if that - -- gives rise to problems. SLPJ June 98 + + -- tvs_here: see Note [Which type variables to abstract over] + tvs_here = varSetElemsKvsFirst $ + intersectVarSet main_tv_set $ + closeOverKinds $ + exprSomeFreeVars isTyVar rhs' abstract subst (Rec prs) = do { (poly_ids, poly_apps) <- mapAndUnzipM (mk_poly tvs_here) ids diff --git a/testsuite/tests/polykinds/T10934.hs b/testsuite/tests/polykinds/T10934.hs new file mode 100644 index 0000000..fb7a538 --- /dev/null +++ b/testsuite/tests/polykinds/T10934.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE + ScopedTypeVariables + , DataKinds + , GADTs + , RankNTypes + , TypeOperators + , PolyKinds -- Comment out PolyKinds and the bug goes away. + #-} +{-# OPTIONS_GHC -O #-} + -- The bug is in SimplUtils.abstractFloats, so we need -O to trigger it + +module KeyValue where + +data AccValidation err a = AccFailure err | AccSuccess a + +data KeyValueError = MissingValue + +type WithKeyValueError = AccValidation [KeyValueError] + +missing :: forall f rs. RecApplicative rs => Rec (WithKeyValueError :. f) rs +missing = rpure missingField + where + missingField :: forall x. (WithKeyValueError :. f) x + missingField = Compose $ AccFailure [MissingValue] + +data Rec :: (u -> *) -> [u] -> * where + RNil :: Rec f '[] + (:&) :: !(f r) -> !(Rec f rs) -> Rec f (r ': rs) + +newtype Compose (f :: l -> *) (g :: k -> l) (x :: k) + = Compose { getCompose :: f (g x) } + +type (:.) f g = Compose f g + +class RecApplicative rs where + rpure + :: (forall x. f x) + -> Rec f rs diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index c073c1b..b1e0793 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -121,3 +121,4 @@ test('T10670', normal, compile, ['']) test('T10670a', normal, compile, ['']) test('T10134', normal, multimod_compile, ['T10134.hs','-v0']) test('T10742', normal, compile, ['']) +test('T10934', normal, compile, ['']) From git at git.haskell.org Tue Oct 6 10:38:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 10:38:29 +0000 (UTC) Subject: [commit: ghc] master: Comments only (7da3d30) Message-ID: <20151006103829.661783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7da3d30cbe52bf25b901a5e18031987a55c52e85/ghc >--------------------------------------------------------------- commit 7da3d30cbe52bf25b901a5e18031987a55c52e85 Author: Simon Peyton Jones Date: Tue Oct 6 09:53:18 2015 +0100 Comments only >--------------------------------------------------------------- 7da3d30cbe52bf25b901a5e18031987a55c52e85 compiler/typecheck/Inst.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/typecheck/Inst.hs b/compiler/typecheck/Inst.hs index 18a0e2f..f4caf2b 100644 --- a/compiler/typecheck/Inst.hs +++ b/compiler/typecheck/Inst.hs @@ -407,6 +407,9 @@ syntaxNameCtxt name orig ty tidy_env -} getOverlapFlag :: Maybe OverlapMode -> TcM OverlapFlag +-- Construct the OverlapFlag from the global module flags, +-- but if the overlap_mode argument is (Just m), +-- set the OverlapMode to 'm' getOverlapFlag overlap_mode = do { dflags <- getDynFlags ; let overlap_ok = xopt Opt_OverlappingInstances dflags From git at git.haskell.org Tue Oct 6 10:56:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 10:56:08 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: nativeGen PPC: fix > 16 bit offsets in stack handling (e22d7dc) Message-ID: <20151006105608.5D3AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/e22d7dc434b64709a4b19b11f2e0a41676c04035/ghc >--------------------------------------------------------------- commit e22d7dc434b64709a4b19b11f2e0a41676c04035 Author: Erik de Castro Lopo Date: Sat Oct 3 11:25:46 2015 +1000 nativeGen PPC: fix > 16 bit offsets in stack handling Back port of Peter Trommler's patch from master (19dae027cb) to the 7.10 branch. Peter's commit does not apply to the 7.10 branch because PowerPC64 was added to master after the 7.10 branch was started. Comments from the original commit: Implement access to spill slots at offsets larger than 16 bits. Also allocation and deallocation of spill slots was restricted to 16 bit offsets. Now 32 bit offsets are supported on all PowerPC platforms. The implementation of 32 bit offsets requires more than one instruction but the native code generator wants one instruction. So we implement pseudo-instructions that are pretty printed into multiple assembly instructions. With pseudo-instructions for spill slot allocation and deallocation we can also implement handling of the back chain pointer according to the ELF ABIs. >--------------------------------------------------------------- e22d7dc434b64709a4b19b11f2e0a41676c04035 compiler/nativeGen/PPC/Instr.hs | 27 ++++++++++++++++++++------- compiler/nativeGen/PPC/Ppr.hs | 33 +++++++++++++++++++++++++++++++++ compiler/nativeGen/PPC/Regs.hs | 12 +++++++++++- includes/CodeGen.Platform.hs | 7 +++++-- 4 files changed, 69 insertions(+), 10 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 e22d7dc434b64709a4b19b11f2e0a41676c04035 From git at git.haskell.org Tue Oct 6 11:34:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 11:34:16 +0000 (UTC) Subject: [commit: ghc] master: Comments about TcLevel assignment (3833e71) Message-ID: <20151006113416.A57493A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3833e71dba10b0a347b5a297a75dcdb6c69d7e72/ghc >--------------------------------------------------------------- commit 3833e71dba10b0a347b5a297a75dcdb6c69d7e72 Author: Simon Peyton Jones Date: Tue Oct 6 12:36:30 2015 +0100 Comments about TcLevel assignment Triggered by investigations around Trac 10845 >--------------------------------------------------------------- 3833e71dba10b0a347b5a297a75dcdb6c69d7e72 compiler/typecheck/TcType.hs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index e5f49e4..bb937c6 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -433,6 +433,7 @@ data UserTypeCtxt newtype TcLevel = TcLevel Int deriving( Eq, Ord ) -- See Note [TcLevel and untouchable type variables] for what this Int is + -- See also Note [TcLevel assignment] {- Note [TcLevel and untouchable type variables] @@ -458,7 +459,6 @@ Note [TcLevel and untouchable type variables] implication are all untouchable; ie their level numbers are LESS THAN the ic_tclvl of the implication - Note [Skolem escape prevention] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We only unify touchable unification variables. Because of @@ -491,15 +491,35 @@ emerges. If we (wrongly) spontaneously solved it to get uf := beta, the whole implication disappears but when we pop out again we are left with (F Int ~ uf) which will be unified by our final zonking stage and uf will get unified *once more* to (F Int). + +Note [TcLevel assignment] +~~~~~~~~~~~~~~~~~~~~~~~~~ +We arrange the TcLevels like this + + 1 Top level + 2 Flatten-meta-vars of level 3 + 3 First-level implication constraints + 4 Flatten-meta-vars of level 5 + 5 Second-level implication constraints + ...etc... + +The even-numbered levels are for the flatten-meta-variables assigned +at the next level in. Eg for a second-level implication conststraint +(level 5), the flatten meta-vars are level 4, which makes them untouchable. +The flatten meta-vars could equally well all have level 0, or just NotALevel +since they do not live across implications. -} fmvTcLevel :: TcLevel -> TcLevel +-- See Note [TcLevel assignment] fmvTcLevel (TcLevel n) = TcLevel (n-1) topTcLevel :: TcLevel +-- See Note [TcLevel assignment] topTcLevel = TcLevel 1 -- 1 = outermost level pushTcLevel :: TcLevel -> TcLevel +-- See Note [TcLevel assignment] pushTcLevel (TcLevel us) = TcLevel (us + 2) strictlyDeeperThan :: TcLevel -> TcLevel -> Bool From git at git.haskell.org Tue Oct 6 14:59:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 14:59:19 +0000 (UTC) Subject: [commit: ghc] wip/rae: Merge #10817/#10899 (e27b267f) (8b69b31) Message-ID: <20151006145919.912C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/8b69b318802f59cfeb0779779cfbbebf74348fa0/ghc >--------------------------------------------------------------- commit 8b69b318802f59cfeb0779779cfbbebf74348fa0 Author: Richard Eisenberg Date: Tue Oct 6 11:00:11 2015 -0400 Merge #10817/#10899 (e27b267f) >--------------------------------------------------------------- 8b69b318802f59cfeb0779779cfbbebf74348fa0 compiler/iface/MkIface.hs | 2 +- compiler/iface/TcIface.hs | 2 +- compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 4 ++-- compiler/typecheck/TcTyClsDecls.hs | 22 ++++++++++++++-------- compiler/typecheck/TcValidity.hs | 15 ++++++++++++++- compiler/types/Class.hs | 6 +++++- .../tests/indexed-types/should_fail/T10817.hs | 14 ++++++++++++++ .../tests/indexed-types/should_fail/T10817.stderr | 6 ++++++ .../tests/indexed-types/should_fail/T10899.hs | 7 +++++++ .../tests/indexed-types/should_fail/T10899.stderr | 4 ++++ testsuite/tests/indexed-types/should_fail/all.T | 3 ++- testsuite/tests/typecheck/should_compile/tc253.hs | 2 ++ 13 files changed, 73 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 8b69b318802f59cfeb0779779cfbbebf74348fa0 From git at git.haskell.org Tue Oct 6 14:59:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 14:59:23 +0000 (UTC) Subject: [commit: ghc] wip/rae's head updated: Merge #10817/#10899 (e27b267f) (8b69b31) Message-ID: <20151006145923.A1DEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/rae' now includes: bb06039 Bump version to 7.10.0 a8c556d Fix typo in GLASGOW_HASKELL_PATCHLEVEL2 macro f10b79d fix spInfoSrcLoc field name a79cfe5 dwarf: sync getIdFromTrivialExpr with exprIsTrivial (test break028 and others) f748ccd Rename NamedWildcards flag to NamedWildCards c52565e Fix panic on :kind _ in GHCi (Trac #9879) 2accf97 Groom comments related to StaticPointers. 8869388 always use 'mkdir -p' and fix missing dir (fixes #9876) 9e87d8c Test earlier for self-import (Trac #9032) a643559 Copy GHC's config.guess/sub over libffi's versions 4566852 Make ghc -e not exit on valid import commands (#9905) 3afe35d Fix linker interaction between Template Haskell and HPC (#9762) a96eb1c Use directory-style database for bootstrapping database 62a6d14 Run T9762 only if dynamic libraries are available a1e2a2c Update Cabal submodule to latest 1.22 snapshot ab69f9f Update Cabal submodule to 1.22.0.0 release tag 23a38fe Release note entry for `-fdefer-typed-holes` 224a48e Fix `heapSizeSuggesionAuto` typo (#9934) 44815dd Update syntax of pattern synonym type signature in documentation (fixes #9967) ee20cbf Fix system linker on Mac OS X 14c198b Support pattern synonyms in GHCi (fixes #9900) 1f59f9a Pattern synonyms do work in GHCi now (see #9900) 6a0182d Don't do a half-hearted recompilation check in compileOne c2c6f64 Fix #9243 so recompilation avoidance works with -fno-code 2b76240 Update pretty submodule to 1.1.2.0 release d834464 Update Cabal submodule to latest 1.22.0.1 snapshot bb56695 Improve documentation for -N and -qa (#9890) 8608429 Allow the linker to run concurrently with the GC fb582ef Compile the RTS with -g by default a7060f9 Optimise scavenge_large_srt_bitmap aaca7bd Add Eq, Ord, Show, and Read instances for Const 4a4d179 aclocal.m4: fix == bashism in FIND_LLVM_PROG b5789df Repsect the package name when checking for self-import c9ab42f Fix a terrible bug in the canonicaliser which led to an infinite loop 194f1b5 Update Cabal/directory/process/terminfo submodules 9db49ea Update bytestring submodule 42aad28 Fix bad '... \\' escape in ghcversion.h generation dfb2b5d add -th-file which generates a th.hs file ced7f4f Trac #9878: Make the static form illegal in interpreted mode. 95368a7 Fix panics of PartialTypeSignatures combined with extensions 87697aa Trac #9384: fix increasing capabilites number for eventlog. f0754dc Pattern synonym names need to be in scope before renaming bindings (#9889) d6ddfcc Package environments d33e2ff Don't hardcode the name "ghc" in versionedAppDir 4ab5702 Dwarf generation fixed pt 2 5541b6c Make AutoDeriveTypeable work for associated datatypes (fix #9999) cd66ec3 Trac #9878: Have StaticPointers support dynamic loading. 37c6934 Update directory submodule to latest 1.2.2 snapshot 4baf8d2 #9957: fix docs for unticked promoted constructor warning a01de8b We track branch 1.22 for GHC 7.10.x fffc60b Update Cabal submodule to latest 1.22.1.0 snapshot a993712 CMM: add a mechanism to import C .data labels dde5561 Restore invariant in `Data (Ratio a)` instance 4c49f08 Update submodule git branch for haddock bcfe534 Restore invariant in `Data (Ratio a)` instance a2858b8 Update binary submodule to 0.7.3.0 release d2f34c9 Update Haddock submodule to `master` branch tip 19ad227 Revert zipWith strictification (re #9949) 53af4bb Improve documentation of pattern synonyms, to reflect conclusion of Trac #9953 7f9704f Make the linker_unload test less fragile 57df7b3 Respect package visibility when deciding wired in packages. bba041e Improve HsBang ccb7d96 Return a [HsImplBang] from dataConImplBangs even with NoDataConRep 5651b41 More comments on HsBang 1f934a5 Correct typos in comments to mkDataCon 1a7621a API Annotations tweaks. 5eae13b API Annotations documentation update, parsing issue, add example test 174082f Split stripTicks into expression editing and tick collection 62d716e Update haskeline submodule to upstream master tip 25e416d Update release notes 5f2af66 RTS : Fix StgRun for aarch64-linux (#9935). 2387369 Fix #10031 by inverting a critical test in kick_out. e25e78f docs: Fix #9928 (wrong version info) 7bf4793 Event Manager: Make one-shot a per-registration property ddd95c0 Fix #10017 aafc415 docs: Add mention of prefetch API changes (#9937) cd0bbc5 docs: Add missing libraries to release notes (#10038) 9ed5689 fix _FILE_OFFSET_BITS redefined warning on Solaris/i386 platform 29bb156 Bring Match m_fun_id_infix through the renamer. 9956c18 GRHS with empty wherebinds gets wrong SrcSpan 262f7a8 Provide default implementation of `Monad(return)` b5f465e Put parens around (ty :: kind) when pretty-printing TH syntax 4c8b652 Fix the nullary-type-class case for associated types 3748c73 Fix Trac #10004: head [] exception when using recursive mdo dd1561f cabal: update submodule (re: #10036) 1d401b4 Fix a profiling bug ed4de44 Don't overwrite input file by default 4e25dc6 nameIsLocalOrFrom should include interactive modules dfb6b9f Fix #10079 by recurring after flattening exposes a TyConApp. 9970626 Fix egregious typo in checkTauTvUpdate. 976e420 Propagate ReturnTvs in matchExpectedFunTys f9e68c5 Add missing test from previous commit (55199a97) a4b5805 Update submodule to Cabal 1.22.1.0 release ad62865 rts/linker: ignore unknown PE sections f163b15 Fix for ticket #10078: ensure that tcPluginStop is called even in case of type errors d9e24f4 Make top-level "configure" accept and propagate --with-curses-{includes,libraries} to libraries 20ccf72 Improve typechecking of RULEs, to account for type wildcard holes 873c398 {Data,Generic(1),MonadZip} instances for Identity 4afc586 fix bus errors on SPARC caused by unalignment access to alloc_limit (fixes #10043) e34ca99 docs: add INSTALL.md to root dir (#9926) b6fc8a9 docs: Flatten MAKEHELP/SUBMAKEHELP 2f2b5c8 base: fix broken link (#10088) 00693e1 Add configurable verbosity level to hpc d4a04dd docs: Update release notes 528b503 Fix build bogons due to missing separator d67b784 Improve documentation of 'trace' 35a0b67 Move comments about evaluating the message to the top of the module 0e0a0b4 Provide a faster implementation for the Read Integer instance d4903a4 Update process submodule to 1.2.3.0 snapshot 8827ade Emulate GMP 5+ operations for GMP 4.x compat e341dcc Drop redundant LANGUAGE pragmas dc73705 Re-export `<$>` from Prelude (#10113) 8601c744 Re-export `<$` from Prelude (#10113) b2b1c8d Add public rnf/hash operations to TypeRep/TyCon 0d58613 Define proper `MINIMAL` pragma for `class Ix` 11441db Add `GHC.OldList` legacy module aec39c9 AllocationLimitExceeded should be a child of SomeAsyncException bbc36b3 Extend the docs for Data.List.transpose 2e2d540 Dynamically link all loaded packages in new object 6de430d Update submodule to Cabal 1.22.1.1 release 2fb9015 Update deepseq submodule to 1.4.1.0 snapshot 8f6ee69 Update array submodule (min ver bump to 0.5.1.0) 9f19723 fixup T10019 output yet again 4be3722 Rename `SysTools.readCreateProcess`. 0259b5f Update directory submodule to latest 1.2.2 snapshot bd785d1 ghc-prim : Hide 64 bit primops when the word size is 32 bits (fixes #9886). fb2ab1e RTS/IOManager: fix trac issue #9722. 4ce0453 testsuite: format commands using config dict e8fd618 Update Cabal submodule to latest 1.22 snapshot 773b90b Update filepath submodule to filepath-1.4 snapshot dde3a23 Cleanup test framework string formatting 029a296 Update submodule hpc (includes fix for #9619) 6f46fe1 Custom `Typeable` solver, that keeps track of kinds. 89465bc Add missed test (uuugh) cc39344 Rename ty{Con,peRep}Hash to ty{Con,peRep}Fingerprint 65753a9 Move the function strip_quotes to testutil.py 3ea3492 Link temporary shared objects with `--no-as-needed` d6f5b4c We need to import 'cast' on Windows cb51506 Update Cabal submodule to latest 1.22.1.2 snapshot e1bc45c libraries/win32: update submodule feccb32 libraries/base: Remove redundant import ec5e7b1 Update release notes about better solver, with known bugs. 67c3062 Fix Windows testsuite driver f92acd8 Dont call unsafeGlobalDynFlags if it is not set 7974c66 Fix testsuite driver for a profiling compiler 72b114a Update filepath/hpc/process submodules a86fe8a Use the gold linker for linux/ARM and android/ARM targets. 072cc76 Fix build on amd64/solaris. 7c132c0 Update Cabal submodule to 1.22 branch tip fb326db compiler: don't warn on -package-name for now 47cd08a libraries: update win32 submodule 111ff63 testsuite: add a regression test for #10011 602a47a Update haskeline submodule to tagged 0.7.2.0 commit 038bdb2 Update deepseq submodule to 1.4.1.1 tag 49c4678 Bump ghc-prim to 0.4.0.0 9d15af8 Try to reconstruct a changelog for TH 2.10 7bd3efe Update integer-gmp2's changelog for release acbfc19 Update bytestring submodule to 0.10.6.0 release tag 6153d16 Update Cabal submodule to Cabal-v1.22.2.0 rls tag 32a5d95 Improve `Typeable` solver. 4631675 Remove unused parameter to `EvTypeableTyCon` 04ae20c Update haddock submodule to 'master' tip 0926edc testsuite: add test for #10177 507c968 Update haskeline submodule to 0.7.2.1 release tag 7e1758a Test case for #10176 011f691 Trim Call Arity b618d01 Fix integer-gmp source tarball distribution f2c7686 Set release date for base-4.8.0.0 in changelog 252953f Avoid redundant-import warning (w/o CPP) b189a5a Make testsuite driver Python 2.6 compatible again d4ae21a Rearrange order of the release note highlights 774a716 docs/relnotes: update version numbers ca00def Set VERSION=7.10.1, RELEASE=YES e98df4f RELEASE=NO 346a1c1 Fix Git-commit-id detection for RELEASE=YES 0b655e5 fix bus error (misaligned data access) on SPARC in __decodeDouble_Int64 56ecec4 libffi: backport noexecstack fix for x86/win32.S 7b8da47 clarify --no-as-needed is only needed on ELF c05804a docs: remove unused -ddump flags from users guide 2f7eb6c Restore unwind information generation 0953afd docs: add 7.10.2 relnotes skeleton ea93048 docs: some 7.10.2 release notes d7338ac Remove an incorrect statement about -fwarn-tabs 7ffd7f4 User's guide: .a files can be 2-2.5x larger with -split-objs ff95018 fix '&stg_interp_constr_entry' FFI type to be FunPtr 53f7235 Suggest how to fix .ghci when it is group writeable (#8248) 623e203 rts/Linker.c: distinct between DATA and CODE labels when importing 9fd6fae The production for `pquals` is incorrect; the specifics are in D803. 0e34751 The production for squals is incorrect; see D806 for specifics. c2ef5ab Add a bizarre corner-case to cgExpr (Trac #9964) 211cc28 Do not quantify over the function itself in a RULE 681d82c Look inside synonyms for foralls when unifying 37f928a Fix a long-standing bug in the demand analyser a818ca7 Test Trac #10148 5c10c69 Zap usage info in CSE (Trac #10218) cf621d9 Import rand using capi c46e4b1 use projectVersion from DynFlags rather than cProjectVersion for versionedAppDir d86de4a Move libffi configuration after basic toolchain setup 335c025 Fix detection of llvm-x.x 07da52c Do version specific detection of LLVM tools (#10170). 49d4282 More aggressive Given/Wanted overlap check f6c690b GHC.Prim.Constraint is not built-in syntax c09f4f8 Update Cabal submodule to 1.22.3.0 release 99e4e26 configure: LLVM and LD detection improvements (#10329) b856f3f configure: Test for #9920 when compiling for arm a76e360 T10195: Drop -fno-warn-redundant-constraints for GHC 7.10 36a4c2d testsuite: Accept qualified GHC.Prim.Constraint 0e5c4af Commit missing T10148 files and ignore the built executable. 2c7b616 Accept changed DmdType in spec-inline test output ab6cce5 Bump base version to 4.8.1.0 b324fac base: Export GHC.Event(.Internal).Lifetime 7ea4e24 Make sure GHC.List.last is memory-efficient d5c0892 Fix fundep coverage-condition check for poly-kinds 96c99d5 Use the gold linker for aarch64/linux (#9673) 2d3d0cd arm: Force non-executable stack (#10369) 354f506 Teach DmdAnal that coercions are value arguments! 6f31e97 Fix typo: identifer -> identifier d4cfe23 base: Fix confusing docs typo 63205f7 Wibble to DmdAnal ad6059f parser: opt_kind_sig has incorrect SrcSpan f05bf38 parser: API Annotations : guardquals1 does not annotate commas properly 9c11848 parser : the API annotation on opt_sig is being discarded 56e5b75 API Annotations : ExprWithTySig processing discards annotated spans a3dfa17 ApiAnnotations : lexer discards comment close in nested comment ad0551c Correct parsing of lifted empty list constructor d4596ef ApiAnnotations : quoted type variables missing leading quote ec6c9ad ApiAnnotations : RdrHsSyn.isFunLhs discards parentheses 2f463c7 ApiAnnotations : AnnComma missing in TupleSection bd2bfe2 ApiAnnotations: misplaced AnnComma for squals production 3aca63a Fix failing API Annotations tests from master cherry pick 4e14780 Rename role annotations w.r.t only local decls. b7287b2 Test #10321 in ghci/scripts/T10321 768f848 Normalise type families in the type of an expression f424118 Tiny refactoring; no change in behaviour 43e682b Fix #10285 by refusing to use NthCo on a newtype. 95921e6 LlvmCodeGen cross-compiling fixes (#9895) f84df20 arm: Force non-executable stack (part 2) 3389562 Improve Call Arity performance 97bd6d6 Call Arity: Trade precision for performance in large mutually recursive groups 8ae3768 docs: Fix #10210 1915e7f docs: Fix #10302 - only LLVM 3.5 is supported for 7.10 5753910 Fix merge-o in testsuite output that I missed 340b54b haddock: update submodule 6b24d26 Do not allow Typeable on constraints (Trac #9858) 7adecba Fixes (hopefully!) T9858 ff2aa3f Do not decompose => (Trac #9858) da6199d Test Trac #9858 comment:101 d260ce3 Fix more merge-o's from earlier cherry-picks bc4968f Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected. 2a0fb5d ApiAnnotations : mkGadtDecl discards annotations for HsFunTy 168e6db ApiAnnotations : BooleanFormula construction discards original 6fea082 ApiAnnotations : pquals production adds AnnVbar in the wrong place 300a10c ApiAnnotations : PatBind gives wrong SrcSpan for the pattern. f8a001a Update stderrs for tests after cherry pick from master 70925f0 docs: Update 7.10.2 release notes a bit bac8717 Speed up elimCommonBlocks by grouping blocks also by outgoing labels 009e285 Greatly speed up nativeCodeGen/seqBlocks 7f24cdd Fix superclass generation in an instance a6d9c3a CmmCommonBlockElim: Improve hash function 072abeb Add regression test for #10110. 6d5387f user guide: correct documentation for -Wall (fixes #10386) b41e4be includes/stg/SMP.h: implement simple load_/store_load_barrier on armv6 and older 46edc43 compiler: make sure we reject -O + HscInterpreted 4edbfcf Turn off warnings when compiling boolFormula fb918ab ApiAnnotations : AST version of nested forall loses forall annotation adb21a8 ApiAnnotations : parens around a context with wildcard loses annotations d66eb5a ApiAnnotatons : AnnDcolon in wrong place for PatBind 70d594d Revert "compiler: make sure we reject -O + HscInterpreted" 3690f03 Add missing name for FFI import (fixes #9950) 079f228 Fix error messages from open(Binary)TempFileWithDefaultPermissions fe9e5a4 Fix ghci-way tests of -XStaticPointers. 0a7f3b3 Omit the static form error for variables not in scope. d29d7cb testsuite: fix RnStaticPointersFail02 stderr b6e5ad7 testsuite: handle missing stats files gracefully (#10305) 080c4e7 Testdriver: do not interfer with MinGW path magic (#10449) 2d56598 ApiAnnotations tweaks 25b8478 base: fix #10298 & #7695 1ae8363 Don't assume tools are in same directory as ghc in some cases 8203730 Catch canonicalizePath exceptions, fix #10101 71d1574 compiler/specialise: shut match_co up a bit 1cce187 rts: Fix aarch64 implementation of xchg 53ef912 Fix dropped event registrations eae1ac8 Test case for indirect dependencies in ghci linker (#10322) 96d4d03 In ghci linker, link against all previous temp sos (#10322) cf9f638 Reduce magic for seqId 9b406cc Fix quadratic behaviour in tidyOccName 8af219a Fix a huge space leak in the mighty Simplifier 452e336 testsuite: commit missing T4945 stdout 91324d4 compiler: kill a stray pprTrace in OccName 07282c7 testsuite: fix some failures from merge problems b980228 Rename new T9858c to T9858d to avoid test name clash 28943a8 Rename new T9858d to T9858e to avoid test name clash 763936c Rename tests so that they have a unique name. 20d33af compiler: make sure we reject -O + HscInterpreted b57348f ApiAnnotations : rationalise tests 1ff03e4 newTempName: Do not include pid in basename 77b55b8 Detabify a programlisting in the User's Guide (#10425) e59fe3e Give a hint when a TH splice has a bad package key, partially fixes #10279 36c3a51 ghc-pkg support query by package-key, fixes #9507 9c657e5 testsuite: Fix minor print007 fallout 670c39f testsuite: fix T9858e fallout 2237c98 testsuite: Add test for #10489 b901f0f Fix #10488 by unwrapping type synonyms. 1ac6198 Update binary submodule to 0.7.5.0 release 5888405 docs: More 7.10.2 notes 12c1f75 build: Clean testsuite before sdist d66b59a Always force the exception in enqueued commands ab6e80a haddock: update submodule 49201ed Revert "The test runner now also works under the msys-native Python." 38edecd make sdist: distclean testsuite for real (#10406) 9c9bc6b Do not copy stack after stack overflow, refix #8435 800888b Fix DWARF generation for MinGW (#10468) e6eaa9e docs: Fix #10416 0d8ca63 libraries: update Cabal submodule 435808f utils: update haddock submodule 4e2c8f2 docs: More 7.10.2 release notes b43df7c docs: More 7.10.2 release notes 65344f6 docs: More 7.10.2 release notes 41ed737 docs: More 7.10.2 release notes 636fc2e docs: More 7.10.2 release notes f4f6f18 docs: More 7.10.2 release notes a9c540e relnotes: Remove duplicate 'known bugs' entry fa942e6 UNREG: fix pprHexVal to emit zeros (#10518) 91538a2 Enable SMP and GHCi support for Aarch64 60016f7 relnotes: More notes, some wordsmithing 3670f33 Fix #10534 007274e Update Cabal submodule to Cabal-v1.22.4.0 rls tag 4a87fe4 Fix ghc-pkg reports cache out date (#10205) 558eb05 Care with impossible-cons in combineIdenticalAlts 8fb101e Revert "Look inside synonyms for foralls when unifying" 6520dbf Parser: commas_tup_tail duplicate SrcSpan on "Missing" value dd928e1 Add parsePattern parser entry point 18e0e95 powerpc: add basic support for PLT relocations (#10402) 7707e54 Be aware of overlapping global STG registers in CmmSink (#10521) c6f8d11 Make enum01/enum02/enum03 tests clang-compatible 0d939ca Comments only 6de9b6e Fix for crash in setnumcapabilities001 a6ef59c Fix deadlock (#10545) 29b43fc closeOverKinds *before* oclose in coverage check 9ea4ded relnotes: More 7.10.2 release notes 5560861 Correct BangPat SrcSpan calculation 93790bb Fix some validation errors. f7ede67 Specialise: Avoid unnecessary recomputation of free variable information df6665e Fix typo in error message 07a1f32 Use lazy substitution in simplCast caacd1d Don't eagerly blackhole single-entry thunks (#10414) 32c4e7a Add more discussion of black-holing logic for #10414 dde2095 Fix "CPP directive" in comment 7fa3b23 Testsuite: mark T4945 as expect_broken (#4945) 0e7e611 driver: pass '-fPIC' option to all CC invocations 1171d42 Add an ambient Id substitution to Subst 73105e2 Recenter performance numbers 9938a40 Add testcase for #10602 4fd6221 Fix T2507 expected output 677552f Fix self-contained handling of ASCII encoding c808656 Make mkQualPackage more robust when package key is bad. 4869272 Don't repeat package key with -dppr-debug when package info is missing. 51de934 Parenthesization wibble in T10279. 358e0a8 parser: Allow Lm (MODIFIER LETTER) category in identifiers 3794b59 Do not optimise RULE lhs in substRule 3cadf44 Make sure rule LHSs are simplified 98587f0 Do not treat prim and javascript imports as C imports in TH and QQ 00cd617 Make the location in TcLclEnv and CtLoc into a RealSrcSpan e3dc280 Expose source locations via Implicit Parameters of type GHC.Location.Location 66428af Fix T10196 expected output 295f5b8 7.10.2-notes: Fix description of iconv bypass 82ffb39 Rewrite announce file b1424cc haddock: Pull in fix for source link rendering 3648e9f Another comment with a leading # (sigh) 7603074 build: fix 'make help' 9724555 Describe IP SrcLoc change in release notes 0cfee53 always use -fPIC on OpenBSD/AMD64 platform ec991a7 base: Mention SrcLoc in changelog 6146daa 7.10.2-notes: Mention API annotations fixes 2c67c68 When iconv is unavailable, use an ASCII encoding to encode ASCII 0da488c Release 7.10.2 f32d8c9 Set RELEASE=NO 3e1366e Fix #10489 5af80e7 Ensure DynFlags are consistent 75fd874 Fix tests for "Ensure DynFlags are consistent" 307e0a5 Dump files always use UTF8 encoding #10762 bbd6730 Transliterate unknown characters at output 6b08e42 Use a response file for linker command line arguments #10777 108e35f Respect GHC_CHARENC environment variable #10762 d73a8ec Forbid annotations when Safe Haskell safe mode is enabled. 2bb2a85 Always generalise a partial type signature db85cbc Do not inline or apply rules on LHS of rules 0269d37 Deal with phantom type variables in rules 1c7e13d Testsuite: mark T6037 expect_fail on Windows (#6037) d8227f6 Remove all references to sync-all 3d72709 Export more types from GHC.RTS.Flags (#9970) d11412e Fix #10493. 3340d30 Fix #10495. aaa1ea8 Add pprRuleName 886a406 Parenthesise TypeOperator in import hints 10c61bf RTS.Flags: Rename Nat to RtsNat 45f7392 Update user guide, fixing #10772 f221212 Fix #10713. 00a7af6 Slightly better `Coercible` errors. f6a3df2 Docs: make sure all libs are included in index.html (#10879) 4a70e2f Fix trac #10413 089462c Build system: remove hack for Mac OSX in configure.ac (#10476) 4596beb Generate .dyn_o files for .hsig files with -dynamic-too d3a2843 fix EBADF unqueueing in select backend (Trac #10590) 024d7c3 Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. eea6557 Flush stdout in test case for #10596 6b8da22 Clarify parsing infelicity. 34899db TyCon: Backport isGenerativeTyCon c99fc94 TcType: Add missing export d70e0ed TcErrors: mkErrorMsgFromCt is just mkErrorMsg dfdb021 Fix a bug with mallocForeignPtr and finalizers (#10904) 5a55ed7 Add framework flags when linking a dynamic library 293bf83 Fix treatment of -0.0 5cba858 Fix up trivial testsuite failures 2685f08 More trivial test fixes 5c1fff2 Make headers C++ compatible (fixes #10700) cbd1ccb Small improvement in pretty-printing constructors. e22d7dc nativeGen PPC: fix > 16 bit offsets in stack handling 8b69b31 Merge #10817/#10899 (e27b267f) From git at git.haskell.org Tue Oct 6 17:15:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 6 Oct 2015 17:15:26 +0000 (UTC) Subject: [commit: ghc] master: Documentation for FrontendResult (59883ae) Message-ID: <20151006171526.1603C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/59883ae370b50f7b59a9bc57b76291fc31937967/ghc >--------------------------------------------------------------- commit 59883ae370b50f7b59a9bc57b76291fc31937967 Author: Edward Z. Yang Date: Tue Oct 6 10:14:39 2015 -0700 Documentation for FrontendResult Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 59883ae370b50f7b59a9bc57b76291fc31937967 compiler/typecheck/TcRnTypes.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 7f51c33..b5da234 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -329,6 +329,14 @@ data DsMetaVal ************************************************************************ -} +-- | 'FrontendResult' describes the result of running the +-- frontend of a Haskell module. Usually, you'll get +-- a 'FrontendTypecheck', since running the frontend involves +-- typechecking a program, but for an hs-boot merge you'll +-- just get a ModIface, since no actual typechecking occurred. +-- +-- This data type really should be in HscTypes, but it needs +-- to have a TcGblEnv which is only defined here. data FrontendResult = FrontendTypecheck TcGblEnv | FrontendMerge ModIface From git at git.haskell.org Wed Oct 7 06:47:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 06:47:04 +0000 (UTC) Subject: [commit: ghc] master: Ensure shiftL/shiftR arguments aren't negative (ea4df12) Message-ID: <20151007064704.D929D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ea4df12f7f3fc4d1d2af335804b8ec893f45550c/ghc >--------------------------------------------------------------- commit ea4df12f7f3fc4d1d2af335804b8ec893f45550c Author: Ben Gamari Date: Tue Oct 6 19:30:50 2015 +0200 Ensure shiftL/shiftR arguments aren't negative Fixes #10571. >--------------------------------------------------------------- ea4df12f7f3fc4d1d2af335804b8ec893f45550c libraries/base/Data/Bits.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs index 84b1c03..38025f8 100644 --- a/libraries/base/Data/Bits.hs +++ b/libraries/base/Data/Bits.hs @@ -515,8 +515,12 @@ instance Bits Integer where complement = complementInteger shift x i@(I# i#) | i >= 0 = shiftLInteger x i# | otherwise = shiftRInteger x (negateInt# i#) - shiftL x (I# i#) = shiftLInteger x i# - shiftR x (I# i#) = shiftRInteger x i# + shiftL x i@(I# i#) + | i < 0 = error "Bits.shiftL(Integer): negative shift" + | otherwise = shiftLInteger x i# + shiftR x i@(I# i#) + | i < 0 = error "Bits.shiftR(Integer): negative shift" + | otherwise = shiftRInteger x i# testBit x (I# i) = testBitInteger x i From git at git.haskell.org Wed Oct 7 06:47:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 06:47:07 +0000 (UTC) Subject: [commit: ghc] master: AsmCodeGen: Ensure LLVM .line directives are sorted (36811bf) Message-ID: <20151007064707.BD6833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/36811bfd3bd981d3cd3cc7280e1a815ba1ed42e9/ghc >--------------------------------------------------------------- commit 36811bfd3bd981d3cd3cc7280e1a815ba1ed42e9 Author: Ben Gamari Date: Tue Oct 6 18:29:03 2015 +0200 AsmCodeGen: Ensure LLVM .line directives are sorted Apparently some Clang 3.6 expects these to be sorted. Patch due to Peter Wortmann. Fixes #10687. >--------------------------------------------------------------- 36811bfd3bd981d3cd3cc7280e1a815ba1ed42e9 compiler/nativeGen/AsmCodeGen.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs index 2e5caf4..2ea63ee 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/nativeGen/AsmCodeGen.hs @@ -82,6 +82,7 @@ import qualified Stream import Data.List import Data.Maybe +import Data.Ord ( comparing ) import Control.Exception #if __GLASGOW_HASKELL__ < 709 import Control.Applicative (Applicative(..)) @@ -428,12 +429,15 @@ cmmNativeGens dflags this_mod modLoc ncgImpl h dbgMap us cmmNativeGen dflags this_mod modLoc ncgImpl us fileIds dbgMap cmm count - let newFileIds = fileIds' `minusUFM` fileIds + -- Generate .file directives for every new file that has been + -- used. Note that it is important that we generate these in + -- ascending order, as Clang's 3.6 assembler complains. + let newFileIds = sortBy (comparing snd) $ eltsUFM $ fileIds' `minusUFM` fileIds pprDecl (f,n) = ptext (sLit "\t.file ") <> ppr n <+> doubleQuotes (ftext f) emitNativeCode dflags h $ vcat $ - map pprDecl (eltsUFM newFileIds) ++ + map pprDecl newFileIds ++ map (pprNatCmmDecl ncgImpl) native -- force evaluation all this stuff to avoid space leaks From git at git.haskell.org Wed Oct 7 06:51:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 06:51:35 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: AsmCodeGen: Ensure LLVM .line directives are sorted (aefb290) Message-ID: <20151007065135.A58003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/aefb2903192ae2faea7a378d488ebe1fba9baeaf/ghc >--------------------------------------------------------------- commit aefb2903192ae2faea7a378d488ebe1fba9baeaf Author: Ben Gamari Date: Tue Oct 6 18:29:03 2015 +0200 AsmCodeGen: Ensure LLVM .line directives are sorted Apparently some Clang 3.6 expects these to be sorted. Patch due to Peter Wortmann. Fixes #10687. >--------------------------------------------------------------- aefb2903192ae2faea7a378d488ebe1fba9baeaf compiler/nativeGen/AsmCodeGen.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs index 9c57e76..ac657dd 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/nativeGen/AsmCodeGen.hs @@ -82,6 +82,7 @@ import qualified Stream import Data.List import Data.Maybe +import Data.Ord ( comparing ) import Control.Exception #if __GLASGOW_HASKELL__ < 709 import Control.Applicative (Applicative(..)) @@ -428,12 +429,15 @@ cmmNativeGens dflags this_mod modLoc ncgImpl h dbgMap us cmmNativeGen dflags this_mod modLoc ncgImpl us fileIds dbgMap cmm count - let newFileIds = fileIds' `minusUFM` fileIds + -- Generate .file directives for every new file that has been + -- used. Note that it is important that we generate these in + -- ascending order, as Clang's 3.6 assembler complains. + let newFileIds = sortBy (comparing snd) $ eltsUFM $ fileIds' `minusUFM` fileIds pprDecl (f,n) = ptext (sLit "\t.file ") <> ppr n <+> doubleQuotes (ftext f) emitNativeCode dflags h $ vcat $ - map pprDecl (eltsUFM newFileIds) ++ + map pprDecl newFileIds ++ map (pprNatCmmDecl ncgImpl) native -- force evaluation all this stuff to avoid space leaks From git at git.haskell.org Wed Oct 7 06:51:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 06:51:38 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Ensure shiftL/shiftR arguments aren't negative (2e87fd1) Message-ID: <20151007065138.74C333A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/2e87fd1b453360ada9ca5bfc267c0a904ab1241d/ghc >--------------------------------------------------------------- commit 2e87fd1b453360ada9ca5bfc267c0a904ab1241d Author: Ben Gamari Date: Tue Oct 6 19:30:50 2015 +0200 Ensure shiftL/shiftR arguments aren't negative Fixes #10571. >--------------------------------------------------------------- 2e87fd1b453360ada9ca5bfc267c0a904ab1241d libraries/base/Data/Bits.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs index 84b1c03..38025f8 100644 --- a/libraries/base/Data/Bits.hs +++ b/libraries/base/Data/Bits.hs @@ -515,8 +515,12 @@ instance Bits Integer where complement = complementInteger shift x i@(I# i#) | i >= 0 = shiftLInteger x i# | otherwise = shiftRInteger x (negateInt# i#) - shiftL x (I# i#) = shiftLInteger x i# - shiftR x (I# i#) = shiftRInteger x i# + shiftL x i@(I# i#) + | i < 0 = error "Bits.shiftL(Integer): negative shift" + | otherwise = shiftLInteger x i# + shiftR x i@(I# i#) + | i < 0 = error "Bits.shiftR(Integer): negative shift" + | otherwise = shiftRInteger x i# testBit x (I# i) = testBitInteger x i From git at git.haskell.org Wed Oct 7 08:52:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 08:52:06 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T10918' created Message-ID: <20151007085206.88C583A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T10918 Referencing: b929ca22734a01bae1c2e951b0b82896e5fdd807 From git at git.haskell.org Wed Oct 7 08:52:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 08:52:09 +0000 (UTC) Subject: [commit: ghc] wip/T10918: First stab at #10918 (ab21472) Message-ID: <20151007085209.4EA503A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10918 Link : http://ghc.haskell.org/trac/ghc/changeset/ab214720d0f7e7d0d8ea1c998c9618c7dca6dda1/ghc >--------------------------------------------------------------- commit ab214720d0f7e7d0d8ea1c998c9618c7dca6dda1 Author: Joachim Breitner Date: Thu Oct 1 23:22:19 2015 +0200 First stab at #10918 >--------------------------------------------------------------- ab214720d0f7e7d0d8ea1c998c9618c7dca6dda1 compiler/simplCore/CallArity.hs | 9 ++++++--- compiler/simplCore/SimplUtils.hs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/simplCore/CallArity.hs b/compiler/simplCore/CallArity.hs index c2a5ad0..24ee9bd 100644 --- a/compiler/simplCore/CallArity.hs +++ b/compiler/simplCore/CallArity.hs @@ -16,7 +16,7 @@ import CoreSyn import Id import CoreArity ( typeArity ) import CoreUtils ( exprIsHNF ) ---import Outputable +-- import Outputable import UnVarGraph import Demand @@ -500,7 +500,7 @@ callArityAnal arity int (Let bind e) -- Which bindings should we look at? -- See Note [Which variables are interesting] isInteresting :: Var -> Bool -isInteresting v = 0 < length (typeArity (idType v)) +isInteresting v = True -- 0 < length (typeArity (idType v)) interestingBinds :: CoreBind -> [Var] interestingBinds = filter isInteresting . bindersOf @@ -521,7 +521,7 @@ callArityBind boring_vars ae_body int (NonRec v rhs) | otherwise = -- pprTrace "callArityBind:NonRec" -- (vcat [ppr v, ppr ae_body, ppr int, ppr ae_rhs, ppr safe_arity]) - (final_ae, NonRec v' rhs') + (final_ae, NonRec v'' rhs') where is_thunk = not (exprIsHNF rhs) -- If v is boring, we will not find it in ae_body, but always assume (0, False) @@ -552,6 +552,9 @@ callArityBind boring_vars ae_body int (NonRec v rhs) v' = v `setIdCallArity` trimmed_arity + v'' | called_once = v' `setIdDemandInfo` oneifyDmd (idDemandInfo v') + | otherwise = v' + -- Recursive let. See Note [Recursion and fixpointing] callArityBind boring_vars ae_body int b@(Rec binds) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index 59d3a05..f8945b3 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1038,7 +1038,7 @@ preInlineUnconditionally dflags env top_lvl bndr rhs act = idInlineActivation bndr try_once in_lam int_cxt -- There's one textual occurrence | not in_lam = isNotTopLevel top_lvl || early_phase - | otherwise = int_cxt && canInlineInLam rhs + | otherwise = (int_cxt && canInlineInLam rhs) || isSingleUsed (idDemandInfo bndr) -- Be very careful before inlining inside a lambda, because (a) we must not -- invalidate occurrence information, and (b) we want to avoid pushing a From git at git.haskell.org Wed Oct 7 08:52:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 08:52:12 +0000 (UTC) Subject: [commit: ghc] wip/T10918: Run Call Arity after the last floating again (b929ca2) Message-ID: <20151007085212.1C2763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10918 Link : http://ghc.haskell.org/trac/ghc/changeset/b929ca22734a01bae1c2e951b0b82896e5fdd807/ghc >--------------------------------------------------------------- commit b929ca22734a01bae1c2e951b0b82896e5fdd807 Author: Joachim Breitner Date: Wed Oct 7 10:53:53 2015 +0200 Run Call Arity after the last floating again >--------------------------------------------------------------- b929ca22734a01bae1c2e951b0b82896e5fdd807 compiler/simplCore/SimplCore.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 90233d6..bef3607 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -293,6 +293,11 @@ getCoreToDo dflags maybe_rule_check (Phase 0), + runWhen call_arity $ CoreDoPasses + [ CoreDoCallArity + , simpl_phase 0 ["post-late-call-arity"] max_iter + ], + -- Case-liberation for -O2. This should be after -- strictness analysis and the simplification which follows it. runWhen liberate_case (CoreDoPasses [ From git at git.haskell.org Wed Oct 7 14:43:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 7 Oct 2015 14:43:47 +0000 (UTC) Subject: [commit: ghc] wip/T10918: Ticket #10918: Inline singly used things even more aggressively (3f964ae) Message-ID: <20151007144347.7F4453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10918 Link : http://ghc.haskell.org/trac/ghc/changeset/3f964ae1b32c968c26a86843aecf2fa0e2ab6f3e/ghc >--------------------------------------------------------------- commit 3f964ae1b32c968c26a86843aecf2fa0e2ab6f3e Author: Joachim Breitner Date: Wed Oct 7 16:45:39 2015 +0200 Ticket #10918: Inline singly used things even more aggressively >--------------------------------------------------------------- 3f964ae1b32c968c26a86843aecf2fa0e2ab6f3e compiler/simplCore/SimplUtils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index f8945b3..987576e 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1037,8 +1037,9 @@ preInlineUnconditionally dflags env top_lvl bndr rhs -- See Note [pre/postInlineUnconditionally in gentle mode] act = idInlineActivation bndr try_once in_lam int_cxt -- There's one textual occurrence + | isSingleUsed (idDemandInfo bndr) = isNotTopLevel top_lvl | not in_lam = isNotTopLevel top_lvl || early_phase - | otherwise = (int_cxt && canInlineInLam rhs) || isSingleUsed (idDemandInfo bndr) + | otherwise = int_cxt && canInlineInLam rhs -- Be very careful before inlining inside a lambda, because (a) we must not -- invalidate occurrence information, and (b) we want to avoid pushing a From git at git.haskell.org Thu Oct 8 01:28:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 01:28:12 +0000 (UTC) Subject: [commit: ghc] master: Improve error messages for ambiguous type variables (7b443bb) Message-ID: <20151008012812.B0B643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7b443bb1df8f7f0a6b3124537590aa655a9300cd/ghc >--------------------------------------------------------------- commit 7b443bb1df8f7f0a6b3124537590aa655a9300cd Author: David Kraeutmann Date: Wed Oct 7 20:28:46 2015 -0500 Improve error messages for ambiguous type variables Improved error messages are only printed when the old message would be "No instance for...", since they're not as helpful for "Could not deduce..." No special test case as error messages are tested by other tests already. Signed-off-by: David Kraeutmann Reviewed By: austin, goldfire Differential Revision: https://phabricator.haskell.org/D1182 GHC Trac Issues: #10733 >--------------------------------------------------------------- 7b443bb1df8f7f0a6b3124537590aa655a9300cd compiler/typecheck/TcErrors.hs | 95 +++++++++++++++++----- .../tests/annotations/should_fail/annfail10.stderr | 14 ++-- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/print019.stderr | 2 +- testsuite/tests/ghci/scripts/Defer02.stderr | 7 +- .../tests/indexed-types/should_fail/T4485.stderr | 7 +- .../should_fail/overloadedlistsfail01.stderr | 21 +++-- testsuite/tests/quotes/TH_localname.stderr | 7 +- testsuite/tests/rebindable/rebindable6.stderr | 26 +++--- testsuite/tests/rename/should_fail/mc14.stderr | 8 +- .../tests/typecheck/should_compile/holes2.stderr | 7 +- testsuite/tests/typecheck/should_fail/T4921.stderr | 14 ++-- testsuite/tests/typecheck/should_fail/T5858.stderr | 9 +- testsuite/tests/typecheck/should_fail/T7857.stderr | 2 +- .../tests/typecheck/should_fail/tcfail008.stderr | 7 +- .../tests/typecheck/should_fail/tcfail040.stderr | 7 +- .../tests/typecheck/should_fail/tcfail043.stderr | 14 ++-- .../tests/typecheck/should_fail/tcfail072.stderr | 2 +- .../tests/typecheck/should_fail/tcfail128.stderr | 9 +- .../tests/typecheck/should_fail/tcfail133.stderr | 7 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- 21 files changed, 173 insertions(+), 98 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 7b443bb1df8f7f0a6b3124537590aa655a9300cd From git at git.haskell.org Thu Oct 8 01:36:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 01:36:03 +0000 (UTC) Subject: [commit: ghc] master: Allow non-operator infix pattern synonyms (69a6e42) Message-ID: <20151008013603.42F3E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/69a6e4258786894578ffed2a1d907a74c52d779b/ghc >--------------------------------------------------------------- commit 69a6e4258786894578ffed2a1d907a74c52d779b Author: Matthew Pickering Date: Wed Oct 7 20:36:38 2015 -0500 Allow non-operator infix pattern synonyms For example ``` pattern head `Cons` tail = head : tail ``` Reviewed By: goldfire, austin Differential Revision: https://phabricator.haskell.org/D1295 GHC Trac Issues: #10747 >--------------------------------------------------------------- 69a6e4258786894578ffed2a1d907a74c52d779b compiler/parser/Parser.y | 2 +- testsuite/tests/patsyn/should_compile/T10747.hs | 5 +++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 7e7f579..7079a94 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1148,7 +1148,7 @@ pattern_synonym_decl :: { LHsDecl RdrName } pattern_synonym_lhs :: { (Located RdrName, HsPatSynDetails (Located RdrName)) } : con vars0 { ($1, PrefixPatSyn $2) } - | varid consym varid { ($2, InfixPatSyn $1 $3) } + | varid conop varid { ($2, InfixPatSyn $1 $3) } vars0 :: { [Located RdrName] } : {- empty -} { [] } diff --git a/testsuite/tests/patsyn/should_compile/T10747.hs b/testsuite/tests/patsyn/should_compile/T10747.hs new file mode 100644 index 0000000..b02d8d0 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T10747.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE PatternSynonyms #-} + +module T10747 where + +pattern head `Cons` tail = head : tail diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index b0776ac..5e86a99 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -24,3 +24,4 @@ test('T9889', normal, compile, ['']) test('T9867', normal, compile, ['']) test('T9975a', normal, compile_fail, ['']) test('T9975b', normal, compile, ['']) +test('T10747', normal, compile, ['']) From git at git.haskell.org Thu Oct 8 01:36:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 01:36:06 +0000 (UTC) Subject: [commit: ghc] master: Parser: revert some error messages to what they were before 7.10 (e2b579e) Message-ID: <20151008013606.C2D183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e2b579e8d77357e8b36f57d15daead101586ac8e/ghc >--------------------------------------------------------------- commit e2b579e8d77357e8b36f57d15daead101586ac8e Author: Thomas Miedema Date: Wed Oct 7 20:36:54 2015 -0500 Parser: revert some error messages to what they were before 7.10 Among doing other things, Phab:D201 (bc2289e13d9586be087bd8136943dc35a0130c88) tried to improve the error messages thrown by the parser. For example a missing else clause now prints "parse error in if statement: else clause empty" instead of "parse error (possibly incorrect indentation or mismatched brackets)". Some error messages got much worse however (see tests), and the result seems to be a net negative. Although not entirely satisfactory, this commits therefore reverts those parser changes. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1309 GHC Trac Issues: #10498 >--------------------------------------------------------------- e2b579e8d77357e8b36f57d15daead101586ac8e compiler/parser/Parser.y | 31 ---------------------- .../parser/should_fail/ParserNoLambdaCase.stderr | 2 +- testsuite/tests/parser/should_fail/T10498a.hs | 14 ++++++++++ testsuite/tests/parser/should_fail/T10498a.stderr | 2 ++ testsuite/tests/parser/should_fail/T10498b.hs | 7 +++++ testsuite/tests/parser/should_fail/T10498b.stderr | 2 ++ testsuite/tests/parser/should_fail/all.T | 2 ++ .../tests/parser/should_fail/readFail020.stderr | 3 +-- 8 files changed, 29 insertions(+), 34 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 7079a94..9245deb 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2182,37 +2182,6 @@ exp10 :: { LHsExpr RdrName } -- hdaume: core annotation | fexp { $1 } - -- parsing error messages go below here - | '\\' apat apats opt_asig '->' error {% parseErrorSDoc (combineLocs $1 $5) $ text - "parse error in lambda: no expression after '->'" - } - | '\\' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked lambda expression '\'" - } - | 'let' binds 'in' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing expression after 'in'" - } - | 'let' binds error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing required 'in'" - } - | 'let' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked let binding" - } - | 'if' exp optSemi 'then' exp optSemi - 'else' error {% hintIf (combineLocs $1 $5) "else clause empty" } - | 'if' exp optSemi 'then' exp optSemi error {% hintIf (combineLocs $1 $5) "missing required else clause" } - | 'if' exp optSemi 'then' error {% hintIf (combineLocs $1 $2) "then clause empty" } - | 'if' exp optSemi error {% hintIf (combineLocs $1 $2) "missing required then and else clauses" } - | 'if' error {% hintIf (getLoc $1) "naked if statement" } - | 'case' exp 'of' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing list after '->'" - } - | 'case' exp error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing required 'of'" - } - | 'case' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked case statement" - } optSemi :: { ([Located a],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } diff --git a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr index 5a3f1cc..5eb8b53 100644 --- a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr +++ b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr @@ -1,2 +1,2 @@ -ParserNoLambdaCase.hs:3:5: parse error: naked lambda expression '' +ParserNoLambdaCase.hs:3:6: error: parse error on input ?case? diff --git a/testsuite/tests/parser/should_fail/T10498a.hs b/testsuite/tests/parser/should_fail/T10498a.hs new file mode 100644 index 0000000..5a9656f --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE LambdaCase #-} +module T10498a where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498a.hs:10:5: +-- parse error in if statement: missing required else clause + +foo = + if True + then + \case -> + 1 -> 2 + else id diff --git a/testsuite/tests/parser/should_fail/T10498a.stderr b/testsuite/tests/parser/should_fail/T10498a.stderr new file mode 100644 index 0000000..8b866f3 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.stderr @@ -0,0 +1,2 @@ + +T10498a.hs:12:15: error: parse error on input ?->? diff --git a/testsuite/tests/parser/should_fail/T10498b.hs b/testsuite/tests/parser/should_fail/T10498b.hs new file mode 100644 index 0000000..19b62af --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.hs @@ -0,0 +1,7 @@ +module T10498b where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498b.hs:7:5: parse error in if statement: naked if statement + +f = if module then True else False diff --git a/testsuite/tests/parser/should_fail/T10498b.stderr b/testsuite/tests/parser/should_fail/T10498b.stderr new file mode 100644 index 0000000..e15343b --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.stderr @@ -0,0 +1,2 @@ + +T10498b.hs:7:8: error: parse error on input ?module? diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 33da721..13fb738 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -91,3 +91,5 @@ test('T9225', normal, compile_fail, ['']) test('T10196Fail1', normal, compile_fail, ['']) test('T10196Fail2', normal, compile_fail, ['']) test('T10196Fail3', expect_broken(10196), compile_fail, ['']) +test('T10498a', normal, compile_fail, ['']) +test('T10498b', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/readFail020.stderr b/testsuite/tests/parser/should_fail/readFail020.stderr index 0c00cdc..0697604 100644 --- a/testsuite/tests/parser/should_fail/readFail020.stderr +++ b/testsuite/tests/parser/should_fail/readFail020.stderr @@ -1,3 +1,2 @@ -readFail020.hs:3:5: - parse error in let binding: missing required 'in' +readFail020.hs:3:16: error: parse error on input ?}? From git at git.haskell.org Thu Oct 8 12:05:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 12:05:54 +0000 (UTC) Subject: [commit: ghc] wip/T10918: Make Call Arity aggressive only in the second run (4e496e7) Message-ID: <20151008120554.D2B423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10918 Link : http://ghc.haskell.org/trac/ghc/changeset/4e496e7a7b2e387b374857a14abc74526e54dc53/ghc >--------------------------------------------------------------- commit 4e496e7a7b2e387b374857a14abc74526e54dc53 Author: Joachim Breitner Date: Thu Oct 8 14:07:02 2015 +0200 Make Call Arity aggressive only in the second run not that I believe that this is a viable solution, but it should be a way to work around https://ghc.haskell.org/trac/ghc/ticket/10918#comment:10 and hopefully tell me whether the whole thing is actually useful. >--------------------------------------------------------------- 4e496e7a7b2e387b374857a14abc74526e54dc53 compiler/coreSyn/CoreLint.hs | 2 +- compiler/simplCore/CallArity.hs | 106 ++++++++++++++++++++-------------------- compiler/simplCore/CoreMonad.hs | 4 +- compiler/simplCore/SimplCore.hs | 8 +-- 4 files changed, 61 insertions(+), 59 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4e496e7a7b2e387b374857a14abc74526e54dc53 From git at git.haskell.org Thu Oct 8 12:14:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 12:14:29 +0000 (UTC) Subject: [commit: ghc] master: Tests for #10945 and #10946 (f64f7c3) Message-ID: <20151008121429.C3E923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f64f7c36ef9395da1cc7b686aaf1b019204cd0fc/ghc >--------------------------------------------------------------- commit f64f7c36ef9395da1cc7b686aaf1b019204cd0fc Author: Jan Stolarek Date: Thu Oct 8 14:10:42 2015 +0200 Tests for #10945 and #10946 >--------------------------------------------------------------- f64f7c36ef9395da1cc7b686aaf1b019204cd0fc testsuite/tests/th/T10945.hs | 14 ++++++++++++++ testsuite/tests/th/{T5971.hs => T10946.hs} | 6 ++++-- testsuite/tests/th/all.T | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/th/T10945.hs b/testsuite/tests/th/T10945.hs new file mode 100644 index 0000000..be7a792 --- /dev/null +++ b/testsuite/tests/th/T10945.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10945 where + +import Language.Haskell.TH + +$$(return [ + SigD (mkName "m") + (ForallT [PlainTV (mkName "a")] + [] + (AppT (AppT ArrowT (VarT (mkName "a"))) (VarT (mkName "a")))) + , FunD (mkName "m") + [Clause [VarP (mkName "x")] (NormalB (VarE (mkName "x"))) []] + ]) diff --git a/testsuite/tests/th/T5971.hs b/testsuite/tests/th/T10946.hs similarity index 54% copy from testsuite/tests/th/T5971.hs copy to testsuite/tests/th/T10946.hs index bca58ea..e234d91 100644 --- a/testsuite/tests/th/T5971.hs +++ b/testsuite/tests/th/T10946.hs @@ -1,6 +1,8 @@ {-# LANGUAGE TemplateHaskell #-} -module T5971 where + +module T10946 where import Language.Haskell.TH -_ = $(newName "x" >>= varE) +m :: a -> a +m x = $$([||_||]) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 9d4736c..8304737 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -360,3 +360,5 @@ test('TH_namePackage', normal, compile_and_run, ['-v0']) test('T10811', normal, compile, ['-v0']) test('T10810', normal, compile, ['-v0']) test('T10891', normal, compile, ['-v0']) +test('T10945', expect_broken(10945), compile, ['-v0']) +test('T10946', expect_broken(10946), compile, ['-v0']) From git at git.haskell.org Thu Oct 8 14:35:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 14:35:11 +0000 (UTC) Subject: [commit: ghc] branch 'wip/base-amp-normalisation' created Message-ID: <20151008143511.31E843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/base-amp-normalisation Referencing: e5ae9ca83fada89652ae9989fa66b09a5a578c76 From git at git.haskell.org Thu Oct 8 14:35:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 8 Oct 2015 14:35:14 +0000 (UTC) Subject: [commit: ghc] wip/base-amp-normalisation: base: MRP-refactoring of AMP instances (e5ae9ca) Message-ID: <20151008143514.0C8293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/base-amp-normalisation Link : http://ghc.haskell.org/trac/ghc/changeset/e5ae9ca83fada89652ae9989fa66b09a5a578c76/ghc >--------------------------------------------------------------- commit e5ae9ca83fada89652ae9989fa66b09a5a578c76 Author: Herbert Valerio Riedel Date: Thu Oct 8 16:34:17 2015 +0200 base: MRP-refactoring of AMP instances This refactors (>>)/(*>)/return/pure methods into normalform. The redundant explicit `return` method definitions are dropped altogether. >--------------------------------------------------------------- e5ae9ca83fada89652ae9989fa66b09a5a578c76 libraries/base/Control/Applicative.hs | 2 +- libraries/base/Control/Arrow.hs | 1 - libraries/base/Control/Monad/ST/Lazy/Imp.hs | 4 +--- libraries/base/Data/Complex.hs | 1 - libraries/base/Data/Either.hs | 1 - libraries/base/Data/Functor/Identity.hs | 1 - libraries/base/Data/List/NonEmpty.hs | 1 - libraries/base/Data/Monoid.hs | 3 --- libraries/base/Data/Proxy.hs | 2 -- libraries/base/Data/Semigroup.hs | 21 ++++++++------------- libraries/base/Data/Traversable.hs | 4 ++-- libraries/base/Data/Version.hs | 9 +++++---- libraries/base/GHC/Base.hs | 18 +++++++----------- libraries/base/GHC/Conc/Sync.hs | 12 ++++++------ libraries/base/GHC/GHCi.hs | 3 +-- libraries/base/GHC/ST.hs | 11 +++++------ libraries/base/Text/ParserCombinators/ReadP.hs | 7 ++----- libraries/base/Text/ParserCombinators/ReadPrec.hs | 3 +-- 18 files changed, 39 insertions(+), 65 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 e5ae9ca83fada89652ae9989fa66b09a5a578c76 From git at git.haskell.org Fri Oct 9 00:32:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 00:32:16 +0000 (UTC) Subject: [commit: ghc] master: Move orphan instance/rule warnings to typechecker/desugarer. (931d0a7) Message-ID: <20151009003216.862473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/931d0a7d1cd296f8c2a6190a06a2d3dcc8996ac3/ghc >--------------------------------------------------------------- commit 931d0a7d1cd296f8c2a6190a06a2d3dcc8996ac3 Author: Edward Z. Yang Date: Thu Oct 1 15:24:41 2015 -0700 Move orphan instance/rule warnings to typechecker/desugarer. Summary: Instead of doing these warnings at MkIface time, we do them when we create the instances/rules in the typechecker/desugarer. Emitting warnings for auto-generated instances was a pain (since the specialization monad doesn't have the capacity to emit warnings) so instead I just deprecated -fwarn-auto-orphans. Auto rule orphans are pretty harmless anyway: they don't cause interface files to be eagerly loaded in. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1297 >--------------------------------------------------------------- 931d0a7d1cd296f8c2a6190a06a2d3dcc8996ac3 compiler/deSugar/Desugar.hs | 6 +- compiler/deSugar/DsBinds.hs | 17 +++- compiler/iface/MkIface.hs | 93 ++++------------------ compiler/main/DynFlags.hs | 3 +- compiler/main/HscMain.hs | 6 +- compiler/specialise/Specialise.hs | 20 +++++ compiler/typecheck/Inst.hs | 16 +++- compiler/typecheck/TcGenGenerics.hs | 23 +++--- compiler/types/InstEnv.hs | 4 +- docs/users_guide/using-warnings.rst | 10 +-- .../tests/typecheck/should_compile/T4912.stderr | 8 +- .../tests/warnings/should_compile/T9178.stderr | 4 +- utils/mkUserGuidePart/Options/Warnings.hs | 4 +- 13 files changed, 96 insertions(+), 118 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 931d0a7d1cd296f8c2a6190a06a2d3dcc8996ac3 From git at git.haskell.org Fri Oct 9 07:27:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 07:27:00 +0000 (UTC) Subject: [commit: ghc] master: Extra files to ignore from the new Restructured documentation. (e99e6db) Message-ID: <20151009072700.8D8D43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e99e6db528bda583233835c5263c448cfd65a2ee/ghc >--------------------------------------------------------------- commit e99e6db528bda583233835c5263c448cfd65a2ee Author: Edward Z. Yang Date: Fri Oct 9 00:27:38 2015 -0700 Extra files to ignore from the new Restructured documentation. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- e99e6db528bda583233835c5263c448cfd65a2ee .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e61c47e..8013e75 100644 --- a/.gitignore +++ b/.gitignore @@ -86,8 +86,11 @@ _darcs/ /compiler/ghc.cabal.old /distrib/configure.ac /distrib/ghc.iss +/docs/man /docs/index.html +/docs/users_guide/users_guide /docs/users_guide/ghc.1 +/docs/users_guide/*.xml /docs/users_guide/*.gen.rst /docs/users_guide/ghc_config.py /docs/users_guide/ghc_config.pyc From git at git.haskell.org Fri Oct 9 17:25:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 17:25:13 +0000 (UTC) Subject: [commit: ghc] master: Disable man building for most quick build styles. (0ead0ca) Message-ID: <20151009172513.5B6423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0ead0cad8d9c71e3c3230b8dbee0a4defa953c64/ghc >--------------------------------------------------------------- commit 0ead0cad8d9c71e3c3230b8dbee0a4defa953c64 Author: Edward Z. Yang Date: Fri Oct 9 10:25:20 2015 -0700 Disable man building for most quick build styles. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 0ead0cad8d9c71e3c3230b8dbee0a4defa953c64 mk/flavours/bench-cross.mk | 1 + mk/flavours/bench-llvm.mk | 1 + mk/flavours/bench.mk | 1 + mk/flavours/devel1.mk | 1 + mk/flavours/devel2.mk | 1 + mk/flavours/perf-cross.mk | 1 + mk/flavours/prof.mk | 1 + mk/flavours/quick-cross.mk | 1 + mk/flavours/quick-llvm.mk | 1 + mk/flavours/quick.mk | 1 + mk/flavours/quickest.mk | 1 + 11 files changed, 11 insertions(+) diff --git a/mk/flavours/bench-cross.mk b/mk/flavours/bench-cross.mk index 0dea042..69447a2 100644 --- a/mk/flavours/bench-cross.mk +++ b/mk/flavours/bench-cross.mk @@ -8,6 +8,7 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES diff --git a/mk/flavours/bench-llvm.mk b/mk/flavours/bench-llvm.mk index 8a73f55..e07c1f3 100644 --- a/mk/flavours/bench-llvm.mk +++ b/mk/flavours/bench-llvm.mk @@ -8,3 +8,4 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO diff --git a/mk/flavours/bench.mk b/mk/flavours/bench.mk index edf73f4..1368c47 100644 --- a/mk/flavours/bench.mk +++ b/mk/flavours/bench.mk @@ -8,3 +8,4 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO diff --git a/mk/flavours/devel1.mk b/mk/flavours/devel1.mk index 6b69adf..8489c0f 100644 --- a/mk/flavours/devel1.mk +++ b/mk/flavours/devel1.mk @@ -8,5 +8,6 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO LAX_DEPENDENCIES = YES diff --git a/mk/flavours/devel2.mk b/mk/flavours/devel2.mk index c799822..1f073ed 100644 --- a/mk/flavours/devel2.mk +++ b/mk/flavours/devel2.mk @@ -8,5 +8,6 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO LAX_DEPENDENCIES = YES diff --git a/mk/flavours/perf-cross.mk b/mk/flavours/perf-cross.mk index 4fa8417..9540f8c 100644 --- a/mk/flavours/perf-cross.mk +++ b/mk/flavours/perf-cross.mk @@ -8,6 +8,7 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES diff --git a/mk/flavours/prof.mk b/mk/flavours/prof.mk index c751332..684ffb0 100644 --- a/mk/flavours/prof.mk +++ b/mk/flavours/prof.mk @@ -8,5 +8,6 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO GhcProfiled = YES diff --git a/mk/flavours/quick-cross.mk b/mk/flavours/quick-cross.mk index 3851bbf..b10dbc5 100644 --- a/mk/flavours/quick-cross.mk +++ b/mk/flavours/quick-cross.mk @@ -8,6 +8,7 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO INTEGER_LIBRARY = integer-simple Stage1Only = YES diff --git a/mk/flavours/quick-llvm.mk b/mk/flavours/quick-llvm.mk index 7a19d0b..84a8034 100644 --- a/mk/flavours/quick-llvm.mk +++ b/mk/flavours/quick-llvm.mk @@ -8,3 +8,4 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO diff --git a/mk/flavours/quick.mk b/mk/flavours/quick.mk index ab8d7b3..0e045ae 100644 --- a/mk/flavours/quick.mk +++ b/mk/flavours/quick.mk @@ -8,3 +8,4 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO diff --git a/mk/flavours/quickest.mk b/mk/flavours/quickest.mk index 63dd5eb..ba95632 100644 --- a/mk/flavours/quickest.mk +++ b/mk/flavours/quickest.mk @@ -8,3 +8,4 @@ HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PS = NO BUILD_SPHINX_PDF = NO +BUILD_MAN = NO From git at git.haskell.org Fri Oct 9 17:25:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 17:25:16 +0000 (UTC) Subject: [commit: ghc] master: Ignore __pycache__. (c7ab799) Message-ID: <20151009172516.325BA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c7ab79952e3fd0654108909fc372e4df5ffff91e/ghc >--------------------------------------------------------------- commit c7ab79952e3fd0654108909fc372e4df5ffff91e Author: Edward Z. Yang Date: Fri Oct 9 10:27:31 2015 -0700 Ignore __pycache__. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- c7ab79952e3fd0654108909fc372e4df5ffff91e .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8013e75..d710852 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ Thumbs.db *.depend* *.dyn_o *.dyn_hi +__pycache__ log tags From git at git.haskell.org Fri Oct 9 23:09:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:09:34 +0000 (UTC) Subject: [commit: ghc] master: Simplify type of ms_srcimps and ms_textual_imps. (e5baf62) Message-ID: <20151009230934.BC4DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e5baf62dfac7fd81acc2bd570ba7d3b1fedd8363/ghc >--------------------------------------------------------------- commit e5baf62dfac7fd81acc2bd570ba7d3b1fedd8363 Author: Edward Z. Yang Date: Thu Oct 8 15:03:01 2015 -0700 Simplify type of ms_srcimps and ms_textual_imps. Summary: Previously, we stored an entire ImportDecl, which was pretty wasteful since all we really cared about was the package qualifier and the module name. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1317 >--------------------------------------------------------------- e5baf62dfac7fd81acc2bd570ba7d3b1fedd8363 compiler/iface/MkIface.hs | 4 ++-- compiler/main/DriverMkDepend.hs | 13 +++++-------- compiler/main/GhcMake.hs | 8 +++----- compiler/main/HeaderInfo.hs | 10 ++++++++-- compiler/main/HscTypes.hs | 22 ++++------------------ 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index 43e57cd..0fc45cc 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1300,8 +1300,8 @@ checkDependencies hsc_env summary iface this_pkg = thisPackage (hsc_dflags hsc_env) - dep_missing (L _ (ImportDecl { ideclName = L _ mod, ideclPkgQual = pkg })) = do - find_res <- liftIO $ findImportedModule hsc_env mod (fmap sl_fs pkg) + dep_missing (mb_pkg, L _ mod) = do + find_res <- liftIO $ findImportedModule hsc_env mod (mb_pkg) let reason = moduleNameString mod ++ " changed" case find_res of Found _ mod diff --git a/compiler/main/DriverMkDepend.hs b/compiler/main/DriverMkDepend.hs index aae4d0e..1541d95 100644 --- a/compiler/main/DriverMkDepend.hs +++ b/compiler/main/DriverMkDepend.hs @@ -16,7 +16,6 @@ module DriverMkDepend ( import qualified GHC import GhcMonad -import HsSyn ( ImportDecl(..) ) import DynFlags import Util import HscTypes @@ -30,7 +29,6 @@ import Panic import SrcLoc import Data.List import FastString -import BasicTypes ( StringLiteral(..) ) import Exception import ErrUtils @@ -227,9 +225,8 @@ processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC node) -- Emit a dependency for each import ; let do_imps is_boot idecls = sequence_ - [ do_imp loc is_boot (fmap sl_fs $ ideclPkgQual i) mod - | L loc i <- idecls, - let mod = unLoc (ideclName i), + [ do_imp loc is_boot mb_pkg mod + | (mb_pkg, L loc mod) <- idecls, mod `notElem` excl_mods ] ; do_imps True (ms_srcimps node) @@ -379,7 +376,7 @@ pprCycle summaries = pp_group (CyclicSCC summaries) pp_ms loop_breaker $$ vcat (map pp_group groups) where (boot_only, others) = partition is_boot_only mss - is_boot_only ms = not (any in_group (map (ideclName.unLoc) (ms_imps ms))) + is_boot_only ms = not (any in_group (map snd (ms_imps ms))) in_group (L _ m) = m `elem` group_mods group_mods = map (moduleName . ms_mod) mss @@ -388,8 +385,8 @@ pprCycle summaries = pp_group (CyclicSCC summaries) groups = GHC.topSortModuleGraph True all_others Nothing pp_ms summary = text mod_str <> text (take (20 - length mod_str) (repeat ' ')) - <+> (pp_imps empty (map (ideclName.unLoc) (ms_imps summary)) $$ - pp_imps (ptext (sLit "{-# SOURCE #-}")) (map (ideclName.unLoc) (ms_srcimps summary))) + <+> (pp_imps empty (map snd (ms_imps summary)) $$ + pp_imps (ptext (sLit "{-# SOURCE #-}")) (map snd (ms_srcimps summary))) where mod_str = moduleNameString (moduleName (ms_mod summary)) diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 3d29b1d..123cc9e 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -34,10 +34,8 @@ import ErrUtils import Finder import GhcMonad import HeaderInfo -import HsSyn import HscTypes import Module -import RdrName ( RdrName ) import TcIface ( typecheckIface ) import TcRnMonad ( initIfaceCheck ) @@ -1720,9 +1718,9 @@ msDeps s = then [ (noLoc (moduleName (ms_mod s)), IsBoot) ] else [] -home_imps :: [Located (ImportDecl RdrName)] -> [Located ModuleName] -home_imps imps = [ ideclName i | L _ i <- imps, - isLocal (fmap sl_fs $ ideclPkgQual i) ] +home_imps :: [(Maybe FastString, Located ModuleName)] -> [Located ModuleName] +home_imps imps = [ lmodname | (mb_pkg, lmodname) <- imps, + isLocal mb_pkg ] where isLocal Nothing = True isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special isLocal _ = False diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index 3473a4a..b4c3f81 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -37,6 +37,7 @@ import Maybes import Bag ( emptyBag, listToBag, unitBag ) import MonadUtils import Exception +import BasicTypes import Control.Monad import System.IO @@ -54,7 +55,9 @@ getImports :: DynFlags -- reporting parse error locations. -> FilePath -- ^ The original source filename (used for locations -- in the function result) - -> IO ([Located (ImportDecl RdrName)], [Located (ImportDecl RdrName)], Located ModuleName) + -> IO ([(Maybe FastString, Located ModuleName)], + [(Maybe FastString, Located ModuleName)], + Located ModuleName) -- ^ The source imports, normal imports, and the module name. getImports dflags buf filename source_filename = do let loc = mkRealSrcLoc (mkFastString filename) 1 1 @@ -83,8 +86,11 @@ getImports dflags buf filename source_filename = do implicit_prelude = xopt Opt_ImplicitPrelude dflags implicit_imports = mkPrelImports (unLoc mod) main_loc implicit_prelude imps + convImport (L _ i) = (fmap sl_fs (ideclPkgQual i), ideclName i) in - return (src_idecls, implicit_imports ++ ordinary_imps, mod) + return (map convImport src_idecls, + map convImport (implicit_imports ++ ordinary_imps), + mod) mkPrelImports :: ModuleName -> SrcSpan -- Attribute the "import Prelude" to this location diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index ddb4ca1..2c426d9 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -2406,9 +2406,9 @@ data ModSummary -- ^ Timestamp of hi file, if we *only* are typechecking (it is -- 'Nothing' otherwise. -- See Note [Recompilation checking when typechecking only] and #9243 - ms_srcimps :: [Located (ImportDecl RdrName)], + ms_srcimps :: [(Maybe FastString, Located ModuleName)], -- ^ Source imports of the module - ms_textual_imps :: [Located (ImportDecl RdrName)], + ms_textual_imps :: [(Maybe FastString, Located ModuleName)], -- ^ Non-source imports of the module from the module *text* ms_merge_imps :: (Bool, [Module]), -- ^ Non-textual imports computed for HsBootMerge @@ -2424,26 +2424,12 @@ data ModSummary ms_mod_name :: ModSummary -> ModuleName ms_mod_name = moduleName . ms_mod -ms_imps :: ModSummary -> [Located (ImportDecl RdrName)] +ms_imps :: ModSummary -> [(Maybe FastString, Located ModuleName)] ms_imps ms = ms_textual_imps ms ++ map mk_additional_import (dynFlagDependencies (ms_hspp_opts ms)) where - -- This is a not-entirely-satisfactory means of creating an import - -- that corresponds to an import that did not occur in the program - -- text, such as those induced by the use of plugins (the -plgFoo - -- flag) - mk_additional_import mod_nm = noLoc $ ImportDecl { - ideclSourceSrc = Nothing, - ideclName = noLoc mod_nm, - ideclPkgQual = Nothing, - ideclSource = False, - ideclImplicit = True, -- Maybe implicit because not "in the program text" - ideclQualified = False, - ideclAs = Nothing, - ideclHiding = Nothing, - ideclSafe = False - } + mk_additional_import mod_nm = (Nothing, noLoc mod_nm) -- The ModLocation contains both the original source filename and the -- filename of the cleaned-up source file after all preprocessing has been From git at git.haskell.org Fri Oct 9 23:42:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:42:41 +0000 (UTC) Subject: [commit: ghc] master: Switch to LLVM version 3.7 (5dc3db7) Message-ID: <20151009234241.4A5623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5dc3db743ec477978b9727a313951be44dbd170f/ghc >--------------------------------------------------------------- commit 5dc3db743ec477978b9727a313951be44dbd170f Author: Erik de Castro Lopo Date: Fri Oct 9 08:21:55 2015 +1100 Switch to LLVM version 3.7 >--------------------------------------------------------------- 5dc3db743ec477978b9727a313951be44dbd170f compiler/llvmGen/Llvm/PpLlvm.hs | 25 +++++++++++++++---------- compiler/llvmGen/Llvm/Types.hs | 1 + compiler/llvmGen/LlvmCodeGen.hs | 11 +++-------- compiler/llvmGen/LlvmCodeGen/Base.hs | 15 ++++----------- configure.ac | 2 +- 5 files changed, 24 insertions(+), 30 deletions(-) diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index 8476b9d..e032a51 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -117,6 +117,7 @@ ppLlvmMeta (MetaNamed n m) -- | Print out an LLVM metadata value. ppLlvmMetaExpr :: MetaExpr -> SDoc +ppLlvmMetaExpr (MetaVar (LMLitVar (LMNullLit _))) = text "null" ppLlvmMetaExpr (MetaStr s ) = text "!" <> doubleQuotes (ftext s) ppLlvmMetaExpr (MetaNode n ) = text "!" <> int n ppLlvmMetaExpr (MetaVar v ) = ppr v @@ -273,17 +274,12 @@ ppCall ct fptr args attrs = case fptr of ++ "local var of pointer function type." where - ppCall' (LlvmFunctionDecl _ _ cc ret argTy params _) = + ppCall' (LlvmFunctionDecl _ _ cc ret _ _ _) = let tc = if ct == TailCall then text "tail " else empty ppValues = hsep $ punctuate comma $ map ppCallMetaExpr args - ppArgTy = (ppCommaJoin $ map fst params) <> - (case argTy of - VarArgs -> text ", ..." - FixedArgs -> empty) - fnty = space <> lparen <> ppArgTy <> rparen <> char '*' attrDoc = ppSpaceJoin attrs in tc <> text "call" <+> ppr cc <+> ppr ret - <> fnty <+> ppName fptr <> lparen <+> ppValues + <+> ppName fptr <> lparen <+> ppValues <+> rparen <+> attrDoc -- Metadata needs to be marked as having the `metadata` type when used @@ -362,8 +358,11 @@ ppCmpXChg addr old new s_ord f_ord = -- of specifying alignment. ppLoad :: LlvmVar -> SDoc -ppLoad var = text "load" <+> ppr var <> align +ppLoad var = text "load" <+> derefType <+> ppr var <> align where + derefType = case getVarType var of + LMPointer x -> ppr x <> comma + _ -> empty align | isVector . pLower . getVarType $ var = text ", align 1" | otherwise = empty @@ -373,7 +372,10 @@ ppALoad ord st var = sdocWithDynFlags $ \dflags -> align = text ", align" <+> ppr alignment sThreaded | st = text " singlethread" | otherwise = empty - in text "load atomic" <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align + derefType = case getVarType var of + LMPointer x -> ppr x <> comma + _ -> empty + in text "load atomic" <+> derefType <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align ppStore :: LlvmVar -> LlvmVar -> SDoc ppStore val dst @@ -409,7 +411,10 @@ ppGetElementPtr :: Bool -> LlvmVar -> [LlvmVar] -> SDoc ppGetElementPtr inb ptr idx = let indexes = comma <+> ppCommaJoin idx inbound = if inb then text "inbounds" else empty - in text "getelementptr" <+> inbound <+> ppr ptr <> indexes + derefType = case getVarType ptr of + LMPointer x -> ppr x <> comma + _ -> error "ppGetElementPtr" + in text "getelementptr" <+> inbound <+> derefType <+> ppr ptr <> indexes ppReturn :: Maybe LlvmVar -> SDoc diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs index 9780bf3..4f8d7ab 100644 --- a/compiler/llvmGen/Llvm/Types.hs +++ b/compiler/llvmGen/Llvm/Types.hs @@ -581,6 +581,7 @@ instance Outputable LlvmCallConvention where ppr CC_Ccc = text "ccc" ppr CC_Fastcc = text "fastcc" ppr CC_Coldcc = text "coldcc" + ppr (CC_Ncc 10) = text "ghccc" ppr (CC_Ncc i) = text "cc " <> ppr i ppr CC_X86_Stdcc = text "x86_stdcallcc" diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index f0c184a..a4e73c6 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -47,21 +47,16 @@ llvmCodeGen dflags h us cmm_stream showPass dflags "LLVM CodeGen" -- get llvm version, cache for later use - ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags + ver <- (fromMaybe supportedLlvmVersion) `fmap` figureLlvmVersion dflags writeIORef (llvmVersion dflags) ver -- warn if unsupported debugTraceMsg dflags 2 (text "Using LLVM version:" <+> text (show ver)) let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags - when (ver < minSupportLlvmVersion && doWarn) $ - errorMsg dflags (text "You are using an old version of LLVM that" - <> text " isn't supported anymore!" + when (ver /= supportedLlvmVersion && doWarn) $ + putMsg dflags (text "You are using an unsupported version of LLVM!" $+$ text "We will try though...") - when (ver > maxSupportLlvmVersion && doWarn) $ - putMsg dflags (text "You are using a new version of LLVM that" - <> text " hasn't been tested yet!" - $+$ text "We will try though...") -- run code generation runLlvm dflags ver bufh us $ diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 5ef0a4b..7ccc632 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -12,8 +12,7 @@ module LlvmCodeGen.Base ( LiveGlobalRegs, LlvmUnresData, LlvmData, UnresLabel, UnresStatic, - LlvmVersion, defaultLlvmVersion, minSupportLlvmVersion, - maxSupportLlvmVersion, + LlvmVersion, supportedLlvmVersion, LlvmM, runLlvm, liftStream, withClearVars, varLookup, varInsert, @@ -174,15 +173,9 @@ llvmPtrBits dflags = widthInBits $ typeWidth $ gcWord dflags -- | LLVM Version Number type LlvmVersion = Int --- | The LLVM Version we assume if we don't know -defaultLlvmVersion :: LlvmVersion -defaultLlvmVersion = 36 - -minSupportLlvmVersion :: LlvmVersion -minSupportLlvmVersion = 36 - -maxSupportLlvmVersion :: LlvmVersion -maxSupportLlvmVersion = 36 +-- | The LLVM Version that is currently supported. +supportedLlvmVersion :: LlvmVersion +supportedLlvmVersion = 37 -- ---------------------------------------------------------------------------- -- * Environment Handling diff --git a/configure.ac b/configure.ac index c9a6ed0..3d9ec41 100644 --- a/configure.ac +++ b/configure.ac @@ -553,7 +553,7 @@ esac # tools we are looking for. In the past, GHC supported a number of # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=3.6 +LlvmVersion=3.7 AC_SUBST([LlvmVersion]) dnl ** Which LLVM llc to use? From git at git.haskell.org Fri Oct 9 23:42:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:42:43 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: configure.ac: AArch64 is now registerised (3ac9b92) Message-ID: <20151009234243.E02413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/3ac9b928a390abf63eb870e654eaa90aa3598b46/ghc >--------------------------------------------------------------- commit 3ac9b928a390abf63eb870e654eaa90aa3598b46 Author: Erik de Castro Lopo Date: Sun Jul 5 11:22:24 2015 +0000 configure.ac: AArch64 is now registerised >--------------------------------------------------------------- 3ac9b928a390abf63eb870e654eaa90aa3598b46 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c9a6ed0..e2fe5a1 100644 --- a/configure.ac +++ b/configure.ac @@ -240,7 +240,7 @@ AC_SUBST(SOLARIS_BROKEN_SHLD) dnl ** Do an unregisterised build? dnl -------------------------------------------------------------- case "$HostArch" in - i386|x86_64|powerpc|powerpc64|powerpc64le|arm) + i386|x86_64|powerpc|powerpc64|powerpc64le|arm|aarch64) UnregisterisedDefault=NO ;; *) From git at git.haskell.org Fri Oct 9 23:42:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:42:46 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: Switch to LLVM version 3.7 (96586c4) Message-ID: <20151009234246.8267F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/96586c45ee82f5924d9292a3e0389007f5f3abff/ghc >--------------------------------------------------------------- commit 96586c45ee82f5924d9292a3e0389007f5f3abff Author: Erik de Castro Lopo Date: Fri Oct 9 08:21:55 2015 +1100 Switch to LLVM version 3.7 >--------------------------------------------------------------- 96586c45ee82f5924d9292a3e0389007f5f3abff compiler/llvmGen/Llvm/PpLlvm.hs | 25 +++++++++++++++---------- compiler/llvmGen/Llvm/Types.hs | 1 + compiler/llvmGen/LlvmCodeGen.hs | 11 +++-------- compiler/llvmGen/LlvmCodeGen/Base.hs | 15 ++++----------- configure.ac | 2 +- 5 files changed, 24 insertions(+), 30 deletions(-) diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index 8476b9d..e032a51 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -117,6 +117,7 @@ ppLlvmMeta (MetaNamed n m) -- | Print out an LLVM metadata value. ppLlvmMetaExpr :: MetaExpr -> SDoc +ppLlvmMetaExpr (MetaVar (LMLitVar (LMNullLit _))) = text "null" ppLlvmMetaExpr (MetaStr s ) = text "!" <> doubleQuotes (ftext s) ppLlvmMetaExpr (MetaNode n ) = text "!" <> int n ppLlvmMetaExpr (MetaVar v ) = ppr v @@ -273,17 +274,12 @@ ppCall ct fptr args attrs = case fptr of ++ "local var of pointer function type." where - ppCall' (LlvmFunctionDecl _ _ cc ret argTy params _) = + ppCall' (LlvmFunctionDecl _ _ cc ret _ _ _) = let tc = if ct == TailCall then text "tail " else empty ppValues = hsep $ punctuate comma $ map ppCallMetaExpr args - ppArgTy = (ppCommaJoin $ map fst params) <> - (case argTy of - VarArgs -> text ", ..." - FixedArgs -> empty) - fnty = space <> lparen <> ppArgTy <> rparen <> char '*' attrDoc = ppSpaceJoin attrs in tc <> text "call" <+> ppr cc <+> ppr ret - <> fnty <+> ppName fptr <> lparen <+> ppValues + <+> ppName fptr <> lparen <+> ppValues <+> rparen <+> attrDoc -- Metadata needs to be marked as having the `metadata` type when used @@ -362,8 +358,11 @@ ppCmpXChg addr old new s_ord f_ord = -- of specifying alignment. ppLoad :: LlvmVar -> SDoc -ppLoad var = text "load" <+> ppr var <> align +ppLoad var = text "load" <+> derefType <+> ppr var <> align where + derefType = case getVarType var of + LMPointer x -> ppr x <> comma + _ -> empty align | isVector . pLower . getVarType $ var = text ", align 1" | otherwise = empty @@ -373,7 +372,10 @@ ppALoad ord st var = sdocWithDynFlags $ \dflags -> align = text ", align" <+> ppr alignment sThreaded | st = text " singlethread" | otherwise = empty - in text "load atomic" <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align + derefType = case getVarType var of + LMPointer x -> ppr x <> comma + _ -> empty + in text "load atomic" <+> derefType <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align ppStore :: LlvmVar -> LlvmVar -> SDoc ppStore val dst @@ -409,7 +411,10 @@ ppGetElementPtr :: Bool -> LlvmVar -> [LlvmVar] -> SDoc ppGetElementPtr inb ptr idx = let indexes = comma <+> ppCommaJoin idx inbound = if inb then text "inbounds" else empty - in text "getelementptr" <+> inbound <+> ppr ptr <> indexes + derefType = case getVarType ptr of + LMPointer x -> ppr x <> comma + _ -> error "ppGetElementPtr" + in text "getelementptr" <+> inbound <+> derefType <+> ppr ptr <> indexes ppReturn :: Maybe LlvmVar -> SDoc diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs index 9780bf3..4f8d7ab 100644 --- a/compiler/llvmGen/Llvm/Types.hs +++ b/compiler/llvmGen/Llvm/Types.hs @@ -581,6 +581,7 @@ instance Outputable LlvmCallConvention where ppr CC_Ccc = text "ccc" ppr CC_Fastcc = text "fastcc" ppr CC_Coldcc = text "coldcc" + ppr (CC_Ncc 10) = text "ghccc" ppr (CC_Ncc i) = text "cc " <> ppr i ppr CC_X86_Stdcc = text "x86_stdcallcc" diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index f0c184a..a4e73c6 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -47,21 +47,16 @@ llvmCodeGen dflags h us cmm_stream showPass dflags "LLVM CodeGen" -- get llvm version, cache for later use - ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags + ver <- (fromMaybe supportedLlvmVersion) `fmap` figureLlvmVersion dflags writeIORef (llvmVersion dflags) ver -- warn if unsupported debugTraceMsg dflags 2 (text "Using LLVM version:" <+> text (show ver)) let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags - when (ver < minSupportLlvmVersion && doWarn) $ - errorMsg dflags (text "You are using an old version of LLVM that" - <> text " isn't supported anymore!" + when (ver /= supportedLlvmVersion && doWarn) $ + putMsg dflags (text "You are using an unsupported version of LLVM!" $+$ text "We will try though...") - when (ver > maxSupportLlvmVersion && doWarn) $ - putMsg dflags (text "You are using a new version of LLVM that" - <> text " hasn't been tested yet!" - $+$ text "We will try though...") -- run code generation runLlvm dflags ver bufh us $ diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 5ef0a4b..7ccc632 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -12,8 +12,7 @@ module LlvmCodeGen.Base ( LiveGlobalRegs, LlvmUnresData, LlvmData, UnresLabel, UnresStatic, - LlvmVersion, defaultLlvmVersion, minSupportLlvmVersion, - maxSupportLlvmVersion, + LlvmVersion, supportedLlvmVersion, LlvmM, runLlvm, liftStream, withClearVars, varLookup, varInsert, @@ -174,15 +173,9 @@ llvmPtrBits dflags = widthInBits $ typeWidth $ gcWord dflags -- | LLVM Version Number type LlvmVersion = Int --- | The LLVM Version we assume if we don't know -defaultLlvmVersion :: LlvmVersion -defaultLlvmVersion = 36 - -minSupportLlvmVersion :: LlvmVersion -minSupportLlvmVersion = 36 - -maxSupportLlvmVersion :: LlvmVersion -maxSupportLlvmVersion = 36 +-- | The LLVM Version that is currently supported. +supportedLlvmVersion :: LlvmVersion +supportedLlvmVersion = 37 -- ---------------------------------------------------------------------------- -- * Environment Handling diff --git a/configure.ac b/configure.ac index e2fe5a1..6510e47 100644 --- a/configure.ac +++ b/configure.ac @@ -553,7 +553,7 @@ esac # tools we are looking for. In the past, GHC supported a number of # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=3.6 +LlvmVersion=3.7 AC_SUBST([LlvmVersion]) dnl ** Which LLVM llc to use? From git at git.haskell.org Fri Oct 9 23:42:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:42:49 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: rts: Fix clobbered regs list for aarch64 StgRun (f00525d) Message-ID: <20151009234249.242C83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/f00525d7d9b3609eb6e5ea58bd96e269d1e44e71/ghc >--------------------------------------------------------------- commit f00525d7d9b3609eb6e5ea58bd96e269d1e44e71 Author: Erik de Castro Lopo Date: Wed Jun 3 05:54:23 2015 +0000 rts: Fix clobbered regs list for aarch64 StgRun >--------------------------------------------------------------- f00525d7d9b3609eb6e5ea58bd96e269d1e44e71 rts/StgCRun.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rts/StgCRun.c b/rts/StgCRun.c index 6448509..b9a9496 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -827,8 +827,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { : "=r" (r) : "r" (f), "r" (basereg), "i" (RESERVED_C_STACK_BYTES) - : "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", "%x26", "%x27", "%x28", - "%x16", "%x17", "%x30" + + : "%x16", "%x17", /* Exclude %r18 (platform/temporary register) */ + "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", + "%x26", "%x27", "%x28", /* Exclude %x29 (frame pointer) */ + "%x30", + "%d8", "%d9", "%d10", "%d11", "%d12", "%d13", "%d14" ); return r; } From git at git.haskell.org Fri Oct 9 23:42:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:42:54 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd's head updated: Switch to LLVM version 3.7 (96586c4) Message-ID: <20151009234254.B32383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/aarch64-regd' now includes: 7ea156a Refactor RdrName.Provenance, to fix #7672 cd9c5c6 Allow Any return in foreign prim, fixes #10460. 08558a3 Move liftData and use it as a default definition for Lift. 942cfa4 typo: 'Ture' / 'True' 21d7c85 Travis: Send notifications to author and commiter c69b69d ghc-pkg support query by package-key, fixes #9507 d8f66f1 Re-center perf numbers for haddock.compiler 75c6e06 Build: make configure and ghc-pkg a bit less chatty 14652b5 ghc-cabal: don't warn about missing cabal fields 092082e Build: ./boot && ./configure && make sdist (#8723) cac68d0 Build: remove unnecessary CLEANING/=YES check 5dd0286 Build: remove more unnecessary CLEANING/=YES checks d0063e8 Make validate more quiet e340f6e Testsuite: add/fix cleanup for certain tests 07feab1 Testsuite: ignore `stdcall attribute ignored` (#1288) 0686d76 Testsuite: don't show compile/link info for some tests 7beb477 Travis: allow user forks 761fb7c Fix #10488 by unwrapping type synonyms. 53c1374 Minor code cleanup 61b96a8 Fix #10489 dcaaa98 docs: Fix #10416 ae83a81 Testsuite: only show output diff when test is expected to pass 328c212 Fix the sdist build 89223ce Fix the build when SplitObjs=YES 19ec6a8 Fix for CAF retention when dynamically loading & unloading code 7944a68 Revert "docs: Fix #10416" 058af6c Refactor wild card renaming a48167e build: Clean testsuite before sdist 3b55659 Always force the exception in enqueued commands bb99671 Revert "The test runner now also works under the msys-native Python." 43ebe24 Testsuite: delete expect_fail setups for hugs 3445947 Testsuite: delete expect_fail setups for ghc < 7.1 4a0b7a1 Build: run autoreconf jobs in parallel 5828457 make sdist: distclean testsuite for real (#10406) ca39b96 docs: Fix #10416 ddbb97d Another major improvement of "improvement" c0dc79f IndTypesPerfMerge no longer seems to requre -M20M a66ef35 Fix DWARF generation for MinGW (#10468) c1dc421 Update submodule process to master da84fd5 Testsuite Windows: fix T8172 (#8172) a765f72 Testsuite: mark tests as expect_broken on win64 506522c Testsuite: mark T4945 as expect_broken (#4945) 6cefeb3 Testsuite: mention the existence of ticket #10510 5e66a69 Testsuite: change some expect_fail tests to expect_broken a4318c6 Travis: use apt-get -q 0db0ac4 Removes all occurrences of __MINGW32__ (#10485) 23582b0 Add failing test for #9562. 28e04de Remove redundant tcg_visible_orphan_mods, it is recorded in imp_orphs. bac927b Revert "Support for multiple signature files in scope." c60704f Revert "Change loadSrcInterface to return a list of ModIface" ce53138 Delete _MSC_VER when not necessary, fix #10511 016bbfd docs: Fix unicode alternatives table (fixes #10509). 0ef7174 Squash typos in comments c14bd01 Testsuite: fix the little known CHECK_FILES_WRITTEN=1 d20031d Add parseExpr and compileParsedExpr and use them in GHC API and GHCi 892c3e9 Do not copy stack after stack overflow, refix #8435 dd5cac7 Fix typo in `traceShowM` haddock comment (#10392) 0a086c8 Docs: it's `gv --orientation=seascape` nowadays (#10497) b07dccc Docs: `-XTypeOperators` (#10175) e02a4f2 Add versioning section to Backpack docs. 5ddd904 Testsuite: diff non-whitespace normalised output (#10152) 6e542a6 Testsuite: add function compile_timeout_multiplier (#10345) a508455 UNREG: fix pprHexVal to emit zeros (#10518) 1cf7fc0 add type annotations to SrcLoc functions dd3080f Increase constraint tuple limit to 62 (Trac #10451) a607011 Test Trac #10348 77e5ec8 Demonstrate that inferring Typeable for type literals works efa136f Remove derived CFunEqCans after solving givens a3f6239 GHCi: fix scoping for record selectors a6cbf41 Spelling in comments 855f56b Improved peak_megabytes_allocated 2613271 Testsuite: fix framework failure 89c7168 Fix #10534 df63736 ghc.mk: Update instances of -auto-all 1ff7f09 Lexer: Suggest adding 'let' on unexpected '=' token 0d6c97b Lexer: Suggest adding 'let' on unexpected '=' token a90712b users_guide: Various spelling fixes d46fdf2 users_guide: Various spelling fixes 681973c Encode alignment in MO_Memcpy and friends a0d158f Encode alignment in MO_Memcpy and friends c772f57 Fix #10494 0de0b14 Fix #10495. ace8d4f Fix #10493. 6644039 Test case for #10428. ff82387 Decompose wanted repr. eqs. when no matchable givens. 93f97be (mostly) Comments only f108003 Testsuite wibble around decomposing newtypes. 7eceffb Refactor handling of decomposition. 9b105c6 Reimplement Unify.typesCantMatch in terms of apartness. 298c424 Treat funTyCon like any other TyCon in can_eq_nc. a6b8b9c Fix typo in comment daf1eee Clarify some comments around injectivity. 65d4b89 Add `Monoid` instance for `IO` f063656 Fix ghc-pkg reports cache out date (#10205) 0760b84 Update foreign export docs, fixes #10467 b98ca17 Make enum01/enum02/enum03 tests clang-compatible 023a0ba Care with impossible-cons in combineIdenticalAlts 5879d5a Report arity errors correctly despite kinds f4370c6 Comments only 4a7a6c3 Rename getCtLoc, setCtLoc 02bac02 Remove some horrible munging of origins for Coercible 760b079 A bit more tracing 0899911 Comments plus tiny refactoring ee64369 Refactor filterAlts into two parts 5d98b68 Trac #4945 is working again 72b21c3 Parser: commas_tup_tail duplicate SrcSpan on "Missing" value ba7c8e5 Test Trac #10503 c45f8ce Elaborate test for Trac #10403 40698fe Spelling in comments e283cec testsuite: mark T4945 as expect_broken 440d1bc docs: Unbreak the PS/PDF builds for the User's Guide (#10509) 7d5a845 should_run/allocLimit4: disable ghci way e491803 Amend tcrun024, tcrun025 after Trac #7854 fix 7c2293a Amend tcrun037 after Trac #7854 fix 2c6a041 Fix a couple of tests for GHCi/-O* (Trac #10052) 5cc08eb Recognise 'hardhloat' as a valid vendor in a host tuple f2ffdc6 Updated output for test ghci024 85d5397 Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh. 0cb1f5c Filter orphan rules based on imports, fixes #10294 and #10420. 29bc13a Fix all.T for T8131/T8131b. 15ef5fc Remove duplicate test. 13ba87f Build system: unset HADDOCK when haddock is not found 4854fce Change `Typeable` instance for type-lis to use the Known* classes. 38f3745 Add parsePattern parser entry point b5a2e87 Documentation: add section on .haskeline file (#2531) e60dbf3 Check KnownSymbol => Typeable deduction f70fb68 Use -package-id to specify libraries on command line. 6c5a66a Fix #10551 by using LIB_NAMES. 01f7e44 Rename $1_$2_$3_LIB_NAME to LIB_FILE. 55843f1 Further elaborate Trac #10403 test c084796 powerpc: add basic support for PLT relocations (#10402) 73a6265 Make $1 in $1_$2_$3_FOO actually be directory. 95d5031 Build system: delete unused variables in config.mk.in ece2c43 Drop prefix from package keys. aa26731 Clean outdated ext-core references in comments. 4d1316a driver: pass '-fPIC' option to all CC invocations 9a34864 Improve kind-checking for 'deriving' clauses c7b6fb5 Test Trac #10562 a2f828a Be aware of overlapping global STG registers in CmmSink (#10521) a7eee0d Comments only 3edc186 White space only 9195927 Improve pretty-printing for CoPat ff8a671 Use a Representaional coercion for data families 0b7e538 Allow recursive unwrapping of data families cc0dba1 Minor fix to free-vars in RnTypes 9014a7e Fix addDataConStrictness b69dc73 Don't float out alpha[sig] ~ Int 97e313c Add module header to test 2f16a3b Get rid of irrlevant result type signature 95fc6d5 Get rid of irrelevant impredicative polymoprhism fb7b692 Treat out-of-scope variables as holes b98ff25 Error message wibbles from out-of-scope changes 0aaea5b Tiny refactor plus comments be0ce87 Fix for crash in setnumcapabilities001 111ba4b Fix deadlock (#10545) 7c8ffd3 GHCi docs: layout rule is respected inside :{ :} cbd9278 Comments only caf9d42 Small doc fixes 0696fc6 Improve CPR behavior for strict constructors 7c07cf1 closeOverKinds *before* oclose in coverage check 614ba3c Kill off sizePred 8e34783 Make fvType ignore kinds a64a26f Better tracing and tiny refactoring ceb3c84 Improve error message for Typeable k (T k) 0e1e798 Test Trac #10524 8d221bb Test #10582 89834d6 Add -fcross-module-specialise flag 302d937 Add -fcross-module-specialise flag bb0e462 Mask to avoid uncaught ^C exceptions 9b5df2a Update performance numbers due to #10482 c6bb2fc Correct BangPat SrcSpan calculation c495c67 Build system: remove unused variable CHECK_PACKAGES 897a46c Testsuite: accept T2592.stderr (minor changes) 6b9fc65 Testsuite: put extra_run_opts last on command line daa5097 Build system: prevent "warning: overriding commands for target..." bbf6078 disable check for .init_array section on OpenBSD 9aa0e4b ghc-pkg: use read/writeUTF8File from Cabal bdd0b71 bin-package-db: copy paste writeFileAtomic from Cabal bdf7f13 Build system: rename bindist to bindist-list... d3c1dda Implement PowerPC 64-bit native code backend for Linux b5e1944 Use `+RTS -G1` for more stable residency measurements (#9675) 1d6ead7 Enable using qualified field of constructor in GHCi f856383 Fix Trac #10519 f07b7a8 Remove unnecessary OrdList from decl parser. 6400c76 users_guide: Describe order-dependence of -f and -O flags e4bf4bf Remove redundant parser entry point 8b55788 Add "since" column for LANGUAGE extensions in user guide 39d83f2 Generalize traceM, traceShowM (fixes #10023) 6b01d3c parser: Allow Lm (MODIFIER LETTER) category in identifiers 889c81c Fix some validation errors. 69beef5 Replace usages of `-w` by `-fno-warn`s b1d1c65 Support MO_{Add,Sub}IntC and MO_Add2 in the LLVM backend 124f399 Testsuite: add -ignore-dot-ghci to some tests ced27de Remove dead code / overlapping pattern (#9723) a4b0342 Lexer: remove -fno-warn-unused-do-bind aa778c8 Comments only [skip ci] c875b08 Use -fno-warn-unused-imports instead of hiding `ord` 8e12a21 Lexer.x and Parser.y: delete dead code 5d48e67 Easy way to defer type errors (implements #8353) 3fabb71 Fix typo [skip ci] (#10605) 75de613 rts: fix incorrect checking start for -x arguments (#9839) edb2c54 Remove Hugs specific test setups (omit_compiler_type) 7a3d85e Remove all *.stderr/stdout-hugs files 4681f55 Specialise: Avoid unnecessary recomputation of free variable information 2765fcf Remove warnings for -fwarn-incomplete-patterns a07898e Spelling in comments 9180df1 Fix offset calculation in __stg_gc_fun aaa0cd2 Don't eagerly blackhole single-entry thunks (#10414) d27e7fd Add more discussion of black-holing logic for #10414 d59cf4e Fix "CPP directive" in comment db530f1 Add Note [Warnings in code generated by Alex] 37de4ad Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) 62fcf05 Fix word repetitions in comments ebfc2fb Update comments around blackholes f753cf1 Allow deferred type error warnings to be suppressed 31580e2 Fix todo in compiler/nativeGen: Rename Size to Format 9a3e165 Deferred type errors now throw TypeError (#10284) 5857e0a fix EBADF unqueueing in select backend (Trac #10590) 6d69c3a Generalize `Control.Monad.forever` d03bcfa always use -fPIC on OpenBSD/AMD64 platform 00c8d4d Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. 1967a52 Export more types from GHC.RTS.Flags (#9970) 8800a73 Backpack: Flesh out more Cabal details d71b65f holePackageKey and isHoleModule utility functions. 3d5f8e7 Unbreak Windows build: delete unusud throwIOIO 6f9efcb Delete duplicate "Note [Unpack equality predicates]" f3bfa3b Broaden Outputable instance for Termination 85b14a7 Comments only 4f9d600 Fix Trac #10618 (out of scope operator) b29633f Bitmap: Fix thunk explosion 889824d Document RULES and class methods c58dc1a White space only b5aabfb Infer types with flexible contexts 7dcf86f users_guide: Fix errant "a" in RULES/class methods docs a6359f2 Add testcase for #10602 6f1c076 Make mkQualPackage more robust when package key is bad. 0a3c43f Comments only 9e86bf1 Better type wildcard errors 888026d Update .mailmap [skip ci] 2d06a9f Improve error message for fundeps 9b1ebba Delete the WayPar way d69dfba Fix self-contained handling of ASCII encoding ee28a79 T1969: Update max_bytes_used a846088 T876 (32-bit): Update bytes allocated de6597e perf/compiler: Switch to -G1 and update performance metrics b935497 T9872d: Update 32-bit allocations d073c77 Do not optimise RULE lhs in substRule e922847 Add Linting for Rules 7da7b0e Make sure rule LHSs are simplified 875723b Reformat a leading # in a comment d7335f7 Test Trac #10463 02a6b29 Test Trac #10634 946c8b1 Another comment with a leading # (sigh) 2e52057 Build system: comments only [skip ci] ec197d3 Build system: add `make show!` command (#7810) f70f1b6 Build system: delete two unused files 47ebe26 Build system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS 392ff06 Build system: do not build stm and parallel by default 5764ade Testsuite: delete unused with_namebase 322ae32 Testsuite: delete remaining only_compiler_types(['ghc']) setups 783b79b traivs: Use the new container based travis setup 4dc3877 Testsuite: rename *.stderr-ghc to *.stderr ab5257b Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0 4ee658a0 Mark test case for #10294 expect_broken on #10301 0a40278 Flush stdout in test case for #10596 8e6a503 Mark test case for #10294 conditionally expect_broken on #10301 b1063b1 Testsuite: mark T10294 conditionally expect_broken on #10301 348f5ca Build system: delete fingerprint.py [skip ci] a592e9f Remove all references to sync-all 75fd5dc Don't get a new nursery if we exceeded large_alloc_lim 9f978b6 Fix #10642. 74a00bc initGroup: only initialize the first and last blocks of a group 504c2ae Docs: `sortOn = sortBy (comparing f)` [skip ci] 02897c5 Failing test case: idArity invariant check, #10181 e29c2ac CoreUtils: Move seq* functions to CoreSeq ae0e340 CoreUtils: Move size utilities to CoreStats fa33f45 PprCore: Add size annotations for top-level bindings 29f8225 CoreLint: Use size-annotated ppr variant 82f1c78 Fix tests ae96c75 Implement -fprint-expanded-synonyms 415351a Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) 2c5c297 DeriveFoldable for data types with existential constraints (#10447) 2c9de9c Handle Char#, Addr# in TH quasiquoter (fixes #10620) a5e9da8 Fix off-by-one error in GHCi line reporting (Trac #10578) 3448f98 Reduce non-determinism in ABI hashes with RULES and instance decls bc604bd Update assert to fix retc001 and retc002 (#9243) 0d4b074 Travis: actually do debug builds ac0feec Testsuite: small test cleanups f607393 Testsuite: accept new stderr for T9497{a,b,c}-run (#10224) a0371c0 Build system: fail when encountering an unknown package tag dc6e556 Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm']) dcaa486 Testsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm']) 11f8612 Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm']) 16a8739 Testsuite: mark qq007 and qq008 expect_broken(#10181) cbb4d78 Testsuite: mark qq007 and qq008 expect_broken(#10047) 43dafc9 Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm']) 34bb460 Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...]) 9834fea Add regression test for unused implicit parameter warning (#10632) 4c96e7c Testsuite: add ImpredicativeTypes to T7861 (#7861) 7f37274 Testsuite: add -XUndecidableInstances to T3500a 029367e Testsuite: add regression test for missing class constraint 82ffc80 LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp 49373ff Support wild cards in TH splices c526e09 primops: Add haddocks to BCO primops 4cd008b Do not treat prim and javascript imports as C imports in TH and QQ 96de809 Fix primops documentation syntax d71d9a9 Testsuite: fix concprog002 (AMP) 2f18b197 Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT']) d0cf8f1 Testsuite: simplify T8089 (#8089) b4ef8b8 Update submodule hpc with fix for #10529 0c6c015 Revert "Revert "Change loadSrcInterface to return a list of ModIface"" 214596d Revert "Revert "Support for multiple signature files in scope."" 9ade087 primops: Fix spelling mistake e0a3c44 Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 8f48fdc Use varToCoreExpr in mkWWcpr_help 3fbf496 Comments only (superclasses and improvement) 3509191 Refactor newSCWorkFromFlavoured 7c0fff4 Improve strictness analysis for exceptions cd48797 Comments and white space only 3c44a46 Refactor self-boot info efa7b3a Add NOINLINE for hs-boot functions aa78cd6 Documents -dsuppress-unfoldings 0df2348 Comments and layout only a0e8bb7 Implement -dsuppress-unfoldings b5c1400 Comments and white space only f1d0480 Avoid out-of-scope top-level Ids 7a6ed66 Comments only 55754ea Fix test T2497 to avoid infinite loop in RULES feaa095 Do occurrence analysis on result of BuiltInRule 00f3187 Make seq-of-cast rule generate a case 35eb736 T4945 is working again f519cb5 testsuite: Show killed command line on timeout 97a50d5 configure: Bump minimum bootstrap GHC version to 7.8 dbe6dac When iconv is unavailable, use an ASCII encoding to encode ASCII 18c6ee2 Travis: use ghc-7.8.4 as stage0 to fix the build d941a89 Validate: by default do show commands a7e0326 Validate: document --quiet [skip ci] 1224bb5 Add utility function isHoleName. 50b9a7a Revert "Trac #4945 is working again" 1b76997 Testsuite: recenter haddock.base allocation numbers b949c96 Eliminate zero_static_objects_list() 0d1a8d0 Two step allocator for 64-bit systems e3df1b1 Validate: explain THREADS instead of CPUS in --help cf57f8f Travis: do pass `--quiet` to validate 0b12aca Switch from recording IsBootInterface to recording full HscSource. adea827 Add ExceptionMonad instance for IOEnv. 144096e Give more informative panic for checkFamInstConsistency. 4a9b40d Export alwaysQualifyPackages and neverQualifyPackages. 939f1b2 Some utility functions for testing IfaceType equality. dd365b1 Use lookupIfaceTop for loading IfaceDecls. 5c3fc92 Fix Trac #10670 9851275 Comments only d784bde Lexer: support consecutive references to Haddock chunks (#10398) d2b4df1 Generate .dyn_o files for .hsig files with -dynamic-too 76e2341 Accept next-docstrings on GADT constructors. e78841b Update encoding001 to test the full range of non-surrogate code points b5c9426 Parenthesise TypeOperator in import hints 1852c3d DataCon: Fix redundant import 4c8e69e rts/sm: Add missing argument names in function definitions 7ec07e4 Slight refactoring to the fix for #4012 608e76c Document type functions in the Paterson conditions e809ef5 ghci: fixity declarations for infix data constructors (#10018) 5ff4dad Add a few comments from SPJ on fixity declarations f9687ca Library names, with Cabal submodule update 45c319f Fix line number in T10018 testcase 30d8349 Comments only e161634 Comments about stricteness of catch# d53d808 Refactoring around FunDeps 6e618d7 Improve instanceCantMatch 09d0505 RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR b04bed0 renamer: fix module-level deprecation message 070f76a -include-pkg-deps takes only one hyphen. 7e70c06 Use isTrue# around primitive comparisons in integer-gmp c55f61c Add missing parentheses in eqBigNatWord# 474d4cc Comment tweaks only f842ad6 Implementation of StrictData language extension 2178273 Add UInfixT to TH types (fixes #10522) 81fffc4 Remove runSTRep from PrelNames bc4b64c Do not inline or apply rules on LHS of rules 2d88a53 Improve warnings for rules that might not fire 09925c3 Revert "RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR" a1e8620 Revert "Eliminate zero_static_objects_list()" e343c0a Test case for #10698 a1dd7dd Fallout from more assiduous RULE warnings f83aab9 Eliminate zero_static_objects_list() 2dbb01a Add a missing check for -fcpr-off fac11f8 Comments only 4e8d74d Deal with phantom type variables in rules 92d2567 Define DsUtils.mkCastDs and use it fa915af Spit out a little more info with -dppr-debug e4114c8 Fix an outright error in competesWith 499b926 Fix Trac #10694: CPR analysis 918dcf8 The parallel package has warnings 2e33b9c Modify spec002 to be less trivial 72d23c3 Better treatment of signatures in cls/inst 24afe6d Fix missing files 5a8a8a6 Don't allowInterrupt inside uninterruptibleMask 9f7cdfe Make configure error out on missing ghc-tarballs on Windows e7c331a Make headers C++ compatible (fixes #10700) 26315ed Fix misspelled function name in a comment 4f80ec0 Improve error message for newtypes and deriving clauses e9ad42d Typos in comments and strings d7c2b01 Fix comment that confused Haddock b5097fe Testsuite: rename rename/should_fail/T5001 to T5001b (#5001) e273c67 Testsuite: mark tests recently fixed as passing + accept new stderr 756fa0a Testsuite: skip T10489 unless compiler_debugged (#10489) 6880277 Testsuite: add arrows/should_compile/T5333 (#5333) 58b5f04 Testsuite: add typecheck/should_fail/T9260 (#9260) 58986c4 Testsuite: add typecheck/should_fail/T8034 (#8034) aee19d0 Testsuite: T10245 is passing for WAY=ghci (#10245) 36bbfbd Backpack docs on renamer and depsolver, also s/package/unit/. a442800 Build system: remove function keyword from configure.ac (#10705) a66e1ba User's guide: delete ancient "Core syntax" example 7cf87df Fix #7919 (again) 353db30 Remove checked-in PDFs. 8f81af9 Typos in comments ad089f5 Give raise# a return type of open kind (#10481) 75504f3 Typos in comments 15dd700 Replace (SourceText,FastString) with StringLiteral data type d9b618f Typo in comment 37227d3 Make BranchFlag a new kind 92f5385 Support MO_U_QuotRem2 in LLVM backend 948e03e Update parallel submodule, and re-enable warnings b38ee89 Fix incorrect stack pointer usage in StgRun() on x86_64 4d8859c Typos in comments d7ced09 Minor improvement to user guide 30b32f4 Test Trac #10134 697079f 4 reduce/reduce parser conflicts resolved d9d2102 Support wild cards in data/type family instances 7ec6ffc Typos in comments [skip ci] 64b6733 CmmParse: Don't force alignment in memcpy-ish operations 30c981e Removed deprecated syntax for GADT constuctors. f063bd5 Fix #10713. b5f1c85 Test #9233 in perf/compiler/T9233 d7b053a Pretty: reformat using style from libraries/pretty (#10735) 9d24b06 Pretty: rename variables to the ones used by libraries/pretty (#10735) 25bc406 Pretty: improve error messages (#10735) 53484d3 Pretty: remove superfluous parenthesis (#10735) 2d1eae2 Pretty: kill code that has been dead since 1997 (#10735) 6f6d082 Pretty: Args of NilAbove/TextBeside/Nest/Union are always RDocs (#10735) 926e428 Pretty: use BangPatterns instead of manual unboxing Ints (#10735) f951ffc Pretty: mimic pretty API more closely (#10735) 85179b5 Pretty: use replicate for spaces and multi_ch (#10735) dd7e188 Add framework flags when linking a dynamic library 4c55f14 users_guide: Add note about #367 to Bugs section 6029748 Drop custom mapM impl for [] ecb1752 Make -fcpr-off a dynamic flag b12dba7 Make Exception datatypes into newtypes 22bbc1c Make sure that `all`, `any`, `and`, and `or` fuse (#9848) fd6b24f Additions to users' guide and release notes 575abf4 Add Fixity info for infix types e2b5738 Allow proper errors/warnings in core2core passes 617f696 Do not complain about SPECIALISE for INLINE a426154 Warn about missed specialisations for imports 49615d9 Comments only ab98860 Minor refactor to use filterInScope 9536481 Tidy up and refactor wildcard handling 28096b2 Fix quantification for inference with sigs 75f5f23 Coments only cc07c40 Comments only 294553e T8968-1 and -3 should pass 64dba51 Test Trac #10742 eca9a1a Ensure DynFlags are consistent 97843d0 base: Add instances 600b153 llvmGen: Rework LLVM mangler aa23054 Add test for #10600 (exhaustiveness check with --make and -fno-code) bc43d23 Rejigger OSMem.my_mmap to allow building on Mac a1c934c base: Add missing Traversable instance for ZipList 6cab3af Big batch of Backpack documentation edits. 79e0a10 Test Trac #10753 a192d6b Comments only f1b4864 Sync base/changelog.md with GHC 7.10.2 release 590aa0f Make oneShot open-kinded 92f35cd cmmCreateSwitchPlan: Handle singletons up-front 2c4a7d3 Update transformers submodule to 0.4.3.0 release f04c7be Fix unused-matches warnings in CmmLex.x a40ec75 Update testsuite/.gitignore [skip ci] b4ed130 Replace HsBang type with HsSrcBang and HsImplBang 2da06d7 User manual update, as prodded by #10760. 2b4710b Add missing to User's guide to fix the build 8cce7e4 Bump template-haskell to new major version 2.11 67576dd Pretty: bugfix fillNB (#10735) bcfae08 Pretty: fix potential bad formatting of error message (#10735) 5d57087 Pretty: fix a broken invariant (#10735) 85bf76a Pretty: show rational as is (#10735) f903949 Pretty: improving the space/time performance of vcat, hsep, hcat (#10735) b0dee61 template-haskell: Add changelog entry to infix type operators 7b211b4 Upgrade GCC to 5.2.0 for Windows x86 and x86_64 e415369 Update mingw tarball location 8c5b087 SysTools: Fix whitespace in error message d2dd5af DynFlags: Prohibit hpc and byte-code interpreter ec68618 Name: Show NameSort in warning 1857191 Testsuite: mark T8089 expect_broken(#7325) on Windows 8906037 Testsuite: mark encoding005 expect_broken(#10623) on Windows ca85442 Testsuite: recenter 2 performance tests on Windows 744ff88 Testsuite: speedup running a single test e367e27 Travis: prevent 10' no output, by setting VERBOSE=2 74897de Make rts/ThreadLabels.c threadsafe for debug runtime. 22aca53 Transliterate unknown characters at output ab9403d Dump files always use UTF8 encoding #10762 b17ec56 Fix rdynamic flag and test on Windows ebca3f8 rts/Printer.c: speed up '-Da' printer for 'LIBBFD' build 18a1567 Add selectors for common fields (DataCon/PatSyn) to ConLike d97e60f Comments reformating/corrections b6be81b Build system: delete half-baked Cygwin support 98f8c9e Delete sync-all a146b28 GhcMake: Fix spelling in comment 0d0e651 Bag: Add Foldable instance 9e8562a Implement getSizeofMutableByteArrayOp primop 3452473 Delete FastBool 2f29ebb Refactor: delete most of the module FastTypes 47493e6 Build system: simplify install.mk.in a1c008b Build system: delete unused distrib/Makefile a5061a9 Check options before warning about source imports. 37a0b50 Delete ExtsCompat46 (#8330) b78494e fix 64bit two-stage allocator on Solaris/AMD64 platform (#10790) fba724c configure.ac: Allow disabling of large-address-space 1c643ba Fix algorithm.tex build and update with some new info. 0f3335f Comments and white space 816d48a Implement lookupGlobal in TcEnv, and use it 711e0bf tcRnDeclsi can use tcRnSrcDecls ac0d052 TcDeriv: Kill dead code de476e9 PrelNames: Clean up list a bit 89d25b9 BinIface: Clean up whitespace 7924469 Clean up handling of knownKeyNames a8601a8 Revert "Clean up handling of knownKeyNames" 28ad98e PrelNames: introduce dcQual in place of conName 211b349 Move newImplicitBinder to from IfaceEnv to BuildTyCl 70ea94c IfaceEnv: Clean up updNameCache a bit f6035bc MkIface: Introduce PatSynId, ReflectionId, DefMethId 7bd8f8f TysWiredIn: Shuffle code around 15c63d2 base: Remove a redundant 'return' 38c98e4 RTS: Reduce MBLOCK_SPACE_SIZE on AArch64 15cb83d Add testcase for #7411 a6826c5 Make Generic (Proxy t) instance poly-kinded (fixes #10775) 1b56c40 Respect GHC_CHARENC environment variable #10762 81ae26d Dwarf: Fix DW_AT_use_UTF8 attribute cbf58a2 Dwarf: Produce {low,high}_pc attributes for compilation units 8476ce2 Dwarf: Produce .dwarf_aranges section 0c823af Fix identifier parsing in hp2ps cd2dc9e ghc-pkg --enable-multi-instance should not complain about case sensitivity. c7f0626 integer-gmp: optimise bitBigNat c1d7b4b StgCmmHeap: Re-add check for large static allocations 60120d2 Fix 7.10 validate 12098c2 Fix typo in pattern synonym documentation. 10a0775 Anchor type family instances deterministically ad26c54 Testsuite: refactoring only 6740d70 Use IP based CallStack in error and undefined 010e187 Fix trac #10413 ff9432f Add test for updating a record with existentially quantified fields. 296bc70 Use a response file for linker command line arguments #10777 ba5554e Allow annotations though addTopDecls (#10486) c8f623e Expand declaration QQs first (#10047) 28ac9d3 Improve the error messages for class instance errors 3cc8f07 stm: Fix test case 5d7a873 Testsuite: don't warn about missing specialisations e0b3ff0 Testsuite: update expected output 3b23379 Testsuite: mark 4 tests expect_broken_for(#10712, opt_ways) 32a9ead Fix some tests that were broken by D861 c43c8e2 Testsuite: by default run all tests for a single way bd16e0b Testsuite: delete dead code 3744578 Injective type families 5dc88b7 Add test for T10836 (expected broken) 34b106f Accept underscores in the module parser. (Thanks spinda for the fix.) b639c97 Testsuite: fix tcfail220 - Maybe is wired-in now e1293bb Testsuite: only print msg when timeout kills process unexpectedly 79cdb25 Testsuite: ignore line number differences in call stacks (#10834) 85915e9 Make Data.List.foldr1 inline 19c6049 Fix T6018th test failure 64761ce Build system: implement `make install-strip` (#1851) 5c372fe ghc-pkg: don't print ignored errors when verbosity=0 c60c462 user-guide: Add missing tags around body 96b986b EventLog: Factor out ensureRoomFor*Event 062feee tracing: Kill EVENT_STARTUP 2c24fd7 Build system: put each BuildFlavour in a separate file (#10223) b40e559 Build system: simplify *-llvm BuildFlavours (#10223) 1abbacd Build system: cleanup utils/ghc-pkg/ghc.mk dc671a1 SPECIALIZE strictMinimum for Int and Integer c6b82e9 Further simplify the story around minimum/maximum 554be5e Build system: detect when user cloned from GitHub 864a9c4 Build system: remove hack for Mac OSX in configure.ac (#10476) a158607 Build system: delete the InstallExtraPackages variable 330fbbd Build system: make *-cross BuildFlavours consistent (#10223) 8be43dd Build system: cleanup BUILD_DIRS + add lots of Notes e4a73f4 Move GeneralCategory et al to GHC.Unicode 1b8eca1 Build system: check for inconsistent settings (#10157) dbb4e41 HeapStackCheck: Small refactoring 4356dac Forbid annotations when Safe Haskell safe mode is enabled. 23a301a Testsuite: comment out `setnumcapabilities001` (#10860) cdca31e Don't check in autogenerated hs files for recomp013. 3a71d78 Comments on oneShot a870738 Improve rejigConRes (again) 487c90e Add a test for Trac #10806 a7f6909 A CFunEqCan can be Derived 377395e Improve documentation for transform list-comps 50d1c72 Fix broken links in documentation 413fa95 Improve documentation of comprehensions f30a492 Testsuite cleanup 8c0eca3 Add assertions 18759cc Remove redundant language extensions 195af2d Dead code removal, export cleanup 4275028 Code movement 7ad4b3c s/StgArrWords/StgArrBytes/ 89324b8 Testsuite: normalise slashes in callstack output 37081ac Testsuite: mark enum01-enum03 expect_broken(#9399) on Windows 3ec205a CodeGen: fix typo in error message 08af42f hpc: use `takeDirectory` instead of `dropWhileEnd (/= '/')` c8d438f Testsuite: mark T6037 expect_fail on Windows (#6037) 12b0bb6 Account for stack allocation in the thread's allocation counter 14c4090 Pretty: fix unicode arrow operators. 325efac Fix `hp2ps -i-` e66daec DynFlags: remove unused sPgm_sysman (#8689) 8d89d80 Testsuite: add test for #10781 43eb1dc Show minimal complete definitions in ghci (#10847) 8ecf6d8 ApplicativeDo transformation 77662e1 Add namePackage function to template-haskell 48746ff Docs: make sure all libs are included in index.html (#10879) a8406f8 Pass TEST_HC_OPTS in bug1465 and T5792. 2d4db40 Fix #10815 by kind-checking type patterns against known kinds. 8ee2b95 Polish some error messages. b89c491 Always run explicitly requested ways (extra_ways) for fast runs. c738b12 Replace [PostTc id Type] with PostTc id [Type] e156361 Put stable pointer names in the name cache. 1637e4d Driver: --make -o without Main should be an error (#10895) 1a13551 Test #10347 d19a77a Update user guide, fixing #10772 d7f2ab0 Test #10770 79b8e89 Print associated types a bit better. 1292c17 Allow TH quoting of assoc type defaults. 27f9186 Clarify parsing infelicity. 93fafe0 Re-polish error messages around injective TFs. 6a20920 Small improvement in pretty-printing constructors. cbcad85 Fix typo in test for #10347. 2f9809e Slightly better `Coercible` errors. e27b267 Perform a validity check on assoc type defaults. 8e8b9ed Run simplifier only when the env is clean. cd2840a Refactor BranchLists. c234acb `_ <- mapM` --> `mapM_` 3f13c20 Revert "Revert "Revert "Support for multiple signature files in scope.""" 09d214d Revert "Revert "Revert "Change loadSrcInterface to return a list of ModIface""" 06d46b1 Unify hsig and hs-boot; add preliminary "hs-boot" merging. d516d2e Fix build failure, I think. 07f6418 Remove graphFromVerticesAndAdjacency 5a8b055 TcDeriv: Use a NameEnv instead of association list 83e23c1 Remove (now bogus) assert. 0b852fc base: use Show for ErrorCall in uncaughtExceptionHandler d4d34a7 Make derived names deterministic 089b72f DeriveLift extension (#1830) 4cdab73 HscMain: Place CPP macro invocation on one line 79f5732 testsuite: attempt fixing fallout from 089b72f52 c6bdf4f Remove references to () from types of mkWeak# and friends 65bf7ba DsBinds: Avoid using String when desugaring CallStack construction 939a7d6 Annotate CmmBranch with an optional likely target cf90a1e Add constant-folding rule for Data.Bits.bit 73921df Update Cabal to recognize DeriveLift 453cdbf base: export allocation counter/limit API from System.Mem 5c11523 reify associated types when reifying typeclasses 39a262e Revert "reify associated types when reifying typeclasses" 2440e3c Fix a bug with mallocForeignPtr and finalizers (#10904) b08a533d Fix DeriveGeneric for types with same OccName (#10487) 4f9ee91 Testsuite: update expected output for T8832 on 32-bit systems (#8832) 5883b56 Testsuite: properly fix T8832.stdout-ws-32 (#8832) 1395185 Testsuite: add test for #10767 fb40926 Weak: Don't require wrapping/unwrapping of finalizers a98815a Dwarf: Rename binding to avoid shadowing ppr a0b1f41 Dwarf: Ensure block length is encoded correctly f7fd864 Skip a possible BOM in utf8 encoding 3fbf8f4 Debug: Remove extraneous LANGUAGE CPP 988b2ba rts: Clean up whitespace in Trace.h b4d43b4 reify associated types when reifying typeclasses(#10891) 78053f4 Allow enumDeltaIntegerFB to be inlined 2eddcd9 Lexer: delete dead code for binary character literals 23baa65 .gitignore update for some test files. e3ab25a Typos in comments 03b3804 Add Data.Semigroup and Data.List.NonEmpty (re #10365) f2a174a Update nofib submodule a52db23 Update nofib submodule again eb975d2 Fix treatment of -0.0 57e3742 Document peculiarities of `traceM`. b29f20e nativeGen PPC: fix > 16 bit offsets in stack handling bd41eb2 LLVM: Implement atomic operations in terms of LLVM primitives 9539408 LLVM: Factor out accumulation of LLVM statements and variables 7442434 Move CallStack back to base e3d2bab Fix signature of atomic builtins 9ed700b Don't use old linkable for hs-boot files. 4fd6207 Move user's guide to ReStructuredText 93e21b9 docs: Fix ghc_config.py.in b6f76b9 Prevent GHC from silently dying when preprocessor is not found c4d7df0 Fix broken validation Build 6564 and accepting a few other test results a3c78ab Build system: add mk/validate.mk.sample a96f1ac Testsuite: update expected output for T8602 6cde981 Make GHC generics capable of handling unboxed types 0eb8fcd Enable `Enumeration is empty` warnings for `Integer` 2f74be9 Fill in associated type defaults with DeriveAnyClass d2fb532 testsuite: Bump up haddock.base expected allocations 620fc6f Make Windows linker more robust to unknown sections aecf4a5 Build system: don't create mk/are-validating.mk c0bdfee Testsuite: only add -fno-warn-missed-specialisations for ghc>=7.11 7fcfee1 A few typos in comments 5ca1d31 Testsuite: make driver python 2.6 compatible again 427f8a1 Deduplicate one-shot/make compile paths. 8c1866a Comments only 0e169a8 Fix kind-var abstraction in SimplUtils.abstractFloats ca816c6 Remove dead code: ruleLhsOrphNames 7da3d30 Comments only 3833e71 Comments about TcLevel assignment 59883ae Documentation for FrontendResult 36811bf AsmCodeGen: Ensure LLVM .line directives are sorted ea4df12 Ensure shiftL/shiftR arguments aren't negative 7b443bb Improve error messages for ambiguous type variables 69a6e42 Allow non-operator infix pattern synonyms e2b579e Parser: revert some error messages to what they were before 7.10 f64f7c3 Tests for #10945 and #10946 931d0a7 Move orphan instance/rule warnings to typechecker/desugarer. e99e6db Extra files to ignore from the new Restructured documentation. 0ead0ca Disable man building for most quick build styles. c7ab799 Ignore __pycache__. e5baf62 Simplify type of ms_srcimps and ms_textual_imps. f00525d rts: Fix clobbered regs list for aarch64 StgRun 3ac9b92 configure.ac: AArch64 is now registerised 96586c4 Switch to LLVM version 3.7 From git at git.haskell.org Fri Oct 9 23:46:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 9 Oct 2015 23:46:47 +0000 (UTC) Subject: [commit: ghc] master: Revert "Switch to LLVM version 3.7" (80602af) Message-ID: <20151009234647.5A3833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/80602af0ad8ae223d294483163fd471d80c2ccd9/ghc >--------------------------------------------------------------- commit 80602af0ad8ae223d294483163fd471d80c2ccd9 Author: Erik de Castro Lopo Date: Sat Oct 10 10:47:37 2015 +1100 Revert "Switch to LLVM version 3.7" Pushed by mistacke before it was ready. This reverts commit 5dc3db743ec477978b9727a313951be44dbd170f. >--------------------------------------------------------------- 80602af0ad8ae223d294483163fd471d80c2ccd9 compiler/llvmGen/Llvm/PpLlvm.hs | 25 ++++++++++--------------- compiler/llvmGen/Llvm/Types.hs | 1 - compiler/llvmGen/LlvmCodeGen.hs | 11 ++++++++--- compiler/llvmGen/LlvmCodeGen/Base.hs | 15 +++++++++++---- configure.ac | 2 +- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/compiler/llvmGen/Llvm/PpLlvm.hs b/compiler/llvmGen/Llvm/PpLlvm.hs index e032a51..9234213 100644 --- a/compiler/llvmGen/Llvm/PpLlvm.hs +++ b/compiler/llvmGen/Llvm/PpLlvm.hs @@ -117,7 +117,6 @@ ppLlvmMeta (MetaNamed n m) -- | Print out an LLVM metadata value. ppLlvmMetaExpr :: MetaExpr -> SDoc -ppLlvmMetaExpr (MetaVar (LMLitVar (LMNullLit _))) = text "null" ppLlvmMetaExpr (MetaStr s ) = text "!" <> doubleQuotes (ftext s) ppLlvmMetaExpr (MetaNode n ) = text "!" <> int n ppLlvmMetaExpr (MetaVar v ) = ppr v @@ -274,12 +273,17 @@ ppCall ct fptr args attrs = case fptr of ++ "local var of pointer function type." where - ppCall' (LlvmFunctionDecl _ _ cc ret _ _ _) = + ppCall' (LlvmFunctionDecl _ _ cc ret argTy params _) = let tc = if ct == TailCall then text "tail " else empty ppValues = hsep $ punctuate comma $ map ppCallMetaExpr args + ppArgTy = (ppCommaJoin $ map fst params) <> + (case argTy of + VarArgs -> text ", ..." + FixedArgs -> empty) + fnty = space <> lparen <> ppArgTy <> rparen <> char '*' attrDoc = ppSpaceJoin attrs in tc <> text "call" <+> ppr cc <+> ppr ret - <+> ppName fptr <> lparen <+> ppValues + <> fnty <+> ppName fptr <> lparen <+> ppValues <+> rparen <+> attrDoc -- Metadata needs to be marked as having the `metadata` type when used @@ -358,11 +362,8 @@ ppCmpXChg addr old new s_ord f_ord = -- of specifying alignment. ppLoad :: LlvmVar -> SDoc -ppLoad var = text "load" <+> derefType <+> ppr var <> align +ppLoad var = text "load" <+> ppr var <> align where - derefType = case getVarType var of - LMPointer x -> ppr x <> comma - _ -> empty align | isVector . pLower . getVarType $ var = text ", align 1" | otherwise = empty @@ -372,10 +373,7 @@ ppALoad ord st var = sdocWithDynFlags $ \dflags -> align = text ", align" <+> ppr alignment sThreaded | st = text " singlethread" | otherwise = empty - derefType = case getVarType var of - LMPointer x -> ppr x <> comma - _ -> empty - in text "load atomic" <+> derefType <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align + in text "load atomic" <+> ppr var <> sThreaded <+> ppSyncOrdering ord <> align ppStore :: LlvmVar -> LlvmVar -> SDoc ppStore val dst @@ -411,10 +409,7 @@ ppGetElementPtr :: Bool -> LlvmVar -> [LlvmVar] -> SDoc ppGetElementPtr inb ptr idx = let indexes = comma <+> ppCommaJoin idx inbound = if inb then text "inbounds" else empty - derefType = case getVarType ptr of - LMPointer x -> ppr x <> comma - _ -> error "ppGetElementPtr" - in text "getelementptr" <+> inbound <+> derefType <+> ppr ptr <> indexes + in text "getelementptr" <+> inbound <+> ppr ptr <> indexes ppReturn :: Maybe LlvmVar -> SDoc diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs index 4f8d7ab..9780bf3 100644 --- a/compiler/llvmGen/Llvm/Types.hs +++ b/compiler/llvmGen/Llvm/Types.hs @@ -581,7 +581,6 @@ instance Outputable LlvmCallConvention where ppr CC_Ccc = text "ccc" ppr CC_Fastcc = text "fastcc" ppr CC_Coldcc = text "coldcc" - ppr (CC_Ncc 10) = text "ghccc" ppr (CC_Ncc i) = text "cc " <> ppr i ppr CC_X86_Stdcc = text "x86_stdcallcc" diff --git a/compiler/llvmGen/LlvmCodeGen.hs b/compiler/llvmGen/LlvmCodeGen.hs index a4e73c6..f0c184a 100644 --- a/compiler/llvmGen/LlvmCodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen.hs @@ -47,16 +47,21 @@ llvmCodeGen dflags h us cmm_stream showPass dflags "LLVM CodeGen" -- get llvm version, cache for later use - ver <- (fromMaybe supportedLlvmVersion) `fmap` figureLlvmVersion dflags + ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags writeIORef (llvmVersion dflags) ver -- warn if unsupported debugTraceMsg dflags 2 (text "Using LLVM version:" <+> text (show ver)) let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags - when (ver /= supportedLlvmVersion && doWarn) $ - putMsg dflags (text "You are using an unsupported version of LLVM!" + when (ver < minSupportLlvmVersion && doWarn) $ + errorMsg dflags (text "You are using an old version of LLVM that" + <> text " isn't supported anymore!" $+$ text "We will try though...") + when (ver > maxSupportLlvmVersion && doWarn) $ + putMsg dflags (text "You are using a new version of LLVM that" + <> text " hasn't been tested yet!" + $+$ text "We will try though...") -- run code generation runLlvm dflags ver bufh us $ diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs index 7ccc632..5ef0a4b 100644 --- a/compiler/llvmGen/LlvmCodeGen/Base.hs +++ b/compiler/llvmGen/LlvmCodeGen/Base.hs @@ -12,7 +12,8 @@ module LlvmCodeGen.Base ( LiveGlobalRegs, LlvmUnresData, LlvmData, UnresLabel, UnresStatic, - LlvmVersion, supportedLlvmVersion, + LlvmVersion, defaultLlvmVersion, minSupportLlvmVersion, + maxSupportLlvmVersion, LlvmM, runLlvm, liftStream, withClearVars, varLookup, varInsert, @@ -173,9 +174,15 @@ llvmPtrBits dflags = widthInBits $ typeWidth $ gcWord dflags -- | LLVM Version Number type LlvmVersion = Int --- | The LLVM Version that is currently supported. -supportedLlvmVersion :: LlvmVersion -supportedLlvmVersion = 37 +-- | The LLVM Version we assume if we don't know +defaultLlvmVersion :: LlvmVersion +defaultLlvmVersion = 36 + +minSupportLlvmVersion :: LlvmVersion +minSupportLlvmVersion = 36 + +maxSupportLlvmVersion :: LlvmVersion +maxSupportLlvmVersion = 36 -- ---------------------------------------------------------------------------- -- * Environment Handling diff --git a/configure.ac b/configure.ac index 3d9ec41..c9a6ed0 100644 --- a/configure.ac +++ b/configure.ac @@ -553,7 +553,7 @@ esac # tools we are looking for. In the past, GHC supported a number of # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. -LlvmVersion=3.7 +LlvmVersion=3.6 AC_SUBST([LlvmVersion]) dnl ** Which LLVM llc to use? From git at git.haskell.org Sat Oct 10 13:09:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:09:49 +0000 (UTC) Subject: [commit: ghc] branch 'wip/D1316' created Message-ID: <20151010130949.764DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/D1316 Referencing: db60084d738621b13835af2444bdf8c50013bf65 From git at git.haskell.org Sat Oct 10 13:09:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:09:52 +0000 (UTC) Subject: [commit: ghc] wip/D1316: base: MRP-refactoring of AMP instances (db60084) Message-ID: <20151010130952.310F33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/D1316 Link : http://ghc.haskell.org/trac/ghc/changeset/db60084d738621b13835af2444bdf8c50013bf65/ghc >--------------------------------------------------------------- commit db60084d738621b13835af2444bdf8c50013bf65 Author: Herbert Valerio Riedel Date: Thu Oct 8 16:34:17 2015 +0200 base: MRP-refactoring of AMP instances Summary: This refactors (>>)/(*>)/return/pure methods into normalform. The redundant explicit `return` method definitions are dropped altogether. This results in measurable runtime improvements in nofib of up to -20% runtime (geometric mean: -7%) in my measurements. Reviewers: quchen, austin, alanz, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1316 >--------------------------------------------------------------- db60084d738621b13835af2444bdf8c50013bf65 libraries/base/Control/Applicative.hs | 2 +- libraries/base/Control/Arrow.hs | 1 - libraries/base/Control/Monad/ST/Lazy/Imp.hs | 4 +--- libraries/base/Data/Complex.hs | 1 - libraries/base/Data/Either.hs | 1 - libraries/base/Data/Functor/Identity.hs | 1 - libraries/base/Data/List/NonEmpty.hs | 1 - libraries/base/Data/Monoid.hs | 3 --- libraries/base/Data/Proxy.hs | 2 -- libraries/base/Data/Semigroup.hs | 21 ++++++++------------- libraries/base/Data/Traversable.hs | 4 ++-- libraries/base/Data/Version.hs | 9 +++++---- libraries/base/GHC/Base.hs | 18 +++++++----------- libraries/base/GHC/Conc/Sync.hs | 12 ++++++------ libraries/base/GHC/GHCi.hs | 3 +-- libraries/base/GHC/ST.hs | 11 +++++------ libraries/base/Text/ParserCombinators/ReadP.hs | 7 ++----- libraries/base/Text/ParserCombinators/ReadPrec.hs | 3 +-- 18 files changed, 39 insertions(+), 65 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 db60084d738621b13835af2444bdf8c50013bf65 From git at git.haskell.org Sat Oct 10 13:22:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:22:04 +0000 (UTC) Subject: [commit: ghc] master: Fix error msg: ghci can't be used with -prof or -static (#10936) (e331392) Message-ID: <20151010132204.F06F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e331392e1891941916ee8e508a127ec7fec33d3d/ghc >--------------------------------------------------------------- commit e331392e1891941916ee8e508a127ec7fec33d3d Author: Thomas Miedema Date: Wed Oct 7 12:03:04 2015 +0200 Fix error msg: ghci can't be used with -prof or -static (#10936) Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1314 >--------------------------------------------------------------- e331392e1891941916ee8e508a127ec7fec33d3d ghc/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc/Main.hs b/ghc/Main.hs index 7ca7481..9fb0718 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -330,7 +330,7 @@ checkOptions mode dflags srcs objs = do when ((filter (not . wayRTSOnly) (ways dflags) /= interpWays) && isInterpretiveMode mode) $ do throwGhcException (UsageError - "--interactive can't be used with -prof.") + "--interactive can't be used with -prof or -static.") -- -ohi sanity check if (isJust (outputHi dflags) && (isCompManagerMode mode || srcs `lengthExceeds` 1)) From git at git.haskell.org Sat Oct 10 13:22:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:22:08 +0000 (UTC) Subject: [commit: ghc] master: Add short library names support to Windows linker (5d84110) Message-ID: <20151010132208.5F1CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5d841108acef950fed6a5e608ac9b18e7431aa87/ghc >--------------------------------------------------------------- commit 5d841108acef950fed6a5e608ac9b18e7431aa87 Author: Tamar Christina Date: Sat Oct 10 15:21:09 2015 +0200 Add short library names support to Windows linker Make Linker.hs try asking gcc for lib%s.dll as well, also changed tryGcc to pass -L to all components by using -B instead. These two fix shortnames linking on windows. re-enabled tests: ghcilink003, ghcilink006 and T3333 Added two tests: load_short_name and enabled T1407 on windows. Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1310 GHC Trac Issues: #9878, #1407, #1883, #5289 >--------------------------------------------------------------- 5d841108acef950fed6a5e608ac9b18e7431aa87 compiler/ghci/Linker.hs | 10 +++++++--- testsuite/tests/ghci/linking/Makefile | 8 ++++++++ testsuite/tests/ghci/linking/T1407.script | 4 ---- testsuite/tests/ghci/linking/all.T | 8 +------- testsuite/tests/ghci/linking/dyn/A.c | 17 +++++++++++++++++ testsuite/tests/ghci/linking/dyn/Makefile | 23 +++++++++++++++++++++++ testsuite/tests/ghci/linking/dyn/T1407.script | 4 ++++ testsuite/tests/ghci/linking/dyn/all.T | 12 ++++++++++++ testsuite/tests/ghci/scripts/all.T | 3 +-- 9 files changed, 73 insertions(+), 16 deletions(-) diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs index 8c2a07c..29968f5 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/ghci/Linker.hs @@ -1200,7 +1200,7 @@ locateLib dflags is_hs dirs lib -- for a dynamic library (#5289) -- otherwise, assume loadDLL can find it -- - = findDll `orElse` findArchive `orElse` tryGcc `orElse` assumeDll + = findDll `orElse` findArchive `orElse` tryGcc `orElse` tryGccPrefixed `orElse` assumeDll | not dynamicGhc -- When the GHC package was not compiled as dynamic library @@ -1221,6 +1221,7 @@ locateLib dflags is_hs dirs lib hs_dyn_lib_file = mkHsSOName platform hs_dyn_lib_name so_name = mkSOName platform lib + lib_so_name = "lib" ++ so_name dyn_lib_file = case (arch, os) of (ArchX86_64, OSSolaris2) -> "64" so_name _ -> so_name @@ -1230,7 +1231,8 @@ locateLib dflags is_hs dirs lib findArchive = liftM (fmap Archive) $ findFile dirs arch_file findHSDll = liftM (fmap DLLPath) $ findFile dirs hs_dyn_lib_file findDll = liftM (fmap DLLPath) $ findFile dirs dyn_lib_file - tryGcc = liftM (fmap DLLPath) $ searchForLibUsingGcc dflags so_name dirs + tryGcc = liftM (fmap DLLPath) $ searchForLibUsingGcc dflags so_name dirs + tryGccPrefixed = liftM (fmap DLLPath) $ searchForLibUsingGcc dflags lib_so_name dirs assumeDll = return (DLL lib) infixr `orElse` @@ -1242,7 +1244,9 @@ locateLib dflags is_hs dirs lib searchForLibUsingGcc :: DynFlags -> String -> [FilePath] -> IO (Maybe FilePath) searchForLibUsingGcc dflags so dirs = do - str <- askCc dflags (map (FileOption "-L") dirs + -- GCC does not seem to extend the library search path (using -L) when using + -- --print-file-name. So instead pass it a new base location. + str <- askCc dflags (map (FileOption "-B") dirs ++ [Option "--print-file-name", Option so]) let file = case lines str of [] -> "" diff --git a/testsuite/tests/ghci/linking/Makefile b/testsuite/tests/ghci/linking/Makefile index 5b8e23c..c833454 100644 --- a/testsuite/tests/ghci/linking/Makefile +++ b/testsuite/tests/ghci/linking/Makefile @@ -40,7 +40,11 @@ ghcilink002 : .PHONY: ghcilink003 ghcilink003 : +ifeq "$(WINDOWS)" "YES" + echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -lstdc++-6 +else echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -lstdc++ +endif # Test 4: # package P @@ -114,7 +118,11 @@ ghcilink006 : echo "version: 1.0" >>$(PKG006) echo "id: test-XXX" >>$(PKG006) echo "key: test-1.0" >>$(PKG006) +ifeq "$(WINDOWS)" "YES" + echo "extra-libraries: stdc++-6" >>$(PKG006) +else echo "extra-libraries: stdc++" >>$(PKG006) +endif '$(GHC_PKG)' init $(LOCAL_PKGCONF006) '$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF006) register $(PKG006) -v0 # diff --git a/testsuite/tests/ghci/linking/T1407.script b/testsuite/tests/ghci/linking/T1407.script deleted file mode 100644 index 9716435..0000000 --- a/testsuite/tests/ghci/linking/T1407.script +++ /dev/null @@ -1,4 +0,0 @@ -:set -ldl -import Foreign -import Foreign.C.String -foreign import ccall "dlerror" dle :: IO CString diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 4d05b8f..fc3516a 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -12,8 +12,6 @@ test('ghcilink002', test('ghcilink003', [ - # still cannot load libstdc++ on Windows. See also #4468. - when(opsys('mingw32'), expect_broken(5289)), unless(doing_ghci, skip), extra_clean(['dir003/*','dir003']) ], @@ -36,8 +34,6 @@ test('ghcilink005', test('ghcilink006', [ - # still cannot load libstdc++ on Windows. See also #4468. - when(opsys('mingw32'), expect_broken(5289)), unless(doing_ghci, skip), extra_clean(['dir006/ghcilink006.package.conf/*', 'dir006/*','dir006']) ], @@ -47,9 +43,7 @@ test('ghcilink006', test('T3333', [extra_clean(['T3333.o']), unless(doing_ghci, skip), - unless(opsys('linux') or ghci_dynamic(), expect_broken(3333))], + unless(ghci_dynamic(), expect_broken(3333))], run_command, ['$MAKE -s --no-print-directory T3333']) -test('T1407', when(opsys('mingw32'), expect_broken(1407)), - ghci_script, ['T1407.script']) diff --git a/testsuite/tests/ghci/linking/dyn/A.c b/testsuite/tests/ghci/linking/dyn/A.c new file mode 100644 index 0000000..fec94f2 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/A.c @@ -0,0 +1,17 @@ +#if defined(_MSC_VER) + // Microsoft + #define EXPORT __declspec(dllexport) +#elif defined(_GCC) + // GCC + #define EXPORT __attribute__((visibility("default"))) +#else + // do nothing and hope for the best? + #define EXPORT +#endif + +extern EXPORT int foo(); + +EXPORT int foo() +{ + return 2; +} diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile new file mode 100644 index 0000000..8a3b736 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -0,0 +1,23 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +ifeq "$(WINDOWS)" "YES" +DLL = lib$1.dll +else ifeq "$(DARWIN)" "YES" +DLL = lib$1.dylib +else +DLL = lib$1.so +endif + + +.PHONY: load_short_name +load_short_name: + rm -rf bin_short + mkdir bin_short + gcc -shared A.c -o "bin_short/$(call DLL,A)" + echo ":q" | "$(TEST_HC)" --interactive -L"$(PWD)/bin_short" -lA -v0 + +.PHONY: compile_libAS +compile_libAS: + gcc -shared A.c -o $(call DLL,AS) diff --git a/testsuite/tests/ghci/linking/dyn/T1407.script b/testsuite/tests/ghci/linking/dyn/T1407.script new file mode 100644 index 0000000..0274f82 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/T1407.script @@ -0,0 +1,4 @@ +:set -lAS +import Foreign +import Foreign.C.Types +foreign import ccall "foo" dle :: IO CInt diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T new file mode 100644 index 0000000..2810c7f --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -0,0 +1,12 @@ +test('load_short_name', + [unless(doing_ghci, skip), + extra_clean(['bin_short/*', 'bin_short'])], + run_command, + ['$MAKE -s --no-print-directory load_short_name']) + +test('T1407', + [unless(doing_ghci, skip), + extra_clean(['libAS.*']), + pre_cmd('$MAKE -s --no-print-directory compile_libAS'), + extra_hc_opts('-L.')], + ghci_script, ['T1407.script']) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index d2244c1..faf3f1d 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -208,8 +208,7 @@ test('T9878', [extra_clean(['T9878.hi','T9878.o'])], ghci_script, ['T9878.script']) test('T9878b', - [ when(opsys('mingw32'), expect_broken(9878)), - extra_run_opts('-fobject-code'), + [ extra_run_opts('-fobject-code'), extra_clean(['T9878b.hi','T9878b.o'])], ghci_script, ['T9878b.script']) test('T10018', normal, ghci_script, ['T10018.script']) From git at git.haskell.org Sat Oct 10 13:39:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:39:36 +0000 (UTC) Subject: [commit: ghc] master: Keep `shift{L, R}` on `Integer` from segfaulting (182c44d) Message-ID: <20151010133936.B5E8D3A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/182c44da50db028a432a81789048c87922bd30f4/ghc >--------------------------------------------------------------- commit 182c44da50db028a432a81789048c87922bd30f4 Author: Ben Gamari Date: Sat Oct 10 14:32:28 2015 +0200 Keep `shift{L,R}` on `Integer` from segfaulting This can happen because the underlying primitive operations in `integer-gmp` don't support negative shift-amounts, and since `integer-gmp` can't throw proper exceptions and just provides a low-level API, it simply segfaults instead... This patch simply removes the `shift{L,R}` method definitions (and defines `unsafeShift{L,R}` instead) whose default-impls fallback on using `shift` which properly handles negative shift arguments. This addresses #10571 Test Plan: harbormaster can do it Reviewers: hvr, austin, rwbarton Subscribers: rwbarton, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1018 GHC Trac Issues: #10571 >--------------------------------------------------------------- 182c44da50db028a432a81789048c87922bd30f4 libraries/base/Data/Bits.hs | 8 -------- libraries/base/changelog.md | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs index 38025f8..9134e13 100644 --- a/libraries/base/Data/Bits.hs +++ b/libraries/base/Data/Bits.hs @@ -515,15 +515,7 @@ instance Bits Integer where complement = complementInteger shift x i@(I# i#) | i >= 0 = shiftLInteger x i# | otherwise = shiftRInteger x (negateInt# i#) - shiftL x i@(I# i#) - | i < 0 = error "Bits.shiftL(Integer): negative shift" - | otherwise = shiftLInteger x i# - shiftR x i@(I# i#) - | i < 0 = error "Bits.shiftR(Integer): negative shift" - | otherwise = shiftRInteger x i# - testBit x (I# i) = testBitInteger x i - zeroBits = 0 #if HAVE_INTEGER_GMP1 diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 4874808..7c4bf77 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -66,6 +66,9 @@ `GHC.Generics` as part of making GHC generics capable of handling unlifted types (#10868) + * Keep `shift{L,R}` on `Integer` with negative shift-arguments from + segfaulting (#10571) + ## 4.8.1.0 *Jul 2015* * Bundled with GHC 7.10.2 From git at git.haskell.org Sat Oct 10 13:39:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:39:39 +0000 (UTC) Subject: [commit: ghc] master: sphinx: Don't share doctrees between targets (fa5eabe) Message-ID: <20151010133939.6CD083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa5eabec43a71546afba6dec7508ae5afb23b805/ghc >--------------------------------------------------------------- commit fa5eabec43a71546afba6dec7508ae5afb23b805 Author: Ben Gamari Date: Sat Oct 10 15:12:59 2015 +0200 sphinx: Don't share doctrees between targets Sphinx may trip over itself when multiple instances are run in parallel. Fixes #10950. >--------------------------------------------------------------- fa5eabec43a71546afba6dec7508ae5afb23b805 rules/sphinx.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rules/sphinx.mk b/rules/sphinx.mk index 87b57d6..5a3c7ce 100644 --- a/rules/sphinx.mk +++ b/rules/sphinx.mk @@ -13,13 +13,16 @@ # Build Sphinx documentation +# We are careful not to use the same directory the doctree files for the +# various Sphinx targets as make may run them in parallel (see #10950). + define sphinx $(call trace, sphinx($1,$2)) $(call profStart, sphinx($1,$2)) # $1 = dir # $2 = docname -$(call clean-target,$1,sphinx,$1/.doctrees $1/build-html/ $1/build-pdf $1/$2.pdf) +$(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf) # empty "all_$1" target just in case we're not building docs at all $(call all-target,$1,) @@ -37,7 +40,7 @@ html : html_$1 ifneq "$$(BINDIST)" "YES" $1/build-html/$2/index.html: $1/conf.py $$($1_RST_SOURCES) - $(SPHINXBUILD) -b html -d $1/.doctrees $(SPHINXOPTS) $1 $1/build-html/$2 + $(SPHINXBUILD) -b html -d $1/.doctrees-html $(SPHINXOPTS) $1 $1/build-html/$2 endif @@ -54,7 +57,7 @@ pdf : pdf_$1 ifneq "$$(BINDIST)" "YES" $1/$2.pdf: $$($1_RST_SOURCES) - $(SPHINXBUILD) -b latex -d $1/.doctrees $(SPHINXOPTS) $1 $1/build-pdf/$2 + $(SPHINXBUILD) -b latex -d $1/.doctrees-pdf $(SPHINXOPTS) $1 $1/build-pdf/$2 cd $1/build-pdf/$2 ; xelatex $2.tex cd $1/build-pdf/$2 ; xelatex $2.tex cp $1/build-pdf/$2/$2.pdf $1/$2.pdf From git at git.haskell.org Sat Oct 10 13:39:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 13:39:42 +0000 (UTC) Subject: [commit: ghc] master: Rename SpecInfo to RuleInfo (upon SPJ's advice). (840df33) Message-ID: <20151010133942.31FF23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/840df33685e8c746ade4b9d4d0eb7c764a773e48/ghc >--------------------------------------------------------------- commit 840df33685e8c746ade4b9d4d0eb7c764a773e48 Author: Edward Z. Yang Date: Sat Oct 10 14:34:21 2015 +0200 Rename SpecInfo to RuleInfo (upon SPJ's advice). Test Plan: validate Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1319 >--------------------------------------------------------------- 840df33685e8c746ade4b9d4d0eb7c764a773e48 compiler/basicTypes/Id.hs | 12 ++++----- compiler/basicTypes/IdInfo.hs | 56 +++++++++++++++++++-------------------- compiler/basicTypes/MkId.hs | 6 ++--- compiler/coreSyn/CoreFVs.hs | 2 +- compiler/coreSyn/CorePrep.hs | 2 +- compiler/coreSyn/CoreSeq.hs | 8 +++--- compiler/coreSyn/CoreSubst.hs | 14 +++++----- compiler/coreSyn/PprCore.hs | 2 +- compiler/main/TidyPgm.hs | 2 +- compiler/simplCore/OccurAnal.hs | 2 +- compiler/simplCore/SetLevels.hs | 2 +- compiler/simplCore/SimplCore.hs | 12 ++++----- compiler/simplCore/Simplify.hs | 6 ++--- compiler/specialise/Rules.hs | 28 ++++++++++---------- compiler/specialise/SpecConstr.hs | 20 +++++++------- compiler/specialise/Specialise.hs | 2 +- 16 files changed, 88 insertions(+), 88 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 840df33685e8c746ade4b9d4d0eb7c764a773e48 From git at git.haskell.org Sat Oct 10 16:31:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 16:31:45 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: T3333 still fails on non-linux statically linked ghci (#3333) (614ce4b) Message-ID: <20151010163145.1D82A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/614ce4b0b93ec1f9c308589b956b725535c57111/ghc >--------------------------------------------------------------- commit 614ce4b0b93ec1f9c308589b956b725535c57111 Author: Thomas Miedema Date: Sat Oct 10 18:28:20 2015 +0200 Testsuite: T3333 still fails on non-linux statically linked ghci (#3333) >--------------------------------------------------------------- 614ce4b0b93ec1f9c308589b956b725535c57111 testsuite/tests/ghci/linking/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index fc3516a..e823f88 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -43,7 +43,7 @@ test('ghcilink006', test('T3333', [extra_clean(['T3333.o']), unless(doing_ghci, skip), - unless(ghci_dynamic(), expect_broken(3333))], + unless(opsys('linux') or ghci_dynamic(), expect_broken(3333))], run_command, ['$MAKE -s --no-print-directory T3333']) From git at git.haskell.org Sat Oct 10 20:10:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 10 Oct 2015 20:10:55 +0000 (UTC) Subject: [commit: ghc] master: Delete ShPackageKey for now. (bbad4f6) Message-ID: <20151010201055.8D38F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbad4f6b5894c3deb417a056e0fd3fd75da7f593/ghc >--------------------------------------------------------------- commit bbad4f6b5894c3deb417a056e0fd3fd75da7f593 Author: Edward Z. Yang Date: Sat Oct 10 12:00:55 2015 -0700 Delete ShPackageKey for now. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- bbad4f6b5894c3deb417a056e0fd3fd75da7f593 compiler/backpack/ShPackageKey.hs | 241 -------------------------------------- compiler/ghc.cabal.in | 1 - compiler/main/DynFlags.hs | 41 ------- compiler/main/PackageConfig.hs | 21 ---- 4 files changed, 304 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 bbad4f6b5894c3deb417a056e0fd3fd75da7f593 From git at git.haskell.org Mon Oct 12 04:03:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 04:03:33 +0000 (UTC) Subject: [commit: ghc] master: compiler/nativeGen/PPC/Ppr.hs: Whitespace (f002340) Message-ID: <20151012040333.9C5F53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f0023409211f619e7676fa5cdac139e14aeaedd4/ghc >--------------------------------------------------------------- commit f0023409211f619e7676fa5cdac139e14aeaedd4 Author: Erik de Castro Lopo Date: Sun Sep 13 19:48:22 2015 +1000 compiler/nativeGen/PPC/Ppr.hs: Whitespace >--------------------------------------------------------------- f0023409211f619e7676fa5cdac139e14aeaedd4 compiler/nativeGen/PPC/Ppr.hs | 0 1 file changed, 0 insertions(+), 0 deletions(-) From git at git.haskell.org Mon Oct 12 04:03:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 04:03:36 +0000 (UTC) Subject: [commit: ghc] master: PPC: Fix right shift by 32 bits #10870 (4bd58c1) Message-ID: <20151012040336.CA4593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4bd58c179b8d0f8cf2850acb920cef8605826a2a/ghc >--------------------------------------------------------------- commit 4bd58c179b8d0f8cf2850acb920cef8605826a2a Author: Erik de Castro Lopo Date: Sun Sep 13 18:57:40 2015 +1000 PPC: Fix right shift by 32 bits #10870 Summary: Test included. Test Plan: Run test T10870.hs on X86/X86_64/Arm/Arm64 etc Reviewers: bgamari, nomeata, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1322 GHC Trac Issues: #10870 >--------------------------------------------------------------- 4bd58c179b8d0f8cf2850acb920cef8605826a2a compiler/nativeGen/PPC/Ppr.hs | 21 +++++++++++++++------ testsuite/tests/codeGen/should_run/T10870.hs | 11 +++++++++++ testsuite/tests/codeGen/should_run/T10870.stdout | 2 ++ testsuite/tests/codeGen/should_run/all.T | 1 + 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index b2bfb4e..e514779 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -710,6 +710,21 @@ pprInstr (EXTS fmt reg1 reg2) = hcat [ pprInstr (NEG reg1 reg2) = pprUnary (sLit "neg") reg1 reg2 pprInstr (NOT reg1 reg2) = pprUnary (sLit "not") reg1 reg2 +pprInstr (SR II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = + -- Handle the case where we are asked to shift a 32 bit register by + -- less than zero or more than 31 bits. We convert this into a clear + -- of the destination register. + -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/5900 + pprInstr (XOR reg1 reg2 (RIReg reg2)) + +pprInstr (SL II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = + -- As aboce for SR, but for left shifts. + -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/10870 + pprInstr (XOR reg1 reg2 (RIReg reg2)) + +pprInstr (SRA II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = + pprInstr (XOR reg1 reg2 (RIReg reg2)) + pprInstr (SL fmt reg1 reg2 ri) = let op = case fmt of II32 -> "slw" @@ -717,12 +732,6 @@ pprInstr (SL fmt reg1 reg2 ri) = _ -> panic "PPC.Ppr.pprInstr: shift illegal size" in pprLogic (sLit op) reg1 reg2 (limitShiftRI fmt ri) -pprInstr (SR II32 reg1 reg2 (RIImm (ImmInt i))) | i > 31 || i < 0 = - -- Handle the case where we are asked to shift a 32 bit register by - -- less than zero or more than 31 bits. We convert this into a clear - -- of the destination register. - -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/5900 - pprInstr (XOR reg1 reg2 (RIReg reg2)) pprInstr (SR fmt reg1 reg2 ri) = let op = case fmt of II32 -> "srw" diff --git a/testsuite/tests/codeGen/should_run/T10870.hs b/testsuite/tests/codeGen/should_run/T10870.hs new file mode 100644 index 0000000..642ef2c --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10870.hs @@ -0,0 +1,11 @@ +import Data.Bits +import Data.Int +import Data.Word + +unsafeShift32R :: (Bits a, Num a) => a -> a +unsafeShift32R x = unsafeShiftR x 32 + +main :: IO () +main = do + print $ map unsafeShift32R [ 123456, 0x7fffffff :: Int ] + print $ map unsafeShift32R [ 123456, 0xffffffff :: Word ] diff --git a/testsuite/tests/codeGen/should_run/T10870.stdout b/testsuite/tests/codeGen/should_run/T10870.stdout new file mode 100644 index 0000000..945f244 --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10870.stdout @@ -0,0 +1,2 @@ +[0,0] +[0,0] diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index ab2ce60..13eda78 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -138,3 +138,4 @@ test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], compile_and_run, ['-feager-blackholing']) test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) +test('T10870', normal, compile_and_run, ['']) From git at git.haskell.org Mon Oct 12 06:36:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:25 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: First stage of storing usage imports as GREs (860e549) Message-ID: <20151012063625.9BD203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/860e549ac228b9ea49b93ea98c5257afeb5b1eb6/ghc >--------------------------------------------------------------- commit 860e549ac228b9ea49b93ea98c5257afeb5b1eb6 Author: Adam Gundry Date: Tue Jul 28 18:03:13 2015 +0100 First stage of storing usage imports as GREs >--------------------------------------------------------------- 860e549ac228b9ea49b93ea98c5257afeb5b1eb6 compiler/rename/RnEnv.hs | 53 +++++++--------------- compiler/rename/RnNames.hs | 41 ++++++----------- compiler/rename/RnPat.hs | 2 +- compiler/typecheck/TcCanonical.hs | 6 +-- compiler/typecheck/TcDeriv.hs | 12 ++--- compiler/typecheck/TcRnDriver.hs | 13 +----- compiler/typecheck/TcRnMonad.hs | 7 +-- compiler/typecheck/TcRnTypes.hs | 4 +- compiler/typecheck/TcSMonad.hs | 10 ++-- .../should_fail/overloadedrecfldsfail06.hs | 13 ++++-- .../should_fail/overloadedrecfldsfail06.stderr | 9 ++++ 11 files changed, 68 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 860e549ac228b9ea49b93ea98c5257afeb5b1eb6 From git at git.haskell.org Mon Oct 12 06:36:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:28 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Radically simplify ChildName and IE-related things (4a01d40) Message-ID: <20151012063628.571873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/4a01d40ef240db42dd29fe7293fc01c5291a5a0d/ghc >--------------------------------------------------------------- commit 4a01d40ef240db42dd29fe7293fc01c5291a5a0d Author: Adam Gundry Date: Tue Jul 28 18:03:37 2015 +0100 Radically simplify ChildName and IE-related things >--------------------------------------------------------------- 4a01d40ef240db42dd29fe7293fc01c5291a5a0d compiler/rename/RnNames.hs | 120 ++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 77 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 4a01d40ef240db42dd29fe7293fc01c5291a5a0d From git at git.haskell.org Mon Oct 12 06:36:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:31 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Tidying up (73d88ab) Message-ID: <20151012063631.090AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/73d88abac35c7eca34a4a96c6b23c10256d27368/ghc >--------------------------------------------------------------- commit 73d88abac35c7eca34a4a96c6b23c10256d27368 Author: Adam Gundry Date: Wed Jul 29 17:23:38 2015 +0100 Tidying up >--------------------------------------------------------------- 73d88abac35c7eca34a4a96c6b23c10256d27368 compiler/basicTypes/RdrName.hs | 21 ++++-------------- compiler/rename/RnEnv.hs | 9 ++++---- compiler/rename/RnNames.hs | 49 +++++++++++------------------------------- 3 files changed, 20 insertions(+), 59 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 73d88abac35c7eca34a4a96c6b23c10256d27368 From git at git.haskell.org Mon Oct 12 06:36:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:33 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Use NameEnv instead of list for storing used GREs; not clear if this helps performance (d1e7a92) Message-ID: <20151012063633.B1FF83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/d1e7a92e9d92c986f37c25462b27b6a2b03274f8/ghc >--------------------------------------------------------------- commit d1e7a92e9d92c986f37c25462b27b6a2b03274f8 Author: Adam Gundry Date: Wed Jul 29 17:47:41 2015 +0100 Use NameEnv instead of list for storing used GREs; not clear if this helps performance >--------------------------------------------------------------- d1e7a92e9d92c986f37c25462b27b6a2b03274f8 compiler/basicTypes/RdrName.hs | 2 +- compiler/rename/RnEnv.hs | 4 ++-- compiler/rename/RnNames.hs | 2 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs index 84f8d8f..c0c1b26 100644 --- a/compiler/basicTypes/RdrName.hs +++ b/compiler/basicTypes/RdrName.hs @@ -43,7 +43,7 @@ module RdrName ( localRdrEnvElts, delLocalRdrEnvList, -- * Global mapping of 'RdrName' to 'GlobalRdrElt's - GlobalRdrEnv, emptyGlobalRdrEnv, mkGlobalRdrEnv, plusGlobalRdrEnv, + GlobalRdrEnv, emptyGlobalRdrEnv, mkGlobalRdrEnv, plusGlobalRdrEnv, plusGRE, lookupGlobalRdrEnv, extendGlobalRdrEnv, greOccName, shadowNames, pprGlobalRdrEnv, globalRdrEnvElts, lookupGRE_RdrName, lookupGRE_Name, lookupGRE_Field_Name, getGRE_NameQualifier_maybes, diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 6dce4c1..f7d016e 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -949,7 +949,7 @@ addUsedGRE warn_if_deprec gre = do { unless (isLocalGRE gre) $ do { env <- getGblEnv ; traceRn (text "addUsedGRE 1" <+> ppr gre) - ; updMutVar (tcg_used_gres env) (gre :) } + ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnv_C plusGRE env (gre_name gre) gre) } ; when warn_if_deprec $ warnIfDeprecated gre } @@ -960,7 +960,7 @@ addUsedGREs :: [GlobalRdrElt] -> RnM () addUsedGREs gres = do { env <- getGblEnv ; traceRn (text "addUsedGREs 2" <+> ppr gres) - ; updMutVar (tcg_used_gres env) (filter (not . isLocalGRE) gres ++) } + ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnvList_C plusGRE env [ (gre_name gre, gre) | gre <- gres, not (isLocalGRE gre)]) } warnIfDeprecated :: GlobalRdrElt -> RnM () warnIfDeprecated gre@(GRE { gre_name = name, gre_imp = iss }) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index f12ded7..407f993 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1502,7 +1502,7 @@ type ImportDeclUsage warnUnusedImportDecls :: TcGblEnv -> RnM () warnUnusedImportDecls gbl_env - = do { uses <- readMutVar (tcg_used_gres gbl_env) + = do { uses <- fmap nameEnvElts $ readMutVar (tcg_used_gres gbl_env) ; let user_imports = filterOut (ideclImplicit . unLoc) (tcg_rn_imports gbl_env) -- This whole function deals only with *user* imports -- both for warning about unnecessary ones, and for diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index b682ded..771adcc 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -82,7 +82,7 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this = do { errs_var <- newIORef (emptyBag, emptyBag) ; tvs_var <- newIORef emptyVarSet ; keep_var <- newIORef emptyNameSet ; - used_gre_var <- newIORef [] ; + used_gre_var <- newIORef emptyNameEnv ; th_var <- newIORef False ; th_splice_var<- newIORef False ; infer_var <- newIORef (True, emptyBag) ; diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 7b49e72..0404603 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -383,7 +383,7 @@ data TcGblEnv -- here about transative trusted packaage requirements. tcg_dus :: DefUses, -- ^ What is defined in this module and what is used. - tcg_used_gres :: TcRef [GlobalRdrElt], + tcg_used_gres :: TcRef (NameEnv GlobalRdrElt), -- See Note [Tracking unused binding and imports] tcg_keep :: TcRef NameSet, From git at git.haskell.org Mon Oct 12 06:36:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:36 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Fix handling of IEs (9aeac12) Message-ID: <20151012063636.5DA913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/9aeac1242bb43146d7bc9e58b4e7b2d51508f3b3/ghc >--------------------------------------------------------------- commit 9aeac1242bb43146d7bc9e58b4e7b2d51508f3b3 Author: Adam Gundry Date: Wed Jul 29 17:59:51 2015 +0100 Fix handling of IEs >--------------------------------------------------------------- 9aeac1242bb43146d7bc9e58b4e7b2d51508f3b3 compiler/rename/RnNames.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 407f993..c67ae0a 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1278,18 +1278,27 @@ exports_from_avail (Just (L _ rdr_items)) rdr_env imports this_mod lookup_ie ie@(IEThingAll (L l rdr)) = do name <- lookupGlobalOccRn rdr - let kids = findChildren kids_env name - addUsedGREs kids + let gres = findChildren kids_env name + addUsedGREs gres warnDodgyExports <- woptM Opt_WarnDodgyExports - when (null kids) $ + when (null gres) $ if isTyConName name then when warnDodgyExports $ addWarn (dodgyExportWarn name) else -- This occurs when you export T(..), but -- only import T abstractly, or T is a synonym. addErr (exportItemErr ie) + -- AMG TODO tidy up the following + let non_flds = [ gre_name gre | gre <- gres, not (isRecFldGRE gre) ] + flds = [ FieldLabel lbl is_overloaded (gre_name gre) | gre <- gres + , FldParent _ mb_lbl <- [gre_par gre] + , let (lbl, is_overloaded) = case mb_lbl of + Nothing -> (occNameFS (nameOccName (gre_name gre)), False) + Just x -> (x, True) + ] + return ( IEThingAll (L l name) - , foldr (plusAvail . availFromGRE) (AvailTC name [name] []) kids ) + , AvailTC name (name:non_flds) flds ) lookup_ie ie@(IEThingWith (L l rdr) sub_rdrs sub_flds) = do name <- lookupGlobalOccRn rdr @@ -1319,7 +1328,7 @@ exports_from_avail (Just (L _ rdr_items)) rdr_env imports this_mod ] addUsedGREs gres return ( IEThingWith (L l name) non_flds flds - , foldr (plusAvail . availFromGRE) (AvailTC name [name] []) gres ) + , AvailTC name (name:map unLoc non_flds) (map unLoc flds) ) lookup_ie _ = panic "lookup_ie" -- Other cases covered earlier From git at git.haskell.org Mon Oct 12 06:36:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:39 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Horrible hacking to refactor HsRecField (6b31bfe) Message-ID: <20151012063639.1A72B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/6b31bfe01a6bfd4cc8bb5f9b5d0f0fed62b22053/ghc >--------------------------------------------------------------- commit 6b31bfe01a6bfd4cc8bb5f9b5d0f0fed62b22053 Author: Adam Gundry Date: Thu Sep 3 00:11:54 2015 +0100 Horrible hacking to refactor HsRecField >--------------------------------------------------------------- 6b31bfe01a6bfd4cc8bb5f9b5d0f0fed62b22053 compiler/deSugar/Coverage.hs | 16 +++------ compiler/deSugar/DsExpr.hs | 2 +- compiler/deSugar/DsMeta.hs | 12 ++++--- compiler/hsSyn/Convert.hs | 12 ++----- compiler/hsSyn/HsPat.hs | 67 ++++++++++++++++-------------------- compiler/hsSyn/HsTypes.hs | 16 +++++---- compiler/hsSyn/PlaceHolder.hs | 16 ++++++++- compiler/parser/RdrHsSyn.hs | 2 +- compiler/rename/RnEnv.hs | 5 ++- compiler/rename/RnPat.hs | 26 +++++++------- compiler/typecheck/TcExpr.hs | 79 +++++++++++++++++++++++++++---------------- compiler/typecheck/TcHsSyn.hs | 11 +++--- 12 files changed, 141 insertions(+), 123 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 6b31bfe01a6bfd4cc8bb5f9b5d0f0fed62b22053 From git at git.haskell.org Mon Oct 12 06:36:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:42 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Merge remote-tracking branch 'origin/master' into wip/orf-reboot (baadd78) Message-ID: <20151012063642.D56473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/baadd78165651e9352a5d331246ddd987552ec17/ghc >--------------------------------------------------------------- commit baadd78165651e9352a5d331246ddd987552ec17 Merge: 6b31bfe a52db23 Author: Adam Gundry Date: Fri Oct 2 19:43:21 2015 +0100 Merge remote-tracking branch 'origin/master' into wip/orf-reboot Conflicts: compiler/basicTypes/DataCon.hs-boot compiler/deSugar/MatchCon.hs compiler/ghc.cabal.in compiler/ghc.mk compiler/hsSyn/Convert.hs compiler/hsSyn/HsImpExp.hs compiler/hsSyn/HsTypes.hs compiler/hsSyn/PlaceHolder.hs compiler/iface/BuildTyCl.hs compiler/iface/TcIface.hs compiler/parser/RdrHsSyn.hs compiler/rename/RnExpr.hs compiler/rename/RnNames.hs compiler/typecheck/TcEnv.hs compiler/typecheck/TcExpr.hs compiler/typecheck/TcTyClsDecls.hs testsuite/tests/driver/T4437.hs utils/haddock >--------------------------------------------------------------- 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 baadd78165651e9352a5d331246ddd987552ec17 From git at git.haskell.org Mon Oct 12 06:36:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:45 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Further refactoring of HsRecUpdField (ef07c2c) Message-ID: <20151012063645.8D9953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/ef07c2cc5db6037461f15707389d6e0edba7a558/ghc >--------------------------------------------------------------- commit ef07c2cc5db6037461f15707389d6e0edba7a558 Author: Adam Gundry Date: Fri Oct 2 19:44:51 2015 +0100 Further refactoring of HsRecUpdField >--------------------------------------------------------------- ef07c2cc5db6037461f15707389d6e0edba7a558 compiler/deSugar/Coverage.hs | 2 +- compiler/deSugar/DsMeta.hs | 11 ++++---- compiler/hsSyn/Convert.hs | 10 ++++---- compiler/hsSyn/HsPat.hs | 55 +++++++++++++++++----------------------- compiler/hsSyn/HsTypes.hs | 51 ++++++++++++++++++++++++++++--------- compiler/hsSyn/PlaceHolder.hs | 12 --------- compiler/parser/RdrHsSyn.hs | 3 ++- compiler/rename/RnPat.hs | 21 ++++++++++------ compiler/typecheck/TcExpr.hs | 58 +++++++++++++++++++++---------------------- compiler/typecheck/TcHsSyn.hs | 5 +--- 10 files changed, 118 insertions(+), 110 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 ef07c2cc5db6037461f15707389d6e0edba7a558 From git at git.haskell.org Mon Oct 12 06:36:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:48 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Test wibbles (cc7e5e9) Message-ID: <20151012063648.3AB023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/cc7e5e937e2d4e6da43151fb00cdad7bb6abe139/ghc >--------------------------------------------------------------- commit cc7e5e937e2d4e6da43151fb00cdad7bb6abe139 Author: Adam Gundry Date: Sun Oct 4 20:13:26 2015 +0100 Test wibbles >--------------------------------------------------------------- cc7e5e937e2d4e6da43151fb00cdad7bb6abe139 testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script | 1 + .../tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script b/testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script index 46ec37c..2aa0a15 100644 --- a/testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script +++ b/testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script @@ -1,3 +1,4 @@ + :set -XDuplicateRecordFields data S = MkS { foo :: Int } data T a = MkT { foo :: Bool, bar :: a -> a } diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr index cf37520..84db6ee 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr @@ -1,5 +1,5 @@ overloadedrecfldsfail08.hs:9:9: error: - No constructor has all these fields: ?x?, ?y? + No type has all these fields: ?x?, ?y? In the expression: e {x = 3, y = True} In an equation for ?foo?: foo e = e {x = 3, y = True} From git at git.haskell.org Mon Oct 12 06:36:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:51 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Clarify a corner case with an additional test (cd4fe28) Message-ID: <20151012063651.CAA083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/cd4fe2818df8f25e10d4e84a5a2a069517114508/ghc >--------------------------------------------------------------- commit cd4fe2818df8f25e10d4e84a5a2a069517114508 Author: Adam Gundry Date: Mon Oct 5 15:59:58 2015 +0100 Clarify a corner case with an additional test >--------------------------------------------------------------- cd4fe2818df8f25e10d4e84a5a2a069517114508 compiler/basicTypes/Avail.hs | 8 ++++++-- .../should_fail/OverloadedRecFldsFail10_A.hs | 5 +++++ .../should_fail/OverloadedRecFldsFail10_B.hs | 6 ++++++ .../should_fail/OverloadedRecFldsFail10_C.hs | 6 ++++++ testsuite/tests/overloadedrecflds/should_fail/all.T | 5 +++++ .../should_fail/overloadedrecfldsfail10.hs | 11 +++++++++++ .../should_fail/overloadedrecfldsfail10.stderr | 14 ++++++++++++++ 7 files changed, 53 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/Avail.hs b/compiler/basicTypes/Avail.hs index cc39625..26bf6ee 100644 --- a/compiler/basicTypes/Avail.hs +++ b/compiler/basicTypes/Avail.hs @@ -95,8 +95,12 @@ is possible to have AvailTC F [F, MkFInt, MkFBool] [FieldLabel "foo" True $sel:foo:MkFInt, FieldLabel "foo" False foo]. -AMG TODO: but if we do this with two identically-named things, -something must go wrong on re-export? +If the two data instances are defined in different modules, both +without `-XDuplicateRecordFields`, it will be impossible to export +them from the same module (even with `-XDuplicateRecordfields` +enabled), because they would be represented identically. The +workaround here is to enable `-XDuplicateRecordFields` on the defining +modules. -} -- | Compare lexicographically diff --git a/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_A.hs b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_A.hs new file mode 100644 index 0000000..9234882 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_A.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies #-} +module OverloadedRecFldsFail10_A where + +data family F a +data instance F Int = MkFInt { foo :: Int } diff --git a/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_B.hs b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_B.hs new file mode 100644 index 0000000..9cb346a --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_B.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies #-} +module OverloadedRecFldsFail10_B (F(..)) where + +import OverloadedRecFldsFail10_A hiding (foo) + +data instance F Bool = MkFBool { foo :: Int } diff --git a/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_C.hs b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_C.hs new file mode 100644 index 0000000..700ed2b --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail10_C.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE DuplicateRecordFields, TypeFamilies #-} +module OverloadedRecFldsFail10_C (F(..)) where + +import OverloadedRecFldsFail10_A + +data instance F Char = MkFChar { foo :: Char } diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T index 1447985..7bce887 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/all.T +++ b/testsuite/tests/overloadedrecflds/should_fail/all.T @@ -11,3 +11,8 @@ test('overloadedrecfldsfail06', test('overloadedrecfldsfail07', normal, compile_fail, ['']) test('overloadedrecfldsfail08', normal, compile_fail, ['']) test('overloadedrecfldsfail09', normal, compile_fail, ['']) +test('overloadedrecfldsfail10', + extra_clean([ 'OverloadedRecFldsFail10_A.hi', 'OverloadedRecFldsFail10_A.o' + , 'OverloadedRecFldsFail10_B.hi', 'OverloadedRecFldsFail10_B.o' + , 'OverloadedRecFldsFail10_C.hi', 'OverloadedRecFldsFail10_C.o']), + multimod_compile_fail, ['overloadedrecfldsfail10', '']) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.hs new file mode 100644 index 0000000..ccb25d3 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.hs @@ -0,0 +1,11 @@ +-- Modules A and B both declare F(foo) +-- Module C declares F($sel:foo:MkFChar) but exports A.F(foo) as well +-- Thus we can't export F(..) even with DuplicateRecordFields enabled + +{-# LANGUAGE DuplicateRecordFields #-} +module Main (main, F(..)) where + +import OverloadedRecFldsFail10_B +import OverloadedRecFldsFail10_C + +main = return () diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.stderr new file mode 100644 index 0000000..9d8e8bd --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail10.stderr @@ -0,0 +1,14 @@ +[1 of 4] Compiling OverloadedRecFldsFail10_A ( OverloadedRecFldsFail10_A.hs, OverloadedRecFldsFail10_A.o ) +[2 of 4] Compiling OverloadedRecFldsFail10_C ( OverloadedRecFldsFail10_C.hs, OverloadedRecFldsFail10_C.o ) +[3 of 4] Compiling OverloadedRecFldsFail10_B ( OverloadedRecFldsFail10_B.hs, OverloadedRecFldsFail10_B.o ) +[4 of 4] Compiling Main ( overloadedrecfldsfail10.hs, overloadedrecfldsfail10.o ) + +overloadedrecfldsfail10.hs:6:20: error: + Conflicting exports for ?foo?: + ?F(..)? exports ?OverloadedRecFldsFail10_B.foo? + imported from ?OverloadedRecFldsFail10_B? at overloadedrecfldsfail10.hs:8:1-32 + (and originally defined at OverloadedRecFldsFail10_B.hs:6:34-36) + ?F(..)? exports ?OverloadedRecFldsFail10_C.foo? + imported from ?OverloadedRecFldsFail10_C? at overloadedrecfldsfail10.hs:9:1-32 + (and originally defined in ?OverloadedRecFldsFail10_A? + at OverloadedRecFldsFail10_A.hs:5:32-34) From git at git.haskell.org Mon Oct 12 06:36:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:54 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Remove unused ieNames (c936cfb) Message-ID: <20151012063654.74C5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/c936cfb36371ca0043791babe316063fdfadb151/ghc >--------------------------------------------------------------- commit c936cfb36371ca0043791babe316063fdfadb151 Author: Adam Gundry Date: Mon Oct 5 16:02:39 2015 +0100 Remove unused ieNames >--------------------------------------------------------------- c936cfb36371ca0043791babe316063fdfadb151 compiler/hsSyn/HsImpExp.hs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/compiler/hsSyn/HsImpExp.hs b/compiler/hsSyn/HsImpExp.hs index a8397e4..a60f86e 100644 --- a/compiler/hsSyn/HsImpExp.hs +++ b/compiler/hsSyn/HsImpExp.hs @@ -197,19 +197,6 @@ ieName (IEThingWith (L _ n) _ _) = n ieName (IEThingAll (L _ n)) = n ieName _ = panic "ieName failed pattern match!" -{- --- AMG TODO get rid of? -ieNames :: IE a -> [a] -ieNames (IEVar (L _ n) ) = [n] -ieNames (IEThingAbs (L _ n) ) = [n] -ieNames (IEThingAll (L _ n) ) = [n] -ieNames (IEThingWith (L _ n) ns fs) = n : map unLoc ns ++ availFieldsNames fs -ieNames (IEModuleContents _ ) = [] -ieNames (IEGroup _ _ ) = [] -ieNames (IEDoc _ ) = [] -ieNames (IEDocNamed _ ) = [] --} - pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc pprImpExp name = type_pref <+> pprPrefixOcc name where From git at git.haskell.org Mon Oct 12 06:36:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:57 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Remove confused debugging code (a3373da) Message-ID: <20151012063657.18D8C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/a3373da46ac9a01527d78cab1d97b5bbe2c0c554/ghc >--------------------------------------------------------------- commit a3373da46ac9a01527d78cab1d97b5bbe2c0c554 Author: Adam Gundry Date: Mon Oct 5 16:06:24 2015 +0100 Remove confused debugging code >--------------------------------------------------------------- a3373da46ac9a01527d78cab1d97b5bbe2c0c554 compiler/rename/RnEnv.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index f6465a3..68501da 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -949,10 +949,7 @@ addUsedGRE warn_if_deprec gre = do { unless (isLocalGRE gre) $ do { env <- getGblEnv ; traceRn (text "addUsedGRE 1" <+> ppr gre) - ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnv_C plusGRE env (gre_name gre) gre) - ; blah <- readMutVar (tcg_used_gres env) - -- AMG TODO ARGH why doesn't this extend with the GRE? - ; traceRn (text "AMG addUsedGRE uses" <+> ppr blah) } + ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnv_C plusGRE env (gre_name gre) gre) } ; when warn_if_deprec $ warnIfDeprecated gre } From git at git.haskell.org Mon Oct 12 06:36:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:36:59 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Revert "Use NameEnv instead of list for storing used GREs; not clear if this helps performance" (0071c36) Message-ID: <20151012063659.B771D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/0071c36756c533f769cfd232f6f22d9ef85aeb7b/ghc >--------------------------------------------------------------- commit 0071c36756c533f769cfd232f6f22d9ef85aeb7b Author: Adam Gundry Date: Mon Oct 5 16:08:34 2015 +0100 Revert "Use NameEnv instead of list for storing used GREs; not clear if this helps performance" This reverts commit d1e7a92e9d92c986f37c25462b27b6a2b03274f8. >--------------------------------------------------------------- 0071c36756c533f769cfd232f6f22d9ef85aeb7b compiler/basicTypes/RdrName.hs | 2 +- compiler/rename/RnEnv.hs | 4 ++-- compiler/rename/RnNames.hs | 2 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs index c0c1b26..84f8d8f 100644 --- a/compiler/basicTypes/RdrName.hs +++ b/compiler/basicTypes/RdrName.hs @@ -43,7 +43,7 @@ module RdrName ( localRdrEnvElts, delLocalRdrEnvList, -- * Global mapping of 'RdrName' to 'GlobalRdrElt's - GlobalRdrEnv, emptyGlobalRdrEnv, mkGlobalRdrEnv, plusGlobalRdrEnv, plusGRE, + GlobalRdrEnv, emptyGlobalRdrEnv, mkGlobalRdrEnv, plusGlobalRdrEnv, lookupGlobalRdrEnv, extendGlobalRdrEnv, greOccName, shadowNames, pprGlobalRdrEnv, globalRdrEnvElts, lookupGRE_RdrName, lookupGRE_Name, lookupGRE_Field_Name, getGRE_NameQualifier_maybes, diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 68501da..d204974 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -949,7 +949,7 @@ addUsedGRE warn_if_deprec gre = do { unless (isLocalGRE gre) $ do { env <- getGblEnv ; traceRn (text "addUsedGRE 1" <+> ppr gre) - ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnv_C plusGRE env (gre_name gre) gre) } + ; updMutVar (tcg_used_gres env) (gre :) } ; when warn_if_deprec $ warnIfDeprecated gre } @@ -960,7 +960,7 @@ addUsedGREs :: [GlobalRdrElt] -> RnM () addUsedGREs gres = do { env <- getGblEnv ; traceRn (text "addUsedGREs 2" <+> ppr gres) - ; updMutVar (tcg_used_gres env) (\ env -> extendNameEnvList_C plusGRE env [ (gre_name gre, gre) | gre <- gres, not (isLocalGRE gre)]) } + ; updMutVar (tcg_used_gres env) (filter (not . isLocalGRE) gres ++) } warnIfDeprecated :: GlobalRdrElt -> RnM () warnIfDeprecated gre@(GRE { gre_name = name, gre_imp = iss }) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index cf048b1..f2e90e5 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1502,7 +1502,7 @@ type ImportDeclUsage warnUnusedImportDecls :: TcGblEnv -> RnM () warnUnusedImportDecls gbl_env - = do { uses <- fmap nameEnvElts $ readMutVar (tcg_used_gres gbl_env) + = do { uses <- readMutVar (tcg_used_gres gbl_env) ; let user_imports = filterOut (ideclImplicit . unLoc) (tcg_rn_imports gbl_env) -- This whole function deals only with *user* imports -- both for warning about unnecessary ones, and for diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index dc002b9..1f77bd2 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -82,7 +82,7 @@ initTc hsc_env hsc_src keep_rn_syntax mod loc do_this = do { errs_var <- newIORef (emptyBag, emptyBag) ; tvs_var <- newIORef emptyVarSet ; keep_var <- newIORef emptyNameSet ; - used_gre_var <- newIORef emptyNameEnv ; + used_gre_var <- newIORef [] ; th_var <- newIORef False ; th_splice_var<- newIORef False ; infer_var <- newIORef (True, emptyBag) ; diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 51db27f..abcf761 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -383,7 +383,7 @@ data TcGblEnv -- here about transative trusted packaage requirements. tcg_dus :: DefUses, -- ^ What is defined in this module and what is used. - tcg_used_gres :: TcRef (NameEnv GlobalRdrElt), + tcg_used_gres :: TcRef [GlobalRdrElt], -- See Note [Tracking unused binding and imports] tcg_keep :: TcRef NameSet, From git at git.haskell.org Mon Oct 12 06:37:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:02 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Revert "Tidying up" (9f84652) Message-ID: <20151012063702.7F32D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/9f8465216491fd5bbda359f9c6e3cf0c5b27de9b/ghc >--------------------------------------------------------------- commit 9f8465216491fd5bbda359f9c6e3cf0c5b27de9b Author: Adam Gundry Date: Mon Oct 5 16:08:36 2015 +0100 Revert "Tidying up" This reverts commit 73d88abac35c7eca34a4a96c6b23c10256d27368. >--------------------------------------------------------------- 9f8465216491fd5bbda359f9c6e3cf0c5b27de9b compiler/basicTypes/RdrName.hs | 21 ++++++++++++++---- compiler/rename/RnEnv.hs | 9 ++++---- compiler/rename/RnNames.hs | 49 +++++++++++++++++++++++++++++++----------- 3 files changed, 59 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9f8465216491fd5bbda359f9c6e3cf0c5b27de9b From git at git.haskell.org Mon Oct 12 06:37:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:05 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Revert "First stage of storing usage imports as GREs" (9531e9e) Message-ID: <20151012063705.644D73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/9531e9e17fe762e06104bfa6202ea4f8e6970c0b/ghc >--------------------------------------------------------------- commit 9531e9e17fe762e06104bfa6202ea4f8e6970c0b Author: Adam Gundry Date: Tue Oct 6 14:38:20 2015 +0100 Revert "First stage of storing usage imports as GREs" This reverts commit 860e549ac228b9ea49b93ea98c5257afeb5b1eb6. Conflicts: compiler/rename/RnNames.hs >--------------------------------------------------------------- 9531e9e17fe762e06104bfa6202ea4f8e6970c0b compiler/rename/RnEnv.hs | 53 +++++++++++++++------- compiler/rename/RnNames.hs | 45 +++++++++++------- compiler/rename/RnPat.hs | 2 +- compiler/typecheck/TcCanonical.hs | 6 +-- compiler/typecheck/TcDeriv.hs | 12 ++--- compiler/typecheck/TcRnDriver.hs | 13 +++++- compiler/typecheck/TcRnMonad.hs | 7 ++- compiler/typecheck/TcRnTypes.hs | 4 +- compiler/typecheck/TcSMonad.hs | 10 ++-- .../should_fail/overloadedrecfldsfail06.hs | 13 ++---- .../should_fail/overloadedrecfldsfail06.stderr | 9 ---- 11 files changed, 104 insertions(+), 70 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 9531e9e17fe762e06104bfa6202ea4f8e6970c0b From git at git.haskell.org Mon Oct 12 06:37:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:08 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Refactoring RnNames (7b3b949) Message-ID: <20151012063708.2CE8F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/7b3b949ededbb28828fa5077a9029bbf05c54ebd/ghc >--------------------------------------------------------------- commit 7b3b949ededbb28828fa5077a9029bbf05c54ebd Author: Adam Gundry Date: Tue Oct 6 15:18:51 2015 +0100 Refactoring RnNames >--------------------------------------------------------------- 7b3b949ededbb28828fa5077a9029bbf05c54ebd compiler/rename/RnNames.hs | 139 +++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 73 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 7b3b949ededbb28828fa5077a9029bbf05c54ebd From git at git.haskell.org Mon Oct 12 06:37:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:10 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Further refactoring RnNames (65f006c) Message-ID: <20151012063710.DC74C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/65f006cb8ecf3b56264ec0bcb32dee2a5fcacf3a/ghc >--------------------------------------------------------------- commit 65f006cb8ecf3b56264ec0bcb32dee2a5fcacf3a Author: Adam Gundry Date: Tue Oct 6 15:31:23 2015 +0100 Further refactoring RnNames >--------------------------------------------------------------- 65f006cb8ecf3b56264ec0bcb32dee2a5fcacf3a compiler/rename/RnNames.hs | 61 ++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 54f9ea5..dc99fdb 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -45,7 +45,7 @@ import FastStringEnv import ListSetOps import Control.Monad -import Data.Either ( partitionEithers ) +import Data.Either ( partitionEithers, isRight, rights ) import Data.Map ( Map ) import qualified Data.Map as Map import Data.Ord ( comparing ) @@ -871,7 +871,7 @@ filterImports iface decl_spec (Just (want_hiding, L l import_items)) -- See the AvailTC Invariant in Avail.hs (n1:ns1) | n1 == name -> ns1 | otherwise -> ns - case lookupChildrenImport subnames subflds rdr_ns of + case lookupChildren (map Left subnames ++ map Right subflds) rdr_ns of Nothing -> failLookupWith BadImport Just (childnames, childflds) -> case mb_parent of @@ -1020,8 +1020,8 @@ mkChildEnv gres = foldr add emptyNameEnv gres findChildren :: NameEnv [a] -> Name -> [a] findChildren env n = lookupNameEnv env n `orElse` [] -lookupChildren :: (a -> FastString) -> [a] -> [Located RdrName] - -> [Maybe (Located [a])] +lookupChildren :: [Either Name FieldLabel] -> [Located RdrName] + -> Maybe ([Located Name], [Located FieldLabel]) -- (lookupChildren all_kids rdr_items) maps each rdr_item to its -- corresponding Name all_kids, if the former exists -- The matching is done by FastString, not OccName, so that @@ -1029,50 +1029,30 @@ lookupChildren :: (a -> FastString) -> [a] -> [Located RdrName] -- will correctly find AssocTy among the all_kids of Cls, even though -- the RdrName for AssocTy may have a (bogus) DataName namespace -- (Really the rdr_items should be FastStrings in the first place.) -lookupChildren f all_kids rdr_items - -- = map (lookupFsEnv kid_env . occNameFS . rdrNameOcc) rdr_items - = map doOne rdr_items +lookupChildren all_kids rdr_items + = do xs <- mapM doOne rdr_items + return (fmap concat (partitionEithers xs)) where doOne (L l r) = case (lookupFsEnv kid_env . occNameFS . rdrNameOcc) r of - Just n -> Just (L l n) - Nothing -> Nothing + Just [Left n] -> Just (Left (L l n)) + Just rs | all isRight rs -> Just (Right (map (L l) (rights rs))) + _ -> Nothing -- See Note [Children for duplicate record fields] kid_env = extendFsEnvList_C (++) emptyFsEnv - [(f x, [x]) | x <- all_kids] - - -lookupChildrenImport :: [Name] -> [FieldLabel] -> [Located RdrName] -> Maybe ([Located Name], [Located FieldLabel]) -lookupChildrenImport subnames subflds rdr_ns = do - xs <- sequence $ lookupChildren (either (occNameFS . nameOccName) flLabel) subs rdr_ns - return $ partitionEithers (concatMap (\ (L l e) -> map (either (Left . L l) (Right . L l)) e) xs) - where - subs = map Left subnames ++ map Right subflds - - -lookupChildrenExport :: [GlobalRdrElt] -> [Located RdrName] -> Maybe ([GlobalRdrElt], [Located Name], [Located FieldLabel]) -lookupChildrenExport gres rdrs = do - lgress <- sequence $ lookupChildren (occNameFS . greOccName) gres rdrs - let gres = concat $ map unLoc lgress - (non_flds, flds) = partitionEithers [ classifyGRE l gre - | L l gres <- lgress - , gre <- gres - ] - return (gres, non_flds, flds) - where - classifyGRE l gre = case gre_par gre of - FldParent _ Nothing -> Right (L l (FieldLabel (occNameFS (nameOccName (gre_name gre))) False (gre_name gre))) - FldParent _ (Just lbl) -> Right (L l (FieldLabel lbl True (gre_name gre))) - _ -> Left (L l (gre_name gre)) + [(either (occNameFS . nameOccName) flLabel x, [x]) | x <- all_kids] classifyGREs :: [GlobalRdrElt] -> ([Name], [FieldLabel]) classifyGREs = partitionEithers . map classifyGRE + +classifyGRE :: GlobalRdrElt -> Either Name FieldLabel +classifyGRE gre = case gre_par gre of + FldParent _ Nothing -> Right (FieldLabel (occNameFS (nameOccName n)) False n) + FldParent _ (Just lbl) -> Right (FieldLabel lbl True n) + _ -> Left n where - classifyGRE gre = case gre_par gre of - FldParent _ Nothing -> Right (FieldLabel (occNameFS (nameOccName (gre_name gre))) False (gre_name gre)) - FldParent _ (Just lbl) -> Right (FieldLabel lbl True (gre_name gre)) - _ -> Left (gre_name gre) + n = gre_name gre -- | Combines 'AvailInfo's from the same family @@ -1309,14 +1289,15 @@ exports_from_avail (Just (L _ rdr_items)) rdr_env imports this_mod lookup_ie ie@(IEThingWith (L l rdr) sub_rdrs sub_flds) = ASSERT2(null sub_flds, ppr sub_flds) do name <- lookupGlobalOccRn rdr + let gres = findChildren kids_env name if isUnboundName name then return ( IEThingWith (L l name) [] [] , AvailTC name [name] [] ) - else case lookupChildrenExport (findChildren kids_env name) sub_rdrs of + else case lookupChildren (map classifyGRE gres) sub_rdrs of Nothing -> do addErr (exportItemErr ie) return ( IEThingWith (L l name) [] [] , AvailTC name [name] [] ) - Just (gres, non_flds, flds) -> + Just (non_flds, flds) -> do addUsedKids rdr gres return ( IEThingWith (L l name) non_flds flds , AvailTC name (name:map unLoc non_flds) (map unLoc flds) ) From git at git.haskell.org Mon Oct 12 06:37:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:13 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Better plusParent (794ce74) Message-ID: <20151012063713.995543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/794ce74139492cea950c7dc34adda265c9278f5d/ghc >--------------------------------------------------------------- commit 794ce74139492cea950c7dc34adda265c9278f5d Author: Adam Gundry Date: Tue Oct 6 15:54:49 2015 +0100 Better plusParent >--------------------------------------------------------------- 794ce74139492cea950c7dc34adda265c9278f5d compiler/basicTypes/RdrName.hs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs index 4828766..209544f 100644 --- a/compiler/basicTypes/RdrName.hs +++ b/compiler/basicTypes/RdrName.hs @@ -437,26 +437,20 @@ instance Outputable Parent where plusParent :: Parent -> Parent -> Parent -- See Note [Combining parents] -plusParent (ParentIs n) p2 = hasParentIs n p2 -plusParent (FldParent n f) p2 = hasFldParent n f p2 -plusParent p1 (ParentIs n) = hasParentIs n p1 -plusParent p1 (FldParent n f) = hasFldParent n f p1 -plusParent NoParent NoParent = NoParent +plusParent p1@(ParentIs _) p2 = hasParent p1 p2 +plusParent p1@(FldParent _ _) p2 = hasParent p1 p2 +plusParent p1 p2@(ParentIs _) = hasParent p2 p1 +plusParent p1 p2@(FldParent _ _) = hasParent p2 p1 +plusParent NoParent NoParent = NoParent -hasParentIs :: Name -> Parent -> Parent +hasParent :: Parent -> Parent -> Parent #ifdef DEBUG -hasParentIs n (ParentIs n') - | n /= n' = pprPanic "hasParentIs" (ppr n <+> ppr n') -- Parents should agree +hasParent p NoParent = p +hasParent p p' + | p /= p' = pprPanic "hasParent" (ppr p <+> ppr p') -- Parents should agree #endif -hasParentIs n _ = ParentIs n +hasParent p _ = p -hasFldParent :: Name -> Maybe FieldLabelString -> Parent -> Parent -#ifdef DEBUG -hasFldParent n f (FldParent n' f') - | n /= n' || f /= f' -- Parents should agree - = pprPanic "hasFldParent" (ppr n <+> ppr f <+> ppr n' <+> ppr f') -#endif -hasFldParent n f _ = FldParent n f {- Note [GlobalRdrElt provenance] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Mon Oct 12 06:37:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:16 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Tidy up disambiguateRecordFields (dec2c1f) Message-ID: <20151012063716.42C4D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/dec2c1fc410bd5bfe191fda3ea4fa8957a246838/ghc >--------------------------------------------------------------- commit dec2c1fc410bd5bfe191fda3ea4fa8957a246838 Author: Adam Gundry Date: Tue Oct 6 16:17:54 2015 +0100 Tidy up disambiguateRecordFields >--------------------------------------------------------------- dec2c1fc410bd5bfe191fda3ea4fa8957a246838 compiler/typecheck/TcExpr.hs | 82 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 9b97192..3b57e00 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1398,33 +1398,37 @@ signature to be omitted. disambiguateRecordBinds :: LHsExpr Name -> [LHsRecUpdField Name] -> Type -> TcM [LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)] disambiguateRecordBinds record_expr rbnds res_ty - | Just rbnds' <- unambiguous = mapM look rbnds' -- Always the case if DuplicateRecordFields is off - | otherwise = do + = case mapM isUnambiguous rbnds of + -- Always the case if DuplicateRecordFields is off + Just rbnds' -> lookupSelectors rbnds' + Nothing -> do { fam_inst_envs <- tcGetFamInstEnvs ; rbnds_with_parents <- fmap (zip rbnds) $ mapM getParents rbnds - ; case possibleParents rbnds_with_parents of - [] -> failWithTc (noPossibleParents rbnds) - [p] -> chooseParent p rbnds_with_parents - _ | Just p <- tyConOf fam_inst_envs res_ty -> chooseParent p rbnds_with_parents - _ | Just sig_ty <- obviousSig (unLoc record_expr) -> + ; p <- case possibleParents rbnds_with_parents of + [] -> failWithTc (noPossibleParents rbnds) + [p] -> return p + _ | Just p <- tyConOf fam_inst_envs res_ty -> return p + _ | Just sig_ty <- obviousSig (unLoc record_expr) -> do { sig_tc_ty <- tcHsSigType ExprSigCtxt sig_ty ; case tyConOf fam_inst_envs sig_tc_ty of - Just p -> chooseParent p rbnds_with_parents + Just p -> return p Nothing -> failWithTc badOverloadedUpdate } - _ -> failWithTc badOverloadedUpdate } + _ -> failWithTc badOverloadedUpdate + ; assignParent p rbnds_with_parents } where - unambiguous = mapM isSingle rbnds + isUnambiguous :: LHsRecUpdField Name -> Maybe (LHsRecUpdField Name, Name) + isUnambiguous x = case unLoc (hsRecFieldLbl (unLoc x)) of + Unambiguous _ sel_name -> Just (x, sel_name) + Ambiguous{} -> Nothing - isSingle :: LHsRecUpdField Name -> Maybe (LHsRecUpdField Name, Name) - isSingle x = case unLoc (hsRecFieldLbl (unLoc x)) of - Unambiguous _ sel_name -> Just (x, sel_name) - Ambiguous{} -> Nothing - - look :: (LHsRecUpdField Name, Name) -> TcM (LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)) - look (L l x, n) = do i <- tcLookupId n - let L loc af = hsRecFieldLbl x - lbl = rdrNameAmbiguousFieldOcc af - return $ L l x { hsRecFieldLbl = L loc (Unambiguous lbl i) } + lookupSelectors :: [(LHsRecUpdField Name, Name)] -> TcM [LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)] + lookupSelectors = mapM look + where + look :: (LHsRecUpdField Name, Name) -> TcM (LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)) + look (L l x, n) = do i <- tcLookupId n + let L loc af = hsRecFieldLbl x + lbl = rdrNameAmbiguousFieldOcc af + return $ L l x { hsRecFieldLbl = L loc (Unambiguous lbl i) } -- Extract the outermost TyCon of a type, if there is one; for -- data families this is the representation tycon (because that's @@ -1440,40 +1444,36 @@ disambiguateRecordBinds record_expr rbnds res_ty -- Look up the parent tycon for each candidate record selector. getParents :: LHsRecUpdField Name -> RnM [(TyCon, Name)] - getParents x = case unLoc (hsRecFieldLbl (unLoc x)) of - Unambiguous _ sel_name -> fmap return $ lookupParent sel_name + getParents (L _ fld) = case unLoc (hsRecFieldLbl fld) of + Unambiguous _ sel_name -> fmap singleton $ lookupParent sel_name Ambiguous _ _ -> do { - Just (Right xs) <- lookupGlobalOccRn_overloaded True (unLoc (hsRecUpdFieldRdr (unLoc x))) + Just (Right xs) <- lookupGlobalOccRn_overloaded True (unLoc (hsRecUpdFieldRdr fld)) ; mapM (lookupParent . selectorFieldOcc) xs } - where - lookupParent name = do { id <- tcLookupId name - ; ASSERT (isRecordSelector id) - return (recordSelectorTyCon id, name) } + + lookupParent :: Name -> RnM (TyCon, Name) + lookupParent name = do { id <- tcLookupId name + ; ASSERT (isRecordSelector id) + return (recordSelectorTyCon id, name) } -- Make all the fields unambiguous by choosing the given parent. -- Fails with an error if any of the ambiguous fields cannot have -- that parent, e.g. if the user writes -- r { x = e } :: T -- where T does not have field x. - chooseParent :: TyCon -> [(LHsRecUpdField Name, [(TyCon, Name)])] -> RnM [LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)] - chooseParent p rbnds | null orphans = mapM foo rbnds' + assignParent :: TyCon -> [(LHsRecUpdField Name, [(TyCon, Name)])] + -> RnM [LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)] + assignParent p rbnds | null orphans = lookupSelectors rbnds' | otherwise = failWithTc (orphanFields p orphans) where (orphans, rbnds') = partitionWith pickParent rbnds - foo :: (LHsRecUpdField Name, Name) -> RnM (LHsRecField' (AmbiguousFieldOcc Id) (LHsExpr Name)) - foo (L l fld, name) = do id <- tcLookupId name - let L loc lbl = hsRecUpdFieldRdr fld - return $ L l fld { hsRecFieldLbl = L loc (Unambiguous lbl id) } - - -- Returns Right fld' if fld can have parent p, or Left lbl if not. - -- TODO refactor - pickParent :: (LHsRecUpdField Name, [(TyCon, Name)]) -> - Either (Located RdrName) (LHsRecUpdField Name, Name) - pickParent (L l fld, xs) + -- Returns Right if fld can have parent p, or Left lbl if not. + pickParent :: (LHsRecUpdField Name, [(TyCon, Name)]) + -> Either (Located RdrName) (LHsRecUpdField Name, Name) + pickParent (fld, xs) = case lookup p xs of - Just name -> Right (L l fld, name) - Nothing -> Left (fmap rdrNameAmbiguousFieldOcc (hsRecFieldLbl fld)) + Just name -> Right (fld, name) + Nothing -> Left (hsRecUpdFieldRdr (unLoc fld)) -- A type signature on the record expression must be "obvious", -- i.e. the outermost constructor ignoring parentheses. From git at git.haskell.org Mon Oct 12 06:37:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:18 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Comments only (f23c72e) Message-ID: <20151012063718.F02723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/f23c72ec6a51d6435b7f869018fc71d7f2866bc4/ghc >--------------------------------------------------------------- commit f23c72ec6a51d6435b7f869018fc71d7f2866bc4 Author: Adam Gundry Date: Tue Oct 6 16:36:55 2015 +0100 Comments only >--------------------------------------------------------------- f23c72ec6a51d6435b7f869018fc71d7f2866bc4 compiler/hsSyn/HsPat.hs | 47 +++++++++++++++++++++++++++-------------------- compiler/hsSyn/HsTypes.hs | 8 ++++++++ compiler/rename/RnPat.hs | 1 - 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/compiler/hsSyn/HsPat.hs b/compiler/hsSyn/HsPat.hs index 2b44950..b37d836 100644 --- a/compiler/hsSyn/HsPat.hs +++ b/compiler/hsSyn/HsPat.hs @@ -286,18 +286,24 @@ data HsRecField' id arg = HsRecField { -- T { A.x } means T { A.x = x } --- TODO update note --- Note [HsRecUpdField selector] --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - --- A HsRecUpdField always contains a label (in hsRecUpdFieldLbl) --- giving the thing the user wrote, but thanks to --- DuplicateRecordFields this may not unambiguously correspond to --- a Name. The hsRecUpdFieldSel is filled in by the renamer --- (RnPat.rnHsRecUpdFields) to contain a list of the candidate --- selector function names. The typechecker (tcExpr) then --- disambiguates the record update, so after the typechecker the list --- will always be a singleton. +-- Note [HsRecField and HsRecUpdField] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +-- A HsRecField (used for record construction and pattern matching) +-- contains an unambiguous occurrence of a field (i.e. a FieldOcc). +-- We can't just store the Name, because thanks to +-- DuplicateRecordFields this may not correspond to the label the user +-- wrote. +-- +-- A HsRecUpdField (used for record update) contains a potentially +-- ambiguous occurrence of a field (an AmbiguousFieldOcc). The +-- renamer will fill in the selector function if it can, but if the +-- selector is ambiguous the renamer will defer to the typechecker. +-- After the typechecker, a unique selector will have been determined. +-- +-- The renamer produces an Unambiguous result if it can, rather than +-- just doing the lookup in the typechecker, so that completely +-- unambiguous updates can be represented by 'DsMeta.repUpdFields'. -- -- For example, suppose we have: -- @@ -306,17 +312,18 @@ data HsRecField' id arg = HsRecField { -- -- f z = (z { x = 3 }) :: S -- --- After the renamer, the HsRecUpdField corresponding to the record --- update will have +-- The parsed HsRecUpdField corresponding to the record update will have: +-- +-- hsRecFieldLbl = Unambiguous "x" PlaceHolder :: AmbiguousFieldOcc RdrName +-- +-- After the renamer, this will become: -- --- hsRecUpdFieldLbl = "x" --- hsRecUpdFieldSel = [$sel:x:MkS, $sel:x:MkT] +-- hsRecFieldLbl = Ambiguous "x" PlaceHolder :: AmbiguousFieldOcc Name -- --- and the typechecker will determine that $sel:x:MkS is meant. +-- (note that the Unambiguous constructor is not type-correct here). +-- The typechecker will determine the particular selector: -- --- We fill in hsRecUpdFieldSel in the renamer, rather than just doing --- the lookup in the typechecker, so that completely unambiguous --- updates can be represented by 'DsMeta.repUpdFields'. +-- hsRecFieldLbl = Unambiguous "x" $sel:x:MkS :: AmbiguousFieldOcc Id hsRecFields :: HsRecFields id arg -> [PostRn id id] hsRecFields rbinds = map (unLoc . hsRecFieldSel . unLoc) (rec_flds rbinds) diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index d882146..22ad00b 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -578,6 +578,14 @@ mkFieldOcc :: RdrName -> FieldOcc RdrName mkFieldOcc rdr = FieldOcc rdr PlaceHolder +-- | Represents an *occurrence* of a field that is potentially +-- ambiguous after the renamer, with the ambiguity resolved by the +-- typechecker. We always store the 'RdrName' that the user +-- originally wrote, and store the selector function after the renamer +-- (for unambiguous occurrences) or the typechecker (for ambiguous +-- occurrences). +-- +-- See Note [HsRecField and HsRecUpdField] in HsPat data AmbiguousFieldOcc name = Unambiguous RdrName (PostRn name name) | Ambiguous RdrName (PostTc name name) diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index 8ef484a..115e4d5 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -648,7 +648,6 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot }) (_, dup_flds) = removeDups compare (getFieldLbls flds) --- TODO unduplicate? rnHsRecUpdFields :: [LHsRecUpdField RdrName] -> RnM ([LHsRecUpdField Name], FreeVars) From git at git.haskell.org Mon Oct 12 06:37:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:21 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Resurrect a failing report-unused-imports test (be204f0) Message-ID: <20151012063721.B17783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/be204f0af9ef400d358eac77408aebfff4d44a3f/ghc >--------------------------------------------------------------- commit be204f0af9ef400d358eac77408aebfff4d44a3f Author: Adam Gundry Date: Tue Oct 6 16:42:39 2015 +0100 Resurrect a failing report-unused-imports test >--------------------------------------------------------------- be204f0af9ef400d358eac77408aebfff4d44a3f .../should_fail/overloadedrecfldsfail06.hs | 13 ++++++++----- .../should_fail/overloadedrecfldsfail06.stderr | 13 +++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs index 9175c9e..249cb56 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.hs @@ -4,12 +4,15 @@ {-# LANGUAGE DuplicateRecordFields #-} {-# OPTIONS_GHC -Werror -fwarn-unused-imports #-} -import OverloadedRecFldsFail06_A (U(MkU, x, y), V(MkV, MkV2, x, y), Unused(unused), u, getX, getY) +import OverloadedRecFldsFail06_A (U(x, y), V(MkV, MkV2, x, y), Unused(unused), u, getY) +import qualified OverloadedRecFldsFail06_A as M (U(x)) +import qualified OverloadedRecFldsFail06_A as N (V(x, y)) +import qualified OverloadedRecFldsFail06_A as P (U(x), V(x)) v = MkV2 True --- Check that this counts a use of U(x) and V(y) but not U(y) or V(x) -main = do print (getX u) - print (getY v) - print ((\ MkU{x=x} -> x) u) +-- Check that this counts a use of U(x) and V(y) but not U(y) or V(x)... +main = do print (u { x = True } :: U) print ((\ MkV2{y=y} -> y) v) + print (N.x v) + print (getY (v { P.x = 3 })) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr index 6339618..6a1b939 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr @@ -14,5 +14,18 @@ overloadedrecfldsfail06.hs:7:1: warning: The import of ?Unused(unused), V(x), U(y), MkV, Unused? from module ?OverloadedRecFldsFail06_A? is redundant +overloadedrecfldsfail06.hs:8:1: warning: + The qualified import of ?OverloadedRecFldsFail06_A? is redundant + except perhaps to import instances from ?OverloadedRecFldsFail06_A? + To import instances alone, use: import OverloadedRecFldsFail06_A() + +overloadedrecfldsfail06.hs:9:1: warning: + The qualified import of ?V(y)? + from module ?OverloadedRecFldsFail06_A? is redundant + +overloadedrecfldsfail06.hs:10:1: warning: + The qualified import of ?U(x), U? + from module ?OverloadedRecFldsFail06_A? is redundant + : error: Failing due to -Werror. From git at git.haskell.org Mon Oct 12 06:37:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:24 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Store FieldOccs in tcg_used_selectors so we get import usage right (6de6654) Message-ID: <20151012063724.C0D093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/6de6654b15372fc744f2aebfb6c34eaaa16f898d/ghc >--------------------------------------------------------------- commit 6de6654b15372fc744f2aebfb6c34eaaa16f898d Author: Adam Gundry Date: Tue Oct 6 17:14:20 2015 +0100 Store FieldOccs in tcg_used_selectors so we get import usage right >--------------------------------------------------------------- 6de6654b15372fc744f2aebfb6c34eaaa16f898d compiler/hsSyn/HsTypes.hs | 2 ++ compiler/rename/RnEnv.hs | 10 ++++++---- compiler/rename/RnNames.hs | 19 ++++++++++--------- compiler/typecheck/TcExpr.hs | 3 ++- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 2 +- 6 files changed, 22 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 6de6654b15372fc744f2aebfb6c34eaaa16f898d From git at git.haskell.org Mon Oct 12 06:37:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:27 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Clean up extendImportMap (c72cd58) Message-ID: <20151012063727.8EAD13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/c72cd58fe0cddb76896807df9597ec356f241dc3/ghc >--------------------------------------------------------------- commit c72cd58fe0cddb76896807df9597ec356f241dc3 Author: Adam Gundry Date: Tue Oct 6 17:31:59 2015 +0100 Clean up extendImportMap >--------------------------------------------------------------- c72cd58fe0cddb76896807df9597ec356f241dc3 compiler/rename/RnNames.hs | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 595fe4d..5e3b71a 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1502,7 +1502,7 @@ warnUnusedImportDecls gbl_env fld_env = mkFieldEnv rdr_env ; let usage :: [ImportDeclUsage] - usage = findImportUsage user_imports rdr_env uses sel_uses fld_env + usage = findImportUsage user_imports rdr_env uses sel_uses ; traceRn (vcat [ ptext (sLit "Uses:") <+> ppr uses , ptext (sLit "Selector uses:") <+> ppr sel_uses @@ -1541,16 +1541,15 @@ findImportUsage :: [LImportDecl Name] -> GlobalRdrEnv -> [RdrName] -> Set.Set (FieldOcc Name) - -> NameEnv (FieldLabelString, Name) -> [ImportDeclUsage] -findImportUsage imports rdr_env rdrs sel_names fld_env +findImportUsage imports rdr_env rdrs sel_names = map unused_decl imports where import_usage :: ImportMap import_usage - = foldr (extendImportMap fld_env rdr_env . Right) - (foldr (extendImportMap fld_env rdr_env . Left) Map.empty rdrs) + = foldr (extendImportMap_Field rdr_env) + (foldr (extendImportMap rdr_env) Map.empty rdrs) (Set.elems sel_names) unused_decl decl@(L loc (ImportDecl { ideclHiding = imps })) @@ -1591,27 +1590,29 @@ findImportUsage imports rdr_env rdrs sel_names fld_env -- imported Num(signum). We don't want to complain that -- Num is not itself mentioned. Hence the two cases in add_unused_with. --- AMG TODO clean this up -extendImportMap :: NameEnv (FieldLabelString, Name) - -> GlobalRdrEnv - -> Either RdrName (FieldOcc Name) +extendImportMap :: GlobalRdrEnv + -> RdrName -> ImportMap -> ImportMap --- For a used RdrName, find all the import decls that brought +extendImportMap rdr_env rdr = + extendImportMap_GRE (lookupGRE_RdrName rdr rdr_env) + +extendImportMap_Field :: GlobalRdrEnv + -> FieldOcc Name + -> ImportMap -> ImportMap +extendImportMap_Field rdr_env (FieldOcc rdr sel) = + extendImportMap_GRE (pickGREs rdr (lookupGRE_Field_Name rdr_env sel lbl)) + where + lbl = occNameFS (rdrNameOcc rdr) + +-- For a single used GRE, find all the import decls that brought -- it into scope; choose one of them (bestImport), and record -- the RdrName in that import decl's entry in the ImportMap -extendImportMap fld_env rdr_env rdr_or_sel imp_map - | Left rdr <- rdr_or_sel - , [gre] <- lookupGRE_RdrName rdr rdr_env - , GRE { gre_lcl = lcl, gre_imp = imps } <- gre - , not lcl - = add_imp gre (bestImport imps) imp_map - - | Right (FieldOcc rdr sel) <- rdr_or_sel - , [gre] <- pickGREs rdr (lookupGRE_Field_Name rdr_env sel (occNameFS (rdrNameOcc rdr))) +extendImportMap_GRE :: [GlobalRdrElt] -> ImportMap -> ImportMap +extendImportMap_GRE gres imp_map + | [gre] <- gres , GRE { gre_lcl = lcl, gre_imp = imps } <- gre , not lcl = add_imp gre (bestImport imps) imp_map - | otherwise = imp_map where From git at git.haskell.org Mon Oct 12 06:37:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:30 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Comments only (f7d5e5c) Message-ID: <20151012063730.60CEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/f7d5e5cbdbcc2544f579c711afb0b364433f19ee/ghc >--------------------------------------------------------------- commit f7d5e5cbdbcc2544f579c711afb0b364433f19ee Author: Adam Gundry Date: Tue Oct 6 17:41:37 2015 +0100 Comments only >--------------------------------------------------------------- f7d5e5cbdbcc2544f579c711afb0b364433f19ee compiler/rename/RnNames.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 5e3b71a..ba30145 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1471,7 +1471,7 @@ reportUnusedNames _export_decls gbl_env used_as_selector :: Set.Set (FieldOcc Name) -> GlobalRdrElt -> Bool used_as_selector sel_uses gre = isRecFldGRE gre && any ((==) (gre_name gre) . selectorFieldOcc) sel_uses - -- AMG TODO use a map instead? + {- ********************************************************* diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index a1e0cc5..2df7fdd 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -583,7 +583,6 @@ We gather three sorts of usage information This usage info is mainly gathered by the renamer's gathering of free-variables -AMG TODO update me please * tcg_used_rdrnames Records used *imported* (not locally-defined) RdrNames Used only to report unused import declarations @@ -593,8 +592,8 @@ AMG TODO update me please is unnecessary. This info isn't present in Names. * tcg_used_selectors - Records the Names of record selectors that are used - by the DuplicateRecordFields extension. These + Records the record selectors that are used + by the DuplicateRecordFields extension. These may otherwise be missed from tcg_used_rdrnames as a single RdrName might refer to multiple fields. From git at git.haskell.org Mon Oct 12 06:37:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:33 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Don't addUsedRdrName for many ambiguous selectors at once (46d2fc2) Message-ID: <20151012063733.211713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/46d2fc207da1001fca7569c5f438bba2342a0384/ghc >--------------------------------------------------------------- commit 46d2fc207da1001fca7569c5f438bba2342a0384 Author: Adam Gundry Date: Wed Oct 7 11:41:05 2015 +0100 Don't addUsedRdrName for many ambiguous selectors at once >--------------------------------------------------------------- 46d2fc207da1001fca7569c5f438bba2342a0384 compiler/rename/RnEnv.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index fa49463..a75932d 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -875,8 +875,9 @@ lookupGlobalOccRn_overloaded overload_ok rdr_name -> do { addUsedRdrName True gre rdr_name ; return (Just (Left (gre_name gre))) } gres | all isRecFldGRE gres && overload_ok - -> do { mapM_ (\ gre -> addUsedRdrName True gre rdr_name) gres - ; return (Just (Right (map (FieldOcc rdr_name . gre_name) gres))) } + -- Don't record usage for ambiguous selectors + -- until we know which is meant + -> return (Just (Right (map (FieldOcc rdr_name . gre_name) gres))) gres -> do { addNameClashErrRn rdr_name gres ; return (Just (Left (gre_name (head gres)))) } } From git at git.haskell.org Mon Oct 12 06:37:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:35 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Get rid of isOverloadedRecFldGRE (50c1b05) Message-ID: <20151012063735.D896B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/50c1b05e7b633cc006f1b38a868fb2f5c2a3f9cd/ghc >--------------------------------------------------------------- commit 50c1b05e7b633cc006f1b38a868fb2f5c2a3f9cd Author: Adam Gundry Date: Wed Oct 7 11:55:16 2015 +0100 Get rid of isOverloadedRecFldGRE >--------------------------------------------------------------- 50c1b05e7b633cc006f1b38a868fb2f5c2a3f9cd compiler/basicTypes/RdrName.hs | 7 +------ compiler/rename/RnEnv.hs | 15 +++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs index 209544f..1430f38 100644 --- a/compiler/basicTypes/RdrName.hs +++ b/compiler/basicTypes/RdrName.hs @@ -54,7 +54,7 @@ module RdrName ( greUsedRdrName, greRdrNames, greSrcSpan, greQualModName, -- ** Global 'RdrName' mapping elements: 'GlobalRdrElt', 'Provenance', 'ImportSpec' - GlobalRdrElt(..), isLocalGRE, isRecFldGRE, isOverloadedRecFldGRE, greLabel, + GlobalRdrElt(..), isLocalGRE, isRecFldGRE, greLabel, unQualOK, qualSpecOK, unQualSpecOK, pprNameProvenance, Parent(..), @@ -716,11 +716,6 @@ isRecFldGRE :: GlobalRdrElt -> Bool isRecFldGRE (GRE {gre_par = FldParent{}}) = True isRecFldGRE _ = False -isOverloadedRecFldGRE :: GlobalRdrElt -> Bool -isOverloadedRecFldGRE (GRE {gre_par = FldParent{par_lbl = Just _}}) - = True -isOverloadedRecFldGRE _ = False - -- Returns the field label of this GRE, if it has one greLabel :: GlobalRdrElt -> Maybe FieldLabelString greLabel (GRE{gre_par = FldParent{par_lbl = Just lbl}}) = Just lbl diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index a75932d..fa4ef28 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -480,7 +480,7 @@ lookupSubBndrOcc warnIfDeprec parent doc rdr_name -- NB: lookupGlobalRdrEnv, not lookupGRE_RdrName! -- The latter does pickGREs, but we want to allow 'x' -- even if only 'M.x' is in scope - [gre] | isOverloadedRecFldGRE gre -> + [gre] | isRecFldGRE gre -> do { addUsedSelector (FieldOcc rdr_name (gre_name gre)) ; return (gre_name gre) } | otherwise -> @@ -868,9 +868,10 @@ lookupGlobalOccRn_overloaded overload_ok rdr_name = do { env <- getGlobalRdrEnv ; case lookupGRE_RdrName rdr_name env of [] -> return Nothing - [gre] | isOverloadedRecFldGRE gre - -> do { addUsedSelector (FieldOcc rdr_name (gre_name gre)) - ; return (Just (Right [FieldOcc rdr_name $ gre_name gre])) } + [gre] | isRecFldGRE gre + -> do { let fld_occ = FieldOcc rdr_name (gre_name gre) + ; addUsedSelector fld_occ + ; return (Just (Right [fld_occ])) } | otherwise -> do { addUsedRdrName True gre rdr_name ; return (Just (Left (gre_name gre))) } @@ -1887,12 +1888,10 @@ warnUnusedGRE gre@(GRE { gre_name = name, gre_lcl = lcl, gre_imp = is }) -- | Make a map from selector names to field labels and parent tycon -- names, to be used when reporting unused record fields. mkFieldEnv :: GlobalRdrEnv -> NameEnv (FieldLabelString, Name) -mkFieldEnv rdr_env = mkNameEnv [ (gre_name gre, (lbl, par_is par)) +mkFieldEnv rdr_env = mkNameEnv [ (gre_name gre, (lbl, par_is (gre_par gre))) | gres <- occEnvElts rdr_env , gre <- gres - , isOverloadedRecFldGRE gre - , let par = gre_par gre - Just lbl = par_lbl par + , Just lbl <- [greLabel gre] ] reportable :: Name -> Bool From git at git.haskell.org Mon Oct 12 06:37:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:38 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Qualified import to fix build pre-BBP (d664c07) Message-ID: <20151012063738.8BF213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/d664c07350aebf94644c33009f7ca03bf62fe563/ghc >--------------------------------------------------------------- commit d664c07350aebf94644c33009f7ca03bf62fe563 Author: Adam Gundry Date: Thu Oct 8 00:14:20 2015 +0100 Qualified import to fix build pre-BBP >--------------------------------------------------------------- d664c07350aebf94644c33009f7ca03bf62fe563 compiler/rename/RnNames.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index ba30145..a1765e7 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -46,6 +46,7 @@ import ListSetOps import Control.Monad import Data.Either ( partitionEithers, isRight, rights ) +import qualified Data.Foldable as Foldable import Data.Map ( Map ) import qualified Data.Map as Map import Data.Ord ( comparing ) @@ -1470,7 +1471,7 @@ reportUnusedNames _export_decls gbl_env -- Remove uses of record selectors recorded in the typechecker used_as_selector :: Set.Set (FieldOcc Name) -> GlobalRdrElt -> Bool used_as_selector sel_uses gre - = isRecFldGRE gre && any ((==) (gre_name gre) . selectorFieldOcc) sel_uses + = isRecFldGRE gre && Foldable.any ((==) (gre_name gre) . selectorFieldOcc) sel_uses {- From git at git.haskell.org Mon Oct 12 06:37:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:41 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Add a test that deprecation warnings cannot be attached to DRFs (dc084f7) Message-ID: <20151012063741.BBD943A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/dc084f73b45615e164870954674a83c9426a70b2/ghc >--------------------------------------------------------------- commit dc084f73b45615e164870954674a83c9426a70b2 Author: Adam Gundry Date: Thu Oct 8 00:41:55 2015 +0100 Add a test that deprecation warnings cannot be attached to DRFs >--------------------------------------------------------------- dc084f73b45615e164870954674a83c9426a70b2 testsuite/tests/overloadedrecflds/should_fail/all.T | 1 + .../tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs | 5 +++++ .../overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T index 7bce887..db689e5 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/all.T +++ b/testsuite/tests/overloadedrecflds/should_fail/all.T @@ -16,3 +16,4 @@ test('overloadedrecfldsfail10', , 'OverloadedRecFldsFail10_B.hi', 'OverloadedRecFldsFail10_B.o' , 'OverloadedRecFldsFail10_C.hi', 'OverloadedRecFldsFail10_C.o']), multimod_compile_fail, ['overloadedrecfldsfail10', '']) +test('overloadedrecfldsfail11', normal, compile_fail, ['']) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs new file mode 100644 index 0000000..9c5c145 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE DuplicateRecordFields #-} + +{-# WARNING foo "No warnings for DRFs" #-} +data S = MkS { foo :: Bool } +data T = MkT { foo :: Int } diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr new file mode 100644 index 0000000..650456c --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr @@ -0,0 +1,4 @@ + +overloadedrecfldsfail11.hs:3:13: error: + The deprecation for ?foo? lacks an accompanying binding + (The deprecation must be given where ?foo? is declared) From git at git.haskell.org Mon Oct 12 06:37:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:45 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Add test for deprecation warnings on non-duplicate fields (22349a7) Message-ID: <20151012063745.2328E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/22349a76a42b0b34c77280e8309c6b0260d1a924/ghc >--------------------------------------------------------------- commit 22349a76a42b0b34c77280e8309c6b0260d1a924 Author: Adam Gundry Date: Fri Oct 9 13:46:18 2015 +0100 Add test for deprecation warnings on non-duplicate fields >--------------------------------------------------------------- 22349a76a42b0b34c77280e8309c6b0260d1a924 .../should_fail/OverloadedRecFldsFail12_A.hs | 5 +++++ testsuite/tests/overloadedrecflds/should_fail/all.T | 3 +++ .../should_fail/overloadedrecfldsfail12.hs | 12 ++++++++++++ .../should_fail/overloadedrecfldsfail12.stderr | 13 +++++++++++++ 4 files changed, 33 insertions(+) diff --git a/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail12_A.hs b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail12_A.hs new file mode 100644 index 0000000..2c69e67 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/OverloadedRecFldsFail12_A.hs @@ -0,0 +1,5 @@ +module OverloadedRecFldsFail12_A where + +{-# WARNING foo "Deprecated foo" #-} +{-# WARNING bar "Deprecated bar" #-} +data T = MkT { foo :: Int, bar :: Int } diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T index db689e5..fe7a85a 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/all.T +++ b/testsuite/tests/overloadedrecflds/should_fail/all.T @@ -17,3 +17,6 @@ test('overloadedrecfldsfail10', , 'OverloadedRecFldsFail10_C.hi', 'OverloadedRecFldsFail10_C.o']), multimod_compile_fail, ['overloadedrecfldsfail10', '']) test('overloadedrecfldsfail11', normal, compile_fail, ['']) +test('overloadedrecfldsfail12', + extra_clean(['OverloadedRecFldsFail12_A.hi', 'OverloadedRecFldsFail12_A.o']), + multimod_compile_fail, ['overloadedrecfldsfail12', '']) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.hs new file mode 100644 index 0000000..0516e43 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE DuplicateRecordFields #-} +{-# OPTIONS_GHC -Werror #-} + +import OverloadedRecFldsFail12_A + +data S = MkS { foo :: Bool } + +-- Use of foo and bar should give deprecation warnings +f :: T -> T +f e = e { foo = 3, bar = 3 } + +main = return () diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr new file mode 100644 index 0000000..65733ed --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr @@ -0,0 +1,13 @@ +[1 of 2] Compiling OverloadedRecFldsFail12_A ( OverloadedRecFldsFail12_A.hs, OverloadedRecFldsFail12_A.o ) +[2 of 2] Compiling Main ( overloadedrecfldsfail12.hs, overloadedrecfldsfail12.o ) + +overloadedrecfldsfail12.hs:10:11: warning: + In the use of ?foo? (imported from OverloadedRecFldsFail12_A): + "Deprecated foo" + +overloadedrecfldsfail12.hs:10:20: warning: + In the use of ?bar? (imported from OverloadedRecFldsFail12_A): + "Deprecated bar" + +: error: +Failing due to -Werror. From git at git.haskell.org Mon Oct 12 06:37:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:47 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Fix how addUsedRdrName is used to get correct deprecation warnings (2c1386d) Message-ID: <20151012063747.C78703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/2c1386d3fbda0b4df8f9560c9aac950f551bb044/ghc >--------------------------------------------------------------- commit 2c1386d3fbda0b4df8f9560c9aac950f551bb044 Author: Adam Gundry Date: Fri Oct 9 13:46:48 2015 +0100 Fix how addUsedRdrName is used to get correct deprecation warnings >--------------------------------------------------------------- 2c1386d3fbda0b4df8f9560c9aac950f551bb044 compiler/rename/RnEnv.hs | 42 +++++++++++++++++++------------------ compiler/rename/RnPat.hs | 2 ++ compiler/typecheck/TcExpr.hs | 49 +++++++++++++++++++++++++------------------- 3 files changed, 52 insertions(+), 41 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 2c1386d3fbda0b4df8f9560c9aac950f551bb044 From git at git.haskell.org Mon Oct 12 06:37:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:50 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Comment (3a53745) Message-ID: <20151012063750.919893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/3a537459b874a88d6e3b294bed6e5c4197661437/ghc >--------------------------------------------------------------- commit 3a537459b874a88d6e3b294bed6e5c4197661437 Author: Adam Gundry Date: Sun Oct 11 20:23:38 2015 +0100 Comment >--------------------------------------------------------------- 3a537459b874a88d6e3b294bed6e5c4197661437 compiler/typecheck/TcExpr.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 5491161..1bdb193 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1468,7 +1468,9 @@ disambiguateRecordBinds record_expr rbnds res_ty where (orphans, rbnds') = partitionWith pickParent rbnds - -- AMG TODO explain why this is fiddly + -- Previously ambiguous fields must be marked as used now that + -- we know which one is meant, but unambiguous ones shouldn't + -- be recorded again (giving duplicate deprecation warnings). f (fld, gre, was_unambiguous) = do { unless was_unambiguous $ do let L loc rdr = hsRecUpdFieldRdr (unLoc fld) From git at git.haskell.org Mon Oct 12 06:37:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 06:37:54 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot's head updated: Comment (3a53745) Message-ID: <20151012063754.5C63A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/orf-reboot' now includes: 09d0505 RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR b04bed0 renamer: fix module-level deprecation message 070f76a -include-pkg-deps takes only one hyphen. 7e70c06 Use isTrue# around primitive comparisons in integer-gmp c55f61c Add missing parentheses in eqBigNatWord# 474d4cc Comment tweaks only f842ad6 Implementation of StrictData language extension 2178273 Add UInfixT to TH types (fixes #10522) 81fffc4 Remove runSTRep from PrelNames bc4b64c Do not inline or apply rules on LHS of rules 2d88a53 Improve warnings for rules that might not fire 09925c3 Revert "RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR" a1e8620 Revert "Eliminate zero_static_objects_list()" e343c0a Test case for #10698 a1dd7dd Fallout from more assiduous RULE warnings 860e549 First stage of storing usage imports as GREs 4a01d40 Radically simplify ChildName and IE-related things f83aab9 Eliminate zero_static_objects_list() 73d88ab Tidying up 2dbb01a Add a missing check for -fcpr-off d1e7a92 Use NameEnv instead of list for storing used GREs; not clear if this helps performance 9aeac12 Fix handling of IEs fac11f8 Comments only 4e8d74d Deal with phantom type variables in rules 92d2567 Define DsUtils.mkCastDs and use it fa915af Spit out a little more info with -dppr-debug e4114c8 Fix an outright error in competesWith 499b926 Fix Trac #10694: CPR analysis 918dcf8 The parallel package has warnings 2e33b9c Modify spec002 to be less trivial 72d23c3 Better treatment of signatures in cls/inst 24afe6d Fix missing files 5a8a8a6 Don't allowInterrupt inside uninterruptibleMask 9f7cdfe Make configure error out on missing ghc-tarballs on Windows e7c331a Make headers C++ compatible (fixes #10700) 26315ed Fix misspelled function name in a comment 4f80ec0 Improve error message for newtypes and deriving clauses e9ad42d Typos in comments and strings d7c2b01 Fix comment that confused Haddock b5097fe Testsuite: rename rename/should_fail/T5001 to T5001b (#5001) e273c67 Testsuite: mark tests recently fixed as passing + accept new stderr 756fa0a Testsuite: skip T10489 unless compiler_debugged (#10489) 6880277 Testsuite: add arrows/should_compile/T5333 (#5333) 58b5f04 Testsuite: add typecheck/should_fail/T9260 (#9260) 58986c4 Testsuite: add typecheck/should_fail/T8034 (#8034) aee19d0 Testsuite: T10245 is passing for WAY=ghci (#10245) 36bbfbd Backpack docs on renamer and depsolver, also s/package/unit/. a442800 Build system: remove function keyword from configure.ac (#10705) a66e1ba User's guide: delete ancient "Core syntax" example 7cf87df Fix #7919 (again) 353db30 Remove checked-in PDFs. 8f81af9 Typos in comments ad089f5 Give raise# a return type of open kind (#10481) 75504f3 Typos in comments 15dd700 Replace (SourceText,FastString) with StringLiteral data type d9b618f Typo in comment 37227d3 Make BranchFlag a new kind 92f5385 Support MO_U_QuotRem2 in LLVM backend 948e03e Update parallel submodule, and re-enable warnings b38ee89 Fix incorrect stack pointer usage in StgRun() on x86_64 4d8859c Typos in comments d7ced09 Minor improvement to user guide 30b32f4 Test Trac #10134 697079f 4 reduce/reduce parser conflicts resolved d9d2102 Support wild cards in data/type family instances 7ec6ffc Typos in comments [skip ci] 64b6733 CmmParse: Don't force alignment in memcpy-ish operations 30c981e Removed deprecated syntax for GADT constuctors. f063bd5 Fix #10713. b5f1c85 Test #9233 in perf/compiler/T9233 d7b053a Pretty: reformat using style from libraries/pretty (#10735) 9d24b06 Pretty: rename variables to the ones used by libraries/pretty (#10735) 25bc406 Pretty: improve error messages (#10735) 53484d3 Pretty: remove superfluous parenthesis (#10735) 2d1eae2 Pretty: kill code that has been dead since 1997 (#10735) 6f6d082 Pretty: Args of NilAbove/TextBeside/Nest/Union are always RDocs (#10735) 926e428 Pretty: use BangPatterns instead of manual unboxing Ints (#10735) f951ffc Pretty: mimic pretty API more closely (#10735) 85179b5 Pretty: use replicate for spaces and multi_ch (#10735) dd7e188 Add framework flags when linking a dynamic library 4c55f14 users_guide: Add note about #367 to Bugs section 6029748 Drop custom mapM impl for [] ecb1752 Make -fcpr-off a dynamic flag b12dba7 Make Exception datatypes into newtypes 22bbc1c Make sure that `all`, `any`, `and`, and `or` fuse (#9848) fd6b24f Additions to users' guide and release notes 575abf4 Add Fixity info for infix types e2b5738 Allow proper errors/warnings in core2core passes 617f696 Do not complain about SPECIALISE for INLINE a426154 Warn about missed specialisations for imports 49615d9 Comments only ab98860 Minor refactor to use filterInScope 9536481 Tidy up and refactor wildcard handling 28096b2 Fix quantification for inference with sigs 75f5f23 Coments only cc07c40 Comments only 294553e T8968-1 and -3 should pass 64dba51 Test Trac #10742 eca9a1a Ensure DynFlags are consistent 97843d0 base: Add instances 600b153 llvmGen: Rework LLVM mangler aa23054 Add test for #10600 (exhaustiveness check with --make and -fno-code) bc43d23 Rejigger OSMem.my_mmap to allow building on Mac a1c934c base: Add missing Traversable instance for ZipList 6cab3af Big batch of Backpack documentation edits. 79e0a10 Test Trac #10753 a192d6b Comments only f1b4864 Sync base/changelog.md with GHC 7.10.2 release 590aa0f Make oneShot open-kinded 92f35cd cmmCreateSwitchPlan: Handle singletons up-front 2c4a7d3 Update transformers submodule to 0.4.3.0 release f04c7be Fix unused-matches warnings in CmmLex.x a40ec75 Update testsuite/.gitignore [skip ci] b4ed130 Replace HsBang type with HsSrcBang and HsImplBang 2da06d7 User manual update, as prodded by #10760. 2b4710b Add missing to User's guide to fix the build 8cce7e4 Bump template-haskell to new major version 2.11 67576dd Pretty: bugfix fillNB (#10735) bcfae08 Pretty: fix potential bad formatting of error message (#10735) 5d57087 Pretty: fix a broken invariant (#10735) 85bf76a Pretty: show rational as is (#10735) f903949 Pretty: improving the space/time performance of vcat, hsep, hcat (#10735) b0dee61 template-haskell: Add changelog entry to infix type operators 7b211b4 Upgrade GCC to 5.2.0 for Windows x86 and x86_64 e415369 Update mingw tarball location 8c5b087 SysTools: Fix whitespace in error message d2dd5af DynFlags: Prohibit hpc and byte-code interpreter ec68618 Name: Show NameSort in warning 1857191 Testsuite: mark T8089 expect_broken(#7325) on Windows 8906037 Testsuite: mark encoding005 expect_broken(#10623) on Windows ca85442 Testsuite: recenter 2 performance tests on Windows 744ff88 Testsuite: speedup running a single test e367e27 Travis: prevent 10' no output, by setting VERBOSE=2 74897de Make rts/ThreadLabels.c threadsafe for debug runtime. 22aca53 Transliterate unknown characters at output ab9403d Dump files always use UTF8 encoding #10762 b17ec56 Fix rdynamic flag and test on Windows ebca3f8 rts/Printer.c: speed up '-Da' printer for 'LIBBFD' build 18a1567 Add selectors for common fields (DataCon/PatSyn) to ConLike d97e60f Comments reformating/corrections b6be81b Build system: delete half-baked Cygwin support 98f8c9e Delete sync-all a146b28 GhcMake: Fix spelling in comment 0d0e651 Bag: Add Foldable instance 9e8562a Implement getSizeofMutableByteArrayOp primop 3452473 Delete FastBool 2f29ebb Refactor: delete most of the module FastTypes 47493e6 Build system: simplify install.mk.in a1c008b Build system: delete unused distrib/Makefile a5061a9 Check options before warning about source imports. 37a0b50 Delete ExtsCompat46 (#8330) b78494e fix 64bit two-stage allocator on Solaris/AMD64 platform (#10790) fba724c configure.ac: Allow disabling of large-address-space 1c643ba Fix algorithm.tex build and update with some new info. 0f3335f Comments and white space 816d48a Implement lookupGlobal in TcEnv, and use it 711e0bf tcRnDeclsi can use tcRnSrcDecls ac0d052 TcDeriv: Kill dead code de476e9 PrelNames: Clean up list a bit 89d25b9 BinIface: Clean up whitespace 7924469 Clean up handling of knownKeyNames a8601a8 Revert "Clean up handling of knownKeyNames" 28ad98e PrelNames: introduce dcQual in place of conName 211b349 Move newImplicitBinder to from IfaceEnv to BuildTyCl 70ea94c IfaceEnv: Clean up updNameCache a bit f6035bc MkIface: Introduce PatSynId, ReflectionId, DefMethId 7bd8f8f TysWiredIn: Shuffle code around 15c63d2 base: Remove a redundant 'return' 38c98e4 RTS: Reduce MBLOCK_SPACE_SIZE on AArch64 15cb83d Add testcase for #7411 a6826c5 Make Generic (Proxy t) instance poly-kinded (fixes #10775) 1b56c40 Respect GHC_CHARENC environment variable #10762 81ae26d Dwarf: Fix DW_AT_use_UTF8 attribute cbf58a2 Dwarf: Produce {low,high}_pc attributes for compilation units 8476ce2 Dwarf: Produce .dwarf_aranges section 0c823af Fix identifier parsing in hp2ps cd2dc9e ghc-pkg --enable-multi-instance should not complain about case sensitivity. c7f0626 integer-gmp: optimise bitBigNat c1d7b4b StgCmmHeap: Re-add check for large static allocations 60120d2 Fix 7.10 validate 12098c2 Fix typo in pattern synonym documentation. 10a0775 Anchor type family instances deterministically ad26c54 Testsuite: refactoring only 6740d70 Use IP based CallStack in error and undefined 010e187 Fix trac #10413 ff9432f Add test for updating a record with existentially quantified fields. 296bc70 Use a response file for linker command line arguments #10777 ba5554e Allow annotations though addTopDecls (#10486) c8f623e Expand declaration QQs first (#10047) 28ac9d3 Improve the error messages for class instance errors 3cc8f07 stm: Fix test case 5d7a873 Testsuite: don't warn about missing specialisations e0b3ff0 Testsuite: update expected output 3b23379 Testsuite: mark 4 tests expect_broken_for(#10712, opt_ways) 32a9ead Fix some tests that were broken by D861 c43c8e2 Testsuite: by default run all tests for a single way bd16e0b Testsuite: delete dead code 6b31bfe Horrible hacking to refactor HsRecField 3744578 Injective type families 5dc88b7 Add test for T10836 (expected broken) 34b106f Accept underscores in the module parser. (Thanks spinda for the fix.) b639c97 Testsuite: fix tcfail220 - Maybe is wired-in now e1293bb Testsuite: only print msg when timeout kills process unexpectedly 79cdb25 Testsuite: ignore line number differences in call stacks (#10834) 85915e9 Make Data.List.foldr1 inline 19c6049 Fix T6018th test failure 64761ce Build system: implement `make install-strip` (#1851) 5c372fe ghc-pkg: don't print ignored errors when verbosity=0 c60c462 user-guide: Add missing tags around body 96b986b EventLog: Factor out ensureRoomFor*Event 062feee tracing: Kill EVENT_STARTUP 2c24fd7 Build system: put each BuildFlavour in a separate file (#10223) b40e559 Build system: simplify *-llvm BuildFlavours (#10223) 1abbacd Build system: cleanup utils/ghc-pkg/ghc.mk dc671a1 SPECIALIZE strictMinimum for Int and Integer c6b82e9 Further simplify the story around minimum/maximum 554be5e Build system: detect when user cloned from GitHub 864a9c4 Build system: remove hack for Mac OSX in configure.ac (#10476) a158607 Build system: delete the InstallExtraPackages variable 330fbbd Build system: make *-cross BuildFlavours consistent (#10223) 8be43dd Build system: cleanup BUILD_DIRS + add lots of Notes e4a73f4 Move GeneralCategory et al to GHC.Unicode 1b8eca1 Build system: check for inconsistent settings (#10157) dbb4e41 HeapStackCheck: Small refactoring 4356dac Forbid annotations when Safe Haskell safe mode is enabled. 23a301a Testsuite: comment out `setnumcapabilities001` (#10860) cdca31e Don't check in autogenerated hs files for recomp013. 3a71d78 Comments on oneShot a870738 Improve rejigConRes (again) 487c90e Add a test for Trac #10806 a7f6909 A CFunEqCan can be Derived 377395e Improve documentation for transform list-comps 50d1c72 Fix broken links in documentation 413fa95 Improve documentation of comprehensions f30a492 Testsuite cleanup 8c0eca3 Add assertions 18759cc Remove redundant language extensions 195af2d Dead code removal, export cleanup 4275028 Code movement 7ad4b3c s/StgArrWords/StgArrBytes/ 89324b8 Testsuite: normalise slashes in callstack output 37081ac Testsuite: mark enum01-enum03 expect_broken(#9399) on Windows 3ec205a CodeGen: fix typo in error message 08af42f hpc: use `takeDirectory` instead of `dropWhileEnd (/= '/')` c8d438f Testsuite: mark T6037 expect_fail on Windows (#6037) 12b0bb6 Account for stack allocation in the thread's allocation counter 14c4090 Pretty: fix unicode arrow operators. 325efac Fix `hp2ps -i-` e66daec DynFlags: remove unused sPgm_sysman (#8689) 8d89d80 Testsuite: add test for #10781 43eb1dc Show minimal complete definitions in ghci (#10847) 8ecf6d8 ApplicativeDo transformation 77662e1 Add namePackage function to template-haskell 48746ff Docs: make sure all libs are included in index.html (#10879) a8406f8 Pass TEST_HC_OPTS in bug1465 and T5792. 2d4db40 Fix #10815 by kind-checking type patterns against known kinds. 8ee2b95 Polish some error messages. b89c491 Always run explicitly requested ways (extra_ways) for fast runs. c738b12 Replace [PostTc id Type] with PostTc id [Type] e156361 Put stable pointer names in the name cache. 1637e4d Driver: --make -o without Main should be an error (#10895) 1a13551 Test #10347 d19a77a Update user guide, fixing #10772 d7f2ab0 Test #10770 79b8e89 Print associated types a bit better. 1292c17 Allow TH quoting of assoc type defaults. 27f9186 Clarify parsing infelicity. 93fafe0 Re-polish error messages around injective TFs. 6a20920 Small improvement in pretty-printing constructors. cbcad85 Fix typo in test for #10347. 2f9809e Slightly better `Coercible` errors. e27b267 Perform a validity check on assoc type defaults. 8e8b9ed Run simplifier only when the env is clean. cd2840a Refactor BranchLists. c234acb `_ <- mapM` --> `mapM_` 3f13c20 Revert "Revert "Revert "Support for multiple signature files in scope.""" 09d214d Revert "Revert "Revert "Change loadSrcInterface to return a list of ModIface""" 06d46b1 Unify hsig and hs-boot; add preliminary "hs-boot" merging. d516d2e Fix build failure, I think. 07f6418 Remove graphFromVerticesAndAdjacency 5a8b055 TcDeriv: Use a NameEnv instead of association list 83e23c1 Remove (now bogus) assert. 0b852fc base: use Show for ErrorCall in uncaughtExceptionHandler d4d34a7 Make derived names deterministic 089b72f DeriveLift extension (#1830) 4cdab73 HscMain: Place CPP macro invocation on one line 79f5732 testsuite: attempt fixing fallout from 089b72f52 c6bdf4f Remove references to () from types of mkWeak# and friends 65bf7ba DsBinds: Avoid using String when desugaring CallStack construction 939a7d6 Annotate CmmBranch with an optional likely target cf90a1e Add constant-folding rule for Data.Bits.bit 73921df Update Cabal to recognize DeriveLift 453cdbf base: export allocation counter/limit API from System.Mem 5c11523 reify associated types when reifying typeclasses 39a262e Revert "reify associated types when reifying typeclasses" 2440e3c Fix a bug with mallocForeignPtr and finalizers (#10904) b08a533d Fix DeriveGeneric for types with same OccName (#10487) 4f9ee91 Testsuite: update expected output for T8832 on 32-bit systems (#8832) 5883b56 Testsuite: properly fix T8832.stdout-ws-32 (#8832) 1395185 Testsuite: add test for #10767 fb40926 Weak: Don't require wrapping/unwrapping of finalizers a98815a Dwarf: Rename binding to avoid shadowing ppr a0b1f41 Dwarf: Ensure block length is encoded correctly f7fd864 Skip a possible BOM in utf8 encoding 3fbf8f4 Debug: Remove extraneous LANGUAGE CPP 988b2ba rts: Clean up whitespace in Trace.h b4d43b4 reify associated types when reifying typeclasses(#10891) 78053f4 Allow enumDeltaIntegerFB to be inlined 2eddcd9 Lexer: delete dead code for binary character literals 23baa65 .gitignore update for some test files. e3ab25a Typos in comments 03b3804 Add Data.Semigroup and Data.List.NonEmpty (re #10365) f2a174a Update nofib submodule a52db23 Update nofib submodule again baadd78 Merge remote-tracking branch 'origin/master' into wip/orf-reboot ef07c2c Further refactoring of HsRecUpdField cc7e5e9 Test wibbles cd4fe28 Clarify a corner case with an additional test c936cfb Remove unused ieNames a3373da Remove confused debugging code 0071c36 Revert "Use NameEnv instead of list for storing used GREs; not clear if this helps performance" 9f84652 Revert "Tidying up" 9531e9e Revert "First stage of storing usage imports as GREs" 7b3b949 Refactoring RnNames 65f006c Further refactoring RnNames 794ce74 Better plusParent dec2c1f Tidy up disambiguateRecordFields f23c72e Comments only be204f0 Resurrect a failing report-unused-imports test 6de6654 Store FieldOccs in tcg_used_selectors so we get import usage right c72cd58 Clean up extendImportMap f7d5e5c Comments only 46d2fc2 Don't addUsedRdrName for many ambiguous selectors at once 50c1b05 Get rid of isOverloadedRecFldGRE d664c07 Qualified import to fix build pre-BBP dc084f7 Add a test that deprecation warnings cannot be attached to DRFs 22349a7 Add test for deprecation warnings on non-duplicate fields 2c1386d Fix how addUsedRdrName is used to get correct deprecation warnings 3a53745 Comment From git at git.haskell.org Mon Oct 12 08:18:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 08:18:33 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: Switch to LLVM version 3.7 (8e7c761) Message-ID: <20151012081833.A00F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/8e7c761b127502f9f670e2a56e31d96d96cf0bbd/ghc >--------------------------------------------------------------- commit 8e7c761b127502f9f670e2a56e31d96d96cf0bbd Author: Erik de Castro Lopo Date: Sat Oct 10 10:54:24 2015 +1100 Switch to LLVM version 3.7 Summary: Before this commit, GHC only supported LLVM 3.6. Now it only supports LLVM 3.7 which was released in August 2015. LLVM version 3.6 and earlier do not work on AArch64/Arm64, but 3.7 does. Also: * Add CC_Ghc constructor to LlvmCallConvention. * Replace `maxSupportLlvmVersion`/`minSupportLlvmVersion` with a single `supportedLlvmVersion` variable. * Get `supportedLlvmVersion` from version specified in configure.ac. * Drop llvmVersion field from DynFlags (no longer needed because only one version is supported). Test Plan: Validate on x86_64 and arm Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1320 GHC Trac Issues: #10953 >--------------------------------------------------------------- 8e7c761b127502f9f670e2a56e31d96d96cf0bbd compiler/llvmGen/Llvm/PpLlvm.hs | 14 ++++++++--- compiler/llvmGen/Llvm/Types.hs | 3 +++ compiler/llvmGen/LlvmCodeGen.hs | 13 +++------- compiler/llvmGen/LlvmCodeGen/Base.hs | 20 ++++++--------- compiler/main/DriverPipeline.hs | 47 ++++++++++-------------------------- compiler/main/DynFlags.hs | 5 ---- compiler/main/SysTools.hs | 17 +++++++------ configure.ac | 4 ++- 8 files changed, 48 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 8e7c761b127502f9f670e2a56e31d96d96cf0bbd From git at git.haskell.org Mon Oct 12 08:18:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 12 Oct 2015 08:18:36 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: WIP arm64 ghci (1b931af) Message-ID: <20151012081836.512FD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/1b931af123f9f51770882d0af805da2afdfaeec3/ghc >--------------------------------------------------------------- commit 1b931af123f9f51770882d0af805da2afdfaeec3 Author: Erik de Castro Lopo Date: Mon Oct 12 15:17:30 2015 +1100 WIP arm64 ghci >--------------------------------------------------------------- 1b931af123f9f51770882d0af805da2afdfaeec3 compiler/ghci/ByteCodeItbls.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs index cd31acb..3e092f6 100644 --- a/compiler/ghci/ByteCodeItbls.hs +++ b/compiler/ghci/ByteCodeItbls.hs @@ -232,6 +232,23 @@ mkJumpToAddr dflags a = case platformArch (targetPlatform dflags) of , 0x47, 0x08 , byte0 w32, byte1 w32, byte2 w32, byte3 w32] + ArchARM64 { } -> + -- Generates: + -- + -- ldr x1, label + -- br x1 + -- label: + -- .quad + -- + -- which looks like: + -- 0: 58000041 ldr x1, + + + The Haskell Report allows you to put a unary + - preceding certain expressions headed by + keywords, allowing constructs like - case x of + ... or - do { ... }. GHC does + not allow this. Instead, unary - is + allowed before only expressions that could potentially + be applied as a function. + + + From git at git.haskell.org Thu Oct 22 15:08:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:01 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Respect GHC_CHARENC environment variable #10762 (239d4c3) Message-ID: <20151022150801.124833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/239d4c38e9ee4fb7166febeea9d8609b34de9418/ghc >--------------------------------------------------------------- commit 239d4c38e9ee4fb7166febeea9d8609b34de9418 Author: Michael Snoyman Date: Sat Aug 29 12:23:48 2015 +0200 Respect GHC_CHARENC environment variable #10762 Only supports UTF-8 as a value right now. I expect some discussion to go on around the naming of this variable and whether it's valid to backport it to GHC 7.10 (which would be my preference). The motivation here is that, when capturing the output of GHC to a file, we often want to ensure that the output is UTF-8, regardless of the actual character encoding of the terminal/console. On the other hand, we don't want to necessary change the terminal/console encoding. The reason being: * On Windows, this requires a global-esque change to the console codepage, which adversely affects other processes in the same console * On all OSes, this can break features like smart quote auto-detection. Test Plan: Set LANG to C, GHC_CHARENC to UTF-8, and compile a Haskell source file with a non-ASCII warning produced. The output who include the UTF-8 sequence instead of replacing it with ?. Reviewers: austin, rwbarton, bgamari Reviewed By: bgamari Subscribers: hsyl20, thomie Differential Revision: https://phabricator.haskell.org/D1167 GHC Trac Issues: #10762 >--------------------------------------------------------------- 239d4c38e9ee4fb7166febeea9d8609b34de9418 ghc/Main.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ghc/Main.hs b/ghc/Main.hs index 7b1c244..2a42c06 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -80,8 +80,18 @@ main = do initGCStatistics -- See Note [-Bsymbolic and hooks] hSetBuffering stdout LineBuffering hSetBuffering stderr LineBuffering - hSetTranslit stdout - hSetTranslit stderr + + -- Handle GHC-specific character encoding flags, allowing us to control how + -- GHC produces output regardless of OS. + env <- getEnvironment + case lookup "GHC_CHARENC" env of + Just "UTF-8" -> do + hSetEncoding stdout utf8 + hSetEncoding stderr utf8 + _ -> do + -- Avoid GHC erroring out when trying to display unhandled characters + hSetTranslit stdout + hSetTranslit stderr GHC.defaultErrorHandler defaultFatalMessager defaultFlushOut $ do -- 1. extract the -B flag from the args From git at git.haskell.org Thu Oct 22 15:08:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:03 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: MonoLocalBinds test passes (2980c31) Message-ID: <20151022150803.F03853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/2980c318c2a269d79133744c22f14823c6fccf0e/ghc >--------------------------------------------------------------- commit 2980c318c2a269d79133744c22f14823c6fccf0e Author: Ben Gamari Date: Tue Oct 20 03:15:19 2015 -0400 MonoLocalBinds test passes >--------------------------------------------------------------- 2980c318c2a269d79133744c22f14823c6fccf0e testsuite/tests/partial-sigs/should_compile/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T index 52a532f..e83e070 100644 --- a/testsuite/tests/partial-sigs/should_compile/all.T +++ b/testsuite/tests/partial-sigs/should_compile/all.T @@ -29,7 +29,7 @@ test('HigherRank2', normal, compile, ['-ddump-types -fno-warn-partial-type-signa test('LocalDefinitionBug', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) test('Meltdown', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) # Bug -test('MonoLocalBinds', expect_fail, compile, ['-ddump-types -fno-warn-partial-type-signatures']) +test('MonoLocalBinds', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) test('NamedTyVar', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) test('ParensAroundContext', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) test('PatBind', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures']) From git at git.haskell.org Thu Oct 22 15:08:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:07 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Parser: revert some error messages to what they were before 7.10 (92c924e) Message-ID: <20151022150807.6FB713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/92c924e07dfef327509555c27a5478d9851ec9fa/ghc >--------------------------------------------------------------- commit 92c924e07dfef327509555c27a5478d9851ec9fa Author: Thomas Miedema Date: Wed Oct 7 20:36:54 2015 -0500 Parser: revert some error messages to what they were before 7.10 Among doing other things, Phab:D201 (bc2289e13d9586be087bd8136943dc35a0130c88) tried to improve the error messages thrown by the parser. For example a missing else clause now prints "parse error in if statement: else clause empty" instead of "parse error (possibly incorrect indentation or mismatched brackets)". Some error messages got much worse however (see tests), and the result seems to be a net negative. Although not entirely satisfactory, this commits therefore reverts those parser changes. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1309 GHC Trac Issues: #10498 >--------------------------------------------------------------- 92c924e07dfef327509555c27a5478d9851ec9fa compiler/parser/Parser.y | 31 ---------------------- .../parser/should_fail/ParserNoLambdaCase.stderr | 2 +- testsuite/tests/parser/should_fail/T10498a.hs | 14 ++++++++++ testsuite/tests/parser/should_fail/T10498a.stderr | 2 ++ testsuite/tests/parser/should_fail/T10498b.hs | 7 +++++ testsuite/tests/parser/should_fail/T10498b.stderr | 2 ++ testsuite/tests/parser/should_fail/all.T | 2 ++ .../tests/parser/should_fail/readFail020.stderr | 3 +-- 8 files changed, 29 insertions(+), 34 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 9006206..3ac0da3 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2067,37 +2067,6 @@ exp10 :: { LHsExpr RdrName } -- hdaume: core annotation | fexp { $1 } - -- parsing error messages go below here - | '\\' apat apats opt_asig '->' error {% parseErrorSDoc (combineLocs $1 $5) $ text - "parse error in lambda: no expression after '->'" - } - | '\\' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked lambda expression '\'" - } - | 'let' binds 'in' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing expression after 'in'" - } - | 'let' binds error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in let binding: missing required 'in'" - } - | 'let' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked let binding" - } - | 'if' exp optSemi 'then' exp optSemi - 'else' error {% hintIf (combineLocs $1 $5) "else clause empty" } - | 'if' exp optSemi 'then' exp optSemi error {% hintIf (combineLocs $1 $5) "missing required else clause" } - | 'if' exp optSemi 'then' error {% hintIf (combineLocs $1 $2) "then clause empty" } - | 'if' exp optSemi error {% hintIf (combineLocs $1 $2) "missing required then and else clauses" } - | 'if' error {% hintIf (getLoc $1) "naked if statement" } - | 'case' exp 'of' error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing list after '->'" - } - | 'case' exp error {% parseErrorSDoc (combineLocs $1 $2) $ text - "parse error in case statement: missing required 'of'" - } - | 'case' error {% parseErrorSDoc (getLoc $1) $ text - "parse error: naked case statement" - } optSemi :: { ([Located a],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } diff --git a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr index 5a3f1cc..147c8fe 100644 --- a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr +++ b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr @@ -1,2 +1,2 @@ -ParserNoLambdaCase.hs:3:5: parse error: naked lambda expression '' +ParserNoLambdaCase.hs:3:6: parse error on input ?case? diff --git a/testsuite/tests/parser/should_fail/T10498a.hs b/testsuite/tests/parser/should_fail/T10498a.hs new file mode 100644 index 0000000..5a9656f --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE LambdaCase #-} +module T10498a where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498a.hs:10:5: +-- parse error in if statement: missing required else clause + +foo = + if True + then + \case -> + 1 -> 2 + else id diff --git a/testsuite/tests/parser/should_fail/T10498a.stderr b/testsuite/tests/parser/should_fail/T10498a.stderr new file mode 100644 index 0000000..ed98bc1 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498a.stderr @@ -0,0 +1,2 @@ + +T10498a.hs:12:15: parse error on input ?->? diff --git a/testsuite/tests/parser/should_fail/T10498b.hs b/testsuite/tests/parser/should_fail/T10498b.hs new file mode 100644 index 0000000..19b62af --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.hs @@ -0,0 +1,7 @@ +module T10498b where + +-- ghc-7.10 would show the unhelpful error message: +-- +-- T10498b.hs:7:5: parse error in if statement: naked if statement + +f = if module then True else False diff --git a/testsuite/tests/parser/should_fail/T10498b.stderr b/testsuite/tests/parser/should_fail/T10498b.stderr new file mode 100644 index 0000000..c1e26a1 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10498b.stderr @@ -0,0 +1,2 @@ + +T10498b.hs:7:8: parse error on input ?module? diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 26d5767..5c99f5be 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -89,3 +89,5 @@ test('T8506', normal, compile_fail, ['']) test('T10196Fail1', normal, compile_fail, ['']) test('T10196Fail2', normal, compile_fail, ['']) test('T10196Fail3', expect_broken(10196), compile_fail, ['']) +test('T10498a', normal, compile_fail, ['']) +test('T10498b', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/readFail020.stderr b/testsuite/tests/parser/should_fail/readFail020.stderr index 0c00cdc..0e3bde4 100644 --- a/testsuite/tests/parser/should_fail/readFail020.stderr +++ b/testsuite/tests/parser/should_fail/readFail020.stderr @@ -1,3 +1,2 @@ -readFail020.hs:3:5: - parse error in let binding: missing required 'in' +readFail020.hs:3:16: parse error on input ?}? From git at git.haskell.org Thu Oct 22 15:08:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:10 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: fix EBADF unqueueing in select backend (Trac #10590) (779df77) Message-ID: <20151022150810.725603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/779df770a172d45811d6bc3a4d92e359a75c210b/ghc >--------------------------------------------------------------- commit 779df770a172d45811d6bc3a4d92e359a75c210b Author: Sergei Trofimovich Date: Tue Jul 7 17:00:23 2015 +0200 fix EBADF unqueueing in select backend (Trac #10590) Alexander found a interesting case: 1. We have a queue of two waiters in a blocked_queue 2. first file descriptor changes state to RUNNABLE, second changes to INVALID 3. awaitEvent function dequeued RUNNABLE thread to a run queue and attempted to dequeue INVALID descriptor to a run queue. Unqueueing INVALID fails thusly: #3 0x000000000045cf1c in barf (s=0x4c1cb0 "removeThreadFromDeQueue: not found") at rts/RtsMessages.c:42 #4 0x000000000046848b in removeThreadFromDeQueue (...) at rts/Threads.c:249 #5 0x000000000049a120 in removeFromQueues (...) at rts/RaiseAsync.c:719 #6 0x0000000000499502 in throwToSingleThreaded__ (...) at rts/RaiseAsync.c:67 #7 0x0000000000499555 in throwToSingleThreaded (..) at rts/RaiseAsync.c:75 #8 0x000000000047c27d in awaitEvent (wait=rtsFalse) at rts/posix/Select.c:415 The problem here is a throwToSingleThreaded function that tries to unqueue a TSO from blocked_queue, but awaitEvent function leaves blocked_queue in a inconsistent state while traverses over blocked_queue: case RTS_FD_IS_READY: IF_DEBUG(scheduler, debugBelch("Waking up blocked thread %lu\n", (unsigned long)tso->id)); tso->why_blocked = NotBlocked; tso->_link = END_TSO_QUEUE; // Here we break the queue head pushOnRunQueue(&MainCapability,tso); break; Signed-off-by: Sergei Trofimovich Test Plan: tested on a sample from T10590 Reviewers: austin, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: qnikst, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1024 GHC Trac Issues: #10590, #4934 >--------------------------------------------------------------- 779df770a172d45811d6bc3a4d92e359a75c210b rts/RaiseAsync.c | 8 +------- rts/RaiseAsync.h | 6 ++++++ rts/posix/Select.c | 10 ++++++++-- testsuite/tests/rts/T10590.hs | 37 +++++++++++++++++++++++++++++++++++++ testsuite/tests/rts/all.T | 5 +++++ 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c index 3b206ff..267707c 100644 --- a/rts/RaiseAsync.c +++ b/rts/RaiseAsync.c @@ -23,12 +23,6 @@ #include "win32/IOManager.h" #endif -static StgTSO* raiseAsync (Capability *cap, - StgTSO *tso, - StgClosure *exception, - rtsBool stop_at_atomically, - StgUpdateFrame *stop_here); - static void removeFromQueues(Capability *cap, StgTSO *tso); static void removeFromMVarBlockedQueue (StgTSO *tso); @@ -777,7 +771,7 @@ removeFromQueues(Capability *cap, StgTSO *tso) * * -------------------------------------------------------------------------- */ -static StgTSO * +StgTSO * raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, rtsBool stop_at_atomically, StgUpdateFrame *stop_here) { diff --git a/rts/RaiseAsync.h b/rts/RaiseAsync.h index 6bfed8d..1f939d4 100644 --- a/rts/RaiseAsync.h +++ b/rts/RaiseAsync.h @@ -19,6 +19,12 @@ void blockedThrowTo (Capability *cap, StgTSO *target, MessageThrowTo *msg); +StgTSO* raiseAsync (Capability *cap, + StgTSO *tso, + StgClosure *exception, + rtsBool stop_at_atomically, + StgUpdateFrame *stop_here); + void throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception); diff --git a/rts/posix/Select.c b/rts/posix/Select.c index 4b19235..d5c9b55 100644 --- a/rts/posix/Select.c +++ b/rts/posix/Select.c @@ -375,6 +375,12 @@ awaitEvent(rtsBool wait) prev = NULL; { + /* + * The queue is being rebuilt in this loop: + * 'blocked_queue_hd' will contain already + * traversed blocked TSOs. As a result you + * can't use functions accessing 'blocked_queue_hd'. + */ for(tso = blocked_queue_hd; tso != END_TSO_QUEUE; tso = next) { next = tso->_link; int fd; @@ -412,8 +418,8 @@ awaitEvent(rtsBool wait) IF_DEBUG(scheduler, debugBelch("Killing blocked thread %lu on bad fd=%i\n", (unsigned long)tso->id, fd)); - throwToSingleThreaded(&MainCapability, tso, - (StgClosure *)blockedOnBadFD_closure); + raiseAsync(&MainCapability, tso, + (StgClosure *)blockedOnBadFD_closure, rtsFalse, NULL); break; case RTS_FD_IS_READY: IF_DEBUG(scheduler, diff --git a/testsuite/tests/rts/T10590.hs b/testsuite/tests/rts/T10590.hs new file mode 100644 index 0000000..24198ab --- /dev/null +++ b/testsuite/tests/rts/T10590.hs @@ -0,0 +1,37 @@ +import Foreign.C +import Foreign.Marshal.Array +import Foreign.Storable +import Control.Concurrent + +-- The test works only on UNIX like. +-- unportable bits: +import qualified System.Posix.Internals as SPI +import qualified System.Posix.Types as SPT + +pipe :: IO (CInt, CInt) +pipe = allocaArray 2 $ \fds -> do + throwErrnoIfMinus1_ "pipe" $ SPI.c_pipe fds + rd <- peekElemOff fds 0 + wr <- peekElemOff fds 1 + return (rd, wr) + +main :: IO () +main = do + (r1, w1) <- pipe + (r2, _w2) <- pipe + _ <- forkIO $ do -- thread A + threadWaitRead (SPT.Fd r1) + _ <- forkIO $ do -- thread B + threadWaitRead (SPT.Fd r2) + yield -- switch to A, then B + -- now both are blocked + _ <- SPI.c_close w1 -- unblocking thread A fd + _ <- SPI.c_close r2 -- breaking thread B fd + yield -- kick RTS IO manager + +{- + Trac #10590 exposed a bug as: + T10590: internal error: removeThreadFromDeQueue: not found + (GHC version 7.11.20150702 for x86_64_unknown_linux) + Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug + -} diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 8e0e76e..e3b9da1 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -279,3 +279,8 @@ test('linker_error3', ignore_output ], run_command, ['$MAKE -s --no-print-directory linker_error3']) + +# ignore_output as RTS reports slightly different error messages +# in 'epoll' and 'select' backends on reading from EBADF +# mingw32 skip as UNIX pipe and close(fd) is used to exercise the problem +test('T10590', [ignore_output, when(opsys('mingw32'),skip)], compile_and_run, ['']) From git at git.haskell.org Thu Oct 22 15:08:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:13 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix up trivial testsuite failures (178d16f) Message-ID: <20151022150813.A51D63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/178d16f65e0f4bdd95d1ac9f8d8236d3246f2ed9/ghc >--------------------------------------------------------------- commit 178d16f65e0f4bdd95d1ac9f8d8236d3246f2ed9 Author: Ben Gamari Date: Tue Oct 20 13:57:29 2015 -0400 Fix up trivial testsuite failures These are fallout from da9b2ec3e19edb1de0e73e8f32aa0443743f072c and 3340d3035afdc128e12fc64d3af97d76d19edda1. >--------------------------------------------------------------- 178d16f65e0f4bdd95d1ac9f8d8236d3246f2ed9 testsuite/tests/deSugar/should_run/T10215.stdout | 1 - testsuite/tests/deSugar/should_run/T9238.stdout | 1 - testsuite/tests/gadt/gadt21.stderr | 0 testsuite/tests/indexed-types/should_fail/T4093a.stderr | 0 testsuite/tests/typecheck/should_fail/T10495.stderr | 6 ++++++ testsuite/tests/typecheck/should_fail/T5853.stderr | 0 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/deSugar/should_run/T10215.stdout b/testsuite/tests/deSugar/should_run/T10215.stdout index abb2393..815d668 100644 --- a/testsuite/tests/deSugar/should_run/T10215.stdout +++ b/testsuite/tests/deSugar/should_run/T10215.stdout @@ -1,3 +1,2 @@ False False - diff --git a/testsuite/tests/deSugar/should_run/T9238.stdout b/testsuite/tests/deSugar/should_run/T9238.stdout index 8dbd09d..85cd477 100644 --- a/testsuite/tests/deSugar/should_run/T9238.stdout +++ b/testsuite/tests/deSugar/should_run/T9238.stdout @@ -1,2 +1 @@ [(-0.0,-0.0,EQ),(-0.0,0.0,LT),(0.0,-0.0,GT),(0.0,0.0,EQ)] - diff --git a/testsuite/tests/typecheck/should_fail/T10495.stderr b/testsuite/tests/typecheck/should_fail/T10495.stderr new file mode 100644 index 0000000..15660d9 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T10495.stderr @@ -0,0 +1,6 @@ + +T10495.hs:5:7: + Couldn't match representation of type ?a0? with that of ?b0? + Relevant bindings include foo :: a0 -> b0 (bound at T10495.hs:5:1) + In the expression: coerce + In an equation for ?foo?: foo = coerce From git at git.haskell.org Thu Oct 22 15:08:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:16 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix export list of PPC.Regs (2a34f54) Message-ID: <20151022150816.6A4C13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/2a34f54459b6a703b1164064115528571fb19e15/ghc >--------------------------------------------------------------- commit 2a34f54459b6a703b1164064115528571fb19e15 Author: Ben Gamari Date: Tue Oct 13 14:56:07 2015 +0200 Fix export list of PPC.Regs This was likely due to an incorrectly merged conflict during cherry-picking. >--------------------------------------------------------------- 2a34f54459b6a703b1164064115528571fb19e15 compiler/nativeGen/PPC/Regs.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/nativeGen/PPC/Regs.hs b/compiler/nativeGen/PPC/Regs.hs index 7af7ffb..a66ea36 100644 --- a/compiler/nativeGen/PPC/Regs.hs +++ b/compiler/nativeGen/PPC/Regs.hs @@ -37,7 +37,6 @@ module PPC.Regs ( fits16Bits, makeImmediate, fReg, - sp, r3, r4, r27, r28, r30, r0, sp, r3, r4, r27, r28, r30, tmpReg, f1, f20, f21, From git at git.haskell.org Thu Oct 22 15:08:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:19 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Export more types from GHC.RTS.Flags (#9970) (c8acf6f) Message-ID: <20151022150819.1AC3B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/c8acf6fb68a4548c5c5aae41b9864cc133f6bcef/ghc >--------------------------------------------------------------- commit c8acf6fb68a4548c5c5aae41b9864cc133f6bcef Author: RyanGlScott Date: Tue Jul 7 21:20:07 2015 +0200 Export more types from GHC.RTS.Flags (#9970) Export the data types `GiveGCStats`, `DoCostCentres`, `DoHeapProfiles`, and `DoTrace`, as well as the type synonyms `Time` and `RtsNat`. The above data types appear as fields in the `-Stats` data types in `GHC.RTS.Flags`, but since they only have `Show` instances, it is practically impossible to due anything useful with the above types unless they are exported. Reviewers: hvr, ekmett, austin, ezyang, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1030 GHC Trac Issues: #9970 >--------------------------------------------------------------- c8acf6fb68a4548c5c5aae41b9864cc133f6bcef libraries/base/GHC/RTS/Flags.hsc | 20 +++++++++++++------- libraries/base/changelog.md | 7 +++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index 16764e5..b8b2973 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -9,13 +9,19 @@ -- @since 4.8.0.0 -- module GHC.RTS.Flags - ( RTSFlags (..) + ( RtsTime + , RtsNat + , RTSFlags (..) + , GiveGCStats (..) , GCFlags (..) , ConcFlags (..) , MiscFlags (..) , DebugFlags (..) + , DoCostCentres (..) , CCFlags (..) + , DoHeapProfile (..) , ProfFlags (..) + , DoTrace (..) , TraceFlags (..) , TickyFlags (..) , getRTSFlags @@ -48,7 +54,7 @@ import GHC.Show import GHC.Word -- | @'Time'@ is defined as a @'StgWord64'@ in @stg/Types.h@ -type Time = Word64 +type RtsTime = Word64 -- | @'nat'@ defined in @rts/Types.h@ type Nat = #{type unsigned int} @@ -98,19 +104,19 @@ data GCFlags = GCFlags -- ^ use "mostly mark-sweep" instead of copying for the oldest generation , ringBell :: Bool , frontpanel :: Bool - , idleGCDelayTime :: Time + , idleGCDelayTime :: RtsTime , doIdleGC :: Bool , heapBase :: Word -- ^ address to ask the OS for memory , allocLimitGrace :: Word } deriving (Show) data ConcFlags = ConcFlags - { ctxtSwitchTime :: Time + { ctxtSwitchTime :: RtsTime , ctxtSwitchTicks :: Int } deriving (Show) data MiscFlags = MiscFlags - { tickInterval :: Time + { tickInterval :: RtsTime , installSignalHandlers :: Bool , machineReadable :: Bool , linkerMemBase :: Word @@ -198,8 +204,8 @@ instance Enum DoHeapProfile where data ProfFlags = ProfFlags { doHeapProfile :: DoHeapProfile - , heapProfileInterval :: Time -- ^ time between samples - , heapProfileIntervalTicks :: Word -- ^ ticks between samples (derived) + , heapProfileInterval :: RtsTime -- ^ time between samples + , heapProfileIntervalTicks :: Word -- ^ ticks between samples (derived) , includeTSOs :: Bool , showCCSOnException :: Bool , maxRetainerSetSize :: Word diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 8882c5a..4297b0a 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -1,5 +1,12 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) +## 4.8.2.0 *Oct 2015* + + * Bundled with GHC 7.10.3 + + * Exported `GiveGCStats`, `DoCostCentres`, `DoHeapProfile`, `DoTrace`, + `RtsTime`, and `RtsNat` from `GHC.RTS.Flags` + ## 4.8.1.0 *Jul 2015* * Bundled with GHC 7.10.2 From git at git.haskell.org Thu Oct 22 15:08:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:21 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Update user guide, fixing #10772 (97dcc50) Message-ID: <20151022150821.D04BA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/97dcc5043bac842337aa0fd7eef655385fd2eabe/ghc >--------------------------------------------------------------- commit 97dcc5043bac842337aa0fd7eef655385fd2eabe Author: Richard Eisenberg Date: Sat Sep 19 14:45:28 2015 -0400 Update user guide, fixing #10772 >--------------------------------------------------------------- 97dcc5043bac842337aa0fd7eef655385fd2eabe docs/users_guide/glasgow_exts.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index fb4837a..3dfd40a 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -2840,8 +2840,11 @@ GHC allows type constructors, classes, and type variables to be operators, and to be written infix, very much like expressions. More specifically: - A type constructor or class can be an operator, beginning with a colon; e.g. :*:. - The lexical syntax is the same as that for data constructors. + A type constructor or class can be any non-reserved operator. + Symbols used in types are always like capitalized identifiers; they + are never variables. Note that this is different from the lexical + syntax of data constructors, which are required to begin with a + :. Data type and type-synonym declarations can be written infix, parenthesised From git at git.haskell.org Thu Oct 22 15:08:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:24 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: rts/linker: make an error msg a debug msg (36a1c46) Message-ID: <20151022150824.7DE1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/36a1c46fa1fc1a6f3266c2cb5cbb7c4fcaf053aa/ghc >--------------------------------------------------------------- commit 36a1c46fa1fc1a6f3266c2cb5cbb7c4fcaf053aa Author: Austin Seipp Date: Fri Apr 3 06:12:35 2015 -0500 rts/linker: make an error msg a debug msg This fixes more testsuite failures on Windows. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 36a1c46fa1fc1a6f3266c2cb5cbb7c4fcaf053aa rts/Linker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 13e222b..c793e2c 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -4051,8 +4051,9 @@ lookupSymbolInDLLs ( UChar *lbl ) ret->addr = sym; ret->next = indirects; indirects = ret; - errorBelch("warning: %s from %S is linked instead of %s", - (char*)(lbl+6), o_dll->name, (char*)lbl); + IF_DEBUG(linker, + debugBelch("warning: %s from %S is linked instead of %s", + (char*)(lbl+6), o_dll->name, (char*)lbl)); return (void*) & ret->addr; } } From git at git.haskell.org Thu Oct 22 15:08:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:27 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix kind-var abstraction in SimplUtils.abstractFloats (05c3506) Message-ID: <20151022150827.8A11D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/05c350606fe6f73a6aa7c4d141f4059d4c209384/ghc >--------------------------------------------------------------- commit 05c350606fe6f73a6aa7c4d141f4059d4c209384 Author: Simon Peyton Jones Date: Tue Oct 6 09:52:21 2015 +0100 Fix kind-var abstraction in SimplUtils.abstractFloats A missing 'closeOverKinds' triggered Trac #10934. Happily the fix is simple. Merge to 7.10.3 >--------------------------------------------------------------- 05c350606fe6f73a6aa7c4d141f4059d4c209384 compiler/simplCore/SimplUtils.hs | 47 +++++++++++++++++++++++-------------- testsuite/tests/polykinds/T10934.hs | 38 ++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 3 +-- 3 files changed, 69 insertions(+), 19 deletions(-) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index 974fa11..c7a3bc2 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1522,6 +1522,30 @@ as we would normally do. That's why the whole transformation is part of the same process that floats let-bindings and constructor arguments out of RHSs. In particular, it is guarded by the doFloatFromRhs call in simplLazyBind. + +Note [Which type variables to abstract over] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Abstract only over the type variables free in the rhs wrt which the +new binding is abstracted. Note that + + * The naive approach of abstracting wrt the + tyvars free in the Id's /type/ fails. Consider: + /\ a b -> let t :: (a,b) = (e1, e2) + x :: a = fst t + in ... + Here, b isn't free in x's type, but we must nevertheless + abstract wrt b as well, because t's type mentions b. + Since t is floated too, we'd end up with the bogus: + poly_t = /\ a b -> (e1, e2) + poly_x = /\ a -> fst (poly_t a *b*) + + * We must do closeOverKinds. Example (Trac #10934): + f = /\k (f:k->*) (a:k). let t = AccFailure @ (f a) in ... + Here we want to float 't', but we must remember to abstract over + 'k' as well, even though it is not explicitly mentioned in the RHS, + otherwise we get + t = /\ (f:k->*) (a:k). AccFailure @ (f a) + which is obviously bogus. -} abstractFloats :: [OutTyVar] -> SimplEnv -> OutExpr -> SimplM ([OutBind], OutExpr) @@ -1542,23 +1566,12 @@ abstractFloats main_tvs body_env body ; return (subst', (NonRec poly_id poly_rhs)) } where rhs' = CoreSubst.substExpr (text "abstract_floats2") subst rhs - tvs_here = varSetElemsKvsFirst (main_tv_set `intersectVarSet` exprSomeFreeVars isTyVar rhs') - - -- Abstract only over the type variables free in the rhs - -- wrt which the new binding is abstracted. But the naive - -- approach of abstract wrt the tyvars free in the Id's type - -- fails. Consider: - -- /\ a b -> let t :: (a,b) = (e1, e2) - -- x :: a = fst t - -- in ... - -- Here, b isn't free in x's type, but we must nevertheless - -- abstract wrt b as well, because t's type mentions b. - -- Since t is floated too, we'd end up with the bogus: - -- poly_t = /\ a b -> (e1, e2) - -- poly_x = /\ a -> fst (poly_t a *b*) - -- So for now we adopt the even more naive approach of - -- abstracting wrt *all* the tyvars. We'll see if that - -- gives rise to problems. SLPJ June 98 + + -- tvs_here: see Note [Which type variables to abstract over] + tvs_here = varSetElemsKvsFirst $ + intersectVarSet main_tv_set $ + closeOverKinds $ + exprSomeFreeVars isTyVar rhs' abstract subst (Rec prs) = do { (poly_ids, poly_apps) <- mapAndUnzipM (mk_poly tvs_here) ids diff --git a/testsuite/tests/polykinds/T10934.hs b/testsuite/tests/polykinds/T10934.hs new file mode 100644 index 0000000..fb7a538 --- /dev/null +++ b/testsuite/tests/polykinds/T10934.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE + ScopedTypeVariables + , DataKinds + , GADTs + , RankNTypes + , TypeOperators + , PolyKinds -- Comment out PolyKinds and the bug goes away. + #-} +{-# OPTIONS_GHC -O #-} + -- The bug is in SimplUtils.abstractFloats, so we need -O to trigger it + +module KeyValue where + +data AccValidation err a = AccFailure err | AccSuccess a + +data KeyValueError = MissingValue + +type WithKeyValueError = AccValidation [KeyValueError] + +missing :: forall f rs. RecApplicative rs => Rec (WithKeyValueError :. f) rs +missing = rpure missingField + where + missingField :: forall x. (WithKeyValueError :. f) x + missingField = Compose $ AccFailure [MissingValue] + +data Rec :: (u -> *) -> [u] -> * where + RNil :: Rec f '[] + (:&) :: !(f r) -> !(Rec f rs) -> Rec f (r ': rs) + +newtype Compose (f :: l -> *) (g :: k -> l) (x :: k) + = Compose { getCompose :: f (g x) } + +type (:.) f g = Compose f g + +class RecApplicative rs where + rpure + :: (forall x. f x) + -> Rec f rs diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index c86e317..dcc9b98 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -1,5 +1,3 @@ -setTestOpts(only_compiler_types(['ghc'])) - test('PolyKinds09', normal, compile_and_run, ['']) test('PolyKinds10', normal, compile_and_run, ['']) @@ -114,3 +112,4 @@ test('T9838', normal, multimod_compile, ['T9838.hs','-v0']) test('T9574', normal, compile_fail, ['']) test('T9833', normal, compile, ['']) test('T7908', normal, compile, ['']) +test('T10934', normal, compile, ['']) From git at git.haskell.org Thu Oct 22 15:08:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:30 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Set RELEASE=NO (37afefb) Message-ID: <20151022150830.563F83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/37afefb056d9ebef5134187a74b1632d600d5964/ghc >--------------------------------------------------------------- commit 37afefb056d9ebef5134187a74b1632d600d5964 Author: Ben Gamari Date: Thu Jul 30 11:54:45 2015 +0200 Set RELEASE=NO >--------------------------------------------------------------- 37afefb056d9ebef5134187a74b1632d600d5964 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 84194f7..4a69db7 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.2], [glasgow-haskell-bugs at haskell.org], [ghc]) # 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 Thu Oct 22 15:08:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:33 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Don't inline/apply other rules when simplifying a rule RHS. (5df7a7a) Message-ID: <20151022150833.38BB23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/5df7a7aba2116102ad14b7ccef53564d9155536e/ghc >--------------------------------------------------------------- commit 5df7a7aba2116102ad14b7ccef53564d9155536e Author: Andrew Farmer Date: Mon Oct 12 21:27:41 2015 -0500 Don't inline/apply other rules when simplifying a rule RHS. HERMIT users depend on RULES to specify equational properties. 6.10.2 performed both inlining and simplification in both sides of the rules, meaning they can't really be used for this. This breaks most HERMIT use cases. A separate commit already disabled this for the LHS of rules. This does so for the RHS. See Trac #10829 for nofib results. Reviewed By: austin, bgamari, simonpj Differential Revision: https://phabricator.haskell.org/D1246 GHC Trac Issues: #10829 >--------------------------------------------------------------- 5df7a7aba2116102ad14b7ccef53564d9155536e compiler/simplCore/SimplUtils.hs | 23 +++++++++++++--------- compiler/simplCore/Simplify.hs | 12 +++++------ .../tests/simplCore/should_compile/T7785.stderr | 2 -- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index 6dbe870..974fa11 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -14,7 +14,7 @@ module SimplUtils ( preInlineUnconditionally, postInlineUnconditionally, activeUnfolding, activeRule, getUnfoldingInRuleMatch, - simplEnvForGHCi, updModeForStableUnfoldings, updModeForRuleLHS, + simplEnvForGHCi, updModeForStableUnfoldings, updModeForRules, -- The continuation type SimplCont(..), DupFlag(..), @@ -700,20 +700,25 @@ updModeForStableUnfoldings inline_rule_act current_mode phaseFromActivation (ActiveAfter n) = Phase n phaseFromActivation _ = InitialPhase -updModeForRuleLHS :: SimplifierMode -> SimplifierMode --- See Note [Simplifying RULE LHSs] -updModeForRuleLHS current_mode +updModeForRules :: SimplifierMode -> SimplifierMode +-- See Note [Simplifying rules] +updModeForRules current_mode = current_mode { sm_phase = InitialPhase , sm_inline = False , sm_rules = False , sm_eta_expand = False } -{- Note [Simplifying RULE LHSs] +{- Note [Simplifying rules] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When simplifying on the LHS of a rule, refrain from all inlining and -all RULES. Doing anything to the LHS is plain confusing, because it -means that what the rule matches is not what the user wrote. -c.f. Trac #10595, and #10528. +When simplifying a rule, refrain from any inlining or applying of other RULES. + +Doing anything to the LHS is plain confusing, because it means that what the +rule matches is not what the user wrote. c.f. Trac #10595, and #10528. +Moreover, inlining (or applying rules) on rule LHSs risks introducing +Ticks into the LHS, which makes matching trickier. Trac #10665, #10745. + +Doing this to either side confounds tools like HERMIT, which seek to reason +about and apply the RULES as originally written. See Trac #10829. Note [Inlining in gentle mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index d816d3f..40a6ec0 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -2966,13 +2966,11 @@ simplRules env mb_new_nm rules = return rule simpl_rule rule@(Rule { ru_bndrs = bndrs, ru_args = args - , ru_fn = fn_name, ru_rhs = rhs - , ru_act = act }) - = do { (env, bndrs') <- simplBinders env bndrs - ; let lhs_env = updMode updModeForRuleLHS env - rhs_env = updMode (updModeForStableUnfoldings act) env - ; args' <- mapM (simplExpr lhs_env) args - ; rhs' <- simplExpr rhs_env rhs + , ru_fn = fn_name, ru_rhs = rhs }) + = do { (env', bndrs') <- simplBinders env bndrs + ; let rule_env = updMode updModeForRules env' + ; args' <- mapM (simplExpr rule_env) args + ; rhs' <- simplExpr rule_env rhs ; return (rule { ru_bndrs = bndrs' , ru_fn = mb_new_nm `orElse` fn_name , ru_args = args' diff --git a/testsuite/tests/simplCore/should_compile/T7785.stderr b/testsuite/tests/simplCore/should_compile/T7785.stderr index f0b9117..db80b99 100644 --- a/testsuite/tests/simplCore/should_compile/T7785.stderr +++ b/testsuite/tests/simplCore/should_compile/T7785.stderr @@ -4,7 +4,5 @@ forall ($dMyFunctor :: MyFunctor []) (irred :: Domain [] Int). shared @ [] $dMyFunctor irred = bar_$sshared -"SPEC/Foo myfmap @ []" [ALWAYS] - forall (tpl :: MyFunctor []). myfmap @ [] tpl = $cmyfmap From git at git.haskell.org Thu Oct 22 15:08:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:36 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Parenthesise TypeOperator in import hints (4275c4a) Message-ID: <20151022150836.8B4E63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/4275c4a72a7fafa3cf57a2f07231e4b6bca2e6b2/ghc >--------------------------------------------------------------- commit 4275c4a72a7fafa3cf57a2f07231e4b6bca2e6b2 Author: Thomas Winant Date: Thu Jul 23 11:43:21 2015 +0200 Parenthesise TypeOperator in import hints When a constructor was mistakenly imported directly instead of as a constructor of a data type, a hint will be shown on how to correctly import it. Just like the constructor, the data type should be surrounded in parentheses if it is an operator (TypeOperator in this case). Instead of: error: In module ?Data.Type.Equality?: ?Refl? is a data constructor of ?:~:? To import it use ?import? Data.Type.Equality( :~:( Refl ) ) or ?import? Data.Type.Equality( :~:(..) ) Print: error: In module ?Data.Type.Equality?: ?Refl? is a data constructor of ?(:~:)? To import it use ?import? Data.Type.Equality( (:~:)( Refl ) ) or ?import? Data.Type.Equality( (:~:)(..) ) Test Plan: pass new test Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1093 GHC Trac Issues: #10668 >--------------------------------------------------------------- 4275c4a72a7fafa3cf57a2f07231e4b6bca2e6b2 compiler/rename/RnNames.hs | 9 +++++---- testsuite/tests/rename/should_fail/T10668.hs | 3 +++ testsuite/tests/rename/should_fail/T10668.stderr | 8 ++++++++ testsuite/tests/rename/should_fail/all.T | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 2818db8..58a743e 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1631,25 +1631,26 @@ badImportItemErrDataCon :: OccName -> ImpDeclSpec -> IE RdrName -> SDoc -badImportItemErrDataCon dataType is_boot decl_spec ie +badImportItemErrDataCon dataType_occ is_boot decl_spec ie = vcat [ ptext (sLit "In module") <+> quotes (ppr (is_mod decl_spec)) <+> source_import <> colon , nest 2 $ quotes datacon <+> ptext (sLit "is a data constructor of") - <+> quotes (ppr dataType) + <+> quotes dataType , ptext (sLit "To import it use") , nest 2 $ quotes (ptext (sLit "import")) <+> ppr (is_mod decl_spec) - <> parens_sp (ppr dataType <> parens_sp datacon) + <> parens_sp (dataType <> parens_sp datacon) , ptext (sLit "or") , nest 2 $ quotes (ptext (sLit "import")) <+> ppr (is_mod decl_spec) - <> parens_sp (ppr dataType <> ptext (sLit "(..)")) + <> parens_sp (dataType <> ptext (sLit "(..)")) ] where datacon_occ = rdrNameOcc $ ieName ie datacon = parenSymOcc datacon_occ (ppr datacon_occ) + dataType = parenSymOcc dataType_occ (ppr dataType_occ) source_import | is_boot = ptext (sLit "(hi-boot interface)") | otherwise = Outputable.empty parens_sp d = parens (space <> d <> space) -- T( f,g ) diff --git a/testsuite/tests/rename/should_fail/T10668.hs b/testsuite/tests/rename/should_fail/T10668.hs new file mode 100644 index 0000000..111637b --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10668.hs @@ -0,0 +1,3 @@ +module T10668 where + +import Data.Type.Equality(Refl) diff --git a/testsuite/tests/rename/should_fail/T10668.stderr b/testsuite/tests/rename/should_fail/T10668.stderr new file mode 100644 index 0000000..8c96fad --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10668.stderr @@ -0,0 +1,8 @@ + +T10668.hs:3:27: error: + In module ?Data.Type.Equality?: + ?Refl? is a data constructor of ?(:~:)? + To import it use + ?import? Data.Type.Equality( (:~:)( Refl ) ) + or + ?import? Data.Type.Equality( (:~:)(..) ) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 2aeee2f..69ad1a3 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -132,3 +132,4 @@ test('T9032', normal, run_command, ['$MAKE -s --no-print-directory T9032']) +test('T10668', normal, compile_fail, ['']) From git at git.haskell.org Thu Oct 22 15:08:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:39 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Testsuite: mark T6037 expect_fail on Windows (#6037) (6f1ac16) Message-ID: <20151022150839.3DD123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/6f1ac160c5bb32a6c862a79c047ac1c1803c7879/ghc >--------------------------------------------------------------- commit 6f1ac160c5bb32a6c862a79c047ac1c1803c7879 Author: Thomas Miedema Date: Sat Sep 12 23:34:12 2015 +0200 Testsuite: mark T6037 expect_fail on Windows (#6037) >--------------------------------------------------------------- 6f1ac160c5bb32a6c862a79c047ac1c1803c7879 testsuite/tests/driver/Makefile | 4 ++-- testsuite/tests/driver/all.T | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index e12f3a5..52f0d9d 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -551,8 +551,8 @@ T7563: -"$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -C T7563.hs # Below we set LC_ALL=C to request standard ASCII output in the resulting error -# messages. Unfortunately, Mac OS X still uses a Unicode encoding even with -# LC_ALL=C, so we expect these tests to fail there. +# messages. Unfortunately, Mac OS X and Windows still use a Unicode encoding +# even with LC_ALL=C, so we expect these tests to fail there. .PHONY: T6037 T6037: diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 6b07d47..4690ef1 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -384,7 +384,10 @@ test('T7060', test('T7130', normal, compile_fail, ['-fflul-laziness']) test('T7563', when(unregisterised(), skip), run_command, ['$MAKE -s --no-print-directory T7563']) -test('T6037', normal, run_command, +test('T6037', + # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X + [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)], + run_command, ['$MAKE -s --no-print-directory T6037']) test('T2507', From git at git.haskell.org Thu Oct 22 15:08:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:42 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix #10495. (b13c6fe) Message-ID: <20151022150842.415F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/b13c6fe9515964b2328d8a40bc9963d59cce801f/ghc >--------------------------------------------------------------- commit b13c6fe9515964b2328d8a40bc9963d59cce801f Author: Richard Eisenberg Date: Mon Jun 8 15:57:33 2015 -0400 Fix #10495. This change means that the intricate reasoning in TcErrors around getting messages just right for nominal equalities is skipped for representational equalities. >--------------------------------------------------------------- b13c6fe9515964b2328d8a40bc9963d59cce801f compiler/typecheck/TcErrors.hs | 13 ++++++++++--- testsuite/tests/typecheck/should_fail/T10285.stderr | 5 ++++- testsuite/tests/typecheck/should_fail/T10495.hs | 5 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index b07fbf9..21abffb 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -815,6 +815,7 @@ mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2 -- be oriented the other way round; -- see TcCanonical.canEqTyVarTyVar || isSigTyVar tv1 && not (isTyVarTy ty2) + || ctEqRel ct == ReprEq -- the cases below don't really apply to ReprEq = mkErrorMsg ctxt ct (vcat [ misMatchOrCND ctxt ct oriented ty1 ty2 , extraTyVarInfo ctxt tv1 ty2 , extra ]) @@ -938,13 +939,19 @@ misMatchOrCND ctxt ct oriented ty1 ty2 isGivenCt ct -- If the equality is unconditionally insoluble -- or there is no context, don't report the context - = misMatchMsg oriented (ctEqRel ct) ty1 ty2 + = misMatchMsg oriented eq_rel ty1 ty2 | otherwise - = couldNotDeduce givens ([mkTcEqPred ty1 ty2], orig) + = couldNotDeduce givens ([eq_pred], orig) where + eq_rel = ctEqRel ct givens = [ given | given@(_, _, no_eqs, _) <- getUserGivens ctxt, not no_eqs] -- Keep only UserGivens that have some equalities - orig = TypeEqOrigin { uo_actual = ty1, uo_expected = ty2 } + + (eq_pred, orig) = case eq_rel of + NomEq -> ( mkTcEqPred ty1 ty2 + , TypeEqOrigin { uo_actual = ty1, uo_expected = ty2 }) + ReprEq -> ( mkCoerciblePred ty1 ty2 + , CoercibleOrigin ty1 ty2 ) couldNotDeduce :: [UserGiven] -> (ThetaType, CtOrigin) -> SDoc couldNotDeduce givens (wanteds, orig) diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr index 47cfbec..5b4af02 100644 --- a/testsuite/tests/typecheck/should_fail/T10285.stderr +++ b/testsuite/tests/typecheck/should_fail/T10285.stderr @@ -1,6 +1,9 @@ T10285.hs:8:17: - Could not deduce (a ~ b) + Could not deduce (Coercible a b) + arising from trying to show that the representations of + ?a? and + ?b? are the same from the context (Coercible (N a) (N b)) bound by a pattern with constructor Coercion :: forall (k :: BOX) (a :: k) (b :: k). diff --git a/testsuite/tests/typecheck/should_fail/T10495.hs b/testsuite/tests/typecheck/should_fail/T10495.hs new file mode 100644 index 0000000..2573f51 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T10495.hs @@ -0,0 +1,5 @@ +module T10495 where + +import Data.Coerce + +foo = coerce diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 95911d1..b6e5867 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -363,3 +363,4 @@ test('T9858b', normal, compile_fail, ['']) test('T9858e', normal, compile_fail, ['']) test('T10534', extra_clean(['T10534a.hi', 'T10534a.o']), multimod_compile_fail, ['T10534', '-v0']) +test('T10495', normal, compile_fail, ['']) From git at git.haskell.org Thu Oct 22 15:08:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:46 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix treatment of -0.0 (ba46270) Message-ID: <20151022150846.335F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/ba46270dec398ae8aebb5f55755be112fe3c417b/ghc >--------------------------------------------------------------- commit ba46270dec398ae8aebb5f55755be112fe3c417b Author: Ben Gamari Date: Fri Oct 2 15:40:43 2015 +0200 Fix treatment of -0.0 Here we fix a few mis-optimizations that could occur in code with floating point comparisons with -0.0. These issues arose from our insistence on rewriting equalities into case analyses and the simplifier's ignorance of floating-point semantics. For instance, in Trac #10215 (and the similar issue Trac #9238) we turned `ds == 0.0` into a case analysis, ``` case ds of __DEFAULT -> ... 0.0 -> ... ``` Where the second alternative matches where `ds` is +0.0 and *also* -0.0. However, the simplifier doesn't realize this and will introduce a local inlining of `ds = -- +0.0` as it believes this is the only value that matches this pattern. Instead of teaching the simplifier about floating-point semantics we simply prohibit case analysis on floating-point scrutinees and keep this logic in the comparison primops, where it belongs. We do several things here, - Add test cases from relevant tickets - Clean up a bit of documentation - Desugar literal matches against floats into applications of the appropriate equality primitive instead of case analysis - Add a CoreLint to ensure we don't pattern match on floats in Core Test Plan: validate with included testcases Reviewers: goldfire, simonpj, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1061 GHC Trac Issues: #10215, #9238 >--------------------------------------------------------------- ba46270dec398ae8aebb5f55755be112fe3c417b compiler/coreSyn/CoreLint.hs | 30 +++++ compiler/coreSyn/CoreSyn.hs | 7 ++ compiler/deSugar/MatchLit.hs | 15 +-- compiler/prelude/PrelRules.hs | 125 ++++++++++++--------- compiler/typecheck/TcType.hs | 7 +- testsuite/tests/deSugar/should_run/T10215.hs | 9 ++ .../should_run/T10215.stdout} | 1 + testsuite/tests/deSugar/should_run/T9238.hs | 16 +++ testsuite/tests/deSugar/should_run/T9238.stdout | 2 + testsuite/tests/deSugar/should_run/all.T | 2 + 10 files changed, 151 insertions(+), 63 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 ba46270dec398ae8aebb5f55755be112fe3c417b From git at git.haskell.org Thu Oct 22 15:08:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:52 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make Windows linker more robust to unknown sections (bf21029) Message-ID: <20151022150852.932003A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/bf210296af2612ead1dd9327c4b1aaae8d552a91/ghc >--------------------------------------------------------------- commit bf210296af2612ead1dd9327c4b1aaae8d552a91 Author: Tamar Christina Date: Sat Oct 3 22:28:07 2015 +0200 Make Windows linker more robust to unknown sections The Windows Linker has 3 main parts that this patch changes. 1) Identification and classification of sections 2) Adding of symbols to the symbols tables 3) Reallocation of sections 1. Previously section identification used to be done on a whitelisted basis. It was also exclusively being done based on the names of the sections. This meant that there was a bit of a cat and mouse game between `GCC` and `GHC`. Every time `GCC` added new sections there was a good chance `GHC` would break. Luckily this hasn't happened much in the past because the `GCC` versions `GHC` used were largely unchanged. The new code instead treats all new section as `CODE` or `DATA` sections, and changes the classifications based on the `Characteristics` flag in the PE header. By doing so we no longer have the fragility of changing section names. The one exception to this is the `.ctors` section, which has no differentiating flag in the PE header, but we know we need to treat it as initialization data. The check to see if the sections are aligned by `4` has been removed. The reason is that debug sections often time are `1 aligned` but do have relocation symbols. In order to support relocations of `.debug` sections this check needs to be gone. Crucially this assumption doesn't seem to be in the rest of the code. We only check if there are at least 4 bytes to realign further down the road. 2. The second loop is iterating of all the symbols in the file and trying to add them to the symbols table. Because the classification of the sections we did previously are (currently) not available in this phase we still have to exclude the sections by hand. If they don't we will load in symbols from sections we've explicitly ignored the in # 1. This whole part should rewritten to avoid this. But didn't want to do it in this commit. 3. Finally the sections are relocated. But for some reason the PE files contain a Linux relocation constant in them `0x0011` This constant as far as I can tell does not come from GHC (or I couldn't find where it's being set). I believe this is probably a bug in GAS. But because the constant is in the output we have to handle it. I am thus mapping it to the constant I think it should be `0x0003`. Finally, static linking *should* work, but won't. At least not if you want to statically link `libgcc` with exceptions support. Doing so would require you to link `libgcc` and `libstd++` but also `libmingwex`. The problem is that `libmingwex` also defines a lot of symbols that the RTS automatically injects into the symbol table. Presumably because they're symbols that it needs. like `coshf`. The these symbols are not in a section that is declared with weak symbols support. So if we ever want to get this working, we should either a) Ask mingw to declare the section as such, or b) treat all a imported symbols as being weak. Though this doesn't seem like it's a good idea.. Test Plan: Running ./validate for both x86 and x86_64 Also running the specific test case for #10672 make TESTS="T10672_x86 T10672_x64" Reviewed By: ezyang, thomie, austin Differential Revision: https://phabricator.haskell.org/D1244 GHC Trac Issues: #9907, #10672, #10563 >--------------------------------------------------------------- bf210296af2612ead1dd9327c4b1aaae8d552a91 rts/Linker.c | 207 +++++++++++++++-------------------- testsuite/driver/runtests.py | 3 + testsuite/tests/rts/T10672/Main.hs | 14 +++ testsuite/tests/rts/T10672/Makefile | 11 ++ testsuite/tests/rts/T10672/Printf.hs | 34 ++++++ testsuite/tests/rts/T10672/all.T | 11 ++ testsuite/tests/rts/T10672/cxxy.cpp | 23 ++++ 7 files changed, 182 insertions(+), 121 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bf210296af2612ead1dd9327c4b1aaae8d552a91 From git at git.haskell.org Thu Oct 22 15:08:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:48 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make headers C++ compatible (fixes #10700) (284a431) Message-ID: <20151022150848.E943F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/284a4317a61f639f085f74be4f32a3e63b62e0f4/ghc >--------------------------------------------------------------- commit 284a4317a61f639f085f74be4f32a3e63b62e0f4 Author: Alexey Shmalko Date: Thu Jul 30 10:37:05 2015 +0200 Make headers C++ compatible (fixes #10700) Some headers used `new` as parameter name, which is reserved word in C++. This patch changes these names to `new_`. Test Plan: validate Reviewers: austin, ezyang, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1107 GHC Trac Issues: #10700 >--------------------------------------------------------------- 284a4317a61f639f085f74be4f32a3e63b62e0f4 includes/stg/Prim.h | 8 ++++---- includes/stg/SMP.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index 80f4f8e..b07e177 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -39,10 +39,10 @@ StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val); StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val); StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val); StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val); -StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new); +StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new_); StgWord hs_atomicread8(volatile StgWord8 *x); StgWord hs_atomicread16(volatile StgWord16 *x); StgWord hs_atomicread32(volatile StgWord32 *x); diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index 156ee42..eace694 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -280,12 +280,12 @@ atomic_inc(StgVolatilePtr p, StgWord incr) ); return r + incr; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old + incr; - } while (cas(p, old, new) != old); - return new; + new_ = old + incr; + } while (cas(p, old, new_) != old); + return new_; #endif } @@ -301,12 +301,12 @@ atomic_dec(StgVolatilePtr p) ); return r-1; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old - 1; - } while (cas(p, old, new) != old); - return new; + new_ = old - 1; + } while (cas(p, old, new_) != old); + return new_; #endif } From git at git.haskell.org Thu Oct 22 15:08:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:55 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix GHCi on Arm (#10375). (6149b1e) Message-ID: <20151022150855.56DFE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/6149b1e3c86c3d56a2c3f2eac71a1dfc5f856573/ghc >--------------------------------------------------------------- commit 6149b1e3c86c3d56a2c3f2eac71a1dfc5f856573 Author: Erik de Castro Lopo Date: Sun Oct 11 16:48:11 2015 +1100 Fix GHCi on Arm (#10375). Arm has two instruction sets, Arm and Thumb, and an execution mode for each. Executing Arm code in Thumb mode or vice-versa will likely result in an Illegal instruction exception. Furthermore, Haskell code compiled via LLVM was generating Arm instructions while C code compiled via GCC was generating Thumb code by default. When these two object code types were being linked by the system linker, all was fine, because the system linker knows how to jump and call from one instruction set to the other. The first problem was with GHCi's object code loader which did not know about Thumb vs Arm. When loading an object file `StgCRun` would jump into the loaded object which could change the mode causing a crash after it returned. This was fixed by forcing all C code to generate Arm instructions by passing `-marm` to GCC. The second problem was the `mkJumpToAddr` function which was generating Thumb instructions. Changing that to generate Arm instructions instead results in a working GHCi on Arm. Test Plan: validate on x86_64 and arm Reviewers: bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1323 GHC Trac Issues: #10375 >--------------------------------------------------------------- 6149b1e3c86c3d56a2c3f2eac71a1dfc5f856573 aclocal.m4 | 16 ++++++++++++---- compiler/ghci/ByteCodeItbls.hs | 10 +++++----- compiler/llvmGen/LlvmCodeGen/Ppr.hs | 2 +- rts/Linker.c | 5 +++++ 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index c17a7d5..d19a66e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -565,10 +565,18 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], $3="$$3 -D_HPUX_SOURCE" $5="$$5 -D_HPUX_SOURCE" ;; - arm*linux* | \ - aarch64*linux* ) - # On arm/linux, aarch64/linux, arm/android and aarch64/android, tell - # gcc to link using the gold linker. + arm*linux*) + # On arm/linux and arm/android, tell gcc to generate Arm + # instructions (ie not Thumb) and to link using the gold linker. + # Forcing LD to be ld.gold is done in FIND_LD m4 macro. + $2="$$2 -marm" + $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack" + $4="$$4 -z noexecstack" + ;; + + aarch64*linux*) + # On aarch64/linux and aarch64/android, tell gcc to link using the + # gold linker. # Forcing LD to be ld.gold is done in FIND_LD m4 macro. $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack" $4="$$4 -z noexecstack" diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs index 5cc537a..fee50ee 100644 --- a/compiler/ghci/ByteCodeItbls.hs +++ b/compiler/ghci/ByteCodeItbls.hs @@ -219,17 +219,17 @@ mkJumpToAddr dflags a = case platformArch (targetPlatform dflags) of , fromIntegral ((w64 `shiftR` 32) .&. 0x0000FFFF) ] ArchARM { } -> - -- Generates Thumb sequence, + -- Generates Arm sequence, -- ldr r1, [pc, #0] -- bx r1 -- -- which looks like: -- 00000000 <.addr-0x8>: - -- 0: 4900 ldr r1, [pc] ; 8 <.addr> - -- 4: 4708 bx r1 + -- 0: 00109fe5 ldr r1, [pc] ; 8 <.addr> + -- 4: 11ff2fe1 bx r1 let w32 = fromIntegral (funPtrToInt a) :: Word32 - in Left [ 0x49, 0x00 - , 0x47, 0x08 + in Left [ 0x00, 0x10, 0x9f, 0xe5 + , 0x11, 0xff, 0x2f, 0xe1 , byte0 w32, byte1 w32, byte2 w32, byte3 w32] arch -> diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs index 5dd27ab..97e4393 100644 --- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs +++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs @@ -52,7 +52,7 @@ moduleLayout = sdocWithPlatform $ \platform -> $+$ text "target triple = \"x86_64-linux-gnu\"" Platform { platformArch = ArchARM {}, platformOS = OSLinux } -> text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\"" - $+$ text "target triple = \"arm-unknown-linux-gnueabi\"" + $+$ text "target triple = \"armv6-unknown-linux-gnueabihf\"" Platform { platformArch = ArchARM {}, platformOS = OSAndroid } -> text "target datalayout = \"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32\"" $+$ text "target triple = \"arm-unknown-linux-androideabi\"" diff --git a/rts/Linker.c b/rts/Linker.c index 343719a..68f1f59 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5569,6 +5569,11 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, #ifdef arm_HOST_ARCH // Thumb instructions have bit 0 of symbol's st_value set is_target_thm = S & 0x1; + + if (is_target_thm) + errorBelch( "Symbol `%s' requires Thumb linkage which is not " + "currently supported.\n", symbol ); + T = sym.st_info & STT_FUNC && is_target_thm; // Make sure we clear bit 0. Strictly speaking we should have done From git at git.haskell.org Thu Oct 22 15:08:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:08:58 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix #10489 (243d57c) Message-ID: <20151022150858.0F9753A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/243d57cfb71fa41ed4ae604e79aaaeb13646b6a1/ghc >--------------------------------------------------------------- commit 243d57cfb71fa41ed4ae604e79aaaeb13646b6a1 Author: Richard Eisenberg Date: Fri Jun 5 09:56:21 2015 -0400 Fix #10489 Dang, roles are annoying. Test case: typecheck/should_compile/T10489 Cherry-Picked-From: 61b96a86c5342fb1c850361177d60fe855d948f6 Conflicts: testsuite/tests/typecheck/should_compile/all.T >--------------------------------------------------------------- 243d57cfb71fa41ed4ae604e79aaaeb13646b6a1 compiler/hsSyn/HsUtils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 4a80ebd..ad438e5 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -504,9 +504,10 @@ mkHsWrapPat :: HsWrapper -> Pat id -> Type -> Pat id mkHsWrapPat co_fn p ty | isIdHsWrapper co_fn = p | otherwise = CoPat co_fn p ty +-- input coercion is Nominal mkHsWrapPatCo :: TcCoercion -> Pat id -> Type -> Pat id mkHsWrapPatCo co pat ty | isTcReflCo co = pat - | otherwise = CoPat (mkWpCast co) pat ty + | otherwise = CoPat (mkWpCast (mkTcSubCo co)) pat ty mkHsDictLet :: TcEvBinds -> LHsExpr Id -> LHsExpr Id mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr From git at git.haskell.org Thu Oct 22 15:09:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:01 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make Data.List.foldr1 inline (3f3ac1c) Message-ID: <20151022150901.2F55F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3f3ac1cb6661f7b1780ea17abcce21f4a36dcea5/ghc >--------------------------------------------------------------- commit 3f3ac1cb6661f7b1780ea17abcce21f4a36dcea5 Author: Joachim Breitner Date: Wed Sep 2 15:58:38 2015 -0700 Make Data.List.foldr1 inline Previously, foldr1 would be defiend recursively and thus not inline. This is bad, for example, when maximumBy has a strict comparison function: Before the BBP, it was implemented via foldl1, which inlined and yielded good code. With BBP, it goes via foldr1, so we better inline this as well. Fixes #10830. Differential Revision: https://phabricator.haskell.org/D1205 >--------------------------------------------------------------- 3f3ac1cb6661f7b1780ea17abcce21f4a36dcea5 libraries/base/GHC/List.hs | 8 +++++--- testsuite/tests/simplCore/should_run/T10830.hs | 3 +++ testsuite/tests/simplCore/should_run/all.T | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs index fcc89d3..ca3fb75 100644 --- a/libraries/base/GHC/List.hs +++ b/libraries/base/GHC/List.hs @@ -355,9 +355,11 @@ match on everything past the :, which is just the tail of scanl. -- and thus must be applied to non-empty lists. foldr1 :: (a -> a -> a) -> [a] -> a -foldr1 _ [x] = x -foldr1 f (x:xs) = f x (foldr1 f xs) -foldr1 _ [] = errorEmptyList "foldr1" +foldr1 f = go + where go [x] = x + go (x:xs) = f x (go xs) + go [] = errorEmptyList "foldr1" +{-# INLINE [0] foldr1 #-} -- | 'scanr' is the right-to-left dual of 'scanl'. -- Note that diff --git a/testsuite/tests/simplCore/should_run/T10830.hs b/testsuite/tests/simplCore/should_run/T10830.hs new file mode 100644 index 0000000..354f0f5 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T10830.hs @@ -0,0 +1,3 @@ +import GHC.OldList +main :: IO () +main = maximumBy compare [1..10000] `seq` return () diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index 364dfd6..ba775b7 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -69,3 +69,4 @@ test('T457', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, test('T9128', normal, compile_and_run, ['']) test('T9390', normal, compile_and_run, ['']) +test('T10830', extra_run_opts('+RTS -K100k -RTS'), compile_and_run, ['']) From git at git.haskell.org Thu Oct 22 15:09:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:04 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix trac #10413 (5b34f18) Message-ID: <20151022150904.0C6153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/5b34f18a9b7ad55801645824bed25eafaad5aa9b/ghc >--------------------------------------------------------------- commit 5b34f18a9b7ad55801645824bed25eafaad5aa9b Author: Ben Gamari Date: Wed Sep 2 13:26:22 2015 +0200 Fix trac #10413 Test Plan: Validate. Reviewers: austin, tibbe, bgamari Reviewed By: tibbe, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1194 GHC Trac Issues: #10413 >--------------------------------------------------------------- 5b34f18a9b7ad55801645824bed25eafaad5aa9b compiler/codeGen/StgCmmPrim.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index e208318..55b4264 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -412,7 +412,9 @@ emitPrimOp _ [] WriteSmallArrayOp [obj,ix,v] = doWriteSmallPtrArrayOp obj -- Getting the size of pointer arrays emitPrimOp dflags [res] SizeofArrayOp [arg] - = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg (fixedHdrSizeW dflags + oFFSET_StgMutArrPtrs_ptrs dflags) (bWord dflags)) + = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg + (fixedHdrSizeW dflags + bytesToWordsRoundUp dflags (oFFSET_StgMutArrPtrs_ptrs dflags)) + (bWord dflags)) emitPrimOp dflags [res] SizeofMutableArrayOp [arg] = emitPrimOp dflags [res] SizeofArrayOp [arg] emitPrimOp dflags [res] SizeofArrayArrayOp [arg] @@ -423,7 +425,8 @@ emitPrimOp dflags [res] SizeofMutableArrayArrayOp [arg] emitPrimOp dflags [res] SizeofSmallArrayOp [arg] = emit $ mkAssign (CmmLocal res) (cmmLoadIndexW dflags arg - (fixedHdrSizeW dflags + oFFSET_StgSmallMutArrPtrs_ptrs dflags) (bWord dflags)) + (fixedHdrSizeW dflags + bytesToWordsRoundUp dflags (oFFSET_StgSmallMutArrPtrs_ptrs dflags)) + (bWord dflags)) emitPrimOp dflags [res] SizeofSmallMutableArrayOp [arg] = emitPrimOp dflags [res] SizeofSmallArrayOp [arg] From git at git.haskell.org Thu Oct 22 15:09:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:06 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Testsuite: mark encoding005 expect_broken(#10623) on Windows (e9d6564) Message-ID: <20151022150906.BB1A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/e9d65641d75ee5b9495d49cc833b1307fd26c0b2/ghc >--------------------------------------------------------------- commit e9d65641d75ee5b9495d49cc833b1307fd26c0b2 Author: Thomas Miedema Date: Sat Aug 15 16:55:26 2015 +0200 Testsuite: mark encoding005 expect_broken(#10623) on Windows >--------------------------------------------------------------- e9d65641d75ee5b9495d49cc833b1307fd26c0b2 libraries/base/tests/IO/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T index fe8faa0..61011d2 100644 --- a/libraries/base/tests/IO/all.T +++ b/libraries/base/tests/IO/all.T @@ -145,7 +145,8 @@ test('encoding001', test('encoding002', normal, compile_and_run, ['']) test('encoding003', normal, compile_and_run, ['']) test('encoding004', normal, compile_and_run, ['']) -test('encoding005', normal, compile_and_run, ['']) +test('encoding005', when(opsys('mingw32'), expect_broken(10623)), + compile_and_run, ['']) test('environment001', [extra_clean(['environment001'])], From git at git.haskell.org Thu Oct 22 15:09:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:09 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Docs: make sure all libs are included in index.html (#10879) (f7c5359) Message-ID: <20151022150909.834323A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f7c5359df283b15b416aef3317b3ae4362424f18/ghc >--------------------------------------------------------------- commit f7c5359df283b15b416aef3317b3ae4362424f18 Author: Thomas Miedema Date: Tue Sep 15 21:37:38 2015 +0200 Docs: make sure all libs are included in index.html (#10879) During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh gen_contents_index --intree' is run, which calls haddock to generate the haddock index at 'libraries/dist-haddock/index.html'. What it did before was check the ./packages file for all libraries. The problem is that 'base' and 'ghc-prim' were folded into the main repo some time ago, hence don't have an entry in the ./packages file anymore. As a result, 'base' and 'ghc-prim' were missing from the index.html file. It now simply runs haddock on all the all the `.haddock` files in the libraries directory. The only risk is that this could include the extra libraries in the index.html, if you ever built them in the past (with BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing this would be a little bit fiddly. Test Plan: 'make libraries/dist-haddock/index.html && grep -q base libraries/dist-haddock/index.html && echo ok' Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1247 >--------------------------------------------------------------- f7c5359df283b15b416aef3317b3ae4362424f18 libraries/gen_contents_index | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index index 34e51f3..a9e58b7 100644 --- a/libraries/gen_contents_index +++ b/libraries/gen_contents_index @@ -33,22 +33,10 @@ then cd dist-haddock HADDOCK=../../inplace/bin/haddock + HADDOCK_FILES=`find ../ -name *.haddock | sort` HADDOCK_ARGS="-p ../prologue.txt" - for REPO in `grep '^libraries/[^ ]* *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'` + for HADDOCK_FILE in $HADDOCK_FILES do - if [ -f "../$REPO/ghc-packages" ] - then - LIBS="`cat ../$REPO/ghc-packages`" - LIBROOT="../$REPO" - else - LIBS="$REPO" - LIBROOT=".." - fi - for LIB in $LIBS - do - HADDOCK_FILE="$LIBROOT/$LIB/dist-install/doc/html/$LIB/$LIB.haddock" - if [ -f "$HADDOCK_FILE" ] - then LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'` NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'` # It's easier to portably remove tabs with tr than to try to get @@ -56,8 +44,6 @@ then VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*://' | tr -d ' \t'` HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE" HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" - fi - done done else HADDOCK=../../../../../bin/haddock From git at git.haskell.org Thu Oct 22 15:09:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:13 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Generate .dyn_o files for .hsig files with -dynamic-too (80c2c52) Message-ID: <20151022150913.4E10C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/80c2c528438804b95cdcd794a62c3368c2cb959d/ghc >--------------------------------------------------------------- commit 80c2c528438804b95cdcd794a62c3368c2cb959d Author: Michael Smith Date: Thu Jul 23 11:41:16 2015 +0200 Generate .dyn_o files for .hsig files with -dynamic-too With -dynamic-too, .dyn_o files were not being generated for .hsig files. Normally, this is handled in the pipeline; however, the branch for .hsig files called compileEmptyStub directly instead of going through runPipeline. When compiling a Cabal package that included .hsig files, this triggered a linker error later on, as it expected a .dyn_o file to have been generated for each .hsig. The fix is to use runPipeline for .hsig files, just as with .hs files. Alternately, one could duplicate the logic for handling -dynamic-too in the .hsig branch, but simply calling runPipeline ends up being much cleaner. Test Plan: validate Reviewers: austin, ezyang, bgamari, thomie Reviewed By: ezyang, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1084 GHC Trac Issues: #10660 >--------------------------------------------------------------- 80c2c528438804b95cdcd794a62c3368c2cb959d compiler/main/DriverPipeline.hs | 13 ++++++++++++- .../tests/driver/dynamicToo/dynamicToo005/A005.hsig | 5 +++++ testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile | 16 ++++++++++++++++ testsuite/tests/driver/dynamicToo/dynamicToo005/test.T | 8 ++++++++ testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig | 5 +++++ testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs | 8 ++++++++ .../dynamicToo/{dynamicToo002 => dynamicToo006}/Makefile | 15 ++++++--------- testsuite/tests/driver/dynamicToo/dynamicToo006/test.T | 9 +++++++++ 8 files changed, 69 insertions(+), 10 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 623f356..3079d1f 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -252,7 +252,18 @@ compileOne' m_tc_result mHscMessage do (iface, changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash hscWriteIface dflags iface changed summary - compileEmptyStub dflags hsc_env basename location + + -- #10660: Use the pipeline instead of calling + -- compileEmptyStub directly, so -dynamic-too gets + -- handled properly + let mod_name = ms_mod_name summary + _ <- runPipeline StopLn hsc_env + (output_fn, + Just (HscOut src_flavour mod_name HscUpdateSig)) + (Just basename) + Persistent + (Just location) + Nothing -- Same as Hs o_time <- getModificationUTCTime object_filename diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig new file mode 100644 index 0000000..75d621c --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig @@ -0,0 +1,5 @@ + +module A005 where + +data Maybe a = Nothing | Just a + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile new file mode 100644 index 0000000..617510e --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile @@ -0,0 +1,16 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +checkExists = [ -f $1 ] || echo $1 missing + +.PHONY: dynamicToo005 +# Check that "-c -dynamic-too" works with .hsig +dynamicToo005: + "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ + -sig-of A005=base:Prelude \ + -c A005.hsig + $(call checkExists,A005.o) + $(call checkExists,A005.hi) + $(call checkExists,A005.dyn_o) + $(call checkExists,A005.dyn_hi) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T new file mode 100644 index 0000000..48460f5 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T @@ -0,0 +1,8 @@ + +test('dynamicToo005', + [extra_clean(['A005.o', 'A005.hi', 'A005.dyn_o', 'A005.dyn_hi']), + unless(have_vanilla(), skip), + unless(have_dynamic(), skip)], + run_command, + ['$MAKE -s --no-print-directory dynamicToo005']) + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig new file mode 100644 index 0000000..f79d5d3 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig @@ -0,0 +1,5 @@ + +module A where + +data Maybe a = Nothing | Just a + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs b/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs new file mode 100644 index 0000000..65900e7 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE NoImplicitPrelude #-} + +module B where + +import A + +b :: Maybe a +b = Nothing diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile similarity index 58% copy from testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile copy to testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile index 8705c87..497f2c0 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile @@ -4,20 +4,17 @@ include $(TOP)/mk/test.mk checkExists = [ -f $1 ] || echo $1 missing -.PHONY: dynamicToo002 -# Check that "--make -dynamic-too" works -dynamicToo002: - "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 --make C +.PHONY: dynamicToo006 +# Check that "--make -dynamic-too" works with .hsig +dynamicToo006: + "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ + -sig-of A=base:Prelude \ + --make B $(call checkExists,A.o) $(call checkExists,B.o) - $(call checkExists,C.o) $(call checkExists,A.hi) $(call checkExists,B.hi) - $(call checkExists,C.hi) $(call checkExists,A.dyn_o) $(call checkExists,B.dyn_o) - $(call checkExists,C.dyn_o) $(call checkExists,A.dyn_hi) $(call checkExists,B.dyn_hi) - $(call checkExists,C.dyn_hi) - diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T new file mode 100644 index 0000000..72e06ca --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T @@ -0,0 +1,9 @@ + +test('dynamicToo006', + [extra_clean(['A.o', 'A.hi', 'A.dyn_o', 'A.dyn_hi', + 'B.o', 'B.hi', 'B.dyn_o', 'B.dyn_hi']), + unless(have_vanilla(), skip), + unless(have_dynamic(), skip)], + run_command, + ['$MAKE -s --no-print-directory dynamicToo006']) + From git at git.haskell.org Thu Oct 22 15:09:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:16 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Mark T10689a as broken (135a671) Message-ID: <20151022150916.167923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/135a671789f2a63b693979a2fda7ce936d944b15/ghc >--------------------------------------------------------------- commit 135a671789f2a63b693979a2fda7ce936d944b15 Author: Ben Gamari Date: Tue Oct 20 08:00:41 2015 -0400 Mark T10689a as broken It needs a parser change from 8.0 which isn't present in 7.10 >--------------------------------------------------------------- 135a671789f2a63b693979a2fda7ce936d944b15 testsuite/tests/simplCore/should_compile/all.T | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 8e01799..58eb97b 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -213,4 +213,7 @@ test('T10176', only_ways(['optasm']), compile, ['']) test('T10602', only_ways(['optasm']), multimod_compile, ['T10602','-v0']) test('T10627', only_ways(['optasm']), compile, ['']) test('T10689', normal, compile, ['']) -test('T10689a', normal, compile, ['']) +# T10698a was introduced by 3772c67f56c05cd5130c793376a9e09d5cc0e78a for 7.10.3 +# which was backported 8.0 from but the testcase relies on a parser change that +# isn't present in 7.10.3 +test('T10689a', expect_broken(None), compile, ['']) From git at git.haskell.org Thu Oct 22 15:09:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:18 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Upgrade GCC to 5.2.0 for Windows x86 and x86_64 (ef25c04) Message-ID: <20151022150918.CB5D33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/ef25c045f97d740f6884ff221d981837d5c2aa5f/ghc >--------------------------------------------------------------- commit ef25c045f97d740f6884ff221d981837d5c2aa5f Author: Tamar Christina Date: Wed Aug 12 13:33:13 2015 +0200 Upgrade GCC to 5.2.0 for Windows x86 and x86_64 This patch does a few things - Moved GHC x86 to MinGW-w64 (Using Awson's patch) - Moves Both GHCs to MSYS2 toolchains - Completely removes the dependencies on the git tarball repo - Downloads only the required tarball for the architecture for which we are building - Downloads the perl tarball is missing as well - Fixed a few bugs in the linker to fix tests on Windows The links currently point to repo.msys2.org and GitHub, it might be more desirable to mirror them on http://downloads.haskell.org/~ghc/mingw/ as with the previous patch attempt. For more details on what the MSYS2 packages I include see #10726 (Awson's comment). but it should contain all we need and no python or fortran, which makes the uncompressed tar a 1-2 hundreds mb smaller. The `GCC 5.2.0` in the package supports `libgcc` as a shared library, this is a problem since when compiling with -shared the produced dll now has a dependency on `libgcc_s_sjlj-1.dll`. To solve this the flag `-static-libgcc` is now being used for all GCC calls on windows. Test Plan: ./validate was ran both on x86 and x86_64 windows and compared against the baseline. A few test were failing due to Ld no longer being noisy. These were updated. The changes to the configure script *should* be validated by the build bots for the other platforms before landing Reviewers: simonmar, awson, bgamari, austin, thomie Reviewed By: thomie Subscribers: #ghc_windows_task_force, thomie, awson Differential Revision: https://phabricator.haskell.org/D1123 GHC Trac Issues: #10726, #9014, #9218, #10435 >--------------------------------------------------------------- ef25c045f97d740f6884ff221d981837d5c2aa5f compiler/main/SysTools.hs | 28 +- configure.ac | 182 ++++--- driver/gcc/gcc.c | 10 +- rts/Linker.c | 574 +++++++++++---------- tarballs | 13 - testsuite/tests/driver/shared001.stderr | 1 - .../tests/ghci/linking/ghcilink002.stderr-mingw32 | 1 - .../tests/ghci/linking/ghcilink005.stderr-mingw32 | 1 - testsuite/tests/rts/T5435_dyn_asm.stderr-mingw32 | 1 - testsuite/tests/rts/T5435_dyn_gcc.stderr-mingw32 | 1 - 10 files changed, 452 insertions(+), 360 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 ef25c045f97d740f6884ff221d981837d5c2aa5f From git at git.haskell.org Thu Oct 22 15:09:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:21 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Update T10668 output (3e5ec3b) Message-ID: <20151022150921.8768F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3e5ec3b9673ee6ff01720d9b43e0fdfd6c997e0b/ghc >--------------------------------------------------------------- commit 3e5ec3b9673ee6ff01720d9b43e0fdfd6c997e0b Author: Ben Gamari Date: Tue Oct 20 09:52:13 2015 -0400 Update T10668 output >--------------------------------------------------------------- 3e5ec3b9673ee6ff01720d9b43e0fdfd6c997e0b testsuite/tests/rename/should_fail/T10668.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/rename/should_fail/T10668.stderr b/testsuite/tests/rename/should_fail/T10668.stderr index 8c96fad..89f9a94 100644 --- a/testsuite/tests/rename/should_fail/T10668.stderr +++ b/testsuite/tests/rename/should_fail/T10668.stderr @@ -1,5 +1,5 @@ -T10668.hs:3:27: error: +T10668.hs:3:27: In module ?Data.Type.Equality?: ?Refl? is a data constructor of ?(:~:)? To import it use From git at git.haskell.org Thu Oct 22 15:09:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:24 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make configure error out on missing ghc-tarballs on Windows (778bd43) Message-ID: <20151022150924.3B0D33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/778bd43fb36e47b5cf2593ddb597ab81ce6ac5ff/ghc >--------------------------------------------------------------- commit 778bd43fb36e47b5cf2593ddb597ab81ce6ac5ff Author: Tamar Christina Date: Thu Jul 30 10:36:45 2015 +0200 Make configure error out on missing ghc-tarballs on Windows Currently checking out the source on windows requires two git checkouts. One for the GHC sources and one for the GHC-tarballs. This patch will make configure issue an error if compiling under windows and the GHC-tarballs folder is missing. On failure the user is told which command they need to run to get the tarballs or if they want configure to handle it for them configure provide the `--enable-tarballs-autodownload` flag. Test Plan: 1. make sure ghc-tarballs folder is not present 2. run ./configure which should fail giving an error that tarballs is missing and how to get it 3. run ./configure --enable-tarballs-autodownload and the tarballs should be downloaded and configure finishes 4. rerun the command in 3, no new download should be done. 5. run configure without --enable-tarballs-autodownload, configure should finish correctly. Reviewers: bgamari, austin, thomie Reviewed By: thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1108 GHC Trac Issues: #10705 >--------------------------------------------------------------- 778bd43fb36e47b5cf2593ddb597ab81ce6ac5ff HACKING.md | 6 +++--- INSTALL.md | 5 +++++ README.md | 10 +++++----- configure.ac | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/HACKING.md b/HACKING.md index b59e747..6ed39ea 100644 --- a/HACKING.md +++ b/HACKING.md @@ -33,11 +33,11 @@ Next, clone the repository and all the associated libraries: $ git clone --recursive git://git.haskell.org/ghc.git ``` -On Windows, you need an extra repository containing some build tools: +On Windows, you need an extra repository containing some build tools. +These can be downloaded for you by configure. This only needs to be done once by running: ``` -$ cd ghc/ -$ git clone git://git.haskell.org/ghc-tarballs.git +$ ./configure --enable-tarballs-autodownload ``` First copy `mk/build.mk.sample` to `mk/build.mk` and ensure it has diff --git a/INSTALL.md b/INSTALL.md index 1db2595..58930af 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,6 +23,11 @@ Quick start: the following gives you a default build: $ make $ make install + On Windows, you need an extra repository containing some build tools. + These can be downloaded for you by configure. This only needs to be done once by running: + + $ ./configure --enable-tarballs-autodownload + The "perl boot" step is only necessary if this is a tree checked out from git. For source distributions downloaded from GHC's web site, this step has already been performed. diff --git a/README.md b/README.md index 5ad1adb..025140c 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,6 @@ There are two ways to get a source tree: $ git clone --recursive git://git.haskell.org/ghc.git - On Windows, you need an extra repository containing some build tools: - - $ cd ghc/ - $ git clone git://git.haskell.org/ghc-tarballs.git - Note: cloning GHC from Github requires a special setup. See [Getting a GHC repository from Github] [7]. @@ -66,6 +61,11 @@ dblatex. $ make # can also say 'make -jX' for X number of jobs $ make install + On Windows, you need an extra repository containing some build tools. + These can be downloaded for you by configure. This only needs to be done once by running: + + $ ./configure --enable-tarballs-autodownload + (NB: **Do you have multiple cores? Be sure to tell that to `make`!** This can save you hours of build time depending on your system configuration, and is almost always a win regardless of how many cores you have. As a simple rule, diff --git a/configure.ac b/configure.ac index 5e0ab79..23f89d9 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,12 @@ AC_ARG_ENABLE(bootstrap-with-devel-snapshot, EnableBootstrapWithDevelSnaphost=NO ) +AC_ARG_ENABLE(tarballs-autodownload, +[AC_HELP_STRING([--enable-tarballs-autodownload], + [Automatically download Windows distribution binaries if needed.])], + TarballsAutodownload=YES, + TarballsAutodownload=NO +) if test "$WithGhc" != ""; then FPTOOLS_GHC_VERSION([GhcVersion], [GhcMajVersion], [GhcMinVersion], [GhcPatchLevel])dnl @@ -267,12 +273,49 @@ AC_SUBST(WithHc) FP_INTREE_GHC_PWD FP_FIND_ROOT +function fail() { + echo >&2 + echo "$1" >&2 + exit 1 +} + +function set_up_tarballs() { + local tarball_repo_url="$1" + local tarball_dir="$2" + + if ! test -d "${tarball_dir}" + then + local git_cmd="git clone ${tarball_repo_url} ${tarball_dir}" + if test "$TarballsAutodownload" = "NO" + then + echo >&2 + echo "ERROR: Windows tarball binary distributions not found." >&2 + echo "Please rerun configure with --enable-tarballs-autodownload, or clone the repository manually:" >&2 + echo " $git_cmd" >&2 + exit 1 + fi + AC_MSG_NOTICE([Downloading Windows tarball distributions to ${tarball_dir}...]) + $git_cmd || { + rm -f "${tarball_dir}" + fail "ERROR: Git clone failed." + } + else + AC_MSG_NOTICE([Using Windows tarball distributions found in ${tarball_dir}...]) + fi +} + if test "$HostOS" = "mingw32" then test -d inplace || mkdir inplace + # NB. For now just run git clone on the tarball repo + ghc_tarball_repo='git://git.haskell.org/ghc-tarballs.git' + ghc_tarball_dir='ghc-tarballs' + set_up_tarballs "${ghc_tarball_repo}" "${ghc_tarball_dir}" + if test "$HostArch" = "i386" then + # NB. If you update the tarballs to a new version of gcc, don't # forget to tweak the paths in driver/gcc/gcc.c. if ! test -d inplace/mingw || From git at git.haskell.org Thu Oct 22 15:09:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:27 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Forbid annotations when Safe Haskell safe mode is enabled. (3f9f6f3) Message-ID: <20151022150927.AD4113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3f9f6f3fd2c0eac1d680d7c3c1e5f831e41af89c/ghc >--------------------------------------------------------------- commit 3f9f6f3fd2c0eac1d680d7c3c1e5f831e41af89c Author: David Kraeutmann Date: Tue Sep 8 11:35:33 2015 -0500 Forbid annotations when Safe Haskell safe mode is enabled. For now, this fails compliation immediately with an error. If desired, this can be a warning that annotations in Safe Haskell are ignored. Signed-off-by: David Kraeutmann Reviewed By: goldfire, austin Differential Revision: https://phabricator.haskell.org/D1226 GHC Trac Issues: #10826 >--------------------------------------------------------------- 3f9f6f3fd2c0eac1d680d7c3c1e5f831e41af89c compiler/typecheck/TcAnnotations.hs | 11 ++- docs/users_guide/7.10.3-notes.xml | 84 ++++++++++++++++++++++ docs/users_guide/safe_haskell.xml | 6 ++ testsuite/tests/annotations/should_fail/T10826.hs | 7 ++ .../tests/annotations/should_fail/T10826.stderr | 6 ++ testsuite/tests/annotations/should_fail/all.T | 2 +- 6 files changed, 114 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcAnnotations.hs b/compiler/typecheck/TcAnnotations.hs index 474630b..688a1e9 100644 --- a/compiler/typecheck/TcAnnotations.hs +++ b/compiler/typecheck/TcAnnotations.hs @@ -12,6 +12,8 @@ module TcAnnotations ( tcAnnotations, annCtxt ) where #ifdef GHCI import {-# SOURCE #-} TcSplice ( runAnnotation ) import Module +import DynFlags +import Control.Monad ( when ) #endif import HsSyn @@ -47,7 +49,14 @@ tcAnnotation (L loc ann@(HsAnnotation _ provenance expr)) = do let target = annProvenanceToTarget mod provenance -- Run that annotation and construct the full Annotation data structure - setSrcSpan loc $ addErrCtxt (annCtxt ann) $ runAnnotation target expr + setSrcSpan loc $ addErrCtxt (annCtxt ann) $ do + -- See #10826 -- Annotations allow one to bypass Safe Haskell. + dflags <- getDynFlags + when (safeLanguageOn dflags) $ failWithTc safeHsErr + runAnnotation target expr + where + safeHsErr = vcat [ ptext (sLit "Annotations are not compatible with Safe Haskell.") + , ptext (sLit "See https://ghc.haskell.org/trac/ghc/ticket/10826") ] annProvenanceToTarget :: Module -> AnnProvenance Name -> AnnTarget Name annProvenanceToTarget _ (ValueAnnProvenance (L _ name)) = NamedTarget name diff --git a/docs/users_guide/7.10.3-notes.xml b/docs/users_guide/7.10.3-notes.xml new file mode 100644 index 0000000..d75eb33 --- /dev/null +++ b/docs/users_guide/7.10.3-notes.xml @@ -0,0 +1,84 @@ + + + Release notes for version 7.10.3 + + + The 7.10.3 release is a bugfix release, with over 70+ bug fixes + relative to 7.10.1. The major fixes are listed below. For the full + list with more detail, see the GHC 7.10.3 + milestone on our bug tracker. + + + + GHC + + + + + Due to a + security issue + , Safe Haskell now forbids annotations in programs marked as + -XSafe + + + + + + + + Libraries + + + base + + + + Version number 4.8.1.0 (was 4.8.0.0) + + + + + The Lifetime datatype (and its + constructors) are now exported from + GHC.Event. + + + + + + + binary + + + + Version number 0.7.5.0 (was 0.7.3.0) + + + + + + + Cabal + + + + Version number 1.22.4.0 (was 1.22.2.0). + + + + + + + ghc + + + + + + + Known bugs + + + + diff --git a/docs/users_guide/safe_haskell.xml b/docs/users_guide/safe_haskell.xml index 634482a..16f2bbd 100644 --- a/docs/users_guide/safe_haskell.xml +++ b/docs/users_guide/safe_haskell.xml @@ -776,6 +776,12 @@ Wiki. + + Additionally, the use of annotations + is forbidden, as that would allow bypassing Safe Haskell restrictions. + See ticket #10826. + + diff --git a/testsuite/tests/annotations/should_fail/T10826.hs b/testsuite/tests/annotations/should_fail/T10826.hs new file mode 100644 index 0000000..cddf33c --- /dev/null +++ b/testsuite/tests/annotations/should_fail/T10826.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE Safe #-} +module Test (hook) where + +import System.IO.Unsafe + +{-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-} +hook = undefined diff --git a/testsuite/tests/annotations/should_fail/T10826.stderr b/testsuite/tests/annotations/should_fail/T10826.stderr new file mode 100644 index 0000000..0e2bed5 --- /dev/null +++ b/testsuite/tests/annotations/should_fail/T10826.stderr @@ -0,0 +1,6 @@ + +T10826.hs:6:1: error: + Annotations are not compatible with Safe Haskell. + See https://ghc.haskell.org/trac/ghc/ticket/10826 + In the annotation: + {-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-} diff --git a/testsuite/tests/annotations/should_fail/all.T b/testsuite/tests/annotations/should_fail/all.T index 21eaa76..0b10d83 100644 --- a/testsuite/tests/annotations/should_fail/all.T +++ b/testsuite/tests/annotations/should_fail/all.T @@ -18,7 +18,7 @@ test('annfail10', req_interp, compile_fail, ['']) test('annfail11', normal, compile_fail, ['']) test('annfail12', req_interp, compile_fail, ['-v0']) test('annfail13', normal, compile_fail, ['']) - +test('T10826', normal, compile_fail, ['']) """" Helpful things to C+P: From git at git.haskell.org Thu Oct 22 15:09:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:30 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Build system: remove function keyword from configure.ac (#10705) (77eba27) Message-ID: <20151022150930.67BB13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/77eba27ffa146fba0f0e303d42447d26c3e9eb83/ghc >--------------------------------------------------------------- commit 77eba27ffa146fba0f0e303d42447d26c3e9eb83 Author: Thomas Miedema Date: Fri Jul 31 12:45:44 2015 +0200 Build system: remove function keyword from configure.ac (#10705) This fixes the FreeBSD build. >--------------------------------------------------------------- 77eba27ffa146fba0f0e303d42447d26c3e9eb83 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 23f89d9..7d9bc9c 100644 --- a/configure.ac +++ b/configure.ac @@ -273,13 +273,13 @@ AC_SUBST(WithHc) FP_INTREE_GHC_PWD FP_FIND_ROOT -function fail() { +fail() { echo >&2 echo "$1" >&2 exit 1 } -function set_up_tarballs() { +set_up_tarballs() { local tarball_repo_url="$1" local tarball_dir="$2" From git at git.haskell.org Thu Oct 22 15:09:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:33 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Use a response file for linker command line arguments #10777 (58584c2) Message-ID: <20151022150933.122083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/58584c2ef7d3bf9d8453d48946a28c10e52552d0/ghc >--------------------------------------------------------------- commit 58584c2ef7d3bf9d8453d48946a28c10e52552d0 Author: Michael Snoyman Date: Wed Sep 2 13:31:25 2015 +0200 Use a response file for linker command line arguments #10777 On Windows, we're constrained to 32k bytes total for command line arguments. When building large projects, this limit can be exceeded. This patch changes GHC to always use response files for linker arguments, a feature first used by Microsoft compilers and added to GCC (over a decade ago). Alternatives here include: * Only use this method on Windows systems * Check the length of the command line arguments and use that to decide whether to use this method I did not pursue either of these, as I believe it would make the patch more likely to break in less tested situations. Test Plan: Confirm that linking still works in general. Ideally: compile a very large project on Windows with this patch. (I am attempting to do that myself now, but having trouble getting the Windows build tool chain up and running.) Reviewers: goldfire, hvr, rwbarton, austin, thomie, bgamari, Phyx Reviewed By: thomie, bgamari, Phyx Subscribers: erikd, awson, #ghc_windows_task_force, thomie Differential Revision: https://phabricator.haskell.org/D1158 GHC Trac Issues: #8596, #10777 >--------------------------------------------------------------- 58584c2ef7d3bf9d8453d48946a28c10e52552d0 compiler/main/SysTools.hs | 56 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 811b930..f84974b 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -407,7 +407,7 @@ runCc dflags args = do args1 = map Option (getOpts dflags opt_c) args2 = args0 ++ args1 ++ args mb_env <- getGccEnv args2 - runSomethingFiltered dflags cc_filter "C Compiler" p args2 mb_env + runSomethingResponseFile dflags cc_filter "C Compiler" p args2 mb_env where -- discard some harmless warnings from gcc that we can't turn off cc_filter = unlines . doFilter . lines @@ -895,7 +895,7 @@ runLink dflags args = do args1 = map Option (getOpts dflags opt_l) args2 = args0 ++ linkargs ++ args1 ++ args mb_env <- getGccEnv args2 - runSomethingFiltered dflags ld_filter "Linker" p args2 mb_env + runSomethingResponseFile dflags ld_filter "Linker" p args2 mb_env where ld_filter = case (platformOS (targetPlatform dflags)) of OSSolaris2 -> sunos_ld_filter @@ -1223,6 +1223,58 @@ runSomething :: DynFlags runSomething dflags phase_name pgm args = runSomethingFiltered dflags id phase_name pgm args Nothing +-- | Run a command, placing the arguments in an external response file. +-- +-- This command is used in order to avoid overlong command line arguments on +-- Windows. The command line arguments are first written to an external, +-- temporary response file, and then passed to the linker via @filepath. +-- response files for passing them in. See: +-- +-- https://gcc.gnu.org/wiki/Response_Files +-- https://ghc.haskell.org/trac/ghc/ticket/10777 +runSomethingResponseFile + :: DynFlags -> (String->String) -> String -> String -> [Option] + -> Maybe [(String,String)] -> IO () + +runSomethingResponseFile dflags filter_fn phase_name pgm args mb_env = + runSomethingWith dflags phase_name pgm args $ \real_args -> do + fp <- getResponseFile real_args + let args = ['@':fp] + r <- builderMainLoop dflags filter_fn pgm args mb_env + return (r,()) + where + getResponseFile args = do + fp <- newTempName dflags "rsp" + withFile fp WriteMode $ \h -> do + hSetEncoding h utf8 + hPutStr h $ unlines $ map escape args + return fp + + -- Note: Response files have backslash-escaping, double quoting, and are + -- whitespace separated (some implementations use newline, others any + -- whitespace character). Therefore, escape any backslashes, newlines, and + -- double quotes in the argument, and surround the content with double + -- quotes. + -- + -- Another possibility that could be considered would be to convert + -- backslashes in the argument to forward slashes. This would generally do + -- the right thing, since backslashes in general only appear in arguments + -- as part of file paths on Windows, and the forward slash is accepted for + -- those. However, escaping is more reliable, in case somehow a backslash + -- appears in a non-file. + escape x = concat + [ "\"" + , concatMap + (\c -> + case c of + '\\' -> "\\\\" + '\n' -> "\\n" + '\"' -> "\\\"" + _ -> [c]) + x + , "\"" + ] + runSomethingFiltered :: DynFlags -> (String->String) -> String -> String -> [Option] -> Maybe [(String,String)] -> IO () From git at git.haskell.org Thu Oct 22 15:09:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:36 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Ensure DynFlags are consistent (28101c7) Message-ID: <20151022150936.F3E1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/28101c7d2422e2fdbb4c2542afe07feb4024d0b6/ghc >--------------------------------------------------------------- commit 28101c7d2422e2fdbb4c2542afe07feb4024d0b6 Author: Ben Gamari Date: Thu Aug 6 17:25:46 2015 +0200 Ensure DynFlags are consistent While we have always had makeDynFlagsConsistent to enforce a variety of consistency invariants on DynFlags, it hasn't been widely used. GHC.Main, for instance, ignored it entirely. This leads to issues like Trac #10549, where an OPTIONS_GHC pragma introduced an inconsistency, leading to a perplexing crash later in compilation. Here I add consistency checks in GHC.Main.set{Session,Program}DynFlags, closing this hole. Fixes #10549. Test Plan: Validate with T10549 Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1128 GHC Trac Issues: #10549 Cherry-Picked-From: eca9a1a17c12d01636417fb88bda5ee5fe34577f >--------------------------------------------------------------- 28101c7d2422e2fdbb4c2542afe07feb4024d0b6 compiler/main/DynFlags.hs | 36 ++++++++++++++++++++-- compiler/main/GHC.hs | 27 +++------------- testsuite/tests/ghc-api/T10052/T10052.stderr | 2 +- .../tests/ghci.debugger/scripts/print007.stderr | 5 +-- .../should_compile => ghci/should_fail}/Makefile | 0 testsuite/tests/ghci/should_fail/T10549.hs | 15 +++++++++ testsuite/tests/ghci/should_fail/T10549.script | 1 + .../should_fail/T10549.stderr} | 2 +- testsuite/tests/ghci/should_fail/all.T | 3 ++ 9 files changed, 61 insertions(+), 30 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 28101c7d2422e2fdbb4c2542afe07feb4024d0b6 From git at git.haskell.org Thu Oct 22 15:09:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:39 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Add pprRuleName (48b6a62) Message-ID: <20151022150939.D53EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/48b6a62a9cdee4c0455fcf19d7d7a5bc9aad76be/ghc >--------------------------------------------------------------- commit 48b6a62a9cdee4c0455fcf19d7d7a5bc9aad76be Author: Ben Gamari Date: Thu Sep 24 01:17:27 2015 +0200 Add pprRuleName >--------------------------------------------------------------- 48b6a62a9cdee4c0455fcf19d7d7a5bc9aad76be compiler/basicTypes/BasicTypes.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index ee34b21..cf1c6d1 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -37,7 +37,7 @@ module BasicTypes( RecFlag(..), isRec, isNonRec, boolToRecFlag, Origin(..), isGenerated, - RuleName, + RuleName, pprRuleName, TopLevelFlag(..), isTopLevel, isNotTopLevel, @@ -283,6 +283,9 @@ instance Outputable WarningTxt where type RuleName = FastString +pprRuleName :: RuleName -> SDoc +pprRuleName rn = doubleQuotes (ftext rn) + {- ************************************************************************ * * From git at git.haskell.org Thu Oct 22 15:09:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:42 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Update test T10826 (e3ef7b1) Message-ID: <20151022150942.86AF73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/e3ef7b1d204f83eaf42aa78e409e9405bd8ad883/ghc >--------------------------------------------------------------- commit e3ef7b1d204f83eaf42aa78e409e9405bd8ad883 Author: Ben Gamari Date: Mon Oct 19 21:24:22 2015 -0400 Update test T10826 >--------------------------------------------------------------- e3ef7b1d204f83eaf42aa78e409e9405bd8ad883 testsuite/tests/annotations/should_fail/T10826.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/annotations/should_fail/T10826.stderr b/testsuite/tests/annotations/should_fail/T10826.stderr index 0e2bed5..541ae4c 100644 --- a/testsuite/tests/annotations/should_fail/T10826.stderr +++ b/testsuite/tests/annotations/should_fail/T10826.stderr @@ -1,5 +1,5 @@ -T10826.hs:6:1: error: +T10826.hs:6:1: Annotations are not compatible with Safe Haskell. See https://ghc.haskell.org/trac/ghc/ticket/10826 In the annotation: From git at git.haskell.org Thu Oct 22 15:09:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:45 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Ensure shiftL/shiftR arguments aren't negative (b29ad80) Message-ID: <20151022150945.3C9753A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/b29ad804074c2a27f0781448f817c9671a93dd77/ghc >--------------------------------------------------------------- commit b29ad804074c2a27f0781448f817c9671a93dd77 Author: Ben Gamari Date: Tue Oct 6 19:30:50 2015 +0200 Ensure shiftL/shiftR arguments aren't negative Fixes #10571. >--------------------------------------------------------------- b29ad804074c2a27f0781448f817c9671a93dd77 libraries/base/Data/Bits.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs index 84b1c03..38025f8 100644 --- a/libraries/base/Data/Bits.hs +++ b/libraries/base/Data/Bits.hs @@ -515,8 +515,12 @@ instance Bits Integer where complement = complementInteger shift x i@(I# i#) | i >= 0 = shiftLInteger x i# | otherwise = shiftRInteger x (negateInt# i#) - shiftL x (I# i#) = shiftLInteger x i# - shiftR x (I# i#) = shiftRInteger x i# + shiftL x i@(I# i#) + | i < 0 = error "Bits.shiftL(Integer): negative shift" + | otherwise = shiftLInteger x i# + shiftR x i@(I# i#) + | i < 0 = error "Bits.shiftR(Integer): negative shift" + | otherwise = shiftRInteger x i# testBit x (I# i) = testBitInteger x i From git at git.haskell.org Thu Oct 22 15:09:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:09:47 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix tests (f05a75c) Message-ID: <20151022150947.F2A453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f05a75c0831ce9a5dd92c595fececb78c2de4977/ghc >--------------------------------------------------------------- commit f05a75c0831ce9a5dd92c595fececb78c2de4977 Author: Ben Gamari Date: Tue Oct 20 14:05:45 2015 -0400 Fix tests >--------------------------------------------------------------- f05a75c0831ce9a5dd92c595fececb78c2de4977 testsuite/tests/typecheck/should_fail/T10285.stderr | 7 ++----- testsuite/tests/typecheck/should_fail/T7525.stderr | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr index e9bb56e..47cfbec 100644 --- a/testsuite/tests/typecheck/should_fail/T10285.stderr +++ b/testsuite/tests/typecheck/should_fail/T10285.stderr @@ -1,10 +1,7 @@ T10285.hs:8:17: - Could not deduce: (Coercible a b) - arising from trying to show that the representations of - ?a? and - ?b? are the same - from the context: (Coercible (N a) (N b)) + Could not deduce (a ~ b) + from the context (Coercible (N a) (N b)) bound by a pattern with constructor Coercion :: forall (k :: BOX) (a :: k) (b :: k). Coercible a b => diff --git a/testsuite/tests/typecheck/should_fail/T7525.stderr b/testsuite/tests/typecheck/should_fail/T7525.stderr index e80e3dc..ecf3eb1 100644 --- a/testsuite/tests/typecheck/should_fail/T7525.stderr +++ b/testsuite/tests/typecheck/should_fail/T7525.stderr @@ -1,8 +1,8 @@ T7525.hs:5:30: - Could not deduce: (?b::Bool) + Could not deduce (?b::Bool) arising from a use of implicit parameter ??b? - from the context: (?a::Bool) + from the context (?a::Bool) bound by the implicit-parameter binding for ?a at T7525.hs:5:7-31 In the second argument of ?(&&)?, namely ??b? In the expression: ?a && ?b From git at git.haskell.org Thu Oct 22 15:32:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:32:52 +0000 (UTC) Subject: [commit: ghc] master: Suggest chmod 755 instead of 644 (0ae6a43) Message-ID: <20151022153252.8D18E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0ae6a43ebccca65c3a6b6172e0513802d303e84e/ghc >--------------------------------------------------------------- commit 0ae6a43ebccca65c3a6b6172e0513802d303e84e Author: Ben Gamari Date: Thu Oct 22 17:35:18 2015 +0200 Suggest chmod 755 instead of 644 Previous suggestion would clear executable bit, meaning directory couldn't be entered. Fixes #11003. Test Plan: Read message. Reviewers: austin, thomie, dfeuer Reviewed By: thomie, dfeuer Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1350 GHC Trac Issues: #11003 >--------------------------------------------------------------- 0ae6a43ebccca65c3a6b6172e0513802d303e84e ghc/InteractiveUI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index f3d2035..736b8a9 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -630,7 +630,7 @@ checkPerms file = -- #8248: Improving warning to include a possible fix. putStrLn $ "*** WARNING: " ++ file ++ " is writable by someone else, IGNORING!" ++ - "\nSuggested fix: execute 'chmod 644 " ++ file ++ "'" + "\nSuggested fix: execute 'chmod go-w " ++ file ++ "'" return ok #endif From git at git.haskell.org Thu Oct 22 15:34:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 15:34:27 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Suggest chmod 755 instead of 644 (70c2b17) Message-ID: <20151022153427.EAC623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/70c2b176079c63ba5040220c9b59c25029ef8b79/ghc >--------------------------------------------------------------- commit 70c2b176079c63ba5040220c9b59c25029ef8b79 Author: Ben Gamari Date: Thu Oct 22 17:35:18 2015 +0200 Suggest chmod 755 instead of 644 Previous suggestion would clear executable bit, meaning directory couldn't be entered. Fixes #11003. Test Plan: Read message. Reviewers: austin, thomie, dfeuer Reviewed By: thomie, dfeuer Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1350 GHC Trac Issues: #11003 >--------------------------------------------------------------- 70c2b176079c63ba5040220c9b59c25029ef8b79 ghc/InteractiveUI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 27343e9..ec82e3d 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -614,7 +614,7 @@ checkPerms name = -- #8248: Improving warning to include a possible fix. putStrLn $ "*** WARNING: " ++ name ++ " is writable by someone else, IGNORING!" ++ - "\nSuggested fix: execute 'chmod 644 " ++ name ++ "'" + "\nSuggested fix: execute 'chmod go-w " ++ file ++ "'" return ok #endif From git at git.haskell.org Thu Oct 22 16:33:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 16:33:46 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: InteractiveUI: Fix previous commit (6563052) Message-ID: <20151022163346.613653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/65630525db41e31cc309a59c363aca0869a63760/ghc >--------------------------------------------------------------- commit 65630525db41e31cc309a59c363aca0869a63760 Author: Ben Gamari Date: Thu Oct 22 18:04:36 2015 +0200 InteractiveUI: Fix previous commit Some day I'll learn to validate before pushing. >--------------------------------------------------------------- 65630525db41e31cc309a59c363aca0869a63760 ghc/InteractiveUI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index ec82e3d..4b50b01 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -614,7 +614,7 @@ checkPerms name = -- #8248: Improving warning to include a possible fix. putStrLn $ "*** WARNING: " ++ name ++ " is writable by someone else, IGNORING!" ++ - "\nSuggested fix: execute 'chmod go-w " ++ file ++ "'" + "\nSuggested fix: execute 'chmod go-w " ++ name ++ "'" return ok #endif From git at git.haskell.org Thu Oct 22 19:47:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 19:47:32 +0000 (UTC) Subject: [commit: ghc] master: Quote GHC path in configure so we can deal with multiple spaces. (fa7d582) Message-ID: <20151022194732.54BB63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa7d582e0d5a79a4811946759b922881c6c9db9f/ghc >--------------------------------------------------------------- commit fa7d582e0d5a79a4811946759b922881c6c9db9f Author: Edward Z. Yang Date: Thu Oct 22 00:01:41 2015 -0700 Quote GHC path in configure so we can deal with multiple spaces. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- fa7d582e0d5a79a4811946759b922881c6c9db9f aclocal.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 2282b99..2bf27be 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1393,7 +1393,7 @@ AC_DEFUN([FP_PROG_GHC_PKG], # so we sed off -stage[0-9]$. However, if we are told to use # ghc-6.12.1 then we want to use ghc-pkg-6.12.1, so we keep any # other suffix. -fp_ghc_pkg_guess=`echo $WithGhc | sed -e 's/-stage@<:@0-9@:>@$//' -e 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'` +fp_ghc_pkg_guess=`echo "$WithGhc" | sed -e 's/-stage@<:@0-9@:>@$//' -e 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'` if "$fp_ghc_pkg_guess" list > /dev/null 2>&1; then fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess else From git at git.haskell.org Thu Oct 22 20:08:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 22 Oct 2015 20:08:06 +0000 (UTC) Subject: [commit: ghc] master: Quote GHC_PKG in Makefile. (8f5ad1a) Message-ID: <20151022200806.097673A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8f5ad1a009eddd05447ff8057792b4d03983cd35/ghc >--------------------------------------------------------------- commit 8f5ad1a009eddd05447ff8057792b4d03983cd35 Author: Edward Z. Yang Date: Thu Oct 22 13:10:43 2015 -0700 Quote GHC_PKG in Makefile. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 8f5ad1a009eddd05447ff8057792b4d03983cd35 ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc.mk b/ghc.mk index 47926c4..611d817 100644 --- a/ghc.mk +++ b/ghc.mk @@ -739,7 +739,7 @@ ifneq "$(BINDIST)" "YES" ifneq "$(BOOTSTRAPPING_CONF)" "" ifeq "$(wildcard $(BOOTSTRAPPING_CONF))" "" -$(shell $(GHC_PKG) init $(BOOTSTRAPPING_CONF)) +$(shell "$(GHC_PKG)" init $(BOOTSTRAPPING_CONF)) endif endif From git at git.haskell.org Fri Oct 23 02:54:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 Oct 2015 02:54:30 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: rts/StgCRun.c: Add d15 to clobbered regs (5e218e8) Message-ID: <20151023025430.A7D343A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/5e218e881b2457bf291de1498914fe70a9b50c90/ghc >--------------------------------------------------------------- commit 5e218e881b2457bf291de1498914fe70a9b50c90 Author: Erik de Castro Lopo Date: Tue Oct 13 09:45:39 2015 +1100 rts/StgCRun.c: Add d15 to clobbered regs >--------------------------------------------------------------- 5e218e881b2457bf291de1498914fe70a9b50c90 rts/StgCRun.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rts/StgCRun.c b/rts/StgCRun.c index b9a9496..7039537 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -832,7 +832,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", "%x26", "%x27", "%x28", /* Exclude %x29 (frame pointer) */ "%x30", - "%d8", "%d9", "%d10", "%d11", "%d12", "%d13", "%d14" + "%d8", "%d9", "%d10", "%d11", "%d12", "%d13", "%d14", "%d15" + /* Since all these registers listed as clobbered are being explicitly + * saved and restored, they should probably not be listed as + * clobbered. Leaving them as is for now while I debug other + * issues. + */ ); return r; } From git at git.haskell.org Fri Oct 23 02:54:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 Oct 2015 02:54:33 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: rts: Fix clobbered regs list for aarch64 StgRun (0db7ac3) Message-ID: <20151023025433.589EB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/0db7ac3efc15237b10e1ae72d6c97056fea74092/ghc >--------------------------------------------------------------- commit 0db7ac3efc15237b10e1ae72d6c97056fea74092 Author: Erik de Castro Lopo Date: Wed Jun 3 05:54:23 2015 +0000 rts: Fix clobbered regs list for aarch64 StgRun >--------------------------------------------------------------- 0db7ac3efc15237b10e1ae72d6c97056fea74092 rts/StgCRun.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rts/StgCRun.c b/rts/StgCRun.c index 6448509..b9a9496 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -827,8 +827,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { : "=r" (r) : "r" (f), "r" (basereg), "i" (RESERVED_C_STACK_BYTES) - : "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", "%x26", "%x27", "%x28", - "%x16", "%x17", "%x30" + + : "%x16", "%x17", /* Exclude %r18 (platform/temporary register) */ + "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", + "%x26", "%x27", "%x28", /* Exclude %x29 (frame pointer) */ + "%x30", + "%d8", "%d9", "%d10", "%d11", "%d12", "%d13", "%d14" ); return r; } From git at git.haskell.org Fri Oct 23 02:54:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 23 Oct 2015 02:54:36 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: Implement AArch64 codegen in `mkJumpToAddr` (for GHCi). (96ad129) Message-ID: <20151023025436.0EDCD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/96ad129c90dc0ef524e3edd2c31959c9763dc21e/ghc >--------------------------------------------------------------- commit 96ad129c90dc0ef524e3edd2c31959c9763dc21e Author: Erik de Castro Lopo Date: Mon Oct 12 15:17:30 2015 +1100 Implement AArch64 codegen in `mkJumpToAddr` (for GHCi). >--------------------------------------------------------------- 96ad129c90dc0ef524e3edd2c31959c9763dc21e compiler/ghci/ByteCodeItbls.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/compiler/ghci/ByteCodeItbls.hs b/compiler/ghci/ByteCodeItbls.hs index a01fcd8..a97c79a 100644 --- a/compiler/ghci/ByteCodeItbls.hs +++ b/compiler/ghci/ByteCodeItbls.hs @@ -232,6 +232,23 @@ mkJumpToAddr dflags a = case platformArch (targetPlatform dflags) of , 0x11, 0xff, 0x2f, 0xe1 , byte0 w32, byte1 w32, byte2 w32, byte3 w32] + ArchARM64 { } -> + -- Generates: + -- + -- ldr x1, label + -- br x1 + -- label: + -- .quad + -- + -- which looks like: + -- 0: 58000041 ldr x1, + + + The GiveGCStats, + DoCostCentres, DoHeapProfile, + DoTrace, Time, and Nat + datatypes are now exported from + GHC.RTS.Flags. + From git at git.haskell.org Mon Oct 26 17:00:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 17:00:30 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Handle platforms with renamed "readelf" (f7cb40b) Message-ID: <20151026170030.3C05F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f7cb40bbca319677e508b768ec8fe92deee9dc90/ghc >--------------------------------------------------------------- commit f7cb40bbca319677e508b768ec8fe92deee9dc90 Author: Mykola Orliuk Date: Mon Oct 26 16:12:21 2015 +0100 Handle platforms with renamed "readelf" - Add `-pgmreadelf` option - Auto configure path and name of "readelf" - Add settings `readelf command` - During build of GHC name of tool can be changed with `./configure --with-readelf=myreadelf` Test Plan: ``` make -C testsuite/tests/driver/recomp011 ``` Reviewers: austin, bgamari Subscribers: erikd, thomie Differential Revision: https://phabricator.haskell.org/D1335 GHC Trac Issues: #10974 >--------------------------------------------------------------- f7cb40bbca319677e508b768ec8fe92deee9dc90 aclocal.m4 | 19 +++++++++++++++++++ compiler/main/DynFlags.hs | 7 ++++++- compiler/main/SysTools.hs | 6 ++++-- configure.ac | 5 +++++ distrib/configure.ac.in | 5 +++++ docs/users_guide/flags.xml | 7 +++++++ docs/users_guide/phases.xml | 11 +++++++++++ settings.in | 1 + 8 files changed, 58 insertions(+), 3 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d19a66e..6ca3986 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -472,6 +472,7 @@ AC_DEFUN([FP_SETTINGS], SettingsDllWrapCommand="/bin/false" SettingsWindresCommand="/bin/false" SettingsLibtoolCommand="libtool" + SettingsReadElfCommand="$ReadElfCmd" SettingsTouchCommand='touch' fi if test -z "$LlcCmd" @@ -501,6 +502,7 @@ AC_DEFUN([FP_SETTINGS], AC_SUBST(SettingsDllWrapCommand) AC_SUBST(SettingsWindresCommand) AC_SUBST(SettingsLibtoolCommand) + AC_SUBST(SettingsReadElfCommand) AC_SUBST(SettingsTouchCommand) AC_SUBST(SettingsLlcCommand) AC_SUBST(SettingsOptCommand) @@ -2203,6 +2205,23 @@ AC_DEFUN([FIND_GCC],[ AC_SUBST($1) ]) +# FIND_READELF() +# -------------------------------- +# Finds which `readelf` to use. This is used in both in the top level +# `configure.ac` and in `distrib/configure.ac.in` +# +# $1 = the variable to set +# +AC_DEFUN([FIND_READELF],[ + if test "$HostOS" != "mingw32"; then + FP_ARG_WITH_PATH_GNU_PROG([READELF], [readelf], [readelf]) + if test -z "$READELF"; then + AC_MSG_ERROR([cannot identify readelf tool]) + fi + $1="$READELF" + fi +]) + AC_DEFUN([MAYBE_OVERRIDE_STAGE0],[ if test ! -z "$With_$1" -a "$CrossCompiling" != "YES"; then AC_MSG_NOTICE([Not cross-compiling, so --with-$1 also sets $2]) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 78370cf..42ac14e 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -71,7 +71,7 @@ module DynFlags ( versionedAppDir, extraGccViaCFlags, systemPackageConfig, pgm_L, pgm_P, pgm_F, pgm_c, pgm_s, pgm_a, pgm_l, pgm_dll, pgm_T, - pgm_sysman, pgm_windres, pgm_libtool, pgm_lo, pgm_lc, + pgm_sysman, pgm_windres, pgm_libtool, pgm_readelf, pgm_lo, pgm_lc, opt_L, opt_P, opt_F, opt_c, opt_a, opt_l, opt_windres, opt_lo, opt_lc, @@ -935,6 +935,7 @@ data Settings = Settings { sPgm_sysman :: String, sPgm_windres :: String, sPgm_libtool :: String, + sPgm_readelf :: String, sPgm_lo :: (String,[Option]), -- LLVM: opt llvm optimiser sPgm_lc :: (String,[Option]), -- LLVM: llc static compiler -- options for particular phases @@ -995,6 +996,8 @@ pgm_windres :: DynFlags -> String pgm_windres dflags = sPgm_windres (settings dflags) pgm_libtool :: DynFlags -> String pgm_libtool dflags = sPgm_libtool (settings dflags) +pgm_readelf :: DynFlags -> String +pgm_readelf dflags = sPgm_readelf (settings dflags) pgm_lo :: DynFlags -> (String,[Option]) pgm_lo dflags = sPgm_lo (settings dflags) pgm_lc :: DynFlags -> (String,[Option]) @@ -2308,6 +2311,8 @@ dynamic_flags = [ (hasArg (\f -> alterSettings (\s -> s { sPgm_windres = f}))) , defFlag "pgmlibtool" (hasArg (\f -> alterSettings (\s -> s { sPgm_libtool = f}))) + , defFlag "pgmreadelf" + (hasArg (\f -> alterSettings (\s -> s { sPgm_readelf = f}))) -- need to appear before -optl/-opta to be parsed as LLVM flags. , defFlag "optlo" diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index b3a540b..8c3ab1a 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -275,6 +275,7 @@ initSysTools mbMinusB windres_path <- getSetting "windres command" libtool_path <- getSetting "libtool command" + readelf_path <- getSetting "readelf command" tmpdir <- getTemporaryDirectory @@ -346,6 +347,7 @@ initSysTools mbMinusB sPgm_sysman = top_dir ++ "/ghc/rts/parallel/SysMan", sPgm_windres = windres_path, sPgm_libtool = libtool_path, + sPgm_readelf = readelf_path, sPgm_lo = (lo_prog,[]), sPgm_lc = (lc_prog,[]), -- Hans: this isn't right in general, but you can @@ -1048,9 +1050,9 @@ copyWithHeader dflags purpose maybe_header from to = do -- | read the contents of the named section in an ELF object as a -- String. readElfSection :: DynFlags -> String -> FilePath -> IO (Maybe String) -readElfSection _dflags section exe = do +readElfSection dflags section exe = do let - prog = "readelf" + prog = pgm_readelf dflags args = [Option "-p", Option section, FileOption "" exe] -- r <- readProcessEnvWithExitCode prog (filter notNull (map showOpt args)) diff --git a/configure.ac b/configure.ac index b41a810..5b94d07 100644 --- a/configure.ac +++ b/configure.ac @@ -532,6 +532,11 @@ FP_ARG_WITH_PATH_GNU_PROG([RANLIB], [ranlib], [ranlib]) RanlibCmd="$RANLIB" RANLIB="$RanlibCmd" +dnl ** Which readelf to use? +dnl -------------------------------------------------------------- +FIND_READELF([ReadElfCmd]) +AC_SUBST([ReadElfCmd]) + # Note: we may not have objdump on OS X, and we only need it on Windows (for DLL checks) case $HostOS_CPP in diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 0fcd869..f1abd91 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -139,6 +139,11 @@ dnl ** how to invoke `ar' and `ranlib' FP_PROG_AR_SUPPORTS_ATFILE FP_PROG_AR_NEEDS_RANLIB +dnl ** Which readelf to use? +dnl -------------------------------------------------------------- +FIND_READELF([ReadElfCmd]) +AC_SUBST([ReadElfCmd]) + FP_SETTINGS # diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index f019854..b4a76ff 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -2780,6 +2780,13 @@ dynamic - + + cmd + Use cmd as the command for readelf + (part of Unix binutils) + dynamic + - + diff --git a/docs/users_guide/phases.xml b/docs/users_guide/phases.xml index 8994ffe..3b7403b 100644 --- a/docs/users_guide/phases.xml +++ b/docs/users_guide/phases.xml @@ -148,6 +148,17 @@ (when using only). + + + + cmd + + + + Use cmd as the readelf command + (part of Unix binutils). + + diff --git a/settings.in b/settings.in index e8cdad3..5f54fd9 100644 --- a/settings.in +++ b/settings.in @@ -17,6 +17,7 @@ ("dllwrap command", "@SettingsDllWrapCommand@"), ("windres command", "@SettingsWindresCommand@"), ("libtool command", "@SettingsLibtoolCommand@"), + ("readelf command", "@SettingsReadElfCommand@"), ("perl command", "@SettingsPerlCommand@"), ("cross compiling", "@CrossCompiling@"), ("target os", "@HaskellTargetOs@"), From git at git.haskell.org Mon Oct 26 17:00:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 17:00:32 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: configure.ac: Bump to 7.10.3 (8c90071) Message-ID: <20151026170032.D7B8F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/8c90071bfe39ee23653bba6daa042faddd4ecb06/ghc >--------------------------------------------------------------- commit 8c90071bfe39ee23653bba6daa042faddd4ecb06 Author: Ben Gamari Date: Mon Oct 26 16:37:31 2015 +0100 configure.ac: Bump to 7.10.3 >--------------------------------------------------------------- 8c90071bfe39ee23653bba6daa042faddd4ecb06 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5b94d07..8a6ecdc 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.2], [glasgow-haskell-bugs at haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.3], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO : ${RELEASE=NO} From git at git.haskell.org Mon Oct 26 17:00:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 17:00:35 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: base: Update version number (8d0e0a1) Message-ID: <20151026170035.796343A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/8d0e0a1d0dc0fcf724a03bd6340a6e3b0fbf0b50/ghc >--------------------------------------------------------------- commit 8d0e0a1d0dc0fcf724a03bd6340a6e3b0fbf0b50 Author: Ben Gamari Date: Mon Oct 26 16:40:42 2015 +0100 base: Update version number >--------------------------------------------------------------- 8d0e0a1d0dc0fcf724a03bd6340a6e3b0fbf0b50 libraries/base/base.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal index fd1c3d8..372404f 100644 --- a/libraries/base/base.cabal +++ b/libraries/base/base.cabal @@ -1,5 +1,5 @@ name: base -version: 4.8.1.0 +version: 4.8.2.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Mon Oct 26 17:00:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 17:00:38 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: More release notes (dd04271) Message-ID: <20151026170038.389C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/dd042713e26c9b58882aa70592d1ba572400d1b9/ghc >--------------------------------------------------------------- commit dd042713e26c9b58882aa70592d1ba572400d1b9 Author: Ben Gamari Date: Mon Oct 26 16:40:50 2015 +0100 More release notes >--------------------------------------------------------------- dd042713e26c9b58882aa70592d1ba572400d1b9 docs/users_guide/7.10.3-notes.xml | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/docs/users_guide/7.10.3-notes.xml b/docs/users_guide/7.10.3-notes.xml index 3afc49d..98235c5 100644 --- a/docs/users_guide/7.10.3-notes.xml +++ b/docs/users_guide/7.10.3-notes.xml @@ -4,7 +4,7 @@ The 7.10.3 release is a bugfix release, with over 70+ bug fixes - relative to 7.10.1. The major fixes are listed below. For the full + relative to 7.10.2. The major fixes are listed below. For the full list with more detail, see the GHC 7.10.3 milestone on our bug tracker. @@ -133,18 +133,11 @@ - Version number 4.8.1.0 (was 4.8.0.0) + Version number 4.8.2.0 (was 4.8.1.0) - The Lifetime datatype (and its - constructors) are now exported from - GHC.Event. - - - - The GiveGCStats, DoCostCentres, DoHeapProfile, DoTrace, Time, and Nat @@ -154,34 +147,6 @@ - - - binary - - - - Version number 0.7.5.0 (was 0.7.3.0) - - - - - - - Cabal - - - - Version number 1.22.4.0 (was 1.22.2.0). - - - - - - - ghc - - - From git at git.haskell.org Mon Oct 26 18:09:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 18:09:34 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix 7.10.3 release notes (f52dd04) Message-ID: <20151026180934.416C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f52dd047210cb7e104cfbab809f9787865056b46/ghc >--------------------------------------------------------------- commit f52dd047210cb7e104cfbab809f9787865056b46 Author: Ben Gamari Date: Mon Oct 26 18:34:12 2015 +0100 Fix 7.10.3 release notes >--------------------------------------------------------------- f52dd047210cb7e104cfbab809f9787865056b46 docs/users_guide/7.10.3-notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/7.10.3-notes.xml b/docs/users_guide/7.10.3-notes.xml index 98235c5..e17d96a 100644 --- a/docs/users_guide/7.10.3-notes.xml +++ b/docs/users_guide/7.10.3-notes.xml @@ -3,7 +3,7 @@ Release notes for version 7.10.3 - The 7.10.3 release is a bugfix release, with over 70+ bug fixes + The 7.10.3 release is a bugfix release, with over fifty bug fixes relative to 7.10.2. The major fixes are listed below. For the full list with more detail, see the GHC 7.10.3 From git at git.haskell.org Mon Oct 26 18:09:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 18:09:36 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: base: Add Haddocks to GHC.RTS.Flags (3d42460) Message-ID: <20151026180936.D09E33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3d42460745e8e4835b0ea74f46133a978650e0e1/ghc >--------------------------------------------------------------- commit 3d42460745e8e4835b0ea74f46133a978650e0e1 Author: Ben Gamari Date: Mon Oct 26 19:10:50 2015 +0100 base: Add Haddocks to GHC.RTS.Flags >--------------------------------------------------------------- 3d42460745e8e4835b0ea74f46133a978650e0e1 libraries/base/GHC/RTS/Flags.hsc | 49 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index d2afcab..62e720f 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -54,11 +54,19 @@ import GHC.Show import GHC.Word -- | @'Time'@ is defined as a @'StgWord64'@ in @stg/Types.h@ +-- +-- @since 4.8.2.0 type RtsTime = Word64 -- | @'nat'@ defined in @rts/Types.h@ +-- +-- @since 4.8.2.0 type RtsNat = #{type unsigned int} +-- | Should we produce a summary of the garbage collector statistics after the +-- program has exited? +-- +-- @since 4.8.2.0 data GiveGCStats = NoGCStats | CollectGCStats @@ -81,6 +89,9 @@ instance Enum GiveGCStats where toEnum #{const VERBOSE_GC_STATS} = VerboseGCStats toEnum e = error ("invalid enum for GiveGCStats: " ++ show e) +-- | Parameters of the garbage collector. +-- +-- @since 4.8.0.0 data GCFlags = GCFlags { statsFile :: Maybe FilePath , giveStats :: GiveGCStats @@ -110,11 +121,17 @@ data GCFlags = GCFlags , allocLimitGrace :: Word } deriving (Show) +-- | Parameters concerning context switching +-- +-- @since 4.8.0.0 data ConcFlags = ConcFlags { ctxtSwitchTime :: RtsTime , ctxtSwitchTicks :: Int } deriving (Show) +-- | Miscellaneous parameters +-- +-- @since 4.8.0.0 data MiscFlags = MiscFlags { tickInterval :: RtsTime , installSignalHandlers :: Bool @@ -125,6 +142,8 @@ data MiscFlags = MiscFlags -- | Flags to control debugging output & extra checking in various -- subsystems. +-- +-- @since 4.8.0.0 data DebugFlags = DebugFlags { scheduler :: Bool -- ^ 's' , interpreter :: Bool -- ^ 'i' @@ -143,6 +162,9 @@ data DebugFlags = DebugFlags , sparks :: Bool -- ^ 'r' } deriving (Show) +-- | Should the RTS produce a cost-center summary? +-- +-- @since 4.8.2.0 data DoCostCentres = CostCentresNone | CostCentresSummary @@ -165,12 +187,18 @@ instance Enum DoCostCentres where toEnum #{const COST_CENTRES_XML} = CostCentresXML toEnum e = error ("invalid enum for DoCostCentres: " ++ show e) +-- | Parameters pertaining to the cost-center profiler. +-- +-- @since 4.8.0.0 data CCFlags = CCFlags { doCostCentres :: DoCostCentres , profilerTicks :: Int , msecsPerTick :: Int } deriving (Show) +-- | What sort of heap profile are we collecting? +-- +-- @since 4.8.2.0 data DoHeapProfile = NoHeapProfiling | HeapByCCS @@ -202,6 +230,9 @@ instance Enum DoHeapProfile where toEnum #{const HEAP_BY_CLOSURE_TYPE} = HeapByClosureType toEnum e = error ("invalid enum for DoHeapProfile: " ++ show e) +-- | Parameters of the cost-center profiler +-- +-- @since 4.8.0.0 data ProfFlags = ProfFlags { doHeapProfile :: DoHeapProfile , heapProfileInterval :: RtsTime -- ^ time between samples @@ -219,10 +250,13 @@ data ProfFlags = ProfFlags , bioSelector :: Maybe String } deriving (Show) +-- | Is event tracing enabled? +-- +-- @since 4.8.2.0 data DoTrace - = TraceNone - | TraceEventLog - | TraceStderr + = TraceNone -- ^ no tracing + | TraceEventLog -- ^ send tracing events to the event log + | TraceStderr -- ^ send tracing events to @stderr@ deriving (Show) instance Enum DoTrace where @@ -235,6 +269,9 @@ instance Enum DoTrace where toEnum #{const TRACE_STDERR} = TraceStderr toEnum e = error ("invalid enum for DoTrace: " ++ show e) +-- | Parameters pertaining to event tracing +-- +-- @since 4.8.0.0 data TraceFlags = TraceFlags { tracing :: DoTrace , timestamp :: Bool -- ^ show timestamp in stderr output @@ -245,11 +282,17 @@ data TraceFlags = TraceFlags , user :: Bool -- ^ trace user events (emitted from Haskell code) } deriving (Show) +-- | Parameters pertaining to ticky-ticky profiler +-- +-- @since 4.8.0.0 data TickyFlags = TickyFlags { showTickyStats :: Bool , tickyFile :: Maybe FilePath } deriving (Show) +-- | Parameters of the runtime system +-- +-- @since 4.8.0.0 data RTSFlags = RTSFlags { gcFlags :: GCFlags , concurrentFlags :: ConcFlags From git at git.haskell.org Mon Oct 26 18:11:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 18:11:37 +0000 (UTC) Subject: [commit: ghc] master: base: Add Haddocks to GHC.RTS.Flags (0b79aa1) Message-ID: <20151026181137.426EA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0b79aa171ee067c4792fff6b6ac73851d7cf030d/ghc >--------------------------------------------------------------- commit 0b79aa171ee067c4792fff6b6ac73851d7cf030d Author: Ben Gamari Date: Mon Oct 26 19:10:50 2015 +0100 base: Add Haddocks to GHC.RTS.Flags >--------------------------------------------------------------- 0b79aa171ee067c4792fff6b6ac73851d7cf030d libraries/base/GHC/RTS/Flags.hsc | 49 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index d2afcab..62e720f 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -54,11 +54,19 @@ import GHC.Show import GHC.Word -- | @'Time'@ is defined as a @'StgWord64'@ in @stg/Types.h@ +-- +-- @since 4.8.2.0 type RtsTime = Word64 -- | @'nat'@ defined in @rts/Types.h@ +-- +-- @since 4.8.2.0 type RtsNat = #{type unsigned int} +-- | Should we produce a summary of the garbage collector statistics after the +-- program has exited? +-- +-- @since 4.8.2.0 data GiveGCStats = NoGCStats | CollectGCStats @@ -81,6 +89,9 @@ instance Enum GiveGCStats where toEnum #{const VERBOSE_GC_STATS} = VerboseGCStats toEnum e = error ("invalid enum for GiveGCStats: " ++ show e) +-- | Parameters of the garbage collector. +-- +-- @since 4.8.0.0 data GCFlags = GCFlags { statsFile :: Maybe FilePath , giveStats :: GiveGCStats @@ -110,11 +121,17 @@ data GCFlags = GCFlags , allocLimitGrace :: Word } deriving (Show) +-- | Parameters concerning context switching +-- +-- @since 4.8.0.0 data ConcFlags = ConcFlags { ctxtSwitchTime :: RtsTime , ctxtSwitchTicks :: Int } deriving (Show) +-- | Miscellaneous parameters +-- +-- @since 4.8.0.0 data MiscFlags = MiscFlags { tickInterval :: RtsTime , installSignalHandlers :: Bool @@ -125,6 +142,8 @@ data MiscFlags = MiscFlags -- | Flags to control debugging output & extra checking in various -- subsystems. +-- +-- @since 4.8.0.0 data DebugFlags = DebugFlags { scheduler :: Bool -- ^ 's' , interpreter :: Bool -- ^ 'i' @@ -143,6 +162,9 @@ data DebugFlags = DebugFlags , sparks :: Bool -- ^ 'r' } deriving (Show) +-- | Should the RTS produce a cost-center summary? +-- +-- @since 4.8.2.0 data DoCostCentres = CostCentresNone | CostCentresSummary @@ -165,12 +187,18 @@ instance Enum DoCostCentres where toEnum #{const COST_CENTRES_XML} = CostCentresXML toEnum e = error ("invalid enum for DoCostCentres: " ++ show e) +-- | Parameters pertaining to the cost-center profiler. +-- +-- @since 4.8.0.0 data CCFlags = CCFlags { doCostCentres :: DoCostCentres , profilerTicks :: Int , msecsPerTick :: Int } deriving (Show) +-- | What sort of heap profile are we collecting? +-- +-- @since 4.8.2.0 data DoHeapProfile = NoHeapProfiling | HeapByCCS @@ -202,6 +230,9 @@ instance Enum DoHeapProfile where toEnum #{const HEAP_BY_CLOSURE_TYPE} = HeapByClosureType toEnum e = error ("invalid enum for DoHeapProfile: " ++ show e) +-- | Parameters of the cost-center profiler +-- +-- @since 4.8.0.0 data ProfFlags = ProfFlags { doHeapProfile :: DoHeapProfile , heapProfileInterval :: RtsTime -- ^ time between samples @@ -219,10 +250,13 @@ data ProfFlags = ProfFlags , bioSelector :: Maybe String } deriving (Show) +-- | Is event tracing enabled? +-- +-- @since 4.8.2.0 data DoTrace - = TraceNone - | TraceEventLog - | TraceStderr + = TraceNone -- ^ no tracing + | TraceEventLog -- ^ send tracing events to the event log + | TraceStderr -- ^ send tracing events to @stderr@ deriving (Show) instance Enum DoTrace where @@ -235,6 +269,9 @@ instance Enum DoTrace where toEnum #{const TRACE_STDERR} = TraceStderr toEnum e = error ("invalid enum for DoTrace: " ++ show e) +-- | Parameters pertaining to event tracing +-- +-- @since 4.8.0.0 data TraceFlags = TraceFlags { tracing :: DoTrace , timestamp :: Bool -- ^ show timestamp in stderr output @@ -245,11 +282,17 @@ data TraceFlags = TraceFlags , user :: Bool -- ^ trace user events (emitted from Haskell code) } deriving (Show) +-- | Parameters pertaining to ticky-ticky profiler +-- +-- @since 4.8.0.0 data TickyFlags = TickyFlags { showTickyStats :: Bool , tickyFile :: Maybe FilePath } deriving (Show) +-- | Parameters of the runtime system +-- +-- @since 4.8.0.0 data RTSFlags = RTSFlags { gcFlags :: GCFlags , concurrentFlags :: ConcFlags From git at git.haskell.org Mon Oct 26 20:40:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 20:40:27 +0000 (UTC) Subject: [commit: ghc] master: Fix a typo in the User's Guide ReST intro (73c273a) Message-ID: <20151026204027.AF9163A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/73c273af193f56ea339d423e79d803bea5f45db5/ghc >--------------------------------------------------------------- commit 73c273af193f56ea339d423e79d803bea5f45db5 Author: Bartosz Nitka Date: Mon Oct 26 20:42:18 2015 +0100 Fix a typo in the User's Guide ReST intro Test Plan: harbormaster Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1374 >--------------------------------------------------------------- 73c273af193f56ea339d423e79d803bea5f45db5 docs/users_guide/editing-guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/editing-guide.rst b/docs/users_guide/editing-guide.rst index 7e973ce..64db781 100644 --- a/docs/users_guide/editing-guide.rst +++ b/docs/users_guide/editing-guide.rst @@ -106,7 +106,7 @@ on this convention in the User's Guide, ~~~~~~~~~~~~~~ Header level 4 - ^^^^^^^^^^^^^^^ + ^^^^^^^^^^^^^^ Formatting code From git at git.haskell.org Mon Oct 26 20:40:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 20:40:30 +0000 (UTC) Subject: [commit: ghc] master: Remove cygwin32_HOST_OS #ifdefs (23e344b) Message-ID: <20151026204030.5A8D23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/23e344bbbd27418bb84bdc588374b3e44f6d23a6/ghc >--------------------------------------------------------------- commit 23e344bbbd27418bb84bdc588374b3e44f6d23a6 Author: Erik de Castro Lopo Date: Mon Oct 26 20:42:30 2015 +0100 Remove cygwin32_HOST_OS #ifdefs Build system support for Cygwin was removed in b6be81b841. Test Plan: - Validate on x86_64/linux - Cross-compile rts/RtsSymbols.c and rts/Linker.c to Windows using the i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc cross compilers. Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1371 >--------------------------------------------------------------- 23e344bbbd27418bb84bdc588374b3e44f6d23a6 libraries/base/System/CPUTime.hsc | 4 +- rts/Linker.c | 18 +------- rts/RtsMessages.c | 14 +++--- rts/RtsSymbols.c | 90 +-------------------------------------- rts/Trace.c | 2 +- testsuite/tests/rts/T5435.hs | 2 +- testsuite/tests/rts/T5435_asm.c | 2 +- 7 files changed, 14 insertions(+), 118 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 23e344bbbd27418bb84bdc588374b3e44f6d23a6 From git at git.haskell.org Mon Oct 26 20:40:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 20:40:33 +0000 (UTC) Subject: [commit: ghc] master: Implement MIN_VERSION and VERSION macros natively in GHC. (a9c93bd) Message-ID: <20151026204033.DE8A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a9c93bdd8b027d6de09a3eada7721e7fd2d3e050/ghc >--------------------------------------------------------------- commit a9c93bdd8b027d6de09a3eada7721e7fd2d3e050 Author: Edward Z. Yang Date: Mon Oct 26 20:48:36 2015 +0100 Implement MIN_VERSION and VERSION macros natively in GHC. Test Plan: validate Reviewers: austin, thomie, bgamari Reviewed By: thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1349 GHC Trac Issues: #10970 >--------------------------------------------------------------- a9c93bdd8b027d6de09a3eada7721e7fd2d3e050 compiler/main/DriverPipeline.hs | 45 +++++++++++++++++++++++++++++++++++ compiler/main/Packages.hs | 11 ++++++++- docs/users_guide/phases.rst | 16 +++++++++++++ testsuite/.gitignore | 3 ++- testsuite/tests/driver/T10970.hs | 6 +++++ testsuite/tests/driver/T10970.stdout | 2 ++ testsuite/tests/driver/T10970a.hs | 6 +++++ testsuite/tests/driver/T10970a.stderr | 6 +++++ testsuite/tests/driver/all.T | 3 +++ 9 files changed, 96 insertions(+), 2 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 a9c93bdd8b027d6de09a3eada7721e7fd2d3e050 From git at git.haskell.org Mon Oct 26 20:40:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 26 Oct 2015 20:40:36 +0000 (UTC) Subject: [commit: ghc] master: Add flag to reverse errors in GHC/GHCi (499ce29) Message-ID: <20151026204036.860633A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/499ce291b6bab252c63f0791276c38012280f0b4/ghc >--------------------------------------------------------------- commit 499ce291b6bab252c63f0791276c38012280f0b4 Author: Siddhanathan Shanmugam Date: Mon Oct 26 20:42:43 2015 +0100 Add flag to reverse errors in GHC/GHCi Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1367 GHC Trac Issues: #10848 >--------------------------------------------------------------- 499ce291b6bab252c63f0791276c38012280f0b4 compiler/main/DynFlags.hs | 13 +++++++++++-- compiler/main/ErrUtils.hs | 15 +++++++++++---- utils/mkUserGuidePart/Options/Misc.hs | 7 +++++++ 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 4385865..4af16cf 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -897,7 +897,10 @@ data DynFlags = DynFlags { -- | Only inline memset if it generates no more than this many -- pseudo (roughly: Cmm) instructions. - maxInlineMemsetInsns :: Int + maxInlineMemsetInsns :: Int, + + -- | Reverse the order of error messages in GHC/GHCi + reverseErrors :: Bool } class HasDynFlags m where @@ -1558,7 +1561,9 @@ defaultDynFlags mySettings = maxInlineAllocSize = 128, maxInlineMemcpyInsns = 32, - maxInlineMemsetInsns = 32 + maxInlineMemsetInsns = 32, + + reverseErrors = False } defaultWays :: Settings -> [Way] @@ -2397,6 +2402,10 @@ dynamic_flags = [ deprecate "Use -fno-force-recomp instead")) , defGhcFlag "no-recomp" (NoArg (do setGeneralFlag Opt_ForceRecomp deprecate "Use -fforce-recomp instead")) + , defGhcFlag "freverse-errors" + (noArg (\d -> d {reverseErrors = True} )) + , defGhcFlag "fno-reverse-errors" + (noArg (\d -> d {reverseErrors = False} )) ------ HsCpp opts --------------------------------------------------- , defFlag "D" (AnySuffix (upd . addOptP)) diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs index fd10694..11c8c9d 100644 --- a/compiler/main/ErrUtils.hs +++ b/compiler/main/ErrUtils.hs @@ -54,6 +54,7 @@ import System.FilePath ( takeDirectory, () ) import Data.List import qualified Data.Set as Set import Data.IORef +import Data.Maybe ( fromMaybe ) import Data.Ord import Data.Time import Control.Monad @@ -198,10 +199,12 @@ printBagOfErrors dflags bag_of_errors errMsgShortDoc = d, errMsgSeverity = sev, errMsgExtraInfo = e, - errMsgContext = unqual } <- sortMsgBag bag_of_errors ] + errMsgContext = unqual } <- sortMsgBag (Just dflags) + bag_of_errors + ] pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc] -pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag bag ] +pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag Nothing bag ] pprLocErrMsg :: ErrMsg -> SDoc pprLocErrMsg (ErrMsg { errMsgSpan = s @@ -213,8 +216,12 @@ pprLocErrMsg (ErrMsg { errMsgSpan = s withPprStyle (mkErrStyle dflags unqual) $ mkLocMessage sev s (d $$ e) -sortMsgBag :: Bag ErrMsg -> [ErrMsg] -sortMsgBag bag = sortBy (comparing errMsgSpan) $ bagToList bag +sortMsgBag :: Maybe DynFlags -> Bag ErrMsg -> [ErrMsg] +sortMsgBag dflags = sortBy (maybeFlip $ comparing errMsgSpan) . bagToList + where maybeFlip :: (a -> a -> b) -> (a -> a -> b) + maybeFlip + | fromMaybe False (fmap reverseErrors dflags) = flip + | otherwise = id ghcExit :: DynFlags -> Int -> IO () ghcExit dflags val diff --git a/utils/mkUserGuidePart/Options/Misc.hs b/utils/mkUserGuidePart/Options/Misc.hs index d6a4c4e..141a9ca 100644 --- a/utils/mkUserGuidePart/Options/Misc.hs +++ b/utils/mkUserGuidePart/Options/Misc.hs @@ -29,4 +29,11 @@ miscOptions = "the main thread, rather than a forked thread." , flagType = DynamicFlag } + , flag { flagName = "-freverse-errors" + , flagDescription = + "Display errors in GHC/GHCi sorted by reverse order of "++ + "source code line numbers." + , flagType = DynamicFlag + , flagReverse = "-fno-reverse-errors" + } ] From git at git.haskell.org Tue Oct 27 08:15:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 08:15:24 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: More wibbles (0a30502) Message-ID: <20151027081524.D1C423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/0a30502db2fd0dd93f43c15fb02e3179baebeee2/ghc >--------------------------------------------------------------- commit 0a30502db2fd0dd93f43c15fb02e3179baebeee2 Author: Simon Peyton Jones Date: Tue Oct 27 00:17:43 2015 +0000 More wibbles >--------------------------------------------------------------- 0a30502db2fd0dd93f43c15fb02e3179baebeee2 compiler/typecheck/TcBinds.hs | 12 ++++++++---- compiler/typecheck/TcExpr.hs | 31 +++++++++++++------------------ compiler/typecheck/TcPat.hs | 6 +++--- compiler/typecheck/TcRnTypes.hs | 2 ++ compiler/typecheck/TcTyClsDecls.hs | 4 +++- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 04d995f..6a592fc 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -796,9 +796,10 @@ chooseInferredQuantifiers inferred_theta tau_tvs ; partial_sigs <- xoptM Opt_PartialTypeSignatures ; warn_partial_sigs <- woptM Opt_WarnPartialTypeSignatures ; msg <- mkLongErrAt loc (mk_msg inferred_diff partial_sigs) empty - ; traceTc "completeTheta" (vcat - [ ppr bndr_info - , ppr annotated_theta, ppr inferred_theta, ppr inferred_diff ]) + ; traceTc "completeTheta" $ + vcat [ ppr bndr_info + , ppr annotated_theta, ppr inferred_theta + , ppr inferred_diff ] ; case partial_sigs of True | warn_partial_sigs -> reportWarning msg | otherwise -> return () @@ -1800,7 +1801,10 @@ decideGeneralisationPlan dflags type_env bndr_names lbinds sig_fn | strict_pat_binds = NoGen | Just (lbind, sig) <- one_funbind_with_sig = if isPartialSig sig -- See Note [Partial type signatures and generalisation] - then infer_plan + -- We use InferGen False to say "do inference, but do not apply + -- the MR". It's stupid to apply the MR when we are given a + -- signature! C.f Trac #11016, function f1 + then InferGen False else CheckGen lbind sig | mono_local_binds = NoGen | otherwise = infer_plan diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 50ad827..2f02862 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1060,9 +1060,19 @@ tcExprSig expr sig@(TISI { sig_bndr = s_bndr ; tau <- zonkTcType tau ; let inferred_theta = map evVarPred givens tau_tvs = tyVarsOfType tau - ; (_, theta) <- chooseInferredQuantifiers inferred_theta tau_tvs (Just sig) - ; let poly_wrap = mkWpTyLams qtvs - <.> mkWpLams givens -- Not right + ; (my_tv_set, my_theta) <- chooseInferredQuantifiers inferred_theta tau_tvs (Just sig) + ; let my_tvs = filter (`elemVarSet` my_tv_set) qtvs -- Maintain original order + inferred_sigma = mkSigmaTy qtvs inferred_theta tau + my_sigma = mkSigmaTy my_tvs my_theta tau + ; wrap <- if inferred_sigma `eqType` my_sigma + then return idHsWrapper -- Fast path; also avoids complaint when we infer + -- an ambiguouse type and have AllowAmbiguousType + -- e..g infer x :: forall a. F a -> Int + else tcSubType_NC ExprSigCtxt inferred_sigma my_sigma + + ; let poly_wrap = wrap + <.> mkWpTyLams qtvs + <.> mkWpLams givens <.> mkWpLet ev_binds ; return (mkLHsWrap poly_wrap expr', mkSigmaTy qtvs theta tau) } @@ -1070,21 +1080,6 @@ tcExprSig expr sig@(TISI { sig_bndr = s_bndr where skol_info = SigSkol ExprSigCtxt (mkPhiTy theta tau) skol_tvs = map snd skol_prs -{- - ; ev_binds <- emitImplicationFor tclvl skol_info - skol_tvs given wanted - -- NB: don't use checkConsraints here, because that - -- doesn't bump the level if skol_tvs is empty - -- But we must also bump the level if there are - -- any wildcards. Easier to do so unconditionally. - - - = do { (tclvl, wanted, expr') <- pushLevelAndCaptureConstraints $ - tcExtendTyVarEnvFromSig sig $ - tcPolyExprNC expr tau - ; (qtvs, givens, _mr_bites, ev_binds) - <- simplifyInfer tclvl False skol_tvs [(name,tau)] wanted --} {- ********************************************************************* * * diff --git a/compiler/typecheck/TcPat.hs b/compiler/typecheck/TcPat.hs index b0b528d..cb424b1 100644 --- a/compiler/typecheck/TcPat.hs +++ b/compiler/typecheck/TcPat.hs @@ -699,10 +699,10 @@ tcPatSynPat penv (L con_span _) pat_syn pat_ty arg_pats thing_inside ; checkExistentials ex_tvs penv ; (tenv, ex_tvs') <- tcInstSuperSkolTyVarsX subst ex_tvs - ; let ty' = substTy tenv ty - arg_tys' = substTys tenv arg_tys + ; let ty' = substTy tenv ty + arg_tys' = substTys tenv arg_tys prov_theta' = substTheta tenv prov_theta - req_theta' = substTheta tenv req_theta + req_theta' = substTheta tenv req_theta ; wrap <- coToHsWrapper <$> unifyType ty' pat_ty ; traceTc "tcPatSynPat" (ppr pat_syn $$ diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 5ee1f87..257ac5a 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1200,6 +1200,8 @@ instance Outputable TcIdSigInfo where , ppr (map fst tyvars) ] instance Outputable TcIdSigBndr where + ppr (CompleteSig f) = ptext (sLit "CompleteSig") <+> ppr f + ppr (PartialSig { sig_name = n }) = ptext (sLit "PartialSig") <+> ppr n instance Outputable TcPatSynInfo where ppr (TPSI{ patsig_name = name}) = ppr name diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index e09e894..65914e4 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -1299,7 +1299,9 @@ tcConDecl new_or_data rep_tycon tmpl_tvs res_tmpl -- Data types -- See Note [Checking GADT return types] ; fam_envs <- tcGetFamInstEnvs - ; traceTc "tcConDecl 2" (ppr names $$ ppr arg_tys $$ ppr univ_tvs $$ ppr ex_tvs $$ ppr field_lbls) + + -- Can't print univ_tvs, arg_tys etc, because we are inside the knot here + ; traceTc "tcConDecl 2" (ppr names $$ ppr field_lbls) ; let buildOneDataCon (L _ name) = do { is_infix <- tcConIsInfix name hs_details res_ty From git at git.haskell.org Tue Oct 27 08:16:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 08:16:14 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben2: A bunch of fixes (1e72227) Message-ID: <20151027081614.B95A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben2 Link : http://ghc.haskell.org/trac/ghc/changeset/1e72227843417995110d411531aecc7e2668248c/ghc >--------------------------------------------------------------- commit 1e72227843417995110d411531aecc7e2668248c Author: Simon Peyton Jones Date: Mon Oct 26 17:50:17 2015 +0000 A bunch of fixes These fixes apply to the "do Typeable stuff at definition sites" branch. >--------------------------------------------------------------- 1e72227843417995110d411531aecc7e2668248c compiler/coreSyn/MkCore.hs | 8 +-- compiler/deSugar/DsBinds.hs | 48 +++++++------- compiler/deSugar/DsExpr.hs | 14 ++-- compiler/deSugar/DsUtils.hs | 14 ++-- compiler/prelude/PrelNames.hs | 41 +++++++----- compiler/prelude/THNames.hs | 105 ++++++++++++++++++----------- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcEnv.hs | 3 +- compiler/typecheck/TcEvidence.hs | 36 +++++----- compiler/typecheck/TcHsSyn.hs | 5 +- compiler/typecheck/TcInteract.hs | 110 +++++++++++++++++-------------- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable/Internal.hs | 40 +++++++---- 13 files changed, 246 insertions(+), 186 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 1e72227843417995110d411531aecc7e2668248c From git at git.haskell.org Tue Oct 27 12:26:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 12:26:00 +0000 (UTC) Subject: [commit: ghc] master: Build system: comments only [skip ci] (c10c01c) Message-ID: <20151027122600.0A5133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c10c01cdd59c5068efcb480c4cc8fb50f354e0b1/ghc >--------------------------------------------------------------- commit c10c01cdd59c5068efcb480c4cc8fb50f354e0b1 Author: Thomas Miedema Date: Mon Oct 26 09:29:12 2015 +0100 Build system: comments only [skip ci] >--------------------------------------------------------------- c10c01cdd59c5068efcb480c4cc8fb50f354e0b1 rules/build-package-way.mk | 19 ++++++++++--------- rules/build-prog.mk | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 2dc43ff..a10e538 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -89,16 +89,17 @@ $$($1_$2_$3_LIB0) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS $$(call build-dll,$1,$2,$3,,$$($1_$2_dll0_HS_OBJS) $$($1_$2_$3_NON_HS_OBJS),$$($1_$2_$3_LIB0)) endif -else - +else # ifneq "$$(HostOS_CPP)" "mingw32" $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \ -shared -dynamic -dynload deploy \ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \ -no-auto-link-packages \ -o $$@ -endif -else +endif # "$$(HostOS_CPP)" "mingw32" + +else # ifneq "$3" "dyn" + # Build the ordinary .a library $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(call removeFiles,$$@ $$@.contents) @@ -123,7 +124,7 @@ $$($1_$2_$3_LIB0) : endif endif -endif +endif # "$3" "dyn" $(call all-target,$1_$2,all_$1_$2_$3) $(call all-target,$1_$2_$3,$$($1_$2_$3_LIB)) @@ -155,12 +156,12 @@ ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES" ifneq "$4" "0" $(call all-target,$1_$2,$$($1_$2_GHCI_LIB)) endif -endif -endif -endif +endif # "$$($1_$2_BUILD_GHCI_LIB)" "YES" +endif # "$3" "v" +endif # "$$(DYNAMIC_GHC_PROGRAMS)" "YES" $(call profEnd, build-package-way($1,$2,$3)) -endef +endef # build-package-way # $1 = dir # $2 = distdir diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 2a2049b..1a49707 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -283,7 +283,7 @@ $$($1_$2_INPLACE) : $1/$2/build/tmp/$$($1_$2_PROG_INPLACE) | $$$$(dir $$$$@)/. $$(INSTALL) -m 755 $$< $$@ endif -endif # BINDIST=YES +endif # BINDIST ifneq "$$($1_$2_INSTALL_INPLACE)" "NO" $(call all-target,$1_$2,$$($1_$2_INPLACE)) From git at git.haskell.org Tue Oct 27 13:25:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 13:25:17 +0000 (UTC) Subject: [commit: ghc] master: Add regression tests for #10045, #10999 (f86fb5e) Message-ID: <20151027132517.77ACE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f86fb5e5a0694ea57cace824bbc0dce06bdf0698/ghc >--------------------------------------------------------------- commit f86fb5e5a0694ea57cace824bbc0dce06bdf0698 Author: Simon Peyton Jones Date: Thu Oct 22 16:04:39 2015 +0100 Add regression tests for #10045, #10999 >--------------------------------------------------------------- f86fb5e5a0694ea57cace824bbc0dce06bdf0698 testsuite/tests/partial-sigs/should_fail/T10045.hs | 8 ++++++++ .../tests/partial-sigs/should_fail/T10045.stderr | 24 ++++++++++++++++++++++ testsuite/tests/partial-sigs/should_fail/T10999.hs | 8 ++++++++ .../should_fail/T10999.stderr} | 0 testsuite/tests/partial-sigs/should_fail/all.T | 2 ++ 5 files changed, 42 insertions(+) diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.hs b/testsuite/tests/partial-sigs/should_fail/T10045.hs new file mode 100644 index 0000000..9b8c45f --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T10045.hs @@ -0,0 +1,8 @@ +module T10045 where + +newtype Meta = Meta () + +foo (Meta ws1) = + let copy :: _ + copy w from = copy w True + in copy ws1 False diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.stderr b/testsuite/tests/partial-sigs/should_fail/T10045.stderr new file mode 100644 index 0000000..c57170e --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T10045.stderr @@ -0,0 +1,24 @@ + +T10045.hs:6:18: error: + Found type wildcard ?_? standing for ?t1 -> Bool -> t2? + Where: ?t1? is a rigid type variable bound by + the inferred type of copy :: t1 -> Bool -> t2 at T10045.hs:7:10 + ?t2? is a rigid type variable bound by + the inferred type of copy :: t1 -> Bool -> t2 at T10045.hs:7:10 + To use the inferred type, enable PartialTypeSignatures + Relevant bindings include + ws1 :: () (bound at T10045.hs:5:11) + foo :: Meta -> t (bound at T10045.hs:5:1) + In the type signature for: + copy :: _ + In the expression: + let + copy :: _ + copy w from = copy w True + in copy ws1 False + In an equation for ?foo?: + foo (Meta ws1) + = let + copy :: _ + copy w from = copy w True + in copy ws1 False diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.hs b/testsuite/tests/partial-sigs/should_fail/T10999.hs new file mode 100644 index 0000000..07d86ff --- /dev/null +++ b/testsuite/tests/partial-sigs/should_fail/T10999.hs @@ -0,0 +1,8 @@ +module T10999 where + +import qualified Data.Set as Set + +f :: () -> _ +f _ = Set.fromList undefined + +g = map fst $ Set.toList $ f () diff --git a/testsuite/tests/deSugar/should_run/T5472.stdout b/testsuite/tests/partial-sigs/should_fail/T10999.stderr similarity index 100% copy from testsuite/tests/deSugar/should_run/T5472.stdout copy to testsuite/tests/partial-sigs/should_fail/T10999.stderr diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index d172a01..bebd8bd 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -59,4 +59,6 @@ test('WildcardInTypeFamilyInstanceRHS', normal, compile_fail, ['']) test('WildcardInTypeSynonymLHS', normal, compile_fail, ['']) test('WildcardInTypeSynonymRHS', normal, compile_fail, ['']) test('T10615', normal, compile_fail, ['']) +test('T10045', normal, compile_fail, ['']) +test('T10999', normal, compile_fail, ['']) From git at git.haskell.org Tue Oct 27 13:25:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 13:25:20 +0000 (UTC) Subject: [commit: ghc] master: Comments only (6831815) Message-ID: <20151027132520.2F08E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/68318151621554686dda9664f1c8fcee473b012c/ghc >--------------------------------------------------------------- commit 68318151621554686dda9664f1c8fcee473b012c Author: Simon Peyton Jones Date: Thu Oct 22 16:05:46 2015 +0100 Comments only >--------------------------------------------------------------- 68318151621554686dda9664f1c8fcee473b012c compiler/parser/Parser.y | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index e24d1cb..895d1bf 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2946,6 +2946,7 @@ qvarid :: { Located RdrName } -- Note that 'role' and 'family' get lexed separately regardless of -- the use of extensions. However, because they are listed here, this -- is OK and they can be used as normal varids. +-- See Note [Lexing type pseudo-keywords] in Lexer.x varid :: { Located RdrName } : VARID { sL1 $1 $! mkUnqual varName (getVARID $1) } | special_id { sL1 $1 $! mkUnqual varName (unLoc $1) } From git at git.haskell.org Tue Oct 27 13:25:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 13:25:24 +0000 (UTC) Subject: [commit: ghc] master: Zonk properly when checkig pattern synonyms (0ce858e) Message-ID: <20151027132524.1DA333A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0ce858e571f0f8f378f2b04f8d924d1fafeafdd1/ghc >--------------------------------------------------------------- commit 0ce858e571f0f8f378f2b04f8d924d1fafeafdd1 Author: Simon Peyton Jones Date: Tue Oct 27 13:27:42 2015 +0000 Zonk properly when checkig pattern synonyms Fixes Trac #10997 Merge to stable branch >--------------------------------------------------------------- 0ce858e571f0f8f378f2b04f8d924d1fafeafdd1 compiler/typecheck/TcPatSyn.hs | 49 ++++++++++++++-------- compiler/typecheck/TcUnify.hs | 39 ++++++++++------- testsuite/tests/patsyn/should_compile/T10997.hs | 6 +++ .../should_compile/T10997_1.hs} | 4 +- .../should_compile/T10997_1a.hs} | 2 +- testsuite/tests/patsyn/should_compile/T10997a.hs | 11 +++++ testsuite/tests/patsyn/should_compile/all.T | 4 ++ testsuite/tests/typecheck/should_compile/all.T | 2 - 8 files changed, 80 insertions(+), 37 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 0ce858e571f0f8f378f2b04f8d924d1fafeafdd1 From git at git.haskell.org Tue Oct 27 14:06:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 14:06:21 +0000 (UTC) Subject: [commit: ghc] master: manpage: Mark as orphan document (adc3d17) Message-ID: <20151027140621.8CAB93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/adc3d1785dd8efc2b194cec331eff816ae77dd93/ghc >--------------------------------------------------------------- commit adc3d1785dd8efc2b194cec331eff816ae77dd93 Author: Ben Gamari Date: Tue Oct 27 13:16:47 2015 +0100 manpage: Mark as orphan document This silences warnings from Sphinx of the form, docs/users_guide/ghc.rst:: WARNING: document isn't included in any toctree >--------------------------------------------------------------- adc3d1785dd8efc2b194cec331eff816ae77dd93 docs/users_guide/ghc.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/users_guide/ghc.rst b/docs/users_guide/ghc.rst index f2b9b70..a44c9d9 100644 --- a/docs/users_guide/ghc.rst +++ b/docs/users_guide/ghc.rst @@ -1,3 +1,5 @@ +:orphan: + GHC === From git at git.haskell.org Tue Oct 27 14:06:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 14:06:24 +0000 (UTC) Subject: [commit: ghc] master: Use correct documentation flag for freverse-errors (d1d8704) Message-ID: <20151027140624.6D5D13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1d8704cb3d003315177fad1394fce49f98fb1a2/ghc >--------------------------------------------------------------- commit d1d8704cb3d003315177fad1394fce49f98fb1a2 Author: Siddhanathan Shanmugam Date: Tue Oct 27 15:08:41 2015 +0100 Use correct documentation flag for freverse-errors Reviewers: austin, thomie, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1376 GHC Trac Issues: #10848 >--------------------------------------------------------------- d1d8704cb3d003315177fad1394fce49f98fb1a2 compiler/main/DynFlags.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 4af16cf..7794145 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2402,9 +2402,9 @@ dynamic_flags = [ deprecate "Use -fno-force-recomp instead")) , defGhcFlag "no-recomp" (NoArg (do setGeneralFlag Opt_ForceRecomp deprecate "Use -fforce-recomp instead")) - , defGhcFlag "freverse-errors" + , defFlag "freverse-errors" (noArg (\d -> d {reverseErrors = True} )) - , defGhcFlag "fno-reverse-errors" + , defFlag "fno-reverse-errors" (noArg (\d -> d {reverseErrors = False} )) ------ HsCpp opts --------------------------------------------------- From git at git.haskell.org Tue Oct 27 14:18:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 14:18:00 +0000 (UTC) Subject: [commit: ghc] master: Make it possible to have different UniqSupply strategies (158d2a9) Message-ID: <20151027141800.112863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/158d2a91581d82dc1690a858b474eaab3a02e43e/ghc >--------------------------------------------------------------- commit 158d2a91581d82dc1690a858b474eaab3a02e43e Author: Bartosz Nitka Date: Tue Oct 27 15:17:32 2015 +0100 Make it possible to have different UniqSupply strategies To get reproducible/deterministic builds, the way that the Uniques are assigned shouldn't matter. This allows to test for that. It add 2 new flags: * `-dinitial-unique` * `-dunique-increment` And by varying these you can get interesting effects: * `-dinitial-unique=0 -dunique-increment 1` - current sequential UniqSupply * `-dinitial-unique=16777215 -dunique-increment -1` - UniqSupply that generates in decreasing order * `-dinitial-unique=1 -dunique-increment PRIME` - where PRIME big enough to overflow often - nonsequential order I haven't proven the usefullness of the last one yet and it's the reason why we have to mask the bits with `0xFFFFFF` in `genSym`, so I can remove it if it becomes contentious. Test Plan: validate on harbormaster Reviewers: simonmar, austin, ezyang, bgamari Reviewed By: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1360 GHC Trac Issues: #4012 >--------------------------------------------------------------- 158d2a91581d82dc1690a858b474eaab3a02e43e compiler/basicTypes/UniqSupply.hs | 4 ++++ compiler/cbits/genSym.c | 11 ++++++++--- compiler/main/DynFlags.hs | 14 ++++++-------- docs/users_guide/debugging.rst | 32 ++++++++++++++++++++++++++++++++ ghc/Main.hs | 2 ++ 5 files changed, 52 insertions(+), 11 deletions(-) diff --git a/compiler/basicTypes/UniqSupply.hs b/compiler/basicTypes/UniqSupply.hs index b84270a..afc4d3c 100644 --- a/compiler/basicTypes/UniqSupply.hs +++ b/compiler/basicTypes/UniqSupply.hs @@ -22,6 +22,9 @@ module UniqSupply ( -- ** Operations on the monad initUs, initUs_, lazyThenUs, lazyMapUs, + + -- * Set supply strategy + initUniqSupply ) where import Unique @@ -85,6 +88,7 @@ mkSplitUniqSupply c mk_supply foreign import ccall unsafe "genSym" genSym :: IO Int +foreign import ccall unsafe "initGenSym" initUniqSupply :: Int -> Int -> IO () splitUniqSupply (MkSplitUniqSupply _ s1 s2) = (s1, s2) listSplitUniqSupply (MkSplitUniqSupply _ s1 s2) = s1 : listSplitUniqSupply s2 diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c index 08d403d..70ea417 100644 --- a/compiler/cbits/genSym.c +++ b/compiler/cbits/genSym.c @@ -2,16 +2,21 @@ #include "Rts.h" static HsInt GenSymCounter = 0; +static HsInt GenSymInc = 1; HsInt genSym(void) { #if defined(THREADED_RTS) if (n_capabilities == 1) { - return GenSymCounter++; + return GenSymCounter = (GenSymCounter + GenSymInc) & 0xFFFFFF; } else { - return atomic_inc((StgWord *)&GenSymCounter, 1); + return atomic_inc((StgWord *)&GenSymCounter, GenSymInc) & 0xFFFFFF; } #else - return GenSymCounter++; + return GenSymCounter = (GenSymCounter + GenSymInc) & 0xFFFFFF; #endif } +void initGenSym(HsInt NewGenSymCounter, HsInt NewGenSymInc) { + GenSymCounter = NewGenSymCounter; + GenSymInc = NewGenSymInc; +} diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 7794145..f7a3edd 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -900,7 +900,11 @@ data DynFlags = DynFlags { maxInlineMemsetInsns :: Int, -- | Reverse the order of error messages in GHC/GHCi - reverseErrors :: Bool + reverseErrors :: Bool, + + -- | Unique supply configuration for testing build determinism + initialUnique :: Int, + uniqueIncrement :: Int } class HasDynFlags m where @@ -1561,9 +1565,7 @@ defaultDynFlags mySettings = maxInlineAllocSize = 128, maxInlineMemcpyInsns = 32, - maxInlineMemsetInsns = 32, - - reverseErrors = False + maxInlineMemsetInsns = 32 } defaultWays :: Settings -> [Way] @@ -2402,10 +2404,6 @@ dynamic_flags = [ deprecate "Use -fno-force-recomp instead")) , defGhcFlag "no-recomp" (NoArg (do setGeneralFlag Opt_ForceRecomp deprecate "Use -fforce-recomp instead")) - , defFlag "freverse-errors" - (noArg (\d -> d {reverseErrors = True} )) - , defFlag "fno-reverse-errors" - (noArg (\d -> d {reverseErrors = False} )) ------ HsCpp opts --------------------------------------------------- , defFlag "D" (AnySuffix (upd . addOptP)) diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index 9482b8e..ddb3c2a 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -429,3 +429,35 @@ Checking for consistency single: -dcmm-lint Ditto for C-- level. + +.. _checking-determinism: + +Checking for determinism +------------------------ + +.. index:: + single: deterministic builds + +``-dinitial-unique=?s?`` + .. index:: + single: -dinitial-unique + + Start ``UniqSupply`` allocation from ?s?. + +``-dunique-increment=?i?`` + .. index:: + single: -dunique-increment + + Set the increment for the generated ``Unique``'s to ?i?. + + This is useful in combination with ``-dinitial-unique`` to test if the + generated files depend on the order of ``Unique``'s. + + Some interesting values: + + * ``-dinitial-unique=0 -dunique-increment=1`` - current sequential + ``UniqSupply`` + * ``-dinitial-unique=16777215 -dunique-increment=-1`` - ``UniqSupply`` that + generates in decreasing order + * ``-dinitial-unique=1 -dunique-increment=PRIME`` - where PRIME big enough + to overflow often - nonsequential order diff --git a/ghc/Main.hs b/ghc/Main.hs index fc6ab88..647bbad 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -44,6 +44,7 @@ import Outputable import SrcLoc import Util import Panic +import UniqSupply import MonadUtils ( liftIO ) -- Imports for --abi-hash @@ -236,6 +237,7 @@ main' postLoadMode dflags0 args flagWarnings = do printInfoForUser (dflags6 { pprCols = 200 }) (pkgQual dflags6) (pprModuleMap dflags6) + liftIO $ initUniqSupply (initialUnique dflags6) (uniqueIncrement dflags6) ---------------- Final sanity checking ----------- liftIO $ checkOptions postLoadMode dflags6 srcs objs From git at git.haskell.org Tue Oct 27 14:51:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 14:51:12 +0000 (UTC) Subject: [commit: ghc] master: Fix "Use correct documentation flag for freverse-errors" (079dd12) Message-ID: <20151027145112.BA5D73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/079dd12cdd77271a070875780689a3dbd0913a87/ghc >--------------------------------------------------------------- commit 079dd12cdd77271a070875780689a3dbd0913a87 Author: Ben Gamari Date: Tue Oct 27 15:53:20 2015 +0100 Fix "Use correct documentation flag for freverse-errors" This fixes commit d1d8704cb3d003315177fad1394fce49f98fb1a2, which somehow was mangled during merge. >--------------------------------------------------------------- 079dd12cdd77271a070875780689a3dbd0913a87 compiler/main/DynFlags.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index f7a3edd..f22011e 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2404,6 +2404,10 @@ dynamic_flags = [ deprecate "Use -fno-force-recomp instead")) , defGhcFlag "no-recomp" (NoArg (do setGeneralFlag Opt_ForceRecomp deprecate "Use -fforce-recomp instead")) + , defGhcFlag "freverse-errors" + (noArg (\d -> d {reverseErrors = True} )) + , defGhcFlag "fno-reverse-errors" + (noArg (\d -> d {reverseErrors = False} )) ------ HsCpp opts --------------------------------------------------- , defFlag "D" (AnySuffix (upd . addOptP)) From git at git.haskell.org Tue Oct 27 14:56:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 14:56:45 +0000 (UTC) Subject: [commit: ghc] master: DynFlags: Fix more merge errors (dc13467) Message-ID: <20151027145645.EC6E13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dc13467347fa9bf9e1a70389a2eccd9bd4853d21/ghc >--------------------------------------------------------------- commit dc13467347fa9bf9e1a70389a2eccd9bd4853d21 Author: Ben Gamari Date: Tue Oct 27 15:59:00 2015 +0100 DynFlags: Fix more merge errors >--------------------------------------------------------------- dc13467347fa9bf9e1a70389a2eccd9bd4853d21 compiler/main/DynFlags.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index f22011e..97b15d3 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1565,7 +1565,9 @@ defaultDynFlags mySettings = maxInlineAllocSize = 128, maxInlineMemcpyInsns = 32, - maxInlineMemsetInsns = 32 + maxInlineMemsetInsns = 32, + + reverseErrors = False } defaultWays :: Settings -> [Way] From git at git.haskell.org Tue Oct 27 15:18:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 15:18:02 +0000 (UTC) Subject: [commit: ghc] master: Sort field labels before fingerprint hashing (ffcdd84) Message-ID: <20151027151802.E2E983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ffcdd84f86727c1621be0a0e522eb6a3a64e479f/ghc >--------------------------------------------------------------- commit ffcdd84f86727c1621be0a0e522eb6a3a64e479f Author: Bartosz Nitka Date: Tue Oct 27 10:19:48 2015 -0500 Sort field labels before fingerprint hashing `fsEnvElts :: FastStringEnv a -> [a]` returns a list of `[a]` in the order of `Unique`s which is arbitrary. In this case it gives a list of record fields in arbitrary order, from which we then extract the field labels to contribute to the record fingerprint. The arbitrary ordering of field labels introduces unnecessary nondeterminism in interface files as demonstrated by the test case. We sort `FastString` here. It's safe, because the only way that the `Unique` associated with the `FastString` is used in comparison is for equality. If the `Unique`s are different it fallbacks to comparing the actual `ByteString`. Reviewed By: ezyang, thomie, bgamari, austin Differential Revision: https://phabricator.haskell.org/D1373 GHC Trac Issues: #4012 >--------------------------------------------------------------- ffcdd84f86727c1621be0a0e522eb6a3a64e479f compiler/basicTypes/Unique.hs | 16 ++++++++++++++++ compiler/iface/MkIface.hs | 9 ++++++++- testsuite/tests/determinism/determ002/A.hs | 10 ++++++++++ testsuite/tests/determinism/determ002/Makefile | 13 +++++++++++++ testsuite/tests/determinism/determ002/all.T | 4 ++++ .../tests/determinism/determ002/determ002.stderr | 0 testsuite/tests/determinism/determ002/determ002.stdout | 2 ++ 7 files changed, 53 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/Unique.hs b/compiler/basicTypes/Unique.hs index 5ce9c64..12629ff 100644 --- a/compiler/basicTypes/Unique.hs +++ b/compiler/basicTypes/Unique.hs @@ -174,6 +174,22 @@ use `deriving' because we want {\em precise} control of ordering (equality on @Uniques@ is v common). -} +-- Note [Unique Determinism] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~ +-- The order of allocated @Uniques@ is not stable across rebuilds. +-- The main reason for that is that typechecking interface files pulls +-- @Uniques@ from @UniqSupply@ and the interface file for the module being +-- currently compiled can, but doesn't have to exist. +-- +-- It gets more complicated if you take into account that the interface +-- files are loaded lazily and that building multiple files at once has to +-- work for any subset of interface files present. When you add parallelism +-- this makes @Uniques@ hopelessly random. +-- +-- As such, to get deterministic builds, the order of the allocated +-- @Uniques@ should not affect the final result. +-- see also wiki/DeterministicBuilds + eqUnique, ltUnique, leUnique :: Unique -> Unique -> Bool eqUnique (MkUnique u1) (MkUnique u2) = u1 == u2 ltUnique (MkUnique u1) (MkUnique u2) = u1 < u2 diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index 66a885b..d4b764b 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1700,7 +1700,14 @@ tyConToIfaceDecl env tycon ifaceOverloaded flds = case fsEnvElts flds of fl:_ -> flIsOverloaded fl [] -> False - ifaceFields flds = map flLabel $ fsEnvElts flds + ifaceFields flds = sort $ map flLabel $ fsEnvElts flds + -- We need to sort the labels because they come out + -- of FastStringEnv in arbitrary order, because + -- FastStringEnv is keyed on Uniques. + -- Sorting FastString is ok here, because Uniques + -- are only used for equality checks in the Ord + -- instance for FastString. + -- See Note [Unique Determinism] in Unique. toIfaceBang :: TidyEnv -> HsImplBang -> IfaceBang toIfaceBang _ HsLazy = IfNoBang diff --git a/testsuite/tests/determinism/determ002/A.hs b/testsuite/tests/determinism/determ002/A.hs new file mode 100644 index 0000000..9a88f2c --- /dev/null +++ b/testsuite/tests/determinism/determ002/A.hs @@ -0,0 +1,10 @@ +module A where + +-- This is a repro for the issue where to fingerprint a record, field labels +-- were pulled from FastStringEnv in the order of Uniques which are known +-- to have arbitrary order - see Note [Unique Determinism] in Unique. + +data B = C + { e :: () + , d :: () + } diff --git a/testsuite/tests/determinism/determ002/Makefile b/testsuite/tests/determinism/determ002/Makefile new file mode 100644 index 0000000..d94a1c2 --- /dev/null +++ b/testsuite/tests/determinism/determ002/Makefile @@ -0,0 +1,13 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +TEST_HC_OPTS_NO_RECOMP = $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) + +determ002: + $(RM) A.hi A.o + '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) A.hs + $(CP) A.hi A.old.hi + $(RM) A.o + '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) A.hs + diff A.hi A.old.hi diff --git a/testsuite/tests/determinism/determ002/all.T b/testsuite/tests/determinism/determ002/all.T new file mode 100644 index 0000000..9bfd05d --- /dev/null +++ b/testsuite/tests/determinism/determ002/all.T @@ -0,0 +1,4 @@ +test('determ002', + extra_clean(['A.o', 'A.hi', 'A.old.hi']), + run_command, + ['$MAKE -s --no-print-directory determ002']) diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/determinism/determ002/determ002.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/determinism/determ002/determ002.stderr diff --git a/testsuite/tests/determinism/determ002/determ002.stdout b/testsuite/tests/determinism/determ002/determ002.stdout new file mode 100644 index 0000000..60c2bc3 --- /dev/null +++ b/testsuite/tests/determinism/determ002/determ002.stdout @@ -0,0 +1,2 @@ +[1 of 1] Compiling A ( A.hs, A.o ) +[1 of 1] Compiling A ( A.hs, A.o ) From git at git.haskell.org Tue Oct 27 15:23:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 15:23:20 +0000 (UTC) Subject: [commit: ghc] master: DynFlags: Yet one more fix (166c597) Message-ID: <20151027152320.EC5CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/166c5972fc7269b6a7802cd68ab04d86affbb879/ghc >--------------------------------------------------------------- commit 166c5972fc7269b6a7802cd68ab04d86affbb879 Author: Ben Gamari Date: Tue Oct 27 16:17:46 2015 +0100 DynFlags: Yet one more fix >--------------------------------------------------------------- 166c5972fc7269b6a7802cd68ab04d86affbb879 compiler/main/DynFlags.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 97b15d3..6f5fa6a 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1567,6 +1567,9 @@ defaultDynFlags mySettings = maxInlineMemcpyInsns = 32, maxInlineMemsetInsns = 32, + initialUnique = 0, + uniqueIncrement = 1, + reverseErrors = False } From git at git.haskell.org Tue Oct 27 17:25:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 17:25:16 +0000 (UTC) Subject: [commit: ghc] master: Make worker-wrapper optional (31704ad) Message-ID: <20151027172516.BB8CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/31704adc82c3a1e48ac05c51f02933fd996b642a/ghc >--------------------------------------------------------------- commit 31704adc82c3a1e48ac05c51f02933fd996b642a Author: Christiaan Baaij Date: Tue Oct 27 10:21:27 2015 -0500 Make worker-wrapper optional Add -fworker-wrapper flag which enables the worker-wrapper transformation. It is implied by -O. The expected users of this flag, which includes myself, are GHC API users. In my Haskell-to-Hardware compiler, which uses the GHC API, I have seen no benifits of the worker-wrapper transformation. It does however induce longer compilation times. Further discussion can be seen here: https://mail.haskell.org/pipermail/ghc-devs/2015-October/010096.html Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1372 GHC Trac Issues: #11020 >--------------------------------------------------------------- 31704adc82c3a1e48ac05c51f02933fd996b642a compiler/main/DynFlags.hs | 29 ++++++++++++++++++++++---- compiler/simplCore/SimplCore.hs | 24 ++++++++++++--------- docs/users_guide/7.12.1-notes.rst | 6 ++++++ utils/mkUserGuidePart/Options/Optimizations.hs | 13 +++++++++++- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 6f5fa6a..320a11e 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -374,6 +374,7 @@ data GeneralFlag | Opt_DmdTxDictSel -- use a special demand transformer for dictionary selectors | Opt_Loopification -- See Note [Self-recursive tail calls] | Opt_CprAnal + | Opt_WorkerWrapper -- Interface files | Opt_IgnoreInterfacePragmas @@ -3011,7 +3012,8 @@ fFlags = [ flagSpec "unbox-small-strict-fields" Opt_UnboxSmallStrictFields, flagSpec "unbox-strict-fields" Opt_UnboxStrictFields, flagSpec "vectorisation-avoidance" Opt_VectorisationAvoidance, - flagSpec "vectorise" Opt_Vectorise + flagSpec "vectorise" Opt_Vectorise, + flagSpec "worker-wrapper" Opt_WorkerWrapper ] -- | These @-f\@ flags can all be reversed with @-fno-\@ @@ -3251,8 +3253,17 @@ default_PIC platform = -- information. _ -> [] +-- General flags that are switched on/off when other general flags are switched +-- on impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)] -impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles)] +impliedGFlags = [(Opt_DeferTypeErrors, turnOn, Opt_DeferTypedHoles) + ,(Opt_Strictness, turnOn, Opt_WorkerWrapper) + ] + +-- General flags that are switched on/off when other general flags are switched +-- off +impliedOffGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)] +impliedOffGFlags = [(Opt_Strictness, turnOff, Opt_WorkerWrapper)] impliedXFlags :: [(ExtensionFlag, TurnOnFlag, ExtensionFlag)] impliedXFlags @@ -3346,6 +3357,7 @@ optLevelFlags -- see Note [Documenting optimisation flags] , ([1,2], Opt_Strictness) , ([1,2], Opt_UnboxSmallStrictFields) , ([1,2], Opt_CprAnal) + , ([1,2], Opt_WorkerWrapper) , ([2], Opt_LiberateCase) , ([2], Opt_SpecConstr) @@ -3613,8 +3625,17 @@ setGeneralFlag' f dflags = foldr ($) (gopt_set dflags f) deps -- implies further flags unSetGeneralFlag' :: GeneralFlag -> DynFlags -> DynFlags -unSetGeneralFlag' f dflags = gopt_unset dflags f - -- When you un-set f, however, we don't un-set the things it implies +unSetGeneralFlag' f dflags = foldr ($) (gopt_unset dflags f) deps + where + deps = [ if turn_on then setGeneralFlag' d + else unSetGeneralFlag' d + | (f', turn_on, d) <- impliedOffGFlags, f' == f ] + -- In general, when you un-set f, we don't un-set the things it implies. + -- There are however some exceptions, e.g., -fno-strictness implies + -- -fno-worker-wrapper. + -- + -- NB: use unSetGeneralFlag' recursively, in case the implied off flags + -- imply further flags. -------------------------- setWarningFlag, unSetWarningFlag :: WarningFlag -> DynP () diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index dddb24d..9207cf4 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -127,6 +127,7 @@ getCoreToDo dflags static_args = gopt Opt_StaticArgumentTransformation dflags rules_on = gopt Opt_EnableRewriteRules dflags eta_expand_on = gopt Opt_DoLambdaEtaExpansion dflags + ww_on = gopt Opt_WorkerWrapper dflags maybe_rule_check phase = runMaybe rule_check (CoreDoRuleCheck phase) @@ -187,12 +188,16 @@ getCoreToDo dflags -- Don't do case-of-case transformations. -- This makes full laziness work better + strictness_pass = if ww_on + then [CoreDoStrictness,CoreDoWorkerWrapper] + else [CoreDoStrictness] + + -- New demand analyser - demand_analyser = (CoreDoPasses ([ - CoreDoStrictness, - CoreDoWorkerWrapper, - simpl_phase 0 ["post-worker-wrapper"] max_iter - ])) + demand_analyser = (CoreDoPasses ( + strictness_pass ++ + [simpl_phase 0 ["post-worker-wrapper"] max_iter] + )) core_todo = if opt_level == 0 then @@ -309,11 +314,10 @@ getCoreToDo dflags -- Final clean-up simplification: simpl_phase 0 ["final"] max_iter, - runWhen late_dmd_anal $ CoreDoPasses [ - CoreDoStrictness, - CoreDoWorkerWrapper, - simpl_phase 0 ["post-late-ww"] max_iter - ], + runWhen late_dmd_anal $ CoreDoPasses ( + strictness_pass ++ + [simpl_phase 0 ["post-late-ww"] max_iter] + ), maybe_rule_check (Phase 0) ] diff --git a/docs/users_guide/7.12.1-notes.rst b/docs/users_guide/7.12.1-notes.rst index e05366c..5cc02ad 100644 --- a/docs/users_guide/7.12.1-notes.rst +++ b/docs/users_guide/7.12.1-notes.rst @@ -102,6 +102,12 @@ Compiler ``-fcpr-off`` is now removed, run with ``-fno-cpr-anal`` to get the old ``-fcpr-off`` behaviour. +- Added the option ``-fworker-wrapper``. When enabled, the worker-wrapper + transformation is performed after a strictness analysis pass. It is implied + by ``-O`` and by ``-fstrictness``. It is disabled by ``-fno-strictness``. + Enabling ``-fworker-wrapper`` while strictness analysis is disabled (by + ``-fno-strictness``) has no effect. + GHCi ~~~~ diff --git a/utils/mkUserGuidePart/Options/Optimizations.hs b/utils/mkUserGuidePart/Options/Optimizations.hs index 0082a21..6e0a2ff 100644 --- a/utils/mkUserGuidePart/Options/Optimizations.hs +++ b/utils/mkUserGuidePart/Options/Optimizations.hs @@ -289,7 +289,8 @@ optimizationsOptions = , flagReverse = "-fno-static-argument-transformation" } , flag { flagName = "-fstrictness" - , flagDescription = "Turn on strictness analysis. Implied by ``-O``." + , flagDescription = "Turn on strictness analysis." ++ + " Implied by ``-O``. Implies ``-fworker-wrapper``" , flagType = DynamicFlag , flagReverse = "-fno-strictness" } @@ -341,4 +342,14 @@ optimizationsOptions = , flagType = DynamicFlag , flagReverse = "-fno-vectorise" } + , flag { flagName = "-fworker-wrapper" + , flagDescription = + "Enable the worker-wrapper transformation after a strictness" ++ + " analysis pass. Implied by ``-O``, and by ``-fstrictness``." ++ + " Disabled by ``-fno-strictness``. Enabling ``-fworker-wrapper``" ++ + " while strictness analysis is disabled (by ``-fno-strictness``)" ++ + " has no effect." + , flagType = DynamicFlag + , flagReverse = "-fno-worker-wrapper" + } ] From git at git.haskell.org Tue Oct 27 17:25:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 17:25:19 +0000 (UTC) Subject: [commit: ghc] master: Fix the DYNAMIC_GHC_PROGRAMS=NO build on Mac/Windows (9efa56d) Message-ID: <20151027172519.69EAF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9efa56dd26e0ec05823bd367e69e21da3c35af2b/ghc >--------------------------------------------------------------- commit 9efa56dd26e0ec05823bd367e69e21da3c35af2b Author: Reid Barton Date: Tue Oct 27 12:26:54 2015 -0500 Fix the DYNAMIC_GHC_PROGRAMS=NO build on Mac/Windows LEADING_UNDERSCORE is defined in a header file, so we need to #include that file where we use LEADING_UNDERSCORE. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1382 >--------------------------------------------------------------- 9efa56dd26e0ec05823bd367e69e21da3c35af2b rts/RtsSymbols.h | 1 + 1 file changed, 1 insertion(+) diff --git a/rts/RtsSymbols.h b/rts/RtsSymbols.h index cc02a98..10c158c 100644 --- a/rts/RtsSymbols.h +++ b/rts/RtsSymbols.h @@ -9,6 +9,7 @@ #ifndef RTS_SYMBOLS_H #define RTS_SYMBOLS_H +#include "ghcautoconf.h" #ifdef LEADING_UNDERSCORE #define MAYBE_LEADING_UNDERSCORE_STR(s) ("_" s) From git at git.haskell.org Tue Oct 27 17:33:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 17:33:22 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: Chugging along on this branch (4a1456d) Message-ID: <20151027173322.F17C33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/4a1456db3acf68b5ffe3e942b59694d439a1a397/ghc >--------------------------------------------------------------- commit 4a1456db3acf68b5ffe3e942b59694d439a1a397 Author: Simon Peyton Jones Date: Tue Oct 27 17:35:41 2015 +0000 Chugging along on this branch Uupdates the haddock submodule too >--------------------------------------------------------------- 4a1456db3acf68b5ffe3e942b59694d439a1a397 compiler/deSugar/DsMeta.hs | 2 +- compiler/ghc.mk | 2 -- compiler/hsSyn/HsTypes.hs | 29 +++++++++++++++++++++++------ compiler/typecheck/TcRnDriver.hs | 4 +--- utils/haddock | 2 +- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 427580e..3d8eae0 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -598,7 +598,7 @@ repRuleBndr (L _ (RuleBndr n)) ; rep2 ruleVarName [n'] } repRuleBndr (L _ (RuleBndrSig n sig)) = do { MkC n' <- lookupLBinder n - ; MkC ty' <- repLTy (hsWcSigType sig) + ; MkC ty' <- repLTy (hsSigWcType sig) ; rep2 typedRuleVarName [n', ty'] } repAnnD :: LAnnDecl Name -> DsM (SrcSpan, Core TH.DecQ) diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 5883b8a..4f08caf 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -495,7 +495,6 @@ compiler_stage2_dll0_MODULES = \ CoreSeq \ CoreStats \ CostCentre \ - Ctype \ DataCon \ Demand \ Digraph \ @@ -534,7 +533,6 @@ compiler_stage2_dll0_MODULES = \ InstEnv \ Kind \ Lexeme \ - Lexer \ ListSetOps \ Literal \ Maybes \ diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index f0ef451..abfd981 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -46,7 +46,8 @@ module HsTypes ( wildCardName, sameWildCard, sameNamedWildCard, isAnonWildCard, isNamedWildCard, - mkHsImplicitBndrs, mkHsWildCardBndrs, + mkHsImplicitBndrs, mkHsWildCardBndrs, hsImplicitBody, + mkEmptyImplicitBndrs, mkEmptyWildCardBndrs, mkHsQTvs, hsQTvBndrs, isHsKindedTyVar, hsTvbAllKinded, hsScopedTvs, hsWcScopedTvs, dropWildCards, hsTyVarName, hsLKiTyVarNames, @@ -57,7 +58,7 @@ module HsTypes ( splitLHsClassTy_maybe, splitHsFunType, splitHsAppTys, hsTyGetAppHead_maybe, mkHsAppTys, mkHsOpTy, - ignoreParens, hsSigType, hsWcSigType, + ignoreParens, hsSigType, hsSigWcType, hsLTyVarBndrsToTypes, -- Printing @@ -207,15 +208,18 @@ type LHsSigWcType name = HsImplicitBndrs name (LHsWcType name) -- Both -- See Note [Representing type signatures] +hsImplicitBody :: HsImplicitBndrs name thing -> thing +hsImplicitBody (HsIB { hsib_body = body }) = body + hsSigType :: LHsSigType name -> LHsType name -hsSigType sig_ty = hsib_body sig_ty +hsSigType = hsImplicitBody -hsWcSigType :: LHsSigWcType name -> LHsType name -hsWcSigType sig_ty = hswc_body (hsib_body sig_ty) +hsSigWcType :: LHsSigWcType name -> LHsType name +hsSigWcType sig_ty = hswc_body (hsib_body sig_ty) dropWildCards :: LHsSigWcType name -> LHsSigType name -- Drop the wildcard part of a LHsSigWcType -dropWildCards sig_ty = sig_ty { hsib_body = hsWcSigType sig_ty } +dropWildCards sig_ty = sig_ty { hsib_body = hsSigWcType sig_ty } {- Note [Representing type signatures] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -248,6 +252,19 @@ mkHsWildCardBndrs x = HsWC { hswc_body = x , hswc_wcs = PlaceHolder , hswc_ctx = Nothing } +-- Add empty binders. This is a bit suspicious; what if +-- the wrapped thing had free type variables? +mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs Name thing +mkEmptyImplicitBndrs x = HsIB { hsib_body = x + , hsib_kvs = [] + , hsib_tvs = [] } + +mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs Name thing +mkEmptyWildCardBndrs x = HsWC { hswc_body = x + , hswc_wcs = [] + , hswc_ctx = Nothing } + + -------------------------------------------------- -- | These names are used early on to store the names of implicit -- parameters. They completely disappear after type-checking. diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 096cf97..439d749 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -1751,9 +1751,7 @@ getGhciStepIO = do , hst_body = nlHsFunTy ghciM ioM } stepTy :: LHsSigWcType Name -- Urgh! - stepTy = HsIB { hsib_tvs = [], hsib_kvs = [] - , hsib_body = HsWC { hswc_wcs = [], hswc_ctx = Nothing - , hswc_body = step_ty } } + stepTy = mkEmptyImplicitBndrs (mkEmptyWildCardBndrs step_ty) return (noLoc $ ExprWithTySig (nlHsVar ghciStepIoMName) stepTy) isGHCiMonad :: HscEnv -> String -> IO (Messages, Maybe Name) diff --git a/utils/haddock b/utils/haddock index a394ee8..ec20bd1 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit a394ee884befd8cc8ba31a6071afaec7cca14e7c +Subproject commit ec20bd15e724d580a01d9fad98791bb53db5e57c From git at git.haskell.org Tue Oct 27 17:40:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 17:40:15 +0000 (UTC) Subject: [commit: ghc] master: Make T10970a non-dependent on GCC version. (19354fb) Message-ID: <20151027174015.075F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/19354fb22767bfdcc525d2f851e24cd8a493e84f/ghc >--------------------------------------------------------------- commit 19354fb22767bfdcc525d2f851e24cd8a493e84f Author: Edward Z. Yang Date: Tue Oct 27 10:42:51 2015 -0700 Make T10970a non-dependent on GCC version. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 19354fb22767bfdcc525d2f851e24cd8a493e84f testsuite/tests/driver/T10970a.hs | 6 ++++-- testsuite/tests/driver/T10970a.stderr | 6 ------ .../{simplCore/should_run/T5453.stdout => driver/T10970a.stdout} | 1 + testsuite/tests/driver/all.T | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/testsuite/tests/driver/T10970a.hs b/testsuite/tests/driver/T10970a.hs index 9de4f80..8e7aa60 100644 --- a/testsuite/tests/driver/T10970a.hs +++ b/testsuite/tests/driver/T10970a.hs @@ -1,6 +1,8 @@ {-# LANGUAGE CPP #-} main = do - putStrLn VERSION_containers -#if MIN_VERSION_base(3,0,0) +#ifndef VERSION_containers + putStrLn "OK" +#endif +#ifndef MIN_VERSION_base putStrLn "OK" #endif diff --git a/testsuite/tests/driver/T10970a.stderr b/testsuite/tests/driver/T10970a.stderr index 74c6821..e69de29 100644 --- a/testsuite/tests/driver/T10970a.stderr +++ b/testsuite/tests/driver/T10970a.stderr @@ -1,6 +0,0 @@ - -T10970a.hs:4:0: error: - error: missing binary operator before token "(" - #if MIN_VERSION_base(3,0,0) - ^ -`gcc' failed in phase `C pre-processor'. (Exit code: 1) diff --git a/testsuite/tests/simplCore/should_run/T5453.stdout b/testsuite/tests/driver/T10970a.stdout similarity index 50% copy from testsuite/tests/simplCore/should_run/T5453.stdout copy to testsuite/tests/driver/T10970a.stdout index e178f82..2c94e48 100644 --- a/testsuite/tests/simplCore/should_run/T5453.stdout +++ b/testsuite/tests/driver/T10970a.stdout @@ -1 +1,2 @@ OK +OK diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index f946055..7c74cb6 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -458,4 +458,4 @@ test('T9360a', normal, run_command, ['{compiler} --interactive -e ""']) test('T9360b', normal, run_command, ['{compiler} -e "" --interactive']) test('T10970', normal, compile_and_run, ['-hide-all-packages -package base -package containers']) -test('T10970a', normal, compile_fail, ['']) +test('T10970a', normal, compile_and_run, ['']) From git at git.haskell.org Tue Oct 27 20:30:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 20:30:37 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: accept output for T10999 (#10999) (7c2ab6f) Message-ID: <20151027203037.54DFF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7c2ab6fb41464ace21fcae885ae8dc5354014a25/ghc >--------------------------------------------------------------- commit 7c2ab6fb41464ace21fcae885ae8dc5354014a25 Author: Thomas Miedema Date: Tue Oct 27 21:32:52 2015 +0100 Testsuite: accept output for T10999 (#10999) >--------------------------------------------------------------- 7c2ab6fb41464ace21fcae885ae8dc5354014a25 testsuite/tests/partial-sigs/should_fail/T10999.stderr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.stderr b/testsuite/tests/partial-sigs/should_fail/T10999.stderr index 0519ecb..2bf060b 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10999.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10999.stderr @@ -1 +1,14 @@ +T10999.hs:5:12: error: + Found type wildcard ?_? standing for ?Set.Set a? + Where: ?a? is a rigid type variable bound by + the inferred type of f :: Ord a => () -> Set.Set a at T10999.hs:6:1 + To use the inferred type, enable PartialTypeSignatures + In the type signature for: + f :: () -> _ + +T10999.hs:6:1: error: + No instance for (Ord a) + When checking that ?f? has the inferred type + f :: forall a. () -> Set.Set a + Probable cause: the inferred type is ambiguous From git at git.haskell.org Tue Oct 27 21:33:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 21:33:01 +0000 (UTC) Subject: [commit: ghc] master: PrelNames: Fix duplicate unique (d1ab6fc) Message-ID: <20151027213301.AC4033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1ab6fc9eddcee63ea594c1357d47d3dcebe2492/ghc >--------------------------------------------------------------- commit d1ab6fc9eddcee63ea594c1357d47d3dcebe2492 Author: Ben Gamari Date: Tue Oct 27 22:10:58 2015 +0100 PrelNames: Fix duplicate unique Previously unboundKey and fromIntegerClassOpKey were sharing a Unique Reassign unboundKey to `mkPreludeMiscIdUnique 158` >--------------------------------------------------------------- d1ab6fc9eddcee63ea594c1357d47d3dcebe2492 compiler/prelude/PrelNames.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 3808c4e..30d11fe 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -1849,7 +1849,7 @@ during type checking. -- Just a place holder for unbound variables produced by the renamer: unboundKey :: Unique -unboundKey = mkPreludeMiscIdUnique 160 +unboundKey = mkPreludeMiscIdUnique 158 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey, enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey, From git at git.haskell.org Tue Oct 27 23:25:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 23:25:33 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: configure.ac: Bump back down to 7.10.2 (fc9c9fb) Message-ID: <20151027232533.063223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/fc9c9fbd357a22dce2a7ba32167d8a69700b13f2/ghc >--------------------------------------------------------------- commit fc9c9fbd357a22dce2a7ba32167d8a69700b13f2 Author: Ben Gamari Date: Mon Oct 26 20:32:13 2015 +0100 configure.ac: Bump back down to 7.10.2 Keep at 7.10.2 for release candidate >--------------------------------------------------------------- fc9c9fbd357a22dce2a7ba32167d8a69700b13f2 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8a6ecdc..5b94d07 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.3], [glasgow-haskell-bugs at haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.2], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO : ${RELEASE=NO} From git at git.haskell.org Tue Oct 27 23:25:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 23:25:35 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: testsuite: Update base version number in results (6f63609) Message-ID: <20151027232535.9F5273A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/6f63609a351f6f9500d6b778b30ec53f8875c0b7/ghc >--------------------------------------------------------------- commit 6f63609a351f6f9500d6b778b30ec53f8875c0b7 Author: Ben Gamari Date: Mon Oct 26 15:56:39 2015 -0400 testsuite: Update base version number in results >--------------------------------------------------------------- 6f63609a351f6f9500d6b778b30ec53f8875c0b7 testsuite/tests/ghci/scripts/ghci008.stdout | 4 ++-- .../tests/indexed-types/should_compile/T3017.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/ADT.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr1.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr2.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr3.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr4.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr5.stderr | 2 +- .../tests/partial-sigs/should_compile/AddAndOr6.stderr | 2 +- .../tests/partial-sigs/should_compile/BoolToBool.stderr | 2 +- .../partial-sigs/should_compile/Defaulting1MROn.stderr | 2 +- .../partial-sigs/should_compile/Defaulting2MROff.stderr | 2 +- .../partial-sigs/should_compile/Defaulting2MROn.stderr | 2 +- .../tests/partial-sigs/should_compile/Either.stderr | 2 +- testsuite/tests/partial-sigs/should_compile/Every.stderr | 2 +- .../tests/partial-sigs/should_compile/EveryNamed.stderr | 2 +- .../partial-sigs/should_compile/ExpressionSig.stderr | 2 +- .../should_compile/ExpressionSigNamed.stderr | 2 +- .../partial-sigs/should_compile/ExtraConstraints1.stderr | 2 +- .../partial-sigs/should_compile/ExtraConstraints2.stderr | 2 +- .../partial-sigs/should_compile/ExtraConstraints3.stderr | 2 +- .../partial-sigs/should_compile/ExtraNumAMROff.stderr | 2 +- .../tests/partial-sigs/should_compile/Forall1.stderr | 2 +- .../tests/partial-sigs/should_compile/GenNamed.stderr | 2 +- .../tests/partial-sigs/should_compile/HigherRank1.stderr | 2 +- .../tests/partial-sigs/should_compile/HigherRank2.stderr | 2 +- .../should_compile/LocalDefinitionBug.stderr | 2 +- .../tests/partial-sigs/should_compile/Meltdown.stderr | 2 +- .../partial-sigs/should_compile/MonoLocalBinds.stderr | 2 +- .../tests/partial-sigs/should_compile/NamedTyVar.stderr | 2 +- .../should_compile/ParensAroundContext.stderr | 2 +- .../tests/partial-sigs/should_compile/PatBind.stderr | 2 +- .../tests/partial-sigs/should_compile/PatternSig.stderr | 2 +- .../tests/partial-sigs/should_compile/Recursive.stderr | 2 +- .../should_compile/ScopedNamedWildcards.stderr | 2 +- .../should_compile/ScopedNamedWildcardsGood.stderr | 2 +- .../tests/partial-sigs/should_compile/ShowNamed.stderr | 2 +- .../tests/partial-sigs/should_compile/SimpleGen.stderr | 2 +- .../tests/partial-sigs/should_compile/SkipMany.stderr | 2 +- .../partial-sigs/should_compile/SomethingShowable.stderr | 2 +- .../tests/partial-sigs/should_compile/Uncurry.stderr | 2 +- .../partial-sigs/should_compile/UncurryNamed.stderr | 2 +- .../should_compile/WarningWildcardInstantiations.stderr | 5 ++--- testsuite/tests/rename/should_fail/rnfail040.stderr | 2 +- testsuite/tests/roles/should_compile/Roles1.stderr | 2 +- testsuite/tests/roles/should_compile/Roles14.stderr | 2 +- testsuite/tests/roles/should_compile/Roles2.stderr | 2 +- testsuite/tests/roles/should_compile/Roles3.stderr | 2 +- testsuite/tests/roles/should_compile/Roles4.stderr | 2 +- testsuite/tests/roles/should_compile/T8958.stderr | 2 +- testsuite/tests/safeHaskell/check/Check01.stderr | 2 +- testsuite/tests/safeHaskell/check/Check06.stderr | 2 +- testsuite/tests/safeHaskell/check/Check08.stderr | 2 +- testsuite/tests/safeHaskell/check/Check09.stderr | 4 ++-- testsuite/tests/safeHaskell/check/pkg01/ImpSafe01.stderr | 2 +- testsuite/tests/safeHaskell/check/pkg01/ImpSafe04.stderr | 2 +- .../tests/safeHaskell/check/pkg01/ImpSafeOnly07.stderr | 4 ++-- .../tests/safeHaskell/check/pkg01/ImpSafeOnly08.stderr | 4 ++-- testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout | 16 ++++++++-------- testsuite/tests/safeHaskell/flags/SafeFlags17.stderr | 2 +- testsuite/tests/th/TH_Roles2.stderr | 2 +- testsuite/tests/typecheck/should_compile/tc231.stderr | 2 +- testsuite/tests/typecheck/should_fail/tcfail182.stderr | 2 +- 63 files changed, 75 insertions(+), 76 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 6f63609a351f6f9500d6b778b30ec53f8875c0b7 From git at git.haskell.org Tue Oct 27 23:25:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 23:25:38 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Move win32 tarball download logic to script (d3e069a) Message-ID: <20151027232538.A86233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/d3e069a3f8238c01df235ec7aff5c946843e8a21/ghc >--------------------------------------------------------------- commit d3e069a3f8238c01df235ec7aff5c946843e8a21 Author: Ben Gamari Date: Mon Oct 26 23:12:57 2015 +0100 Move win32 tarball download logic to script This provides an easy way for users and packages to grab the tarballs necessary to generate a complete source tarball. >--------------------------------------------------------------- d3e069a3f8238c01df235ec7aff5c946843e8a21 .gitignore | 1 + configure.ac | 110 +++++++++++------------------------- mk/get-win32-tarballs.sh | 144 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+), 78 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 d3e069a3f8238c01df235ec7aff5c946843e8a21 From git at git.haskell.org Tue Oct 27 23:25:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 23:25:41 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: TcRnMonad: Backport pushLevelAndCaptureConstraints (9359dbc) Message-ID: <20151027232541.4610A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/9359dbcc2d01db19d251e68adf6c428eac7c7144/ghc >--------------------------------------------------------------- commit 9359dbcc2d01db19d251e68adf6c428eac7c7144 Author: Ben Gamari Date: Tue Oct 27 20:10:46 2015 +0100 TcRnMonad: Backport pushLevelAndCaptureConstraints >--------------------------------------------------------------- 9359dbcc2d01db19d251e68adf6c428eac7c7144 compiler/typecheck/TcRnMonad.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index 74f8099..dd70011 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -1170,6 +1170,17 @@ captureTcLevel thing_inside thing_inside ; return (res, tclvl') } +pushLevelAndCaptureConstraints :: TcM a -> TcM (a, TcLevel, WantedConstraints) +pushLevelAndCaptureConstraints thing_inside + = do { env <- getLclEnv + ; lie_var <- newTcRef emptyWC ; + ; let tclvl' = pushTcLevel (tcl_tclvl env) + ; res <- setLclEnv (env { tcl_tclvl = tclvl' + , tcl_lie = lie_var }) + thing_inside + ; lie <- readTcRef lie_var + ; return (res, tclvl', lie) } + pushTcLevelM :: TcM a -> TcM a pushTcLevelM thing_inside = do { env <- getLclEnv From git at git.haskell.org Tue Oct 27 23:25:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 27 Oct 2015 23:25:44 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Zonk properly when checkig pattern synonyms (5144990) Message-ID: <20151027232544.D91493A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/5144990c5a4ef44397d3a2eddd0c4308b5fe7195/ghc >--------------------------------------------------------------- commit 5144990c5a4ef44397d3a2eddd0c4308b5fe7195 Author: Simon Peyton Jones Date: Tue Oct 27 13:27:42 2015 +0000 Zonk properly when checkig pattern synonyms Fixes Trac #10997 Merge to stable branch >--------------------------------------------------------------- 5144990c5a4ef44397d3a2eddd0c4308b5fe7195 compiler/typecheck/TcPatSyn.hs | 55 +++++++++++++++------- compiler/typecheck/TcUnify.hs | 47 +++++++++--------- testsuite/tests/patsyn/should_compile/T10997.hs | 6 +++ testsuite/tests/patsyn/should_compile/T10997_1.hs | 15 ++++++ testsuite/tests/patsyn/should_compile/T10997_1a.hs | 17 +++++++ testsuite/tests/patsyn/should_compile/T10997a.hs | 11 +++++ testsuite/tests/patsyn/should_compile/all.T | 4 ++ 7 files changed, 115 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 5144990c5a4ef44397d3a2eddd0c4308b5fe7195 From git at git.haskell.org Wed Oct 28 06:48:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 06:48:31 +0000 (UTC) Subject: [commit: ghc] master: Build system: don't add ALL_HC_OPTS when linking (9fc2d77) Message-ID: <20151028064831.347273A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9fc2d777f53110040f48ab27643a16888fa377f5/ghc >--------------------------------------------------------------- commit 9fc2d777f53110040f48ab27643a16888fa377f5 Author: Thomas Miedema Date: Mon Oct 26 20:54:58 2015 +0100 Build system: don't add ALL_HC_OPTS when linking Summary: The current scheme in rules/distdir-way-opts.mk is something like this: GHC_LD_OPTS = MOST_HC_OPTS + ALL_LD_OPTS MOST_DIR_HC_OPTS = MOST_HC_OPTS + -odir,-hidir,-stubdir ALL_HC_OPTS = MOST_DIR_HC_OPTS + -hisuf,-osuf,-hcsuf,-split-objs,-dynamic-too Notice that both ALL_HC_OPTS and GHC_LD_OPTS include MOST_HC_OPTS, and currently both got added when linking. Adding MOST_HC_OPTS twice results in overly long and hard to decipher command lines (and build logs). This commit fixes that. Afaik, -odir,-hidir,-stubdir,-hisuf,-osuf,-hcsuf,-spit-objs,-dynamic-too are all not needed when linking, so this change should be safe to make. GHC_LD_OPTS is for linking, ALL_HC_OPTS is for compiling. ALL_HC_OPTS was added to the linking commands in 37a6a52facd1c3999ce4472c50b0030568be1e04, to make sure -no-user-package-conf would be in the options list. It still is after this change. Reviewers: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1379 >--------------------------------------------------------------- 9fc2d777f53110040f48ab27643a16888fa377f5 rules/build-package-way.mk | 4 ++-- rules/build-prog.mk | 2 +- rules/distdir-way-opts.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index a10e538..592d3a7 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -91,7 +91,7 @@ endif else # ifneq "$$(HostOS_CPP)" "mingw32" $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) - $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \ + $$(call cmd,$1_$2_HC) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \ -shared -dynamic -dynload deploy \ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \ -no-auto-link-packages \ @@ -170,7 +170,7 @@ endef # build-package-way # $5 = object files to link # $6 = output filename define build-dll - $(call cmd,$1_$2_HC) $($1_$2_$3_ALL_HC_OPTS) $($1_$2_$3_GHC_LD_OPTS) $4 $5 \ + $(call cmd,$1_$2_HC) $($1_$2_$3_GHC_LD_OPTS) $4 $5 \ -shared -dynamic -dynload deploy \ $(addprefix -l,$($1_$2_EXTRA_LIBRARIES)) \ -no-auto-link-packages \ diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 1a49707..48b8aa2 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -255,7 +255,7 @@ $1/$2/build/tmp/$$($1_$2_PROG).dll : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$( else # $1_$2_PROG_NEEDS_C_WRAPPER=NO ifeq "$$($1_$2_LINK_WITH_GCC)" "NO" $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. - $$(call cmd,$1_$2_HC) -o $$@ $$($1_$2_$$($1_$2_PROGRAM_WAY)_ALL_HC_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_GHC_LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) + $$(call cmd,$1_$2_HC) -o $$@ $$($1_$2_$$($1_$2_PROGRAM_WAY)_GHC_LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) else $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index 920ff07..e848943 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -131,7 +131,7 @@ $1_$2_$3_MOST_DIR_HC_OPTS = \ # that -O0 is effective (see #5484) # $1_$2_$3_ALL_HC_OPTS: this is all the options we will pass to GHC -# for a given ($1,$2,$3). +# for a given ($1,$2,$3) when we use it for compiling. $1_$2_$3_ALL_HC_OPTS = \ -hisuf $$($3_hisuf) -osuf $$($3_osuf) -hcsuf $$($3_hcsuf) \ $$($1_$2_$3_MOST_DIR_HC_OPTS) \ From git at git.haskell.org Wed Oct 28 10:14:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:05 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9858-typeable-ben3' created Message-ID: <20151028101405.E054C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T9858-typeable-ben3 Referencing: 02323906b30aa1cf84409e049637278f1ac64636 From git at git.haskell.org Wed Oct 28 10:14:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:08 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: IntWord64: Add import of GHC.Types (411731d) Message-ID: <20151028101408.82A513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/411731d7e0e7cb318602e892acbb21e95dc60914/ghc >--------------------------------------------------------------- commit 411731d7e0e7cb318602e892acbb21e95dc60914 Author: Ben Gamari Date: Tue Sep 22 22:49:08 2015 +0200 IntWord64: Add import of GHC.Types >--------------------------------------------------------------- 411731d7e0e7cb318602e892acbb21e95dc60914 libraries/ghc-prim/GHC/IntWord64.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/ghc-prim/GHC/IntWord64.hs b/libraries/ghc-prim/GHC/IntWord64.hs index 52dc08e..35bbfd8 100644 --- a/libraries/ghc-prim/GHC/IntWord64.hs +++ b/libraries/ghc-prim/GHC/IntWord64.hs @@ -23,7 +23,10 @@ module GHC.IntWord64 ( #endif ) where +import GHC.Types () -- Make implicit dependency known to build system + #if WORD_SIZE_IN_BITS < 64 + import GHC.Prim foreign import ccall unsafe "hs_eqWord64" eqWord64# :: Word64# -> Word64# -> Int# From git at git.haskell.org Wed Oct 28 10:14:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:11 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: Generate Typeable info at definition sites (8c3a2ed) Message-ID: <20151028101411.C5AF73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e/ghc >--------------------------------------------------------------- commit 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e Author: Ben Gamari Date: Wed Aug 26 18:24:34 2015 +0200 Generate Typeable info at definition sites This patch implements the idea floated in Trac #9858, namely that we should generate type-representation information at the data type declaration site, rather than when solving a Typeable constraint. However, this turned out quite a bit harder than I expected. I still think it's the right thing to do, and it's done now, but it was quite a struggle. See particularly * Note [Grand plan for Typeable] in TcTypeable (which is a new module) * Note [The overall promotion story] in DataCon (clarifies existing stuff) The most painful bit was that to generate Typeable instances (ie TyConRepName bindings) for every TyCon is tricky for types in ghc-prim etc: * We need to have enough data types around to *define* a TyCon * Many of these types are wired-in Also, to minimise the code generated for each data type, I wanted to generate pure data, not CAFs with unpackCString# stuff floating about. Performance ~~~~~~~~~~~ Three perf/compiler tests start to allocate quite a bit more. This isn't surprising, because they all allocate zillions of data types, with practically no other code, esp. T1969 * T1969: GHC allocates 30% more * T5642: GHC allocates 14% more * T9872d: GHC allocates 5% more I'm treating this as acceptable. The payoff comes in Typeable-heavy code. Remaining to do ~~~~~~~~~~~~~~~ * I think that "TyCon" and "Module" are over-generic names to use for the runtime type representations used in GHC.Typeable. Better might be "TrTyCon" and "TrModule". But I have not yet done this * Add more info the the "TyCon" e.g. source location where it was defined * Use the new "Module" type to help with Trac Trac #10068 * It would be possible to generate TyConRepName (ie Typeable instances) selectively rather than all the time. We'd need to persist the information in interface files. Lacking a motivating reason I have not done this, but it would not be difficult. Refactoring ~~~~~~~~~~~ As is so often the case, I ended up refactoring more than I intended. In particular * In TyCon, a type *family* (whether type or data) is repesented by a FamilyTyCon * a algebraic data type (including data/newtype instances) is represented by AlgTyCon This wasn't true before; a data family was represented as an AlgTyCon. There are some corresponding changes in IfaceSyn. * Also get rid of the (unhelpfully named) tyConParent. * In TyCon define 'Promoted', isomorphic to Maybe, used when things are optionally promoted; and use it elsewhere in GHC. * Cleanup handling of knownKeyNames * Each TyCon, including promoted TyCons, contains its TyConRepName, if it has one. This is, in effect, the name of its Typeable instance. * Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls >--------------------------------------------------------------- 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e compiler/basicTypes/DataCon.hs | 222 ++++++++--- compiler/basicTypes/OccName.hs | 6 +- compiler/basicTypes/Unique.hs | 51 ++- compiler/coreSyn/MkCore.hs | 8 +- compiler/deSugar/DsBinds.hs | 281 +++++++------ compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsUtils.hs | 14 +- compiler/ghc.cabal.in | 1 + compiler/hsSyn/HsUtils.hs | 6 +- compiler/iface/BuildTyCl.hs | 42 +- compiler/iface/IfaceSyn.hs | 100 +++-- compiler/iface/MkIface.hs | 9 +- compiler/iface/TcIface.hs | 89 +++-- compiler/main/HscMain.hs | 13 +- compiler/main/HscTypes.hs | 12 +- compiler/prelude/PrelInfo.hs | 111 +++--- compiler/prelude/PrelNames.hs | 88 +++-- compiler/prelude/THNames.hs | 105 +++-- compiler/prelude/TysPrim.hs | 38 +- compiler/prelude/TysWiredIn.hs | 55 ++- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcBinds.hs | 35 +- compiler/typecheck/TcEnv.hs | 5 +- compiler/typecheck/TcEvidence.hs | 69 ++-- compiler/typecheck/TcGenGenerics.hs | 41 +- compiler/typecheck/TcHsSyn.hs | 27 +- compiler/typecheck/TcHsType.hs | 8 +- compiler/typecheck/TcInstDcls.hs | 19 +- compiler/typecheck/TcInteract.hs | 440 ++++++++++++--------- compiler/typecheck/TcPatSyn.hs | 4 +- compiler/typecheck/TcRnDriver.hs | 40 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 7 +- compiler/typecheck/TcTyClsDecls.hs | 323 +++------------ compiler/typecheck/TcTyDecls.hs | 330 ++++++++++++---- compiler/typecheck/TcTypeNats.hs | 12 +- compiler/typecheck/TcTypeable.hs | 206 ++++++++++ compiler/types/TyCon.hs | 409 +++++++++++-------- compiler/types/Type.hs | 9 + compiler/utils/Binary.hs | 11 +- compiler/vectorise/Vectorise/Generic/PData.hs | 4 +- compiler/vectorise/Vectorise/Type/Env.hs | 4 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 7 +- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable.hs | 3 +- libraries/base/Data/Typeable/Internal.hs | 330 ++++++++++------ libraries/base/GHC/Show.hs | 10 + libraries/base/GHC/Stack/Types.hs | 13 + libraries/ghc-prim/GHC/Classes.hs | 36 +- libraries/ghc-prim/GHC/Magic.hs | 2 + libraries/ghc-prim/GHC/Tuple.hs | 3 + libraries/ghc-prim/GHC/Types.hs | 54 ++- .../tests/deSugar/should_compile/T2431.stderr | 29 +- testsuite/tests/deriving/should_fail/T10524.stderr | 5 +- testsuite/tests/deriving/should_fail/T9687.stderr | 4 +- testsuite/tests/ghci.debugger/scripts/T2740.stdout | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/break009.stdout | 4 +- .../tests/ghci.debugger/scripts/break010.stdout | 4 +- .../tests/ghci.debugger/scripts/break011.stdout | 8 +- .../tests/ghci.debugger/scripts/break012.stdout | 16 +- .../tests/ghci.debugger/scripts/break018.stdout | 4 +- .../ghci.debugger/scripts/break022/break022.stdout | 2 +- .../tests/ghci.debugger/scripts/break028.stdout | 6 +- .../tests/ghci.debugger/scripts/print018.stdout | 6 +- .../tests/ghci.debugger/scripts/print019.stderr | 4 +- .../tests/ghci.debugger/scripts/print031.stdout | 2 +- testsuite/tests/ghci/scripts/T8674.stdout | 4 +- .../indexed-types/should_compile/T3017.stderr | 2 +- .../tests/numeric/should_compile/T7116.stdout | 58 ++- .../should_fail/overloadedlistsfail01.stderr | 4 +- testsuite/tests/polykinds/T8132.stderr | 4 +- testsuite/tests/quasiquotation/T7918.stdout | 3 + testsuite/tests/roles/should_compile/Roles1.stderr | 61 +++ .../tests/roles/should_compile/Roles13.stderr | 53 ++- .../tests/roles/should_compile/Roles14.stderr | 7 + testsuite/tests/roles/should_compile/Roles2.stderr | 13 + testsuite/tests/roles/should_compile/Roles3.stderr | 25 ++ testsuite/tests/roles/should_compile/Roles4.stderr | 13 + testsuite/tests/roles/should_compile/T8958.stderr | 9 +- .../tests/simplCore/should_compile/T3234.stderr | 4 +- .../tests/simplCore/should_compile/T3717.stderr | 29 +- .../tests/simplCore/should_compile/T3772.stdout | 29 +- .../tests/simplCore/should_compile/T4908.stderr | 29 +- .../tests/simplCore/should_compile/T4930.stderr | 29 +- .../tests/simplCore/should_compile/T7360.stderr | 47 ++- .../tests/simplCore/should_compile/T8274.stdout | 10 +- .../tests/simplCore/should_compile/T9400.stderr | 17 +- .../tests/simplCore/should_compile/rule2.stderr | 3 +- .../simplCore/should_compile/spec-inline.stderr | 29 +- .../tests/stranal/should_compile/T10694.stdout | 3 + .../stranal/sigs/BottomFromInnerLambda.stderr | 1 + testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr | 2 + testsuite/tests/stranal/sigs/HyperStrUse.stderr | 1 + testsuite/tests/stranal/sigs/StrAnalExample.stderr | 1 + testsuite/tests/stranal/sigs/T8569.stderr | 2 + testsuite/tests/stranal/sigs/T8598.stderr | 1 + testsuite/tests/stranal/sigs/UnsatFun.stderr | 1 + testsuite/tests/th/TH_Roles2.stderr | 8 + .../tests/typecheck/should_compile/holes2.stderr | 13 +- testsuite/tests/typecheck/should_fail/T5095.stderr | 2 +- .../tests/typecheck/should_fail/T9858a.stderr | 6 +- .../tests/typecheck/should_fail/T9858b.stderr | 5 +- .../should_fail/TcStaticPointersFail02.stderr | 4 +- .../tests/typecheck/should_fail/tcfail072.stderr | 4 +- .../tests/typecheck/should_fail/tcfail133.stderr | 14 +- 106 files changed, 2838 insertions(+), 1548 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 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e From git at git.haskell.org Wed Oct 28 10:14:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:14 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: Fixes (e2b3d1d) Message-ID: <20151028101414.6B29D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/e2b3d1dfc6ffecff4ff01364dfbdedec70219e47/ghc >--------------------------------------------------------------- commit e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 Author: Ben Gamari Date: Tue Oct 27 14:53:39 2015 +0100 Fixes >--------------------------------------------------------------- e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 compiler/basicTypes/OccName.hs | 13 +++++ compiler/deSugar/DsBinds.hs | 2 +- compiler/iface/IfaceSyn.hs | 1 - compiler/iface/MkIface.hs | 3 +- compiler/typecheck/TcEnv.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 3 -- compiler/typecheck/TcTyDecls.hs | 97 ++++++++++++++++++-------------------- compiler/typecheck/TcTypeable.hs | 4 +- libraries/ghc-prim/GHC/Types.hs | 6 ++- 9 files changed, 67 insertions(+), 64 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 e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 From git at git.haskell.org Wed Oct 28 10:14:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:17 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: debug (f814b47) Message-ID: <20151028101417.085B73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/f814b47ccc7efde0951f867ad3f56c27b27f4856/ghc >--------------------------------------------------------------- commit f814b47ccc7efde0951f867ad3f56c27b27f4856 Author: Ben Gamari Date: Tue Oct 27 16:25:18 2015 +0100 debug >--------------------------------------------------------------- f814b47ccc7efde0951f867ad3f56c27b27f4856 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcTyDecls.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 1e52a22..1afeda0 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -194,7 +194,7 @@ tcTopBinds (ValBindsIn {}) = panic "tcTopBinds" tcRecSelBinds :: HsValBinds Name -> TcM TcGblEnv tcRecSelBinds (ValBindsOut binds sigs) - = -- tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ + = tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ -- this envt extension happens in tcValBinds do { (rec_sel_binds, tcg_env) <- discardWarnings $ tcValBinds TopLevel binds sigs getGblEnv diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index d1b091d..ea96bb5 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -819,6 +819,7 @@ tcAddImplicits tyclss do { (typeable_ids, typeable_binds) <- mkTypeableBinds tycons ; gbl_env <- tcExtendGlobalValEnv typeable_ids $ tcRecSelBinds $ mkRecSelBinds tyclss + ; traceTc "tcAddImplicits" (ppr $ mkRecSelBinds tyclss) ; return (gbl_env `addTypecheckedBinds` typeable_binds) } where implicit_things = concatMap implicitTyThings tyclss From git at git.haskell.org Wed Oct 28 10:14:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:19 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: Fix (2c8a85b) Message-ID: <20151028101419.9C6213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/2c8a85b127526844f73032c8554bc8e86c80cc9a/ghc >--------------------------------------------------------------- commit 2c8a85b127526844f73032c8554bc8e86c80cc9a Author: Ben Gamari Date: Tue Oct 27 17:00:17 2015 +0100 Fix >--------------------------------------------------------------- 2c8a85b127526844f73032c8554bc8e86c80cc9a compiler/iface/MkIface.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index d92942a..79fbf67 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1610,7 +1610,7 @@ tyConToIfaceDecl env tycon ifCons = ifaceConDecls (algTyConRhs tycon) (algTcFields tycon), ifRec = boolToRecFlag (isRecursiveTyCon tycon), ifGadtSyntax = isGadtSyntaxTyCon tycon, - ifPromotable = isPromotedTyCon tycon, + ifPromotable = isPromotableTyCon tycon, ifParent = parent }) | otherwise -- FunTyCon, PrimTyCon, promoted TyCon/DataCon From git at git.haskell.org Wed Oct 28 10:14:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:22 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: Fix (e493718) Message-ID: <20151028101422.399933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/e493718d67d00954f584af9eefa0340ea7119129/ghc >--------------------------------------------------------------- commit e493718d67d00954f584af9eefa0340ea7119129 Author: Ben Gamari Date: Tue Oct 27 17:10:40 2015 +0100 Fix >--------------------------------------------------------------- e493718d67d00954f584af9eefa0340ea7119129 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcTyDecls.hs | 43 ++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 1afeda0..1e52a22 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -194,7 +194,7 @@ tcTopBinds (ValBindsIn {}) = panic "tcTopBinds" tcRecSelBinds :: HsValBinds Name -> TcM TcGblEnv tcRecSelBinds (ValBindsOut binds sigs) - = tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ + = -- tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ -- this envt extension happens in tcValBinds do { (rec_sel_binds, tcg_env) <- discardWarnings $ tcValBinds TopLevel binds sigs getGblEnv diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index ea96bb5..83ef841 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -27,7 +27,7 @@ module TcTyDecls( import TcRnMonad import TcEnv import TcTypeable( mkTypeableBinds ) -import TcBinds( tcRecSelBinds, addTypecheckedBinds ) +import TcBinds( tcValBinds, addTypecheckedBinds ) import TypeRep( Type(..) ) import TcType import TysWiredIn( unitTy ) @@ -816,11 +816,10 @@ tcAddImplicits tyclss = discardWarnings $ tcExtendGlobalEnvImplicit implicit_things $ tcExtendGlobalValEnv def_meth_ids $ - do { (typeable_ids, typeable_binds) <- mkTypeableBinds tycons - ; gbl_env <- tcExtendGlobalValEnv typeable_ids - $ tcRecSelBinds $ mkRecSelBinds tyclss - ; traceTc "tcAddImplicits" (ppr $ mkRecSelBinds tyclss) - ; return (gbl_env `addTypecheckedBinds` typeable_binds) } + do { (rec_sel_ids, rec_sel_binds) <- mkRecSelBinds tycons + ; (typeable_ids, typeable_binds) <- mkTypeableBinds tycons + ; gbl_env <- tcExtendGlobalValEnv (rec_sel_ids ++ typeable_ids) getGblEnv + ; return (gbl_env `addTypecheckedBinds` (rec_sel_binds ++ typeable_binds)) } where implicit_things = concatMap implicitTyThings tyclss tycons = [tc | ATyCon tc <- tyclss] @@ -860,22 +859,26 @@ must bring the default method Ids into scope first (so they can be seen when typechecking the [d| .. |] quote, and typecheck them later. -} -mkRecSelBinds :: [TyThing] -> HsValBinds Name --- NB We produce *un-typechecked* bindings, rather like 'deriving' --- This makes life easier, because the later type checking will add --- all necessary type abstractions and applications +mkRecSelBinds :: [TyCon] -> TcM ([Id], [LHsBinds Id]) mkRecSelBinds tycons - = ValBindsOut [(NonRecursive, b) | b <- binds] sigs - where - (sigs, binds) = unzip rec_sels - rec_sels = map mkRecSelBind [ (tc,fld) - | ATyCon tc <- tycons - , fld <- tyConFieldLabels tc ] - - -mkRecSelBind :: (TyCon, FieldLabel) -> (LSig Name, LHsBinds Name) + = do { -- We generate *un-typechecked* bindings in mkRecSelBind, and + -- then typecheck them, rather like 'deriving'. This makes life + -- easier, because the later type checking will add all necessary + -- type abstractions and applications + + let sel_binds :: [(RecFlag, LHsBinds Name)] + sel_sigs :: [LSig Name] + (sel_sigs, sel_binds) + = mapAndUnzip mkRecSelBind [ (tc,fld) + | tc <- tycons + , fld <- tyConFieldLabels tc ] + sel_ids = [sel_id | L _ (IdSig sel_id) <- sel_sigs] + ; (sel_binds, _) <- tcValBinds TopLevel sel_binds sel_sigs (return ()) + ; return (sel_ids, map snd sel_binds) } + +mkRecSelBind :: (TyCon, FieldLabel) -> (LSig Name, (RecFlag, LHsBinds Name)) mkRecSelBind (tycon, fl) - = (L loc (IdSig sel_id), unitBag (L loc sel_bind)) + = (L loc (IdSig sel_id), (NonRecursive, unitBag (L loc sel_bind))) where loc = getSrcSpan sel_name sel_id = mkExportedLocalId rec_details sel_name sel_ty From git at git.haskell.org Wed Oct 28 10:14:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:24 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: PrelNames: Fix duplicate unique (8d9e40b) Message-ID: <20151028101424.CC59D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/8d9e40b0e6b961c43c7546813c258e32e15002b7/ghc >--------------------------------------------------------------- commit 8d9e40b0e6b961c43c7546813c258e32e15002b7 Author: Ben Gamari Date: Tue Oct 27 22:10:58 2015 +0100 PrelNames: Fix duplicate unique Previously unboundKey and fromIntegerClassOpKey were sharing a Unique Reassign unboundKey to `mkPreludeMiscIdUnique 158` >--------------------------------------------------------------- 8d9e40b0e6b961c43c7546813c258e32e15002b7 compiler/prelude/PrelNames.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 077bc36..05a38ff 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -1891,7 +1891,7 @@ during type checking. -- Just a place holder for unbound variables produced by the renamer: unboundKey :: Unique -unboundKey = mkPreludeMiscIdUnique 160 +unboundKey = mkPreludeMiscIdUnique 158 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey, enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey, From git at git.haskell.org Wed Oct 28 10:14:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:27 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: Unify: Add Outputable instance for UnifyResultM (f992424) Message-ID: <20151028101427.64A2B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c/ghc >--------------------------------------------------------------- commit f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c Author: Ben Gamari Date: Wed Oct 28 02:21:16 2015 +0100 Unify: Add Outputable instance for UnifyResultM >--------------------------------------------------------------- f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c compiler/types/Unify.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index de22066..87681e0 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -30,6 +30,8 @@ import Type import TyCon import TypeRep import Util ( filterByList ) +import Outputable +import FastString (sLit) import Control.Monad (liftM, foldM, ap) #if __GLASGOW_HASKELL__ < 709 @@ -475,6 +477,11 @@ tcUnifyTysFG :: (TyVar -> BindFlag) tcUnifyTysFG bind_fn tys1 tys2 = initUM bind_fn (unify_tys tys1 tys2) +instance Outputable a => Outputable (UnifyResultM a) where + ppr SurelyApart = ptext (sLit "SurelyApart") + ppr (Unifiable x) = ptext (sLit "Unifiable") <+> ppr x + ppr (MaybeApart x) = ptext (sLit "MaybeApart") <+> ppr x + {- ************************************************************************ * * From git at git.haskell.org Wed Oct 28 10:14:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:14:30 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben3: debug (0232390) Message-ID: <20151028101430.08DCF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben3 Link : http://ghc.haskell.org/trac/ghc/changeset/02323906b30aa1cf84409e049637278f1ac64636/ghc >--------------------------------------------------------------- commit 02323906b30aa1cf84409e049637278f1ac64636 Author: Ben Gamari Date: Wed Oct 28 10:36:28 2015 +0100 debug >--------------------------------------------------------------- 02323906b30aa1cf84409e049637278f1ac64636 compiler/types/FamInstEnv.hs | 13 +++++++++++-- compiler/types/Unify.hs | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index a41e453..1143fa7 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -674,11 +674,13 @@ lookupFamInstEnvConflicts -- Precondition: the tycon is saturated (or over-saturated) lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) - = lookup_fam_inst_env my_unify envs fam tys + = let ret = lookup_fam_inst_env my_unify envs fam tys + in pprTrace "lookupFamInstEnvConflicts(return)" (vcat [pprBranch new_branch, ppr $ null ret]) ret where (fam, tys) = famInstSplitLHS fam_inst -- In example above, fam tys' = F [b] + pprBranch br = ppr (coAxBranchLHS br) <+> char '~' <+> ppr (coAxBranchRHS br) my_unify (FamInst { fi_axiom = old_axiom }) tpl_tvs tpl_tys _ = ASSERT2( tyVarsOfTypes tys `disjointVarSet` tpl_tvs, (ppr fam <+> ppr tys) $$ @@ -687,7 +689,14 @@ lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) -- They shouldn't because we allocate separate uniques for them if compatibleBranches (coAxiomSingleBranch old_axiom) new_branch then Nothing - else Just noSubst + else pprTrace "lookupFamInstEnvConflicts" + (vcat [pprBranch (coAxiomSingleBranch old_axiom), pprBranch new_branch + , ppr lhs1, ppr lhs2 + , ppr $ compatibleBranches (coAxiomSingleBranch old_axiom) new_branch + , ppr $ tcUnifyTysFG instanceBindFun lhs1 lhs2]) $ + Just noSubst + where lhs1 = cab_lhs $ coAxiomSingleBranch old_axiom + lhs2 = cab_lhs $ new_branch -- Note [Family instance overlap conflicts] noSubst = panic "lookupFamInstEnvConflicts noSubst" diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index 87681e0..7f28bed 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -577,7 +577,7 @@ unify ty1 ty2 = if tc1 == tc2 then if isInjectiveTyCon tc1 Nominal then unify_tys tys1 tys2 - else don'tBeSoSure $ unify_tys tys1 tys2 + else pprTrace "NotSoFast" (hsep [ppr tc1, ppr tys1, ppr tc2, ppr tys2]) $ don'tBeSoSure $ unify_tys tys1 tys2 else -- tc1 /= tc2 if isGenerativeTyCon tc1 Nominal && isGenerativeTyCon tc2 Nominal then surelyApart @@ -610,7 +610,7 @@ unify_tys orig_xs orig_ys go [] [] = return () go (x:xs) (y:ys) = do { unify x y ; go xs ys } - go _ _ = maybeApart -- See Note [Lists of different lengths are MaybeApart] + go _ _ = pprTrace "unify_tys" (hsep [ppr orig_xs, ppr orig_ys])maybeApart -- See Note [Lists of different lengths are MaybeApart] --------------------------------- uVar :: TyVar -- Type variable to be unified @@ -661,7 +661,7 @@ uUnrefined subst tv1 ty2 (TyVarTy tv2) ; b2 <- tvBindFlag tv2 ; let ty1 = TyVarTy tv1 ; case (b1, b2) of - (Skolem, Skolem) -> maybeApart -- See Note [Unification with skolems] + (Skolem, Skolem) -> pprTrace "uUnrefined" (hsep [ppr tv1, ppr ty2, ppr tv2]) maybeApart -- See Note [Unification with skolems] (BindMe, _) -> extendSubst tv1 ty2 (_, BindMe) -> extendSubst tv2 ty1 } @@ -681,7 +681,7 @@ bindTv :: TyVar -> Type -> UM () bindTv tv ty -- ty is not a type variable = do { b <- tvBindFlag tv ; case b of - Skolem -> maybeApart -- See Note [Unification with skolems] + Skolem -> pprTrace "bindTv" (hsep [ppr tv, ppr ty]) maybeApart -- See Note [Unification with skolems] BindMe -> extendSubst tv ty } From git at git.haskell.org Wed Oct 28 10:16:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:05 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9858-typeable-ben' deleted Message-ID: <20151028101605.768883A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/T9858-typeable-ben From git at git.haskell.org Wed Oct 28 10:16:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:14 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9858-typeable-ben2' deleted Message-ID: <20151028101614.08D733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/T9858-typeable-ben2 From git at git.haskell.org Wed Oct 28 10:16:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:22 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9858-typeable-ben3' deleted Message-ID: <20151028101622.D5CAA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/T9858-typeable-ben3 From git at git.haskell.org Wed Oct 28 10:16:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:38 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T9858-typeable-ben' created Message-ID: <20151028101638.3B78C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T9858-typeable-ben Referencing: 02323906b30aa1cf84409e049637278f1ac64636 From git at git.haskell.org Wed Oct 28 10:16:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:40 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: IntWord64: Add import of GHC.Types (411731d) Message-ID: <20151028101640.D0BF83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/411731d7e0e7cb318602e892acbb21e95dc60914/ghc >--------------------------------------------------------------- commit 411731d7e0e7cb318602e892acbb21e95dc60914 Author: Ben Gamari Date: Tue Sep 22 22:49:08 2015 +0200 IntWord64: Add import of GHC.Types >--------------------------------------------------------------- 411731d7e0e7cb318602e892acbb21e95dc60914 libraries/ghc-prim/GHC/IntWord64.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/ghc-prim/GHC/IntWord64.hs b/libraries/ghc-prim/GHC/IntWord64.hs index 52dc08e..35bbfd8 100644 --- a/libraries/ghc-prim/GHC/IntWord64.hs +++ b/libraries/ghc-prim/GHC/IntWord64.hs @@ -23,7 +23,10 @@ module GHC.IntWord64 ( #endif ) where +import GHC.Types () -- Make implicit dependency known to build system + #if WORD_SIZE_IN_BITS < 64 + import GHC.Prim foreign import ccall unsafe "hs_eqWord64" eqWord64# :: Word64# -> Word64# -> Int# From git at git.haskell.org Wed Oct 28 10:16:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:44 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Generate Typeable info at definition sites (8c3a2ed) Message-ID: <20151028101644.0A9733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e/ghc >--------------------------------------------------------------- commit 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e Author: Ben Gamari Date: Wed Aug 26 18:24:34 2015 +0200 Generate Typeable info at definition sites This patch implements the idea floated in Trac #9858, namely that we should generate type-representation information at the data type declaration site, rather than when solving a Typeable constraint. However, this turned out quite a bit harder than I expected. I still think it's the right thing to do, and it's done now, but it was quite a struggle. See particularly * Note [Grand plan for Typeable] in TcTypeable (which is a new module) * Note [The overall promotion story] in DataCon (clarifies existing stuff) The most painful bit was that to generate Typeable instances (ie TyConRepName bindings) for every TyCon is tricky for types in ghc-prim etc: * We need to have enough data types around to *define* a TyCon * Many of these types are wired-in Also, to minimise the code generated for each data type, I wanted to generate pure data, not CAFs with unpackCString# stuff floating about. Performance ~~~~~~~~~~~ Three perf/compiler tests start to allocate quite a bit more. This isn't surprising, because they all allocate zillions of data types, with practically no other code, esp. T1969 * T1969: GHC allocates 30% more * T5642: GHC allocates 14% more * T9872d: GHC allocates 5% more I'm treating this as acceptable. The payoff comes in Typeable-heavy code. Remaining to do ~~~~~~~~~~~~~~~ * I think that "TyCon" and "Module" are over-generic names to use for the runtime type representations used in GHC.Typeable. Better might be "TrTyCon" and "TrModule". But I have not yet done this * Add more info the the "TyCon" e.g. source location where it was defined * Use the new "Module" type to help with Trac Trac #10068 * It would be possible to generate TyConRepName (ie Typeable instances) selectively rather than all the time. We'd need to persist the information in interface files. Lacking a motivating reason I have not done this, but it would not be difficult. Refactoring ~~~~~~~~~~~ As is so often the case, I ended up refactoring more than I intended. In particular * In TyCon, a type *family* (whether type or data) is repesented by a FamilyTyCon * a algebraic data type (including data/newtype instances) is represented by AlgTyCon This wasn't true before; a data family was represented as an AlgTyCon. There are some corresponding changes in IfaceSyn. * Also get rid of the (unhelpfully named) tyConParent. * In TyCon define 'Promoted', isomorphic to Maybe, used when things are optionally promoted; and use it elsewhere in GHC. * Cleanup handling of knownKeyNames * Each TyCon, including promoted TyCons, contains its TyConRepName, if it has one. This is, in effect, the name of its Typeable instance. * Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls >--------------------------------------------------------------- 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e compiler/basicTypes/DataCon.hs | 222 ++++++++--- compiler/basicTypes/OccName.hs | 6 +- compiler/basicTypes/Unique.hs | 51 ++- compiler/coreSyn/MkCore.hs | 8 +- compiler/deSugar/DsBinds.hs | 281 +++++++------ compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsUtils.hs | 14 +- compiler/ghc.cabal.in | 1 + compiler/hsSyn/HsUtils.hs | 6 +- compiler/iface/BuildTyCl.hs | 42 +- compiler/iface/IfaceSyn.hs | 100 +++-- compiler/iface/MkIface.hs | 9 +- compiler/iface/TcIface.hs | 89 +++-- compiler/main/HscMain.hs | 13 +- compiler/main/HscTypes.hs | 12 +- compiler/prelude/PrelInfo.hs | 111 +++--- compiler/prelude/PrelNames.hs | 88 +++-- compiler/prelude/THNames.hs | 105 +++-- compiler/prelude/TysPrim.hs | 38 +- compiler/prelude/TysWiredIn.hs | 55 ++- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcBinds.hs | 35 +- compiler/typecheck/TcEnv.hs | 5 +- compiler/typecheck/TcEvidence.hs | 69 ++-- compiler/typecheck/TcGenGenerics.hs | 41 +- compiler/typecheck/TcHsSyn.hs | 27 +- compiler/typecheck/TcHsType.hs | 8 +- compiler/typecheck/TcInstDcls.hs | 19 +- compiler/typecheck/TcInteract.hs | 440 ++++++++++++--------- compiler/typecheck/TcPatSyn.hs | 4 +- compiler/typecheck/TcRnDriver.hs | 40 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 7 +- compiler/typecheck/TcTyClsDecls.hs | 323 +++------------ compiler/typecheck/TcTyDecls.hs | 330 ++++++++++++---- compiler/typecheck/TcTypeNats.hs | 12 +- compiler/typecheck/TcTypeable.hs | 206 ++++++++++ compiler/types/TyCon.hs | 409 +++++++++++-------- compiler/types/Type.hs | 9 + compiler/utils/Binary.hs | 11 +- compiler/vectorise/Vectorise/Generic/PData.hs | 4 +- compiler/vectorise/Vectorise/Type/Env.hs | 4 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 7 +- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable.hs | 3 +- libraries/base/Data/Typeable/Internal.hs | 330 ++++++++++------ libraries/base/GHC/Show.hs | 10 + libraries/base/GHC/Stack/Types.hs | 13 + libraries/ghc-prim/GHC/Classes.hs | 36 +- libraries/ghc-prim/GHC/Magic.hs | 2 + libraries/ghc-prim/GHC/Tuple.hs | 3 + libraries/ghc-prim/GHC/Types.hs | 54 ++- .../tests/deSugar/should_compile/T2431.stderr | 29 +- testsuite/tests/deriving/should_fail/T10524.stderr | 5 +- testsuite/tests/deriving/should_fail/T9687.stderr | 4 +- testsuite/tests/ghci.debugger/scripts/T2740.stdout | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/break009.stdout | 4 +- .../tests/ghci.debugger/scripts/break010.stdout | 4 +- .../tests/ghci.debugger/scripts/break011.stdout | 8 +- .../tests/ghci.debugger/scripts/break012.stdout | 16 +- .../tests/ghci.debugger/scripts/break018.stdout | 4 +- .../ghci.debugger/scripts/break022/break022.stdout | 2 +- .../tests/ghci.debugger/scripts/break028.stdout | 6 +- .../tests/ghci.debugger/scripts/print018.stdout | 6 +- .../tests/ghci.debugger/scripts/print019.stderr | 4 +- .../tests/ghci.debugger/scripts/print031.stdout | 2 +- testsuite/tests/ghci/scripts/T8674.stdout | 4 +- .../indexed-types/should_compile/T3017.stderr | 2 +- .../tests/numeric/should_compile/T7116.stdout | 58 ++- .../should_fail/overloadedlistsfail01.stderr | 4 +- testsuite/tests/polykinds/T8132.stderr | 4 +- testsuite/tests/quasiquotation/T7918.stdout | 3 + testsuite/tests/roles/should_compile/Roles1.stderr | 61 +++ .../tests/roles/should_compile/Roles13.stderr | 53 ++- .../tests/roles/should_compile/Roles14.stderr | 7 + testsuite/tests/roles/should_compile/Roles2.stderr | 13 + testsuite/tests/roles/should_compile/Roles3.stderr | 25 ++ testsuite/tests/roles/should_compile/Roles4.stderr | 13 + testsuite/tests/roles/should_compile/T8958.stderr | 9 +- .../tests/simplCore/should_compile/T3234.stderr | 4 +- .../tests/simplCore/should_compile/T3717.stderr | 29 +- .../tests/simplCore/should_compile/T3772.stdout | 29 +- .../tests/simplCore/should_compile/T4908.stderr | 29 +- .../tests/simplCore/should_compile/T4930.stderr | 29 +- .../tests/simplCore/should_compile/T7360.stderr | 47 ++- .../tests/simplCore/should_compile/T8274.stdout | 10 +- .../tests/simplCore/should_compile/T9400.stderr | 17 +- .../tests/simplCore/should_compile/rule2.stderr | 3 +- .../simplCore/should_compile/spec-inline.stderr | 29 +- .../tests/stranal/should_compile/T10694.stdout | 3 + .../stranal/sigs/BottomFromInnerLambda.stderr | 1 + testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr | 2 + testsuite/tests/stranal/sigs/HyperStrUse.stderr | 1 + testsuite/tests/stranal/sigs/StrAnalExample.stderr | 1 + testsuite/tests/stranal/sigs/T8569.stderr | 2 + testsuite/tests/stranal/sigs/T8598.stderr | 1 + testsuite/tests/stranal/sigs/UnsatFun.stderr | 1 + testsuite/tests/th/TH_Roles2.stderr | 8 + .../tests/typecheck/should_compile/holes2.stderr | 13 +- testsuite/tests/typecheck/should_fail/T5095.stderr | 2 +- .../tests/typecheck/should_fail/T9858a.stderr | 6 +- .../tests/typecheck/should_fail/T9858b.stderr | 5 +- .../should_fail/TcStaticPointersFail02.stderr | 4 +- .../tests/typecheck/should_fail/tcfail072.stderr | 4 +- .../tests/typecheck/should_fail/tcfail133.stderr | 14 +- 106 files changed, 2838 insertions(+), 1548 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 8c3a2ed0f36c3565f0cd37f50324bdde299bdb0e From git at git.haskell.org Wed Oct 28 10:16:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:46 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Fixes (e2b3d1d) Message-ID: <20151028101646.ACD903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/e2b3d1dfc6ffecff4ff01364dfbdedec70219e47/ghc >--------------------------------------------------------------- commit e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 Author: Ben Gamari Date: Tue Oct 27 14:53:39 2015 +0100 Fixes >--------------------------------------------------------------- e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 compiler/basicTypes/OccName.hs | 13 +++++ compiler/deSugar/DsBinds.hs | 2 +- compiler/iface/IfaceSyn.hs | 1 - compiler/iface/MkIface.hs | 3 +- compiler/typecheck/TcEnv.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 3 -- compiler/typecheck/TcTyDecls.hs | 97 ++++++++++++++++++-------------------- compiler/typecheck/TcTypeable.hs | 4 +- libraries/ghc-prim/GHC/Types.hs | 6 ++- 9 files changed, 67 insertions(+), 64 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 e2b3d1dfc6ffecff4ff01364dfbdedec70219e47 From git at git.haskell.org Wed Oct 28 10:16:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:49 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: debug (f814b47) Message-ID: <20151028101649.49CFD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/f814b47ccc7efde0951f867ad3f56c27b27f4856/ghc >--------------------------------------------------------------- commit f814b47ccc7efde0951f867ad3f56c27b27f4856 Author: Ben Gamari Date: Tue Oct 27 16:25:18 2015 +0100 debug >--------------------------------------------------------------- f814b47ccc7efde0951f867ad3f56c27b27f4856 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcTyDecls.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 1e52a22..1afeda0 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -194,7 +194,7 @@ tcTopBinds (ValBindsIn {}) = panic "tcTopBinds" tcRecSelBinds :: HsValBinds Name -> TcM TcGblEnv tcRecSelBinds (ValBindsOut binds sigs) - = -- tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ + = tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ -- this envt extension happens in tcValBinds do { (rec_sel_binds, tcg_env) <- discardWarnings $ tcValBinds TopLevel binds sigs getGblEnv diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index d1b091d..ea96bb5 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -819,6 +819,7 @@ tcAddImplicits tyclss do { (typeable_ids, typeable_binds) <- mkTypeableBinds tycons ; gbl_env <- tcExtendGlobalValEnv typeable_ids $ tcRecSelBinds $ mkRecSelBinds tyclss + ; traceTc "tcAddImplicits" (ppr $ mkRecSelBinds tyclss) ; return (gbl_env `addTypecheckedBinds` typeable_binds) } where implicit_things = concatMap implicitTyThings tyclss From git at git.haskell.org Wed Oct 28 10:16:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:51 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Fix (2c8a85b) Message-ID: <20151028101651.DAB693A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/2c8a85b127526844f73032c8554bc8e86c80cc9a/ghc >--------------------------------------------------------------- commit 2c8a85b127526844f73032c8554bc8e86c80cc9a Author: Ben Gamari Date: Tue Oct 27 17:00:17 2015 +0100 Fix >--------------------------------------------------------------- 2c8a85b127526844f73032c8554bc8e86c80cc9a compiler/iface/MkIface.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index d92942a..79fbf67 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1610,7 +1610,7 @@ tyConToIfaceDecl env tycon ifCons = ifaceConDecls (algTyConRhs tycon) (algTcFields tycon), ifRec = boolToRecFlag (isRecursiveTyCon tycon), ifGadtSyntax = isGadtSyntaxTyCon tycon, - ifPromotable = isPromotedTyCon tycon, + ifPromotable = isPromotableTyCon tycon, ifParent = parent }) | otherwise -- FunTyCon, PrimTyCon, promoted TyCon/DataCon From git at git.haskell.org Wed Oct 28 10:16:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:54 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Fix (e493718) Message-ID: <20151028101654.737553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/e493718d67d00954f584af9eefa0340ea7119129/ghc >--------------------------------------------------------------- commit e493718d67d00954f584af9eefa0340ea7119129 Author: Ben Gamari Date: Tue Oct 27 17:10:40 2015 +0100 Fix >--------------------------------------------------------------- e493718d67d00954f584af9eefa0340ea7119129 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcTyDecls.hs | 43 ++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 1afeda0..1e52a22 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -194,7 +194,7 @@ tcTopBinds (ValBindsIn {}) = panic "tcTopBinds" tcRecSelBinds :: HsValBinds Name -> TcM TcGblEnv tcRecSelBinds (ValBindsOut binds sigs) - = tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ + = -- tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ -- this envt extension happens in tcValBinds do { (rec_sel_binds, tcg_env) <- discardWarnings $ tcValBinds TopLevel binds sigs getGblEnv diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index ea96bb5..83ef841 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -27,7 +27,7 @@ module TcTyDecls( import TcRnMonad import TcEnv import TcTypeable( mkTypeableBinds ) -import TcBinds( tcRecSelBinds, addTypecheckedBinds ) +import TcBinds( tcValBinds, addTypecheckedBinds ) import TypeRep( Type(..) ) import TcType import TysWiredIn( unitTy ) @@ -816,11 +816,10 @@ tcAddImplicits tyclss = discardWarnings $ tcExtendGlobalEnvImplicit implicit_things $ tcExtendGlobalValEnv def_meth_ids $ - do { (typeable_ids, typeable_binds) <- mkTypeableBinds tycons - ; gbl_env <- tcExtendGlobalValEnv typeable_ids - $ tcRecSelBinds $ mkRecSelBinds tyclss - ; traceTc "tcAddImplicits" (ppr $ mkRecSelBinds tyclss) - ; return (gbl_env `addTypecheckedBinds` typeable_binds) } + do { (rec_sel_ids, rec_sel_binds) <- mkRecSelBinds tycons + ; (typeable_ids, typeable_binds) <- mkTypeableBinds tycons + ; gbl_env <- tcExtendGlobalValEnv (rec_sel_ids ++ typeable_ids) getGblEnv + ; return (gbl_env `addTypecheckedBinds` (rec_sel_binds ++ typeable_binds)) } where implicit_things = concatMap implicitTyThings tyclss tycons = [tc | ATyCon tc <- tyclss] @@ -860,22 +859,26 @@ must bring the default method Ids into scope first (so they can be seen when typechecking the [d| .. |] quote, and typecheck them later. -} -mkRecSelBinds :: [TyThing] -> HsValBinds Name --- NB We produce *un-typechecked* bindings, rather like 'deriving' --- This makes life easier, because the later type checking will add --- all necessary type abstractions and applications +mkRecSelBinds :: [TyCon] -> TcM ([Id], [LHsBinds Id]) mkRecSelBinds tycons - = ValBindsOut [(NonRecursive, b) | b <- binds] sigs - where - (sigs, binds) = unzip rec_sels - rec_sels = map mkRecSelBind [ (tc,fld) - | ATyCon tc <- tycons - , fld <- tyConFieldLabels tc ] - - -mkRecSelBind :: (TyCon, FieldLabel) -> (LSig Name, LHsBinds Name) + = do { -- We generate *un-typechecked* bindings in mkRecSelBind, and + -- then typecheck them, rather like 'deriving'. This makes life + -- easier, because the later type checking will add all necessary + -- type abstractions and applications + + let sel_binds :: [(RecFlag, LHsBinds Name)] + sel_sigs :: [LSig Name] + (sel_sigs, sel_binds) + = mapAndUnzip mkRecSelBind [ (tc,fld) + | tc <- tycons + , fld <- tyConFieldLabels tc ] + sel_ids = [sel_id | L _ (IdSig sel_id) <- sel_sigs] + ; (sel_binds, _) <- tcValBinds TopLevel sel_binds sel_sigs (return ()) + ; return (sel_ids, map snd sel_binds) } + +mkRecSelBind :: (TyCon, FieldLabel) -> (LSig Name, (RecFlag, LHsBinds Name)) mkRecSelBind (tycon, fl) - = (L loc (IdSig sel_id), unitBag (L loc sel_bind)) + = (L loc (IdSig sel_id), (NonRecursive, unitBag (L loc sel_bind))) where loc = getSrcSpan sel_name sel_id = mkExportedLocalId rec_details sel_name sel_ty From git at git.haskell.org Wed Oct 28 10:16:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:57 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: PrelNames: Fix duplicate unique (8d9e40b) Message-ID: <20151028101657.0DDD73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/8d9e40b0e6b961c43c7546813c258e32e15002b7/ghc >--------------------------------------------------------------- commit 8d9e40b0e6b961c43c7546813c258e32e15002b7 Author: Ben Gamari Date: Tue Oct 27 22:10:58 2015 +0100 PrelNames: Fix duplicate unique Previously unboundKey and fromIntegerClassOpKey were sharing a Unique Reassign unboundKey to `mkPreludeMiscIdUnique 158` >--------------------------------------------------------------- 8d9e40b0e6b961c43c7546813c258e32e15002b7 compiler/prelude/PrelNames.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 077bc36..05a38ff 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -1891,7 +1891,7 @@ during type checking. -- Just a place holder for unbound variables produced by the renamer: unboundKey :: Unique -unboundKey = mkPreludeMiscIdUnique 160 +unboundKey = mkPreludeMiscIdUnique 158 fromIntegerClassOpKey, minusClassOpKey, fromRationalClassOpKey, enumFromClassOpKey, enumFromThenClassOpKey, enumFromToClassOpKey, From git at git.haskell.org Wed Oct 28 10:16:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:16:59 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Unify: Add Outputable instance for UnifyResultM (f992424) Message-ID: <20151028101659.9BF983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c/ghc >--------------------------------------------------------------- commit f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c Author: Ben Gamari Date: Wed Oct 28 02:21:16 2015 +0100 Unify: Add Outputable instance for UnifyResultM >--------------------------------------------------------------- f9924244223dea7cd6e1c1bd7ba4e6b32834fc8c compiler/types/Unify.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index de22066..87681e0 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -30,6 +30,8 @@ import Type import TyCon import TypeRep import Util ( filterByList ) +import Outputable +import FastString (sLit) import Control.Monad (liftM, foldM, ap) #if __GLASGOW_HASKELL__ < 709 @@ -475,6 +477,11 @@ tcUnifyTysFG :: (TyVar -> BindFlag) tcUnifyTysFG bind_fn tys1 tys2 = initUM bind_fn (unify_tys tys1 tys2) +instance Outputable a => Outputable (UnifyResultM a) where + ppr SurelyApart = ptext (sLit "SurelyApart") + ppr (Unifiable x) = ptext (sLit "Unifiable") <+> ppr x + ppr (MaybeApart x) = ptext (sLit "MaybeApart") <+> ppr x + {- ************************************************************************ * * From git at git.haskell.org Wed Oct 28 10:17:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:17:02 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: debug (0232390) Message-ID: <20151028101702.5231A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/02323906b30aa1cf84409e049637278f1ac64636/ghc >--------------------------------------------------------------- commit 02323906b30aa1cf84409e049637278f1ac64636 Author: Ben Gamari Date: Wed Oct 28 10:36:28 2015 +0100 debug >--------------------------------------------------------------- 02323906b30aa1cf84409e049637278f1ac64636 compiler/types/FamInstEnv.hs | 13 +++++++++++-- compiler/types/Unify.hs | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index a41e453..1143fa7 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -674,11 +674,13 @@ lookupFamInstEnvConflicts -- Precondition: the tycon is saturated (or over-saturated) lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) - = lookup_fam_inst_env my_unify envs fam tys + = let ret = lookup_fam_inst_env my_unify envs fam tys + in pprTrace "lookupFamInstEnvConflicts(return)" (vcat [pprBranch new_branch, ppr $ null ret]) ret where (fam, tys) = famInstSplitLHS fam_inst -- In example above, fam tys' = F [b] + pprBranch br = ppr (coAxBranchLHS br) <+> char '~' <+> ppr (coAxBranchRHS br) my_unify (FamInst { fi_axiom = old_axiom }) tpl_tvs tpl_tys _ = ASSERT2( tyVarsOfTypes tys `disjointVarSet` tpl_tvs, (ppr fam <+> ppr tys) $$ @@ -687,7 +689,14 @@ lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) -- They shouldn't because we allocate separate uniques for them if compatibleBranches (coAxiomSingleBranch old_axiom) new_branch then Nothing - else Just noSubst + else pprTrace "lookupFamInstEnvConflicts" + (vcat [pprBranch (coAxiomSingleBranch old_axiom), pprBranch new_branch + , ppr lhs1, ppr lhs2 + , ppr $ compatibleBranches (coAxiomSingleBranch old_axiom) new_branch + , ppr $ tcUnifyTysFG instanceBindFun lhs1 lhs2]) $ + Just noSubst + where lhs1 = cab_lhs $ coAxiomSingleBranch old_axiom + lhs2 = cab_lhs $ new_branch -- Note [Family instance overlap conflicts] noSubst = panic "lookupFamInstEnvConflicts noSubst" diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index 87681e0..7f28bed 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -577,7 +577,7 @@ unify ty1 ty2 = if tc1 == tc2 then if isInjectiveTyCon tc1 Nominal then unify_tys tys1 tys2 - else don'tBeSoSure $ unify_tys tys1 tys2 + else pprTrace "NotSoFast" (hsep [ppr tc1, ppr tys1, ppr tc2, ppr tys2]) $ don'tBeSoSure $ unify_tys tys1 tys2 else -- tc1 /= tc2 if isGenerativeTyCon tc1 Nominal && isGenerativeTyCon tc2 Nominal then surelyApart @@ -610,7 +610,7 @@ unify_tys orig_xs orig_ys go [] [] = return () go (x:xs) (y:ys) = do { unify x y ; go xs ys } - go _ _ = maybeApart -- See Note [Lists of different lengths are MaybeApart] + go _ _ = pprTrace "unify_tys" (hsep [ppr orig_xs, ppr orig_ys])maybeApart -- See Note [Lists of different lengths are MaybeApart] --------------------------------- uVar :: TyVar -- Type variable to be unified @@ -661,7 +661,7 @@ uUnrefined subst tv1 ty2 (TyVarTy tv2) ; b2 <- tvBindFlag tv2 ; let ty1 = TyVarTy tv1 ; case (b1, b2) of - (Skolem, Skolem) -> maybeApart -- See Note [Unification with skolems] + (Skolem, Skolem) -> pprTrace "uUnrefined" (hsep [ppr tv1, ppr ty2, ppr tv2]) maybeApart -- See Note [Unification with skolems] (BindMe, _) -> extendSubst tv1 ty2 (_, BindMe) -> extendSubst tv2 ty1 } @@ -681,7 +681,7 @@ bindTv :: TyVar -> Type -> UM () bindTv tv ty -- ty is not a type variable = do { b <- tvBindFlag tv ; case b of - Skolem -> maybeApart -- See Note [Unification with skolems] + Skolem -> pprTrace "bindTv" (hsep [ppr tv, ppr ty]) maybeApart -- See Note [Unification with skolems] BindMe -> extendSubst tv ty } From git at git.haskell.org Wed Oct 28 10:33:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:33:52 +0000 (UTC) Subject: [commit: ghc] master: Pattern synonyms: swap provided/required (04b0a73) Message-ID: <20151028103352.CB9973A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/04b0a73a2a418e1ca9c282ab3f2b4fe216911fdd/ghc >--------------------------------------------------------------- commit 04b0a73a2a418e1ca9c282ab3f2b4fe216911fdd Author: Simon Peyton Jones Date: Wed Oct 28 09:41:27 2015 +0000 Pattern synonyms: swap provided/required This patch swaps the order of provided and required constraints in a pattern signature, so it now goes pattern P :: req => prov => t1 -> ... tn -> res_ty See the long discussion in Trac #10928. I think I have found all the places, but I could have missed something particularly in comments. There is a Haddock changes; so a submodule update. >--------------------------------------------------------------- 04b0a73a2a418e1ca9c282ab3f2b4fe216911fdd compiler/basicTypes/PatSyn.hs | 45 ++++++++++++++++++++-- compiler/hsSyn/HsBinds.hs | 16 ++++---- compiler/iface/IfaceSyn.hs | 2 +- compiler/iface/MkIface.hs | 2 +- compiler/rename/RnBinds.hs | 8 ++-- compiler/typecheck/TcBinds.hs | 15 +++++++- compiler/typecheck/TcPat.hs | 2 +- docs/users_guide/glasgow_exts.rst | 18 ++++----- testsuite/tests/ghci/scripts/T8776.stdout | 3 +- testsuite/tests/patsyn/should_compile/T10997_1a.hs | 2 +- testsuite/tests/patsyn/should_compile/T10997a.hs | 2 +- testsuite/tests/patsyn/should_compile/T8584-2.hs | 2 +- testsuite/tests/patsyn/should_fail/T11010.hs | 18 +++++++++ testsuite/tests/patsyn/should_fail/T11010.stderr | 8 ++++ testsuite/tests/patsyn/should_fail/all.T | 1 + utils/haddock | 2 +- 16 files changed, 112 insertions(+), 34 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 04b0a73a2a418e1ca9c282ab3f2b4fe216911fdd From git at git.haskell.org Wed Oct 28 10:46:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:46:31 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: TyCon: Data family TyCons are injective under Nominal equality (e50c010) Message-ID: <20151028104631.C625D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/e50c0106fbd2d4ffcc659d77265245c029951279/ghc >--------------------------------------------------------------- commit e50c0106fbd2d4ffcc659d77265245c029951279 Author: Ben Gamari Date: Wed Oct 28 11:40:39 2015 +0100 TyCon: Data family TyCons are injective under Nominal equality >--------------------------------------------------------------- e50c0106fbd2d4ffcc659d77265245c029951279 compiler/types/TyCon.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 6745070..000dc3d 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -1367,7 +1367,8 @@ isInjectiveTyCon (AlgTyCon {}) Nominal = True isInjectiveTyCon (AlgTyCon {algTcRhs = rhs}) Representational = isGenInjAlgRhs rhs isInjectiveTyCon (SynonymTyCon {}) _ = False -isInjectiveTyCon (FamilyTyCon {}) _ = False +isInjectiveTyCon (FamilyTyCon {famTcFlav = flav}) Nominal = isDataFamFlav flav +isInjectiveTyCon (FamilyTyCon {}) Representational = False isInjectiveTyCon (PrimTyCon {}) _ = True isInjectiveTyCon (PromotedDataCon {}) _ = True isInjectiveTyCon (PromotedTyCon {ty_con = tc}) r From git at git.haskell.org Wed Oct 28 10:46:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:46:34 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Unify: Add runUM for debugging purposes (ef0a4f7) Message-ID: <20151028104634.69E183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/ef0a4f7203af38feb355e2f3f60f8ede029fce29/ghc >--------------------------------------------------------------- commit ef0a4f7203af38feb355e2f3f60f8ede029fce29 Author: Ben Gamari Date: Wed Oct 28 11:42:09 2015 +0100 Unify: Add runUM for debugging purposes >--------------------------------------------------------------- ef0a4f7203af38feb355e2f3f60f8ede029fce29 compiler/types/Unify.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index 7f28bed..2ee3758 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -733,6 +733,13 @@ instance Monad UM where initUM :: (TyVar -> BindFlag) -> UM () -> UnifyResult initUM badtvs um = fmap (niFixTvSubst . snd) $ unUM um badtvs emptyTvSubstEnv +-- | Run a 'UM' action without affecting the substition environment, returning the +-- 'UnifyResultM' that the action concludes with. +-- +-- For debugging purposes to peer into the decisions that the typechecker makes +runUM :: UM a -> UM (UnifyResultM (a, TvSubstEnv)) +runUM um = UM $ \tv_fn subst -> Unifiable $ (unUM um tv_fn subst, subst) + tvBindFlag :: TyVar -> UM BindFlag tvBindFlag tv = UM (\tv_fn subst -> Unifiable (tv_fn tv, subst)) From git at git.haskell.org Wed Oct 28 10:46:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:46:37 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Motre debug (3692051) Message-ID: <20151028104637.089493A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/3692051741066f6de2b714e397d1f6b7097c2810/ghc >--------------------------------------------------------------- commit 3692051741066f6de2b714e397d1f6b7097c2810 Author: Ben Gamari Date: Wed Oct 28 11:42:31 2015 +0100 Motre debug >--------------------------------------------------------------- 3692051741066f6de2b714e397d1f6b7097c2810 compiler/types/Unify.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index 2ee3758..f4e7b37 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -577,7 +577,9 @@ unify ty1 ty2 = if tc1 == tc2 then if isInjectiveTyCon tc1 Nominal then unify_tys tys1 tys2 - else pprTrace "NotSoFast" (hsep [ppr tc1, ppr tys1, ppr tc2, ppr tys2]) $ don'tBeSoSure $ unify_tys tys1 tys2 + else do tmp <- runUM (unify_tys tys1 tys2) + don'tBeSoSure $ pprTrace "NotSoFast" (hsep [ppr tc1, ppr tys1, ppr tc2, ppr tys2, ppr tmp]) + $ unify_tys tys1 tys2 else -- tc1 /= tc2 if isGenerativeTyCon tc1 Nominal && isGenerativeTyCon tc2 Nominal then surelyApart From git at git.haskell.org Wed Oct 28 10:46:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:46:39 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Bump haddock (1ea10a6) Message-ID: <20151028104639.A61683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/1ea10a63ac7d9d1767b446de4447c06900796048/ghc >--------------------------------------------------------------- commit 1ea10a63ac7d9d1767b446de4447c06900796048 Author: Ben Gamari Date: Wed Oct 28 11:42:41 2015 +0100 Bump haddock >--------------------------------------------------------------- 1ea10a63ac7d9d1767b446de4447c06900796048 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 85b7ed6..289ef81 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 85b7ed6147c18611b5ef6b606f157086a8203e7d +Subproject commit 289ef817aad02c341beb6d4c28ba0495872f5a0f From git at git.haskell.org Wed Oct 28 10:46:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 10:46:42 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-ben: Rip out debugging (6e0913f) Message-ID: <20151028104642.512E33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-ben Link : http://ghc.haskell.org/trac/ghc/changeset/6e0913f5f1f7b42bd444f202d86da432bd7d07d5/ghc >--------------------------------------------------------------- commit 6e0913f5f1f7b42bd444f202d86da432bd7d07d5 Author: Ben Gamari Date: Wed Oct 28 11:43:51 2015 +0100 Rip out debugging >--------------------------------------------------------------- 6e0913f5f1f7b42bd444f202d86da432bd7d07d5 compiler/types/FamInstEnv.hs | 13 ++----------- compiler/types/Unify.hs | 10 ++++------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index 1143fa7..a41e453 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -674,13 +674,11 @@ lookupFamInstEnvConflicts -- Precondition: the tycon is saturated (or over-saturated) lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) - = let ret = lookup_fam_inst_env my_unify envs fam tys - in pprTrace "lookupFamInstEnvConflicts(return)" (vcat [pprBranch new_branch, ppr $ null ret]) ret + = lookup_fam_inst_env my_unify envs fam tys where (fam, tys) = famInstSplitLHS fam_inst -- In example above, fam tys' = F [b] - pprBranch br = ppr (coAxBranchLHS br) <+> char '~' <+> ppr (coAxBranchRHS br) my_unify (FamInst { fi_axiom = old_axiom }) tpl_tvs tpl_tys _ = ASSERT2( tyVarsOfTypes tys `disjointVarSet` tpl_tvs, (ppr fam <+> ppr tys) $$ @@ -689,14 +687,7 @@ lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom }) -- They shouldn't because we allocate separate uniques for them if compatibleBranches (coAxiomSingleBranch old_axiom) new_branch then Nothing - else pprTrace "lookupFamInstEnvConflicts" - (vcat [pprBranch (coAxiomSingleBranch old_axiom), pprBranch new_branch - , ppr lhs1, ppr lhs2 - , ppr $ compatibleBranches (coAxiomSingleBranch old_axiom) new_branch - , ppr $ tcUnifyTysFG instanceBindFun lhs1 lhs2]) $ - Just noSubst - where lhs1 = cab_lhs $ coAxiomSingleBranch old_axiom - lhs2 = cab_lhs $ new_branch + else Just noSubst -- Note [Family instance overlap conflicts] noSubst = panic "lookupFamInstEnvConflicts noSubst" diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index f4e7b37..be987ae 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -577,9 +577,7 @@ unify ty1 ty2 = if tc1 == tc2 then if isInjectiveTyCon tc1 Nominal then unify_tys tys1 tys2 - else do tmp <- runUM (unify_tys tys1 tys2) - don'tBeSoSure $ pprTrace "NotSoFast" (hsep [ppr tc1, ppr tys1, ppr tc2, ppr tys2, ppr tmp]) - $ unify_tys tys1 tys2 + else don'tBeSoSure $ unify_tys tys1 tys2 else -- tc1 /= tc2 if isGenerativeTyCon tc1 Nominal && isGenerativeTyCon tc2 Nominal then surelyApart @@ -612,7 +610,7 @@ unify_tys orig_xs orig_ys go [] [] = return () go (x:xs) (y:ys) = do { unify x y ; go xs ys } - go _ _ = pprTrace "unify_tys" (hsep [ppr orig_xs, ppr orig_ys])maybeApart -- See Note [Lists of different lengths are MaybeApart] + go _ _ = maybeApart -- See Note [Lists of different lengths are MaybeApart] --------------------------------- uVar :: TyVar -- Type variable to be unified @@ -663,7 +661,7 @@ uUnrefined subst tv1 ty2 (TyVarTy tv2) ; b2 <- tvBindFlag tv2 ; let ty1 = TyVarTy tv1 ; case (b1, b2) of - (Skolem, Skolem) -> pprTrace "uUnrefined" (hsep [ppr tv1, ppr ty2, ppr tv2]) maybeApart -- See Note [Unification with skolems] + (Skolem, Skolem) -> maybeApart -- See Note [Unification with skolems] (BindMe, _) -> extendSubst tv1 ty2 (_, BindMe) -> extendSubst tv2 ty1 } @@ -683,7 +681,7 @@ bindTv :: TyVar -> Type -> UM () bindTv tv ty -- ty is not a type variable = do { b <- tvBindFlag tv ; case b of - Skolem -> pprTrace "bindTv" (hsep [ppr tv, ppr ty]) maybeApart -- See Note [Unification with skolems] + Skolem -> maybeApart -- See Note [Unification with skolems] BindMe -> extendSubst tv ty } From git at git.haskell.org Wed Oct 28 19:58:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 19:58:41 +0000 (UTC) Subject: [commit: packages/haskeline] branch 'wip/T10273' created Message-ID: <20151028195841.EB94D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline New branch : wip/T10273 Referencing: e9157f484fae8964baf8164d220650f64f693b47 From git at git.haskell.org Wed Oct 28 20:04:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:04:43 +0000 (UTC) Subject: [commit: packages/haskeline] master: Add ghc-7.8.* to Travis and use a fixed Cabal version. (7821d1b) Message-ID: <20151028200443.B48DB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/7821d1b2a61ea1449359f4a67e76ebc61ac7a0c5 >--------------------------------------------------------------- commit 7821d1b2a61ea1449359f4a67e76ebc61ac7a0c5 Author: Judah Jacobson Date: Sun Mar 22 09:17:32 2015 -0700 Add ghc-7.8.* to Travis and use a fixed Cabal version. >--------------------------------------------------------------- 7821d1b2a61ea1449359f4a67e76ebc61ac7a0c5 .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0ccb2ed..52e138e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ env: - GHCVER=7.6.1 CABALVER=1.18 - GHCVER=7.6.2 CABALVER=1.18 - GHCVER=7.6.3 CABALVER=1.18 + - GHCVER=7.8.1 CABALVER=1.18 + - GHCVER=7.8.2 CABALVER=1.18 + - GHCVER=7.8.3 CABALVER=1.18 before_install: - sudo add-apt-repository -y ppa:hvr/ghc @@ -20,7 +23,7 @@ before_install: install: - cabal-$CABALVER update - cabal-$CABALVER install --only-dependencies - - cabal-$CABALVER install "Cabal >= $CABALVER" + - cabal-$CABALVER install "Cabal == $CABALVER" - ghc --version script: From git at git.haskell.org Wed Oct 28 20:04:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:04:45 +0000 (UTC) Subject: [commit: packages/haskeline] master: Undo previous commit. (28554c4) Message-ID: <20151028200445.B9E8A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/28554c4f18bfde4955ce02759e4a540e56550564 >--------------------------------------------------------------- commit 28554c4f18bfde4955ce02759e4a540e56550564 Author: Judah Jacobson Date: Sun Mar 22 09:49:06 2015 -0700 Undo previous commit. >--------------------------------------------------------------- 28554c4f18bfde4955ce02759e4a540e56550564 .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52e138e..0ccb2ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,6 @@ env: - GHCVER=7.6.1 CABALVER=1.18 - GHCVER=7.6.2 CABALVER=1.18 - GHCVER=7.6.3 CABALVER=1.18 - - GHCVER=7.8.1 CABALVER=1.18 - - GHCVER=7.8.2 CABALVER=1.18 - - GHCVER=7.8.3 CABALVER=1.18 before_install: - sudo add-apt-repository -y ppa:hvr/ghc @@ -23,7 +20,7 @@ before_install: install: - cabal-$CABALVER update - cabal-$CABALVER install --only-dependencies - - cabal-$CABALVER install "Cabal == $CABALVER" + - cabal-$CABALVER install "Cabal >= $CABALVER" - ghc --version script: From git at git.haskell.org Wed Oct 28 20:04:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:04:47 +0000 (UTC) Subject: [commit: packages/haskeline] master: Fix Travis build on 7.2.* and update the script. (439b19a) Message-ID: <20151028200447.C07F13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/439b19a07419bd4182336aa8d11b4679b379e4fe >--------------------------------------------------------------- commit 439b19a07419bd4182336aa8d11b4679b379e4fe Author: Judah Jacobson Date: Sun Mar 22 10:40:55 2015 -0700 Fix Travis build on 7.2.* and update the script. Updated to latest version of multi-ghc-travis. The build on 7.2.* was failing due to the constraint "Cabal >= $CABALVER" which tried to build a too-recent version of Cabal. Fixed by changing the constraint to "Cabal == $CABALVER.*". >--------------------------------------------------------------- 439b19a07419bd4182336aa8d11b4679b379e4fe .travis.yml | 63 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ccb2ed..c625dc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,38 +1,51 @@ +# Based on https://github.com/hvr/multi-ghc-travis +# +# NB: don't set `language: haskell` here env: - - GHCVER=7.0.1 CABALVER=1.16 - - GHCVER=7.0.2 CABALVER=1.16 - - GHCVER=7.0.3 CABALVER=1.16 - - GHCVER=7.0.4 CABALVER=1.16 - - GHCVER=7.2.1 CABALVER=1.18 - - GHCVER=7.2.2 CABALVER=1.18 - - GHCVER=7.4.1 CABALVER=1.18 - - GHCVER=7.4.2 CABALVER=1.18 - - GHCVER=7.6.1 CABALVER=1.18 - - GHCVER=7.6.2 CABALVER=1.18 - - GHCVER=7.6.3 CABALVER=1.18 + - CABALVER=1.16 GHCVER=7.0.1 + - CABALVER=1.16 GHCVER=7.0.2 + - CABALVER=1.16 GHCVER=7.0.3 + - CABALVER=1.16 GHCVER=7.0.4 + - CABALVER=1.16 GHCVER=7.2.1 + - CABALVER=1.16 GHCVER=7.2.2 + - CABALVER=1.16 GHCVER=7.4.1 + - CABALVER=1.16 GHCVER=7.4.2 + - CABALVER=1.16 GHCVER=7.6.1 + - CABALVER=1.16 GHCVER=7.6.2 + - CABALVER=1.18 GHCVER=7.6.3 + - CABALVER=1.18 GHCVER=7.8.1 + - CABALVER=1.18 GHCVER=7.8.2 + - CABALVER=1.18 GHCVER=7.8.3 + - CABALVER=1.22 GHCVER=7.10.1 +# Note: the distinction between `before_install` and `install` is not important. before_install: - - sudo add-apt-repository -y ppa:hvr/ghc - - sudo apt-get update - - sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER - - export PATH=/opt/ghc/$GHCVER/bin:$PATH + - travis_retry sudo add-apt-repository -y ppa:hvr/ghc + - travis_retry sudo apt-get update + - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH install: - - cabal-$CABALVER update - - cabal-$CABALVER install --only-dependencies - - cabal-$CABALVER install "Cabal >= $CABALVER" - - ghc --version + - cabal --version + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" + - travis_retry cabal update + - cabal install --only-dependencies + - cabal install "Cabal == $CABALVER.*" # Use the same Cabal version for Setup.hs and cabal-install +# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail. script: - - cabal-$CABALVER configure -v2 - - cabal-$CABALVER build -v2 - - cabal-$CABALVER check - - cabal-$CABALVER sdist + - if [ -f configure.ac ]; then autoreconf -i; fi + - cabal --version + - cabal configure -v2 # -v2 provides useful information for debugging + - cabal build # this builds all libraries and executables (including tests/benchmarks) + - cabal check + - cabal sdist # tests that a source-distribution can be generated + # The following scriptlet checks that the resulting source distribution can be built & installed - - export SRC_TGZ=$(cabal-$CABALVER info . | awk '{print $2 ".tar.gz";exit}') ; + - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; cd dist/; if [ -f "$SRC_TGZ" ]; then - cabal-$CABALVER install "$SRC_TGZ"; + cabal install --force-reinstalls "$SRC_TGZ"; else echo "expected '$SRC_TGZ' not found"; exit 1; From git at git.haskell.org Wed Oct 28 20:04:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:04:49 +0000 (UTC) Subject: [commit: packages/haskeline] master: GHC 8 is gonna come with base-4.9 (adac43f) Message-ID: <20151028200449.C7D7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/adac43fa0695cdb26c9f0cda11a672bfea46dd6e >--------------------------------------------------------------- commit adac43fa0695cdb26c9f0cda11a672bfea46dd6e Author: Herbert Valerio Riedel Date: Wed Oct 28 09:32:47 2015 +0100 GHC 8 is gonna come with base-4.9 >--------------------------------------------------------------- adac43fa0695cdb26c9f0cda11a672bfea46dd6e haskeline.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haskeline.cabal b/haskeline.cabal index b709ee3..b1e41ae 100644 --- a/haskeline.cabal +++ b/haskeline.cabal @@ -50,7 +50,7 @@ flag legacy-encoding Default: False Library - Build-depends: base >=4.3 && < 4.9, containers>=0.4 && < 0.6, + Build-depends: base >=4.3 && < 4.10, containers>=0.4 && < 0.6, directory>=1.1 && < 1.3, bytestring>=0.9 && < 0.11, filepath >= 1.2 && < 1.5, transformers >= 0.2 && < 0.5 Default-Language: Haskell98 From git at git.haskell.org Wed Oct 28 20:04:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:04:51 +0000 (UTC) Subject: [commit: packages/haskeline] master: Merge pull request #28 from hvr/pr-base49 (fb5b288) Message-ID: <20151028200451.CE1F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haskeline On branch : master Link : http://git.haskell.org/packages/haskeline.git/commitdiff/fb5b2884dd00843f6d2fbbeca87b241822088b83 >--------------------------------------------------------------- commit fb5b2884dd00843f6d2fbbeca87b241822088b83 Merge: 439b19a adac43f Author: Judah Jacobson Date: Wed Oct 28 12:24:13 2015 -0700 Merge pull request #28 from hvr/pr-base49 GHC 8 is gonna come with base-4.9 >--------------------------------------------------------------- fb5b2884dd00843f6d2fbbeca87b241822088b83 haskeline.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Wed Oct 28 20:10:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:10:26 +0000 (UTC) Subject: [commit: packages/terminfo] master: GHC 8 is gonna come with base-4.9 (cb4da17) Message-ID: <20151028201026.45D9A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/terminfo On branch : master Link : http://git.haskell.org/packages/terminfo.git/commitdiff/cb4da175d4e75a862c91b73beaf62f8d740a7fd5 >--------------------------------------------------------------- commit cb4da175d4e75a862c91b73beaf62f8d740a7fd5 Author: Herbert Valerio Riedel Date: Wed Oct 28 09:34:00 2015 +0100 GHC 8 is gonna come with base-4.9 >--------------------------------------------------------------- cb4da175d4e75a862c91b73beaf62f8d740a7fd5 terminfo.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminfo.cabal b/terminfo.cabal index 31d84fa..6cf69bf 100644 --- a/terminfo.cabal +++ b/terminfo.cabal @@ -29,7 +29,7 @@ Library other-extensions: CPP, DeriveDataTypeable, FlexibleInstances, ScopedTypeVariables if impl(ghc>=7.3) other-extensions: Safe, Trustworthy - build-depends: base >= 4.3 && < 4.9 + build-depends: base >= 4.3 && < 4.10 ghc-options: -Wall exposed-modules: System.Console.Terminfo From git at git.haskell.org Wed Oct 28 20:10:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:10:28 +0000 (UTC) Subject: [commit: packages/terminfo] master: Merge pull request #9 from hvr/pr-base49 (68e88c4) Message-ID: <20151028201028.4B7973A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/terminfo On branch : master Link : http://git.haskell.org/packages/terminfo.git/commitdiff/68e88c453237763084f5032d133ee7347980f8b2 >--------------------------------------------------------------- commit 68e88c453237763084f5032d133ee7347980f8b2 Merge: 1b5ab01 cb4da17 Author: Judah Jacobson Date: Wed Oct 28 12:24:24 2015 -0700 Merge pull request #9 from hvr/pr-base49 GHC 8 is gonna come with base-4.9 >--------------------------------------------------------------- 68e88c453237763084f5032d133ee7347980f8b2 terminfo.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Wed Oct 28 20:19:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:19:24 +0000 (UTC) Subject: [commit: ghc] master: Update haskeline/terminfo submodules (de27bed) Message-ID: <20151028201924.9377C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/de27bedb002264d3703394f93f86ee9ec816153a/ghc >--------------------------------------------------------------- commit de27bedb002264d3703394f93f86ee9ec816153a Author: Herbert Valerio Riedel Date: Wed Oct 28 21:15:54 2015 +0100 Update haskeline/terminfo submodules This is needed to prepare for #11026 as these updates relax the upper bounds on `base` to allow for `base-4.9.0.0` This update contains no code-changes to terminfo/haskeline yet >--------------------------------------------------------------- de27bedb002264d3703394f93f86ee9ec816153a libraries/haskeline | 2 +- libraries/terminfo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/haskeline b/libraries/haskeline index 7a72748..fb5b288 160000 --- a/libraries/haskeline +++ b/libraries/haskeline @@ -1 +1 @@ -Subproject commit 7a72748b3898e68c99e3d5ae7d06c58dd190b149 +Subproject commit fb5b2884dd00843f6d2fbbeca87b241822088b83 diff --git a/libraries/terminfo b/libraries/terminfo index 1b5ab01..68e88c4 160000 --- a/libraries/terminfo +++ b/libraries/terminfo @@ -1 +1 @@ -Subproject commit 1b5ab01452eaa6c21de7174ad4312a017a13d0ab +Subproject commit 68e88c453237763084f5032d133ee7347980f8b2 From git at git.haskell.org Wed Oct 28 20:55:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 20:55:06 +0000 (UTC) Subject: [commit: packages/stm] master: Relax upper bound on `base` to allow GHC8/base-4.9 (e917b59) Message-ID: <20151028205506.DFC5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/stm On branch : master Link : http://git.haskell.org/packages/stm.git/commitdiff/e917b5944ce0a5b4e32dcc8f00eaddbec1256e98 >--------------------------------------------------------------- commit e917b5944ce0a5b4e32dcc8f00eaddbec1256e98 Author: Herbert Valerio Riedel Date: Wed Oct 28 21:54:22 2015 +0100 Relax upper bound on `base` to allow GHC8/base-4.9 >--------------------------------------------------------------- e917b5944ce0a5b4e32dcc8f00eaddbec1256e98 stm.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stm.cabal b/stm.cabal index 668bb9d..9700138 100644 --- a/stm.cabal +++ b/stm.cabal @@ -34,7 +34,7 @@ library other-extensions: Safe build-depends: - base >= 4.2 && < 4.9, + base >= 4.2 && < 4.10, array >= 0.3 && < 0.6 exposed-modules: From git at git.haskell.org Wed Oct 28 21:11:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 21:11:08 +0000 (UTC) Subject: [commit: ghc] master: Update `deepseq` submodule (c1e1584) Message-ID: <20151028211108.5CDFC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c1e1584aa175a1c4341ffa1c1f548c2f7513a331/ghc >--------------------------------------------------------------- commit c1e1584aa175a1c4341ffa1c1f548c2f7513a331 Author: Herbert Valerio Riedel Date: Wed Oct 28 21:42:09 2015 +0100 Update `deepseq` submodule This is done now to prepare for #11026 >--------------------------------------------------------------- c1e1584aa175a1c4341ffa1c1f548c2f7513a331 libraries/deepseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/deepseq b/libraries/deepseq index c6cb196..36bfcd2 160000 --- a/libraries/deepseq +++ b/libraries/deepseq @@ -1 +1 @@ -Subproject commit c6cb196fb1bd5f16bb5945add2d6ece3f7910e90 +Subproject commit 36bfcd2a6236f2e019de76c256b05ee670492373 From git at git.haskell.org Wed Oct 28 21:15:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 21:15:58 +0000 (UTC) Subject: [commit: packages/array] master: Relax upper bound on `base` to allow GHC8/base-4.9 (dd75c73) Message-ID: <20151028211558.A5BDD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/array On branch : master Link : http://git.haskell.org/packages/array.git/commitdiff/dd75c73d191b3f07209c38f78ebe9dcc26fc5ed4 >--------------------------------------------------------------- commit dd75c73d191b3f07209c38f78ebe9dcc26fc5ed4 Author: Herbert Valerio Riedel Date: Wed Oct 28 22:13:52 2015 +0100 Relax upper bound on `base` to allow GHC8/base-4.9 >--------------------------------------------------------------- dd75c73d191b3f07209c38f78ebe9dcc26fc5ed4 array.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array.cabal b/array.cabal index cd9215e..566a11c 100644 --- a/array.cabal +++ b/array.cabal @@ -37,7 +37,7 @@ library Trustworthy, UnboxedTuples, UnliftedFFITypes - build-depends: base >= 4.5 && < 4.9 + build-depends: base >= 4.5 && < 4.10 ghc-options: -Wall exposed-modules: Data.Array From git at git.haskell.org Wed Oct 28 21:44:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 28 Oct 2015 21:44:57 +0000 (UTC) Subject: [commit: packages/hpc] master: Relax upper bound on `base` for base-4.9 (e20c61c) Message-ID: <20151028214457.1A32A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/hpc On branch : master Link : http://git.haskell.org/packages/hpc.git/commitdiff/e20c61c358e749ea62f6687089ad2a878d5d1a66 >--------------------------------------------------------------- commit e20c61c358e749ea62f6687089ad2a878d5d1a66 Author: Herbert Valerio Riedel Date: Wed Oct 28 22:44:29 2015 +0100 Relax upper bound on `base` for base-4.9 >--------------------------------------------------------------- e20c61c358e749ea62f6687089ad2a878d5d1a66 hpc.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hpc.cabal b/hpc.cabal index 4e5b6f0..39340f1 100644 --- a/hpc.cabal +++ b/hpc.cabal @@ -35,7 +35,7 @@ Library Trace.Hpc.Reflect Build-Depends: - base >= 4.4.1 && < 4.9, + base >= 4.4.1 && < 4.10, containers >= 0.4.1 && < 0.6, directory >= 1.1 && < 1.3, filepath >= 1 && < 1.5, From git at git.haskell.org Thu Oct 29 02:02:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 02:02:00 +0000 (UTC) Subject: [commit: ghc] master: rts/Linker.c: Drop support for legacy OS X dyn loading (776d55c) Message-ID: <20151029020200.7F5DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/776d55c89fb657706b5476c32629fd032ea54596/ghc >--------------------------------------------------------------- commit 776d55c89fb657706b5476c32629fd032ea54596 Author: Erik de Castro Lopo Date: Thu Oct 29 12:59:30 2015 +1100 rts/Linker.c: Drop support for legacy OS X dyn loading Drop support for old OS X (OS X 10.2 and earlier) dynamic linking. 10.3 was released in 2003. Test Plan: Validate on OS X and Linux. Reviewers: bgamari, thomie, austin Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D1393 >--------------------------------------------------------------- 776d55c89fb657706b5476c32629fd032ea54596 rts/Linker.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6be9a5a..98969b9 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -107,9 +107,6 @@ # include # include # include -#if !defined(HAVE_DLFCN_H) -# include -#endif #if defined(powerpc_HOST_ARCH) # include #endif @@ -914,11 +911,8 @@ static void* lookupSymbol_ (char *lbl) # if defined(OBJFORMAT_ELF) return internal_dlsym(lbl); # elif defined(OBJFORMAT_MACHO) -# if HAVE_DLFCN_H - /* On OS X 10.3 and later, we use dlsym instead of the old legacy - interface. - HACK: On OS X, all symbols are prefixed with an underscore. + /* HACK: On OS X, all symbols are prefixed with an underscore. However, dlsym wants us to omit the leading underscore from the symbol name -- the dlsym routine puts it back on before searching for the symbol. For now, we simply strip it off here (and ONLY @@ -927,14 +921,6 @@ static void* lookupSymbol_ (char *lbl) IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s with dlsym\n", lbl)); ASSERT(lbl[0] == '_'); return internal_dlsym(lbl + 1); -# else - if (NSIsSymbolNameDefined(lbl)) { - NSSymbol symbol = NSLookupAndBindSymbol(lbl); - return NSAddressOfSymbol(symbol); - } else { - return NULL; - } -# endif /* HAVE_DLFCN_H */ # elif defined(OBJFORMAT_PEi386) void* sym; From git at git.haskell.org Thu Oct 29 04:45:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 04:45:26 +0000 (UTC) Subject: [commit: ghc] master: Fix rts/T9579 tests on OS X (ce2416b) Message-ID: <20151029044526.37E7F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ce2416bcceb574cf87140f3e82cc482909f81cc4/ghc >--------------------------------------------------------------- commit ce2416bcceb574cf87140f3e82cc482909f81cc4 Author: Erik de Castro Lopo Date: Thu Oct 29 11:25:42 2015 +1100 Fix rts/T9579 tests on OS X Sed on OS X does not understand 's/[0-9]\+ bytes/NUM bytes/g' but sed on Linux and OS X do understand 's/[0-9]* bytes/NUM bytes/g'. Test Plan: Run all rts/T9579 tests on Linux and Mac Reviewers: thomie, austin, bgamari Differential Revision: https://phabricator.haskell.org/D1394 >--------------------------------------------------------------- ce2416bcceb574cf87140f3e82cc482909f81cc4 testsuite/tests/rts/T9579/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/rts/T9579/all.T b/testsuite/tests/rts/T9579/all.T index fd5a3b6..a8522bf 100644 --- a/testsuite/tests/rts/T9579/all.T +++ b/testsuite/tests/rts/T9579/all.T @@ -11,7 +11,7 @@ def T9579_run_test(binName, expExitCode): testCommandTemplate = """ $MAKE -s --no-print-directory T9579_{binName} \ && ( ( ./T9579_{binName} 2>&1; echo $?) \ - | sed -e 's/[0-9]\+ bytes/NUM bytes/g' ) \ + | sed -e 's/[0-9]* bytes/NUM bytes/g' ) \ """ test(fmt('T9579_{binName}'), From git at git.haskell.org Thu Oct 29 07:17:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 07:17:11 +0000 (UTC) Subject: [commit: ghc] master: Backpack documentation updates for component IDs [no-ci] (08f5c4e) Message-ID: <20151029071711.3515D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/08f5c4e3590609c1a9603bd78b089dbb28cff9f8/ghc >--------------------------------------------------------------- commit 08f5c4e3590609c1a9603bd78b089dbb28cff9f8 Author: Edward Z. Yang Date: Thu Oct 29 00:16:28 2015 -0700 Backpack documentation updates for component IDs [no-ci] Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 08f5c4e3590609c1a9603bd78b089dbb28cff9f8 docs/backpack/algorithm.tex | 348 ++++++++++++++++++++++++-------------------- 1 file changed, 188 insertions(+), 160 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 08f5c4e3590609c1a9603bd78b089dbb28cff9f8 From git at git.haskell.org Thu Oct 29 08:29:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 08:29:56 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: report and error out on unfound tests (032be43) Message-ID: <20151029082956.1EA0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/032be43b66db29ca6893bd4219c0d6036201a94e/ghc >--------------------------------------------------------------- commit 032be43b66db29ca6893bd4219c0d6036201a94e Author: Thomas Miedema Date: Wed Oct 28 12:28:59 2015 +0100 Testsuite: report and error out on unfound tests Users are sometimes confused why their test doesn't run. It is usually because of a misspelled testname, for example using 'TEST=1234' instead of 'TEST=T1234'. After this patch it is hopefully more clear what the problem is, showing: ERROR: tests not found: ['1234'] Instead of: 0 total tests, which gave rise to 0 test cases, of which 0 were skipped Reviewed by: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1388 >--------------------------------------------------------------- 032be43b66db29ca6893bd4219c0d6036201a94e testsuite/driver/runtests.py | 8 +++++++- testsuite/driver/testglobals.py | 3 ++- testsuite/driver/testlib.py | 12 ++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 491335d..0f751f2 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -79,7 +79,8 @@ for opt,arg in opts: config.no_print_summary = True if opt == '--only': - config.only.append(arg) + config.run_only_some_tests = True + config.only.add(arg) if opt == '--way': if (arg not in config.run_ways and arg not in config.compile_ways and arg not in config.other_ways): @@ -287,6 +288,11 @@ for file in t_files: t.n_framework_failures = t.n_framework_failures + 1 traceback.print_exc() +if config.only: + # See Note [Mutating config.only] + sys.stderr.write("ERROR: tests not found: {0}\n".format(list(config.only))) + sys.exit(1) + if config.list_broken: global brokens print('') diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 95168f3..0891624 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -23,7 +23,8 @@ class TestConfig: self.rootdirs = [] # Run these tests only (run all tests if empty) - self.only = [] + self.run_only_some_tests = False + self.only = set() # Accept new output which differs from the sample? self.accept = 0 diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 3ca5d02..45e8d3e 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -591,8 +591,16 @@ def runTest (opts, name, func, args): # name :: String # setup :: TestOpts -> IO () def test (name, setup, func, args): - if config.only and name not in config.only: - return + if config.run_only_some_tests: + if name not in config.only: + return + else: + # Note [Mutating config.only] + # config.only is initiallly the set of tests requested by + # the user (via 'make TEST='). We then remove all tests that + # we've already seen (in .T files), so that we can later + # report on any tests we couldn't find and error out. + config.only.remove(name) global aloneTests global parallelTests From git at git.haskell.org Thu Oct 29 11:24:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 11:24:31 +0000 (UTC) Subject: [commit: ghc] master: Revert "Build system: don't add ALL_HC_OPTS when linking" (a051788) Message-ID: <20151029112431.AE0303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a0517889383127848faf82b32919d3f742a59278/ghc >--------------------------------------------------------------- commit a0517889383127848faf82b32919d3f742a59278 Author: Ben Gamari Date: Thu Oct 29 06:45:45 2015 -0400 Revert "Build system: don't add ALL_HC_OPTS when linking" This reverts commit 9fc2d777f53110040f48ab27643a16888fa377f5. This appears to cause interface file issues during rebuilds. Punting back to @thomie for further investigation. >--------------------------------------------------------------- a0517889383127848faf82b32919d3f742a59278 rules/build-package-way.mk | 4 ++-- rules/build-prog.mk | 2 +- rules/distdir-way-opts.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 592d3a7..a10e538 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -91,7 +91,7 @@ endif else # ifneq "$$(HostOS_CPP)" "mingw32" $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS) - $$(call cmd,$1_$2_HC) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \ + $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \ -shared -dynamic -dynload deploy \ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \ -no-auto-link-packages \ @@ -170,7 +170,7 @@ endef # build-package-way # $5 = object files to link # $6 = output filename define build-dll - $(call cmd,$1_$2_HC) $($1_$2_$3_GHC_LD_OPTS) $4 $5 \ + $(call cmd,$1_$2_HC) $($1_$2_$3_ALL_HC_OPTS) $($1_$2_$3_GHC_LD_OPTS) $4 $5 \ -shared -dynamic -dynload deploy \ $(addprefix -l,$($1_$2_EXTRA_LIBRARIES)) \ -no-auto-link-packages \ diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 48b8aa2..1a49707 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -255,7 +255,7 @@ $1/$2/build/tmp/$$($1_$2_PROG).dll : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$( else # $1_$2_PROG_NEEDS_C_WRAPPER=NO ifeq "$$($1_$2_LINK_WITH_GCC)" "NO" $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. - $$(call cmd,$1_$2_HC) -o $$@ $$($1_$2_$$($1_$2_PROGRAM_WAY)_GHC_LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) + $$(call cmd,$1_$2_HC) -o $$@ $$($1_$2_$$($1_$2_PROGRAM_WAY)_ALL_HC_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_GHC_LD_OPTS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) else $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_$$($1_$2_PROGRAM_WAY)_HS_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_C_OBJS) $$($1_$2_$$($1_$2_PROGRAM_WAY)_S_OBJS) $$($1_$2_OTHER_OBJS) | $$$$(dir $$$$@)/. diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index e848943..920ff07 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -131,7 +131,7 @@ $1_$2_$3_MOST_DIR_HC_OPTS = \ # that -O0 is effective (see #5484) # $1_$2_$3_ALL_HC_OPTS: this is all the options we will pass to GHC -# for a given ($1,$2,$3) when we use it for compiling. +# for a given ($1,$2,$3). $1_$2_$3_ALL_HC_OPTS = \ -hisuf $$($3_hisuf) -osuf $$($3_osuf) -hcsuf $$($3_hcsuf) \ $$($1_$2_$3_MOST_DIR_HC_OPTS) \ From git at git.haskell.org Thu Oct 29 11:24:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 11:24:34 +0000 (UTC) Subject: [commit: ghc] master: Record pattern synonyms (2a74a64) Message-ID: <20151029112434.8FA9F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2a74a64e8329ab9e0c74bec47198cb492d25affb/ghc >--------------------------------------------------------------- commit 2a74a64e8329ab9e0c74bec47198cb492d25affb Author: Matthew Pickering Date: Mon Oct 19 21:17:29 2015 +0100 Record pattern synonyms This patch implements an extension to pattern synonyms which allows user to specify pattern synonyms using record syntax. Doing so generates appropriate selectors and update functions. === Interaction with Duplicate Record Fields === The implementation given here isn't quite as general as it could be with respect to the recently-introduced `DuplicateRecordFields` extension. Consider the following module: {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE PatternSynonyms #-} module Main where pattern S{a, b} = (a, b) pattern T{a} = Just a main = do print S{ a = "fst", b = "snd" } print T{ a = "a" } In principle, this ought to work, because there is no ambiguity. But at the moment it leads to a "multiple declarations of a" error. The problem is that pattern synonym record selectors don't do the same name mangling as normal datatypes when DuplicateRecordFields is enabled. They could, but this would require some work to track the field label and selector name separately. In particular, we currently represent datatype selectors in the third component of AvailTC, but pattern synonym selectors are just represented as Avails (because they don't have a corresponding type constructor). Moreover, the GlobalRdrElt for a selector currently requires it to have a parent tycon. (example due to Adam Gundry) === Updating Explicitly Bidirectional Pattern Synonyms === Consider the following ``` pattern Silly{a} <- [a] where Silly a = [a, a] f1 = a [5] -- 5 f2 = [5] {a = 6} -- currently [6,6] ``` === Fixing Polymorphic Updates === They were fixed by adding these two lines in `dsExpr`. This might break record updates but will be easy to fix. ``` + ; let req_wrap = mkWpTyApps (mkTyVarTys univ_tvs) - , pat_wrap = idHsWrapper } +, pat_wrap = req_wrap } ``` === Mixed selectors error === Note [Mixed Record Field Updates] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider the following pattern synonym. data MyRec = MyRec { foo :: Int, qux :: String } pattern HisRec{f1, f2} = MyRec{foo = f1, qux=f2} This allows updates such as the following updater :: MyRec -> MyRec updater a = a {f1 = 1 } It would also make sense to allow the following update (which we reject). updater a = a {f1 = 1, qux = "two" } ==? MyRec 1 "two" This leads to confusing behaviour when the selectors in fact refer the same field. updater a = a {f1 = 1, foo = 2} ==? ??? For this reason, we reject a mixture of pattern synonym and normal record selectors in the same update block. Although of course we still allow the following. updater a = (a {f1 = 1}) {foo = 2} > updater (MyRec 0 "str") MyRec 2 "str" >--------------------------------------------------------------- 2a74a64e8329ab9e0c74bec47198cb492d25affb compiler/basicTypes/ConLike.hs | 86 +++++++- compiler/basicTypes/ConLike.hs-boot | 18 ++ compiler/basicTypes/Id.hs | 31 ++- compiler/basicTypes/IdInfo.hs | 21 +- compiler/basicTypes/PatSyn.hs | 51 +++-- compiler/deSugar/Coverage.hs | 11 +- compiler/deSugar/DsExpr.hs | 79 ++++--- compiler/deSugar/DsMeta.hs | 2 +- compiler/hsSyn/Convert.hs | 10 +- compiler/hsSyn/HsBinds.hs | 67 +++++- compiler/hsSyn/HsExpr.hs | 35 +++- compiler/hsSyn/HsUtils.hs | 21 +- compiler/hsSyn/PlaceHolder.hs | 6 +- compiler/iface/BuildTyCl.hs | 7 +- compiler/iface/IfaceSyn.hs | 17 +- compiler/iface/MkIface.hs | 11 +- compiler/iface/TcIface.hs | 12 +- compiler/main/HscTypes.hs | 15 +- compiler/parser/Parser.y | 28 ++- compiler/parser/RdrHsSyn.hs | 2 +- compiler/prelude/TysWiredIn.hs | 2 +- compiler/rename/RnBinds.hs | 18 +- compiler/rename/RnExpr.hs | 8 +- compiler/rename/RnNames.hs | 30 +-- compiler/rename/RnSource.hs | 52 ++++- compiler/typecheck/TcBinds.hs | 6 +- compiler/typecheck/TcExpr.hs | 231 +++++++++++++++------ compiler/typecheck/TcHsSyn.hs | 10 +- compiler/typecheck/TcPat.hs | 6 +- compiler/typecheck/TcPatSyn.hs | 124 ++++++++--- compiler/typecheck/TcPatSyn.hs-boot | 8 +- compiler/typecheck/TcRnDriver.hs | 3 +- compiler/typecheck/TcTyClsDecls.hs | 39 ++-- compiler/types/TyCon.hs | 7 +- compiler/types/TypeRep.hs | 2 +- compiler/types/TypeRep.hs-boot | 1 + testsuite/tests/patsyn/should_compile/all.T | 7 +- .../tests/patsyn/should_compile/records-compile.hs | 11 + .../tests/patsyn/should_compile/records-poly.hs | 16 ++ .../patsyn/should_compile/records-prov-req.hs | 26 +++ .../patsyn/should_compile/records-req-only.hs | 16 ++ .../tests/patsyn/should_compile/records-req.hs | 14 ++ testsuite/tests/patsyn/should_fail/all.T | 7 + .../should_fail/mixed-pat-syn-record-sels.hs | 9 + .../should_fail/mixed-pat-syn-record-sels.stderr | 5 + .../tests/patsyn/should_fail/records-check-sels.hs | 10 + .../patsyn/should_fail/records-check-sels.stderr | 3 + .../tests/patsyn/should_fail/records-exquant.hs | 10 + .../patsyn/should_fail/records-exquant.stderr | 11 + .../patsyn/should_fail/records-mixing-fields.hs | 12 ++ .../should_fail/records-mixing-fields.stderr | 17 ++ .../patsyn/should_fail/records-no-uni-update.hs | 7 + .../should_fail/records-no-uni-update.stderr | 5 + .../patsyn/should_fail/records-no-uni-update2.hs | 11 + .../should_fail/records-no-uni-update2.stderr | 5 + .../patsyn/should_fail/records-poly-update.hs | 13 ++ .../patsyn/should_fail/records-poly-update.stderr | 5 + testsuite/tests/patsyn/should_run/all.T | 1 + testsuite/tests/patsyn/should_run/records-run.hs | 14 ++ .../tests/patsyn/should_run/records-run.stdout | 5 + 60 files changed, 1055 insertions(+), 262 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 2a74a64e8329ab9e0c74bec47198cb492d25affb From git at git.haskell.org Thu Oct 29 12:26:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 12:26:48 +0000 (UTC) Subject: [commit: ghc] master: Revert "Build system: don't create mk/are-validating.mk" (fa58731) Message-ID: <20151029122648.632BD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa58731684af45dddc27b8eb11c4c042b1dec9c4/ghc >--------------------------------------------------------------- commit fa58731684af45dddc27b8eb11c4c042b1dec9c4 Author: Thomas Miedema Date: Tue Oct 27 16:46:01 2015 +0100 Revert "Build system: don't create mk/are-validating.mk" Summary: This reverts commit aecf4a5f96d0d3ffcf4cb2c67a20a610d7c64486. It turns out the Simons are relying on 'mk/are-validating.mk', see D1307. The workflow they are using is: * run ./validate * find a bug in the compiler * try to fix the bug, running 'make 1' (or 'make 2') repeatedly. Because of 'mk/are-validating.mk', this uses the same build settings as validate. * continue ./validate (--no-clean) I suggested two alternatives: A. run 'make 1 Validating=YES' instead of 'make 1' Problem: when running `./validate --fast` or `./validate --hpc` instead of a normal `./validate`, validate sets ValidateSpeed and ValdateHpc in mk/are-validating.mk. You would for example have to run 'make 1 Validating=YES ValidateSpeed=FAST' instead of 'make 1' to get the same build settings as `./validate --fast`, which is entirely too long and error prone. B. uncomment `#BuildFlavour=validate` in mk/build.mk, and include 'mk/validate.mk'. Problems: * any other settings you have in build.mk will also get used. * the distinction between 'mk/validate.mk' and 'mk/build.mk' becomes less clear. * it is easy to forget to include 'mk/validate.mk'. * the build system again doesn't have access to the ValidateSpeed and ValdateHpc settings set by validate. Neither of these two options is entirely satisfactory. Reviewers: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1383 >--------------------------------------------------------------- fa58731684af45dddc27b8eb11c4c042b1dec9c4 .gitignore | 1 + ghc.mk | 3 +++ mk/custom-settings.mk | 3 +++ validate | 18 +++++++++++------- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 33664d7..322ae6a 100644 --- a/.gitignore +++ b/.gitignore @@ -135,6 +135,7 @@ _darcs/ /libraries/plus.gif /libraries/synopsis.png /libraries/stamp/ +/mk/are-validating.mk /mk/build.mk /mk/config.h /mk/config.h.in diff --git a/ghc.mk b/ghc.mk index b2be252..595356a 100644 --- a/ghc.mk +++ b/ghc.mk @@ -1327,6 +1327,9 @@ clean_bindistprep: $(call removeTrees,bindistprep/) distclean : clean +# Clean the files that ./validate creates. + $(call removeFiles,mk/are-validating.mk) + # Clean the files that we ask ./configure to create. $(call removeFiles,mk/config.mk) $(call removeFiles,mk/install.mk) diff --git a/mk/custom-settings.mk b/mk/custom-settings.mk index 5f9814b..2b4b127 100644 --- a/mk/custom-settings.mk +++ b/mk/custom-settings.mk @@ -1,3 +1,6 @@ + +-include mk/are-validating.mk + ifeq "$(Validating)" "YES" include mk/flavours/validate.mk -include mk/validate.mk diff --git a/validate b/validate index 827815f..4c123fe 100755 --- a/validate +++ b/validate @@ -174,7 +174,9 @@ fi thisdir=`utils/ghc-pwd/dist-boot/ghc-pwd` -make_settings="Validating=YES ValidateSpeed=$speed ValidateHpc=$hpc" +echo "Validating=YES" > mk/are-validating.mk +echo "ValidateSpeed=$speed" >> mk/are-validating.mk +echo "ValidateHpc=$hpc" >> mk/are-validating.mk # Note [Default build system verbosity]. # @@ -188,14 +190,16 @@ make_settings="Validating=YES ValidateSpeed=$speed ValidateHpc=$hpc" # `make -s`, when user explicitly asks for it with `./validate --quiet`. if [ $be_quiet -eq 1 ]; then # See Note [Default build system verbosity]. - make_settings="$make_settings V=0" + echo "V=0" >> mk/are-validating.mk # Less gunk fi if [ $use_dph -eq 1 ]; then - make_settings="$make_settings BUILD_DPH=YES" + echo "BUILD_DPH=YES" >> mk/are-validating.mk +else + echo "BUILD_DPH=NO" >> mk/are-validating.mk fi -$make -j$threads $make_settings +$make -j$threads # For a "debug make", add "--debug=b --debug=m" check_packages post-build @@ -205,8 +209,8 @@ check_packages post-build if [ $speed != "FAST" ]; then - $make binary-dist-prep $make_settings - $make test_bindist TEST_PREP=YES $make_settings + $make binary-dist-prep + $make test_bindist TEST_PREP=YES # # Install the xhtml package into the bindist. @@ -217,7 +221,7 @@ if [ $speed != "FAST" ]; then check_packages post-install - $make validate_build_xhtml BINDIST_PREFIX="$thisdir/$bindistdir" $make_settings + $make validate_build_xhtml BINDIST_PREFIX="$thisdir/$bindistdir" check_packages post-xhtml fi From git at git.haskell.org Thu Oct 29 13:49:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 13:49:01 +0000 (UTC) Subject: [commit: ghc] master: Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls (e31113f) Message-ID: <20151029134901.BC92B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e31113f2b4bd158a725f5e4902341a3e1e3581a4/ghc >--------------------------------------------------------------- commit e31113f2b4bd158a725f5e4902341a3e1e3581a4 Author: Ben Gamari Date: Wed Oct 28 18:28:57 2015 +0100 Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls >--------------------------------------------------------------- e31113f2b4bd158a725f5e4902341a3e1e3581a4 compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 226 +--------------------------------- compiler/typecheck/TcTyDecls.hs | 240 ++++++++++++++++++++++++++++++++++++- 3 files changed, 238 insertions(+), 230 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 e31113f2b4bd158a725f5e4902341a3e1e3581a4 From git at git.haskell.org Thu Oct 29 15:15:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 15:15:15 +0000 (UTC) Subject: [commit: ghc] master: TcTyDecls: Remove redundant import of Applicative (d25fa86) Message-ID: <20151029151515.B76363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d25fa862b82de644403cb9710c1f011eeb767d33/ghc >--------------------------------------------------------------- commit d25fa862b82de644403cb9710c1f011eeb767d33 Author: Ben Gamari Date: Thu Oct 29 11:12:17 2015 -0400 TcTyDecls: Remove redundant import of Applicative >--------------------------------------------------------------- d25fa862b82de644403cb9710c1f011eeb767d33 compiler/typecheck/TcTyDecls.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index 39d8c04..0da0cb1 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -54,10 +54,6 @@ import Data.List import Bag import FastString ( fastStringToByteString ) -#if __GLASGOW_HASKELL__ < 709 -import Control.Applicative (Applicative(..)) -#endif - import Control.Monad {- From git at git.haskell.org Thu Oct 29 15:15:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 15:15:18 +0000 (UTC) Subject: [commit: ghc] master: DynFlags: Add (another) missing hunk from D1360 (40e6214) Message-ID: <20151029151518.5E8773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/40e6214c06bc197dbdfcf9f7345dad1ad271922b/ghc >--------------------------------------------------------------- commit 40e6214c06bc197dbdfcf9f7345dad1ad271922b Author: Ben Gamari Date: Thu Oct 29 15:42:39 2015 +0100 DynFlags: Add (another) missing hunk from D1360 What a disaster this merge was. >--------------------------------------------------------------- 40e6214c06bc197dbdfcf9f7345dad1ad271922b compiler/main/DynFlags.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 320a11e..8e5ba6a 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2643,6 +2643,11 @@ dynamic_flags = [ , defGhcFlag "fmax-inline-memset-insns" (intSuffix (\n d -> d{ maxInlineMemsetInsns = n })) + , defGhcFlag "dinitial-unique" + (intSuffix (\n d -> d{ initialUnique = n })) + , defGhcFlag "dunique-increment" + (intSuffix (\n d -> d{ uniqueIncrement = n })) + ------ Profiling ---------------------------------------------------- -- OLD profiling flags From git at git.haskell.org Thu Oct 29 15:15:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 15:15:21 +0000 (UTC) Subject: [commit: ghc] master: Generate Typeable info at definition sites (bef2f03) Message-ID: <20151029151521.9507E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bef2f03e4d56d88a7e9752a7afd6a0a35616da6c/ghc >--------------------------------------------------------------- commit bef2f03e4d56d88a7e9752a7afd6a0a35616da6c Author: Ben Gamari Date: Wed Aug 26 18:24:34 2015 +0200 Generate Typeable info at definition sites This patch implements the idea floated in Trac #9858, namely that we should generate type-representation information at the data type declaration site, rather than when solving a Typeable constraint. However, this turned out quite a bit harder than I expected. I still think it's the right thing to do, and it's done now, but it was quite a struggle. See particularly * Note [Grand plan for Typeable] in TcTypeable (which is a new module) * Note [The overall promotion story] in DataCon (clarifies existing stuff) The most painful bit was that to generate Typeable instances (ie TyConRepName bindings) for every TyCon is tricky for types in ghc-prim etc: * We need to have enough data types around to *define* a TyCon * Many of these types are wired-in Also, to minimise the code generated for each data type, I wanted to generate pure data, not CAFs with unpackCString# stuff floating about. Performance ~~~~~~~~~~~ Three perf/compiler tests start to allocate quite a bit more. This isn't surprising, because they all allocate zillions of data types, with practically no other code, esp. T1969 * T3294: GHC allocates 110% more (filed #11030 to track this) * T1969: GHC allocates 30% more * T4801: GHC allocates 14% more * T5321FD: GHC allocates 13% more * T783: GHC allocates 12% more * T9675: GHC allocates 12% more * T5642: GHC allocates 10% more * T9961: GHC allocates 6% more * T9203: Program allocates 54% less I'm treating this as acceptable. The payoff comes in Typeable-heavy code. Remaining to do ~~~~~~~~~~~~~~~ * I think that "TyCon" and "Module" are over-generic names to use for the runtime type representations used in GHC.Typeable. Better might be "TrTyCon" and "TrModule". But I have not yet done this * Add more info the the "TyCon" e.g. source location where it was defined * Use the new "Module" type to help with Trac Trac #10068 * It would be possible to generate TyConRepName (ie Typeable instances) selectively rather than all the time. We'd need to persist the information in interface files. Lacking a motivating reason I have not done this, but it would not be difficult. Refactoring ~~~~~~~~~~~ As is so often the case, I ended up refactoring more than I intended. In particular * In TyCon, a type *family* (whether type or data) is repesented by a FamilyTyCon * a algebraic data type (including data/newtype instances) is represented by AlgTyCon This wasn't true before; a data family was represented as an AlgTyCon. There are some corresponding changes in IfaceSyn. * Also get rid of the (unhelpfully named) tyConParent. * In TyCon define 'Promoted', isomorphic to Maybe, used when things are optionally promoted; and use it elsewhere in GHC. * Cleanup handling of knownKeyNames * Each TyCon, including promoted TyCons, contains its TyConRepName, if it has one. This is, in effect, the name of its Typeable instance. Requires update of the haddock submodule. Differential Revision: https://phabricator.haskell.org/D757 >--------------------------------------------------------------- bef2f03e4d56d88a7e9752a7afd6a0a35616da6c compiler/basicTypes/DataCon.hs | 222 ++++++++--- compiler/basicTypes/OccName.hs | 19 +- compiler/basicTypes/Unique.hs | 51 ++- compiler/coreSyn/MkCore.hs | 8 +- compiler/deSugar/DsBinds.hs | 281 +++++++------ compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsUtils.hs | 14 +- compiler/ghc.cabal.in | 1 + compiler/hsSyn/HsUtils.hs | 6 +- compiler/iface/BuildTyCl.hs | 42 +- compiler/iface/IfaceSyn.hs | 101 +++-- compiler/iface/MkIface.hs | 10 +- compiler/iface/TcIface.hs | 89 +++-- compiler/main/HscMain.hs | 13 +- compiler/main/HscTypes.hs | 13 +- compiler/prelude/PrelInfo.hs | 111 +++--- compiler/prelude/PrelNames.hs | 88 +++-- compiler/prelude/THNames.hs | 105 +++-- compiler/prelude/TysPrim.hs | 38 +- compiler/prelude/TysWiredIn.hs | 55 ++- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcBinds.hs | 35 +- compiler/typecheck/TcEnv.hs | 5 +- compiler/typecheck/TcEvidence.hs | 69 ++-- compiler/typecheck/TcGenGenerics.hs | 41 +- compiler/typecheck/TcHsSyn.hs | 27 +- compiler/typecheck/TcHsType.hs | 8 +- compiler/typecheck/TcInstDcls.hs | 19 +- compiler/typecheck/TcInteract.hs | 440 ++++++++++++--------- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 40 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 7 +- compiler/typecheck/TcTyClsDecls.hs | 18 +- compiler/typecheck/TcTyDecls.hs | 166 +++----- compiler/typecheck/TcTypeNats.hs | 12 +- compiler/typecheck/TcTypeable.hs | 206 ++++++++++ compiler/types/TyCon.hs | 412 ++++++++++--------- compiler/types/Type.hs | 9 + compiler/utils/Binary.hs | 11 +- compiler/vectorise/Vectorise/Generic/PData.hs | 4 +- compiler/vectorise/Vectorise/Type/Env.hs | 4 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 7 +- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable.hs | 3 +- libraries/base/Data/Typeable/Internal.hs | 330 ++++++++++------ libraries/base/GHC/Show.hs | 10 + libraries/base/GHC/Stack/Types.hs | 13 + libraries/ghc-prim/GHC/Classes.hs | 36 +- libraries/ghc-prim/GHC/Magic.hs | 2 + libraries/ghc-prim/GHC/Tuple.hs | 3 + libraries/ghc-prim/GHC/Types.hs | 60 ++- testsuite/tests/codeGen/should_run/cgrun057.stderr | 2 +- .../tests/deSugar/should_compile/T2431.stderr | 29 +- testsuite/tests/deriving/should_fail/T9687.stderr | 4 +- testsuite/tests/ghci.debugger/scripts/T2740.stdout | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/break009.stdout | 4 +- .../tests/ghci.debugger/scripts/break010.stdout | 4 +- .../tests/ghci.debugger/scripts/break011.stdout | 8 +- .../tests/ghci.debugger/scripts/break012.stdout | 16 +- .../tests/ghci.debugger/scripts/break018.stdout | 4 +- .../ghci.debugger/scripts/break022/break022.stdout | 2 +- .../tests/ghci.debugger/scripts/break028.stdout | 6 +- .../tests/ghci.debugger/scripts/print018.stdout | 6 +- .../tests/ghci.debugger/scripts/print019.stderr | 4 +- .../tests/ghci.debugger/scripts/print031.stdout | 2 +- testsuite/tests/ghci/scripts/T4175.stdout | 4 +- testsuite/tests/ghci/scripts/T5417.stdout | 2 - testsuite/tests/ghci/scripts/T8674.stdout | 4 +- .../indexed-types/should_compile/T3017.stderr | 0 .../tests/numeric/should_compile/T7116.stdout | 29 +- .../should_fail/overloadedlistsfail01.stderr | 4 +- .../should_compile/DataFamilyInstanceLHS.stderr | 2 - testsuite/tests/perf/compiler/all.T | 52 ++- testsuite/tests/perf/should_run/all.T | 3 +- testsuite/tests/polykinds/T8132.stderr | 4 +- testsuite/tests/quasiquotation/T7918.stdout | 3 + testsuite/tests/roles/should_compile/Roles1.stderr | 61 +++ .../tests/roles/should_compile/Roles13.stderr | 53 ++- .../tests/roles/should_compile/Roles14.stderr | 7 + testsuite/tests/roles/should_compile/Roles2.stderr | 13 + testsuite/tests/roles/should_compile/Roles3.stderr | 25 ++ testsuite/tests/roles/should_compile/Roles4.stderr | 13 + testsuite/tests/roles/should_compile/T8958.stderr | 9 +- .../tests/simplCore/should_compile/T3234.stderr | 4 +- .../tests/simplCore/should_compile/T3717.stderr | 29 +- .../tests/simplCore/should_compile/T3772.stdout | 29 +- .../tests/simplCore/should_compile/T4908.stderr | 29 +- .../tests/simplCore/should_compile/T4930.stderr | 29 +- .../tests/simplCore/should_compile/T7360.stderr | 47 ++- .../tests/simplCore/should_compile/T8274.stdout | 8 + .../tests/simplCore/should_compile/T9400.stderr | 17 +- .../tests/simplCore/should_compile/rule2.stderr | 3 +- .../simplCore/should_compile/spec-inline.stderr | 29 +- .../tests/stranal/should_compile/T10694.stdout | 3 + .../stranal/sigs/BottomFromInnerLambda.stderr | 1 + testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr | 2 + testsuite/tests/stranal/sigs/HyperStrUse.stderr | 1 + testsuite/tests/stranal/sigs/StrAnalExample.stderr | 1 + testsuite/tests/stranal/sigs/T8569.stderr | 2 + testsuite/tests/stranal/sigs/T8598.stderr | 1 + testsuite/tests/stranal/sigs/UnsatFun.stderr | 1 + testsuite/tests/th/TH_Roles2.stderr | 8 + .../tests/typecheck/should_compile/holes2.stderr | 6 +- testsuite/tests/typecheck/should_fail/T5095.stderr | 2 +- .../tests/typecheck/should_fail/tcfail072.stderr | 4 +- .../tests/typecheck/should_fail/tcfail133.stderr | 7 +- utils/haddock | 2 +- 109 files changed, 2609 insertions(+), 1331 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 bef2f03e4d56d88a7e9752a7afd6a0a35616da6c From git at git.haskell.org Thu Oct 29 16:42:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 16:42:52 +0000 (UTC) Subject: [commit: ghc] master: Revert "Generate Typeable info at definition sites" (bbaf76f) Message-ID: <20151029164252.4905B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbaf76f949426c91d6abbbc5eced1f705530087b/ghc >--------------------------------------------------------------- commit bbaf76f949426c91d6abbbc5eced1f705530087b Author: Ben Gamari Date: Thu Oct 29 17:41:34 2015 +0100 Revert "Generate Typeable info at definition sites" This reverts commit bef2f03e4d56d88a7e9752a7afd6a0a35616da6c. This merge was botched Also reverts haddock submodule. >--------------------------------------------------------------- bbaf76f949426c91d6abbbc5eced1f705530087b compiler/basicTypes/DataCon.hs | 222 +++-------- compiler/basicTypes/OccName.hs | 19 +- compiler/basicTypes/Unique.hs | 51 +-- compiler/coreSyn/MkCore.hs | 8 +- compiler/deSugar/DsBinds.hs | 281 ++++++------- compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsUtils.hs | 14 +- compiler/ghc.cabal.in | 1 - compiler/hsSyn/HsUtils.hs | 6 +- compiler/iface/BuildTyCl.hs | 42 +- compiler/iface/IfaceSyn.hs | 101 ++--- compiler/iface/MkIface.hs | 10 +- compiler/iface/TcIface.hs | 89 ++--- compiler/main/HscMain.hs | 13 +- compiler/main/HscTypes.hs | 13 +- compiler/prelude/PrelInfo.hs | 111 +++--- compiler/prelude/PrelNames.hs | 88 ++--- compiler/prelude/THNames.hs | 105 ++--- compiler/prelude/TysPrim.hs | 38 +- compiler/prelude/TysWiredIn.hs | 55 +-- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcBinds.hs | 35 +- compiler/typecheck/TcEnv.hs | 5 +- compiler/typecheck/TcEvidence.hs | 69 ++-- compiler/typecheck/TcGenGenerics.hs | 41 +- compiler/typecheck/TcHsSyn.hs | 27 +- compiler/typecheck/TcHsType.hs | 8 +- compiler/typecheck/TcInstDcls.hs | 19 +- compiler/typecheck/TcInteract.hs | 440 +++++++++------------ compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 40 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 7 +- compiler/typecheck/TcTyClsDecls.hs | 18 +- compiler/typecheck/TcTyDecls.hs | 166 +++++--- compiler/typecheck/TcTypeNats.hs | 12 +- compiler/typecheck/TcTypeable.hs | 206 ---------- compiler/types/TyCon.hs | 412 +++++++++---------- compiler/types/Type.hs | 9 - compiler/utils/Binary.hs | 11 +- compiler/vectorise/Vectorise/Generic/PData.hs | 4 +- compiler/vectorise/Vectorise/Type/Env.hs | 4 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 7 +- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable.hs | 3 +- libraries/base/Data/Typeable/Internal.hs | 330 ++++++---------- libraries/base/GHC/Show.hs | 10 - libraries/base/GHC/Stack/Types.hs | 13 - libraries/ghc-prim/GHC/Classes.hs | 36 +- libraries/ghc-prim/GHC/Magic.hs | 2 - libraries/ghc-prim/GHC/Tuple.hs | 3 - libraries/ghc-prim/GHC/Types.hs | 60 +-- testsuite/tests/codeGen/should_run/cgrun057.stderr | 2 +- .../tests/deSugar/should_compile/T2431.stderr | 29 +- testsuite/tests/deriving/should_fail/T9687.stderr | 4 +- testsuite/tests/ghci.debugger/scripts/T2740.stdout | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/break009.stdout | 4 +- .../tests/ghci.debugger/scripts/break010.stdout | 4 +- .../tests/ghci.debugger/scripts/break011.stdout | 8 +- .../tests/ghci.debugger/scripts/break012.stdout | 16 +- .../tests/ghci.debugger/scripts/break018.stdout | 4 +- .../ghci.debugger/scripts/break022/break022.stdout | 2 +- .../tests/ghci.debugger/scripts/break028.stdout | 6 +- .../tests/ghci.debugger/scripts/print018.stdout | 6 +- .../tests/ghci.debugger/scripts/print019.stderr | 4 +- .../tests/ghci.debugger/scripts/print031.stdout | 2 +- testsuite/tests/ghci/scripts/T4175.stdout | 4 +- testsuite/tests/ghci/scripts/T5417.stdout | 2 + testsuite/tests/ghci/scripts/T8674.stdout | 4 +- .../indexed-types/should_compile/T3017.stderr | 0 .../tests/numeric/should_compile/T7116.stdout | 29 +- .../should_fail/overloadedlistsfail01.stderr | 4 +- .../should_compile/DataFamilyInstanceLHS.stderr | 2 + testsuite/tests/perf/compiler/all.T | 52 +-- testsuite/tests/perf/should_run/all.T | 3 +- testsuite/tests/polykinds/T8132.stderr | 4 +- testsuite/tests/quasiquotation/T7918.stdout | 3 - testsuite/tests/roles/should_compile/Roles1.stderr | 61 --- .../tests/roles/should_compile/Roles13.stderr | 53 +-- .../tests/roles/should_compile/Roles14.stderr | 7 - testsuite/tests/roles/should_compile/Roles2.stderr | 13 - testsuite/tests/roles/should_compile/Roles3.stderr | 25 -- testsuite/tests/roles/should_compile/Roles4.stderr | 13 - testsuite/tests/roles/should_compile/T8958.stderr | 9 +- .../tests/simplCore/should_compile/T3234.stderr | 4 +- .../tests/simplCore/should_compile/T3717.stderr | 29 +- .../tests/simplCore/should_compile/T3772.stdout | 29 +- .../tests/simplCore/should_compile/T4908.stderr | 29 +- .../tests/simplCore/should_compile/T4930.stderr | 29 +- .../tests/simplCore/should_compile/T7360.stderr | 47 +-- .../tests/simplCore/should_compile/T8274.stdout | 8 - .../tests/simplCore/should_compile/T9400.stderr | 17 +- .../tests/simplCore/should_compile/rule2.stderr | 3 +- .../simplCore/should_compile/spec-inline.stderr | 29 +- .../tests/stranal/should_compile/T10694.stdout | 3 - .../stranal/sigs/BottomFromInnerLambda.stderr | 1 - testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr | 2 - testsuite/tests/stranal/sigs/HyperStrUse.stderr | 1 - testsuite/tests/stranal/sigs/StrAnalExample.stderr | 1 - testsuite/tests/stranal/sigs/T8569.stderr | 2 - testsuite/tests/stranal/sigs/T8598.stderr | 1 - testsuite/tests/stranal/sigs/UnsatFun.stderr | 1 - testsuite/tests/th/TH_Roles2.stderr | 8 - .../tests/typecheck/should_compile/holes2.stderr | 6 +- testsuite/tests/typecheck/should_fail/T5095.stderr | 2 +- .../tests/typecheck/should_fail/tcfail072.stderr | 4 +- .../tests/typecheck/should_fail/tcfail133.stderr | 7 +- utils/haddock | 2 +- 109 files changed, 1331 insertions(+), 2609 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 bbaf76f949426c91d6abbbc5eced1f705530087b From git at git.haskell.org Thu Oct 29 20:07:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 20:07:34 +0000 (UTC) Subject: [commit: ghc] branch 'wip/custom-type-errors' created Message-ID: <20151029200734.37F523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/custom-type-errors Referencing: f330d27fe7bcc884ed9c56fcf2c73bc8eb3e975f From git at git.haskell.org Thu Oct 29 20:07:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 20:07:36 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Implement support for user-defined type errors. (f330d27) Message-ID: <20151029200736.DF2FD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/f330d27fe7bcc884ed9c56fcf2c73bc8eb3e975f/ghc >--------------------------------------------------------------- commit f330d27fe7bcc884ed9c56fcf2c73bc8eb3e975f Author: Iavor S. Diatchki Date: Thu Oct 29 13:03:21 2015 -0700 Implement support for user-defined type errors. Summary: Implements Lennart's idea from the Haskell Symposium. Users may use the special type function `TypeError`, which is similar to `error` at the value level. See Trac ticket https://ghc.haskell.org/trac/ghc/ticket/9637, and wiki page https://ghc.haskell.org/trac/ghc/wiki/CustomTypeErros Test Plan: ? Reviewers: austin, goldfire, hvr, simonpj, bgamari Subscribers: adamgundry, thomie Differential Revision: https://phabricator.haskell.org/D1236 GHC Trac Issues: #9637 >--------------------------------------------------------------- f330d27fe7bcc884ed9c56fcf2c73bc8eb3e975f compiler/prelude/PrelNames.hs | 51 ++++++++++++++++++++++++++++++ compiler/typecheck/TcErrors.hs | 69 ++++++++++++++++++++++++++++++++++++++--- compiler/typecheck/TcRnTypes.hs | 19 +++++++++++- compiler/types/TypeRep.hs | 4 ++- libraries/base/GHC/TypeLits.hs | 15 +++++++++ 5 files changed, 152 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 f330d27fe7bcc884ed9c56fcf2c73bc8eb3e975f From git at git.haskell.org Thu Oct 29 20:55:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 20:55:12 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Add Haddoc documentation. (3ba1639) Message-ID: <20151029205512.EE9423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/3ba1639da54b5cac5c65d0c75f9284a9acdcd9ae/ghc >--------------------------------------------------------------- commit 3ba1639da54b5cac5c65d0c75f9284a9acdcd9ae Author: Iavor S. Diatchki Date: Thu Oct 29 13:54:40 2015 -0700 Add Haddoc documentation. >--------------------------------------------------------------- 3ba1639da54b5cac5c65d0c75f9284a9acdcd9ae libraries/base/GHC/TypeLits.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/base/GHC/TypeLits.hs b/libraries/base/GHC/TypeLits.hs index 7b94785..f124017 100644 --- a/libraries/base/GHC/TypeLits.hs +++ b/libraries/base/GHC/TypeLits.hs @@ -196,10 +196,22 @@ type family (m :: Nat) ^ (n :: Nat) :: Nat type family (m :: Nat) - (n :: Nat) :: Nat +-- | A description of a custom type error. data {-kind-} ErrorMessage = Text Symbol + -- ^ Show the text as is. + | forall t. ShowType t + -- ^ Pretty print the type. + -- @ShowType :: k -> ErrorMessage@ + | ErrorMessage :<>: ErrorMessage + -- ^ Put two pieces of error message next + -- to each other. + | ErrorMessage :$$: ErrorMessage + -- ^ Stack two pieces of error message on top + -- of each other. + infixl 5 :$$: infixl 6 :<>: From git at git.haskell.org Thu Oct 29 23:04:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 29 Oct 2015 23:04:34 +0000 (UTC) Subject: [commit: ghc] master: x86 codegen: don't generate location comments (e272ab9) Message-ID: <20151029230434.CA2253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e272ab99f60884e5c510c9597fbdb1a570eedcaa/ghc >--------------------------------------------------------------- commit e272ab99f60884e5c510c9597fbdb1a570eedcaa Author: Sergei Trofimovich Date: Thu Oct 29 23:03:42 2015 +0000 x86 codegen: don't generate location comments The following source snippet 'module A where x */* y = 42' when being compiled with '-g' option emits syntactically invalid comment for GNU as: .text .align 8 .loc 1 3 1 /* */* */ Fixed by not emitting comments at all. We already suppress all asm comments in 'X86/Ppr.hs'. Signed-off-by: Sergei Trofimovich Test Plan: added test and check it works Reviewers: scpmw, simonmar, austin, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1386 GHC Trac Issues: #10667 >--------------------------------------------------------------- e272ab99f60884e5c510c9597fbdb1a570eedcaa compiler/nativeGen/X86/Ppr.hs | 5 ++--- testsuite/tests/codeGen/should_compile/T10667.hs | 6 ++++++ testsuite/tests/codeGen/should_compile/all.T | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index ce63cae..0c9507a 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -506,9 +506,8 @@ pprInstr (COMMENT _) = empty -- nuke 'em pprInstr (COMMENT s) = ptext (sLit "# ") <> ftext s -} -pprInstr (LOCATION file line col name) - = ptext (sLit "\t.loc ") <> ppr file <+> ppr line <+> ppr col <> - ptext (sLit " /* ") <> text name <> ptext (sLit " */") +pprInstr (LOCATION file line col _name) + = ptext (sLit "\t.loc ") <> ppr file <+> ppr line <+> ppr col pprInstr (DELTA d) = pprInstr (COMMENT (mkFastString ("\tdelta = " ++ show d))) diff --git a/testsuite/tests/codeGen/should_compile/T10667.hs b/testsuite/tests/codeGen/should_compile/T10667.hs new file mode 100644 index 0000000..665c764 --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T10667.hs @@ -0,0 +1,6 @@ +module A where + +-- when used with '-g' debug generation option +-- '*/*' leaked into a /* comment */ and broke +-- GNU as. +x */* y = 42 diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T index d4e12fc..a8ca738 100644 --- a/testsuite/tests/codeGen/should_compile/all.T +++ b/testsuite/tests/codeGen/should_compile/all.T @@ -31,3 +31,4 @@ test('debug', extra_clean(['debug.cmm']), ['$MAKE -s --no-print-directory debug']) test('T9964', normal, compile, ['-O']) test('T10518', [cmm_src], compile, ['']) +test('T10667', normal, compile, ['-g']) From git at git.haskell.org Fri Oct 30 08:53:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 08:53:52 +0000 (UTC) Subject: [commit: ghc] master: Linker: Fix type in m32_free_internal (8ddf417) Message-ID: <20151030085352.7D3923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8ddf41744ea8b0c1d034f9c5e062b0112d3d3aff/ghc >--------------------------------------------------------------- commit 8ddf41744ea8b0c1d034f9c5e062b0112d3d3aff Author: Erik de Castro Lopo Date: Fri Oct 30 15:07:21 2015 +1100 Linker: Fix type in m32_free_internal The code: uint64_t c = __sync_sub_and_fetch((uint64_t*)addr, 1); was causing GCC to emit atomic instructions for 64 bit values which are not available on PowerPC. However, since PowerPC only has a 32 bit address space, use of a 64 bit value is superflous. Switching the type from `uint64_t` to `uintptr_t` should simply do the correct thing on all 32 and 64 bit architectures. Reviewers: austin, bgamari, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1399 GHC Trac Issues: #11036 >--------------------------------------------------------------- 8ddf41744ea8b0c1d034f9c5e062b0112d3d3aff rts/Linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index 98969b9..e7bb8f0 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1217,7 +1217,7 @@ static void m32_allocator_init(m32_allocator m32) { * You shouldn't have to use this method. Use `m32_free` instead. */ static void m32_free_internal(void * addr) { - uint64_t c = __sync_sub_and_fetch((uint64_t*)addr, 1); + uintptr_t c = __sync_sub_and_fetch((uintptr_t*)addr, 1); if (c == 0) { munmapForLinker(addr, getPageSize()); } From git at git.haskell.org Fri Oct 30 11:27:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 11:27:21 +0000 (UTC) Subject: [commit: ghc] master: Swap prov/req in variable naming in Parser.y (9b3a058) Message-ID: <20151030112721.6F6613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9b3a0588e7523db54443270005ba2c6016e56ab8/ghc >--------------------------------------------------------------- commit 9b3a0588e7523db54443270005ba2c6016e56ab8 Author: Simon Peyton Jones Date: Wed Oct 28 12:21:50 2015 +0000 Swap prov/req in variable naming in Parser.y This is a follow on to the patch for Trac #10928. It's a local renaming of variables only; no change in behaviour. >--------------------------------------------------------------- 9b3a0588e7523db54443270005ba2c6016e56ab8 compiler/parser/Parser.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 7f8eb59..d9da3c8 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1168,8 +1168,8 @@ where_decls :: { Located ([AddAnn] ,sL1 $3 (snd $ unLoc $3)) } pattern_synonym_sig :: { LSig RdrName } : 'pattern' con '::' ptype - {% do { let (flag, qtvs, prov, req, ty) = snd $ unLoc $4 - ; let sig = PatSynSig $2 (flag, mkHsQTvs qtvs) prov req ty + {% do { let (flag, qtvs, req, prov, ty) = snd $ unLoc $4 + ; let sig = PatSynSig $2 (flag, mkHsQTvs qtvs) req prov ty ; ams (sLL $1 $> $ sig) (mj AnnPattern $1:mj AnnDcolon $3:(fst $ unLoc $4)) } } From git at git.haskell.org Fri Oct 30 11:27:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 11:27:25 +0000 (UTC) Subject: [commit: ghc] master: Fix unused-import stuff in a better way (9376249) Message-ID: <20151030112725.174C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9376249b6b78610db055a10d05f6592d6bbbea2f/ghc >--------------------------------------------------------------- commit 9376249b6b78610db055a10d05f6592d6bbbea2f Author: Simon Peyton Jones Date: Wed Oct 28 17:16:55 2015 +0000 Fix unused-import stuff in a better way The fix for Trac #10890 in commit 1818b48, namely Fix incorrect import warnings when methods with identical names are imported was wrong, as demonstrated by the new test T10890_2. It suppressed far too many warnings! This patch fixes the original problem in a different way, by making RdrName.greUsedRdrName a bit cleverer. But this too is not really the Right Thing. I think the Right Thing is to store the /GRE/ in the tcg_used_rdrnames, not the /RdrName/. That would be a lot simpler and more direct. But one step at a time. >--------------------------------------------------------------- 9376249b6b78610db055a10d05f6592d6bbbea2f compiler/basicTypes/RdrName.hs | 62 ++++++++++++---------- compiler/rename/RnNames.hs | 28 +++------- testsuite/tests/module/mod177.stderr | 2 +- .../T10890/{T10890.hs => T10890_2.hs} | 12 ++--- .../warnings/should_compile/T10890/T10890_2.stderr | 5 ++ .../should_compile/T10890/{A.hs => T10890_2A.hs} | 2 +- .../should_compile/T10890/{B.hs => T10890_2B.hs} | 2 +- .../tests/warnings/should_compile/T10890/all.T | 4 ++ 8 files changed, 57 insertions(+), 60 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9376249b6b78610db055a10d05f6592d6bbbea2f From git at git.haskell.org Fri Oct 30 11:27:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 11:27:27 +0000 (UTC) Subject: [commit: ghc] master: Record usage information using GlobalRdrElt (3e94842) Message-ID: <20151030112727.C544D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3e94842d4d1258fbd6a1202bf74d41ce1d01c753/ghc >--------------------------------------------------------------- commit 3e94842d4d1258fbd6a1202bf74d41ce1d01c753 Author: Simon Peyton Jones Date: Fri Oct 30 09:41:47 2015 +0000 Record usage information using GlobalRdrElt This patch implements an improvment that I've wanted to do for ages, but never gotten around to. Unused imports are computed based on how imported entities occur (qualified, unqualified). This info was accumulated in tcg_used_rdrnames :: Set RdrName. But that was a huge pain, and it got worse when we introduced duplicate record fields. The Right Thing is to record tcg_used_gres :: [GlobalRdrElt], which records the GRE *after* filtering with pickGREs. See Note [GRE filtering] in RdrName. This is much, much bette. This patch deletes quite a bit of code, and is conceptually much easier to follow. Hooray. There should be no change in functionality. >--------------------------------------------------------------- 3e94842d4d1258fbd6a1202bf74d41ce1d01c753 compiler/basicTypes/RdrName.hs | 140 +++++++++++++-------- compiler/rename/RnEnv.hs | 88 ++++++------- compiler/rename/RnNames.hs | 102 ++++----------- compiler/rename/RnPat.hs | 2 +- compiler/typecheck/TcCanonical.hs | 12 +- compiler/typecheck/TcDeriv.hs | 9 +- compiler/typecheck/TcExpr.hs | 5 +- compiler/typecheck/TcRnDriver.hs | 14 +-- compiler/typecheck/TcRnMonad.hs | 7 +- compiler/typecheck/TcRnTypes.hs | 34 +++-- compiler/typecheck/TcSMonad.hs | 10 +- testsuite/tests/module/Mod136_A.hs | 4 +- testsuite/tests/module/mod136.hs | 1 + testsuite/tests/module/mod136.stderr | 2 +- testsuite/tests/rename/should_compile/T4239.stdout | 2 +- 15 files changed, 183 insertions(+), 249 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 3e94842d4d1258fbd6a1202bf74d41ce1d01c753 From git at git.haskell.org Fri Oct 30 11:27:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 11:27:30 +0000 (UTC) Subject: [commit: ghc] master: Kill redundant import (da58d15) Message-ID: <20151030112730.655A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/da58d1517ce9c57514f7b2bd7d444c9e3051a717/ghc >--------------------------------------------------------------- commit da58d1517ce9c57514f7b2bd7d444c9e3051a717 Author: Simon Peyton Jones Date: Fri Oct 30 09:45:16 2015 +0000 Kill redundant import I don't really understand this. GHC.hs had: module GHC( ..., module HsSyn, ... ) where import HsSyn import qualified HsSyn -- hack as we want to reexport the whole module GHC now reports the 'import qualified' line as redundant; and it certainly is, because 'import HsSyn' brings everything into scope qualified *and* unqualified. I have no idea why the "hack" was necessary before, but following my refactoring of tcg_used_gres (previous commit), it's reported as redundant, so I've deleted it. I'm making it a separate commit because it seems a bit mysterious and I wanted to draw attention to it. >--------------------------------------------------------------- da58d1517ce9c57514f7b2bd7d444c9e3051a717 compiler/main/GHC.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 1f7b117..f647960 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -302,7 +302,6 @@ import TcRnTypes import Packages import NameSet import RdrName -import qualified HsSyn -- hack as we want to reexport the whole module import HsSyn import Type hiding( typeKind ) import Kind ( tyConResKind ) From git at git.haskell.org Fri Oct 30 12:23:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 12:23:30 +0000 (UTC) Subject: [commit: ghc] master: integerConstantFolding: when(compiler_debugged(), expect_broken(#11006)) (268aa9a) Message-ID: <20151030122330.1A1F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/268aa9a2ee98d800594875c930cfcd76cb5e221b/ghc >--------------------------------------------------------------- commit 268aa9a2ee98d800594875c930cfcd76cb5e221b Author: Thomas Miedema Date: Fri Oct 30 13:22:04 2015 +0100 integerConstantFolding: when(compiler_debugged(), expect_broken(#11006)) >--------------------------------------------------------------- 268aa9a2ee98d800594875c930cfcd76cb5e221b testsuite/tests/lib/integer/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/lib/integer/all.T b/testsuite/tests/lib/integer/all.T index cdb8838..c0b39b0 100644 --- a/testsuite/tests/lib/integer/all.T +++ b/testsuite/tests/lib/integer/all.T @@ -3,7 +3,8 @@ test('integerConversions', normal, compile_and_run, ['']) # skip ghci as it doesn't support unboxed tuples test('integerGmpInternals', [reqlib('integer-gmp'), omit_ways('ghci')], compile_and_run, ['']) test('integerConstantFolding', - extra_clean(['integerConstantFolding.simpl']), + [extra_clean(['integerConstantFolding.simpl']), + when(compiler_debugged(), expect_broken(11006))], run_command, ['$MAKE -s --no-print-directory integerConstantFolding']) test('fromToInteger', From git at git.haskell.org Fri Oct 30 14:14:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 14:14:12 +0000 (UTC) Subject: [commit: ghc] branch 'wip/D1242' deleted Message-ID: <20151030141412.796923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/D1242 From git at git.haskell.org Fri Oct 30 14:15:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 14:15:26 +0000 (UTC) Subject: [commit: ghc] master: Disambiguate record selectors by type signature (0a16374) Message-ID: <20151030141526.DB3F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0a16374109ad16d9337185f5c0a845a3f20141cb/ghc >--------------------------------------------------------------- commit 0a16374109ad16d9337185f5c0a845a3f20141cb Author: Adam Gundry Date: Fri Oct 30 14:14:21 2015 +0000 Disambiguate record selectors by type signature This makes DuplicateRecordFields more liberal in when it will accept ambiguous record selectors, making use of type information in a similar way to updates. See Note [Disambiguating record fields] for more details. I've also refactored how record updates are disambiguated. Test Plan: New and amended tests in overloadedrecflds Reviewers: simonpj, goldfire, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1391 >--------------------------------------------------------------- 0a16374109ad16d9337185f5c0a845a3f20141cb compiler/deSugar/DsExpr.hs | 2 +- compiler/deSugar/DsMeta.hs | 6 +- compiler/hsSyn/HsExpr.hs | 8 +- compiler/hsSyn/HsPat.hs | 2 + compiler/hsSyn/HsTypes.hs | 5 +- compiler/rename/RnEnv.hs | 1 + compiler/rename/RnExpr.hs | 11 +- compiler/rename/RnPat.hs | 2 +- compiler/typecheck/TcExpr.hs | 314 ++++++++++++++------- .../tests/overloadedrecflds/should_fail/all.T | 2 + .../should_fail/overloadedrecfldsfail01.stderr | 14 +- .../should_fail/overloadedrecfldsfail04.hs | 2 + .../should_fail/overloadedrecfldsfail09.stderr | 2 +- .../should_fail/overloadedrecfldsfail12.hs | 3 + .../should_fail/overloadedrecfldsfail12.stderr | 4 + .../should_fail/overloadedrecfldsfail13.hs | 20 ++ .../should_fail/overloadedrecfldsfail13.stderr | 22 ++ .../should_fail/overloadedrecfldsfail14.hs | 14 + .../should_fail/overloadedrecfldsfail14.stderr | 5 + testsuite/tests/overloadedrecflds/should_run/all.T | 1 + .../should_run/overloadedrecfldsrun06.hs | 21 ++ .../should_run/overloadedrecfldsrun06.stdout | 1 + 22 files changed, 335 insertions(+), 127 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 0a16374109ad16d9337185f5c0a845a3f20141cb From git at git.haskell.org Fri Oct 30 16:06:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:06:42 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: list approach (does not work) (6be0615) Message-ID: <20151030160642.DAE013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/6be061545f03f07ea752c1fa9c0c503d82e80add/ghc >--------------------------------------------------------------- commit 6be061545f03f07ea752c1fa9c0c503d82e80add Author: George Karachalias Date: Fri Oct 30 17:03:05 2015 +0100 list approach (does not work) >--------------------------------------------------------------- 6be061545f03f07ea752c1fa9c0c503d82e80add compiler/deSugar/Check.hs | 842 +++++++++++++++++++++++++++---------------- compiler/deSugar/TmOracle.hs | 13 +- 2 files changed, 547 insertions(+), 308 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 6be061545f03f07ea752c1fa9c0c503d82e80add From git at git.haskell.org Fri Oct 30 16:18:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:18:14 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: Testsuite wibbles (0c7bb78) Message-ID: <20151030161814.B4C903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/0c7bb782f8ff801637d0c69fd0a72121da9e816a/ghc >--------------------------------------------------------------- commit 0c7bb782f8ff801637d0c69fd0a72121da9e816a Author: Simon Peyton Jones Date: Fri Oct 30 13:00:24 2015 +0000 Testsuite wibbles >--------------------------------------------------------------- 0c7bb782f8ff801637d0c69fd0a72121da9e816a testsuite/tests/ado/ado005.stderr | 8 +++---- .../tests/simplCore/should_compile/T8848.stderr | 4 ++-- .../tests/simplCore/should_compile/rule2.stderr | 2 +- testsuite/tests/th/T10267.stderr | 24 ++++++++++---------- testsuite/tests/typecheck/should_compile/tc244.hs | 2 ++ .../tests/typecheck/should_fail/T10715.stderr | 11 +++++---- testsuite/tests/typecheck/should_fail/T5300.stderr | 20 ----------------- testsuite/tests/typecheck/should_fail/T8030.stderr | 26 ---------------------- testsuite/tests/typecheck/should_fail/T9201.stderr | 9 -------- .../tests/typecheck/should_fail/tcfail072.stderr | 19 ---------------- .../tests/typecheck/should_fail/tcfail181.stderr | 1 - testsuite/tests/typecheck/should_run/T7861.stderr | 17 +------------- 12 files changed, 27 insertions(+), 116 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 0c7bb782f8ff801637d0c69fd0a72121da9e816a From git at git.haskell.org Fri Oct 30 16:18:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:18:17 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: Update Haddck submodule (456a7f6) Message-ID: <20151030161817.68FEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/456a7f6973336bae9019d715fa0bfd4ca50c9b0c/ghc >--------------------------------------------------------------- commit 456a7f6973336bae9019d715fa0bfd4ca50c9b0c Author: Simon Peyton Jones Date: Fri Oct 30 13:05:56 2015 +0000 Update Haddck submodule >--------------------------------------------------------------- 456a7f6973336bae9019d715fa0bfd4ca50c9b0c utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index ec20bd1..8358cd2 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit ec20bd15e724d580a01d9fad98791bb53db5e57c +Subproject commit 8358cd222cc5a2d9f971691fe62e7e2c352d7c9b From git at git.haskell.org Fri Oct 30 16:18:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:18:20 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: Merge remote-tracking branch 'origin/master' into wip/spj-wildcard-refactor (79a8840) Message-ID: <20151030161820.7AC3B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/79a88406267b5e30f0f2ebefb16c96d2f2914667/ghc >--------------------------------------------------------------- commit 79a88406267b5e30f0f2ebefb16c96d2f2914667 Merge: 456a7f6 268aa9a Author: Simon Peyton Jones Date: Fri Oct 30 16:16:31 2015 +0000 Merge remote-tracking branch 'origin/master' into wip/spj-wildcard-refactor Conflicts: compiler/hsSyn/HsBinds.hs compiler/parser/Parser.y compiler/rename/RnBinds.hs compiler/rename/RnEnv.hs compiler/typecheck/TcBinds.hs compiler/typecheck/TcExpr.hs compiler/typecheck/TcPatSyn.hs compiler/typecheck/TcPatSyn.hs-boot compiler/typecheck/TcUnify.hs utils/haddock >--------------------------------------------------------------- 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 79a88406267b5e30f0f2ebefb16c96d2f2914667 From git at git.haskell.org Fri Oct 30 16:18:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:18:22 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor's head updated: Merge remote-tracking branch 'origin/master' into wip/spj-wildcard-refactor (79a8840) Message-ID: <20151030161822.DB95F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/spj-wildcard-refactor' now includes: c2fab84 Add testcase for #10370 86e5eb9 Remove redundant typedef 0b79aa1 base: Add Haddocks to GHC.RTS.Flags 73c273a Fix a typo in the User's Guide ReST intro 23e344b Remove cygwin32_HOST_OS #ifdefs 499ce29 Add flag to reverse errors in GHC/GHCi a9c93bd Implement MIN_VERSION and VERSION macros natively in GHC. c10c01c Build system: comments only [skip ci] f86fb5e Add regression tests for #10045, #10999 6831815 Comments only 0ce858e Zonk properly when checkig pattern synonyms adc3d17 manpage: Mark as orphan document d1d8704 Use correct documentation flag for freverse-errors 158d2a9 Make it possible to have different UniqSupply strategies 079dd12 Fix "Use correct documentation flag for freverse-errors" dc13467 DynFlags: Fix more merge errors ffcdd84 Sort field labels before fingerprint hashing 166c597 DynFlags: Yet one more fix 31704ad Make worker-wrapper optional 9efa56d Fix the DYNAMIC_GHC_PROGRAMS=NO build on Mac/Windows 19354fb Make T10970a non-dependent on GCC version. 7c2ab6f Testsuite: accept output for T10999 (#10999) d1ab6fc PrelNames: Fix duplicate unique 9fc2d77 Build system: don't add ALL_HC_OPTS when linking 04b0a73 Pattern synonyms: swap provided/required de27bed Update haskeline/terminfo submodules c1e1584 Update `deepseq` submodule 776d55c rts/Linker.c: Drop support for legacy OS X dyn loading ce2416b Fix rts/T9579 tests on OS X 08f5c4e Backpack documentation updates for component IDs [no-ci] 032be43 Testsuite: report and error out on unfound tests a051788 Revert "Build system: don't add ALL_HC_OPTS when linking" 2a74a64 Record pattern synonyms fa58731 Revert "Build system: don't create mk/are-validating.mk" e31113f Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls d25fa86 TcTyDecls: Remove redundant import of Applicative 40e6214 DynFlags: Add (another) missing hunk from D1360 bef2f03 Generate Typeable info at definition sites bbaf76f Revert "Generate Typeable info at definition sites" e272ab9 x86 codegen: don't generate location comments 8ddf417 Linker: Fix type in m32_free_internal 9b3a058 Swap prov/req in variable naming in Parser.y 9376249 Fix unused-import stuff in a better way 3e94842 Record usage information using GlobalRdrElt da58d15 Kill redundant import 268aa9a integerConstantFolding: when(compiler_debugged(), expect_broken(#11006)) 0c7bb78 Testsuite wibbles 456a7f6 Update Haddck submodule 79a8840 Merge remote-tracking branch 'origin/master' into wip/spj-wildcard-refactor From git at git.haskell.org Fri Oct 30 16:46:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:46:35 +0000 (UTC) Subject: [commit: ghc] master: Build system: rename runghc.hs to Main.hs (1f1c7c6) Message-ID: <20151030164635.245FB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1f1c7c610b0ff26dccaef089e27003497fa25beb/ghc >--------------------------------------------------------------- commit 1f1c7c610b0ff26dccaef089e27003497fa25beb Author: Thomas Miedema Date: Tue Oct 27 13:25:15 2015 +0100 Build system: rename runghc.hs to Main.hs The build system has trouble with Main modules not called Main.hs. This change allows a hack in utils/runghc/ghc.mk to be removed. >--------------------------------------------------------------- 1f1c7c610b0ff26dccaef089e27003497fa25beb utils/runghc/{runghc.hs => Main.hs} | 0 utils/runghc/ghc.mk | 6 ------ utils/runghc/runghc.cabal.in | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/utils/runghc/runghc.hs b/utils/runghc/Main.hs similarity index 100% rename from utils/runghc/runghc.hs rename to utils/runghc/Main.hs diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk index 6979d50..e981abf 100644 --- a/utils/runghc/ghc.mk +++ b/utils/runghc/ghc.mk @@ -27,12 +27,6 @@ define utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_EXTRA echo 'ghcprog="$(ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)" endef -ifneq "$(BINDIST)" "YES" -# hack: the build system has trouble with Main modules not called Main.hs -utils/runghc/dist-install/build/Main.hs : utils/runghc/runghc.hs | $$(dir $$@)/. - "$(CP)" $< $@ -endif - $(eval $(call build-prog,utils/runghc,dist-install,1)) install: install_runhaskell diff --git a/utils/runghc/runghc.cabal.in b/utils/runghc/runghc.cabal.in index fde6b9a..6da179a 100644 --- a/utils/runghc/runghc.cabal.in +++ b/utils/runghc/runghc.cabal.in @@ -17,7 +17,7 @@ Flag base3 Executable runghc Default-Language: Haskell2010 - Main-Is: runghc.hs + Main-Is: Main.hs if flag(base3) Build-Depends: base >= 3 && < 5, From git at git.haskell.org Fri Oct 30 16:46:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:46:37 +0000 (UTC) Subject: [commit: ghc] master: Build system: cleanup a few .cabal files (b05ab1a) Message-ID: <20151030164637.BB8123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b05ab1a8bde53fee69d1ba99c7475444e9f84aa0/ghc >--------------------------------------------------------------- commit b05ab1a8bde53fee69d1ba99c7475444e9f84aa0 Author: Thomas Miedema Date: Tue Oct 27 14:01:48 2015 +0100 Build system: cleanup a few .cabal files >--------------------------------------------------------------- b05ab1a8bde53fee69d1ba99c7475444e9f84aa0 utils/ghc-cabal/ghc-cabal.cabal | 2 +- utils/ghc-pwd/ghc-pwd.cabal | 2 +- utils/hpc/hpc-bin.cabal | 27 +++++++-------------------- utils/runghc/runghc.cabal.in | 15 ++++----------- 4 files changed, 13 insertions(+), 33 deletions(-) diff --git a/utils/ghc-cabal/ghc-cabal.cabal b/utils/ghc-cabal/ghc-cabal.cabal index 5827333..1697f7c 100644 --- a/utils/ghc-cabal/ghc-cabal.cabal +++ b/utils/ghc-cabal/ghc-cabal.cabal @@ -13,7 +13,7 @@ cabal-version: >=1.10 Executable ghc-cabal Default-Language: Haskell2010 - Main-Is: ghc-cabal.hs + Main-Is: Main.hs Build-Depends: base >= 3 && < 5, bytestring >= 0.10 && < 0.11, diff --git a/utils/ghc-pwd/ghc-pwd.cabal b/utils/ghc-pwd/ghc-pwd.cabal index 4d155b0..dcd9529 100644 --- a/utils/ghc-pwd/ghc-pwd.cabal +++ b/utils/ghc-pwd/ghc-pwd.cabal @@ -13,7 +13,7 @@ cabal-version: >=1.10 Executable ghc-pwd Default-Language: Haskell2010 - Main-Is: ghc-pwd.hs + Main-Is: Main.hs Build-Depends: base >= 3 && < 5, directory >= 1 && < 1.3 diff --git a/utils/hpc/hpc-bin.cabal b/utils/hpc/hpc-bin.cabal index 0257fb9..87c5b11 100644 --- a/utils/hpc/hpc-bin.cabal +++ b/utils/hpc/hpc-bin.cabal @@ -13,15 +13,9 @@ Category: Development build-type: Simple cabal-version: >=1.10 -Flag base4 - Description: Choose the even newer, even smaller, split-up base package. - -Flag base3 - Description: Choose the new smaller, split-up base package. - Executable hpc Default-Language: Haskell2010 - Main-Is: Hpc.hs + Main-Is: Main.hs Other-Modules: HpcParser HpcCombine HpcDraft @@ -34,17 +28,10 @@ Executable hpc HpcUtils Paths_hpc_bin - if flag(base4) - Build-Depends: base >= 4 && < 5 - if flag(base3) - Build-Depends: base >= 3 && < 4 - if !flag(base3) && !flag(base4) - Build-Depends: base < 3 - - if flag(base3) || flag(base4) - Build-Depends: directory >= 1 && < 1.3, - filepath >= 1 && < 1.5, - containers >= 0.1 && < 0.6, - array >= 0.1 && < 0.6 - Build-Depends: hpc + Build-Depends: base >= 4 && < 5, + directory >= 1 && < 1.3, + filepath >= 1 && < 1.5, + containers >= 0.1 && < 0.6, + array >= 0.1 && < 0.6, + hpc diff --git a/utils/runghc/runghc.cabal.in b/utils/runghc/runghc.cabal.in index 6da179a..89f9e05 100644 --- a/utils/runghc/runghc.cabal.in +++ b/utils/runghc/runghc.cabal.in @@ -12,18 +12,11 @@ Category: Development build-type: Simple cabal-version: >=1.10 -Flag base3 - Description: Choose the new smaller, split-up base package. - Executable runghc Default-Language: Haskell2010 Main-Is: Main.hs - if flag(base3) - Build-Depends: base >= 3 && < 5, - directory >= 1 && < 1.3, - process >= 1 && < 1.3 - else - Build-Depends: base < 3 - Build-Depends: filepath - + Build-Depends: base >= 3 && < 5, + directory >= 1 && < 1.3, + process >= 1 && < 1.3, + filepath From git at git.haskell.org Fri Oct 30 16:46:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 16:46:40 +0000 (UTC) Subject: [commit: ghc] master: Build system: cabalise deriveConstants + genprimopcode (314395e) Message-ID: <20151030164640.C44663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/314395e00be10e6343840c215a4779aeec2542df/ghc >--------------------------------------------------------------- commit 314395e00be10e6343840c215a4779aeec2542df Author: Thomas Miedema Date: Mon Oct 26 13:30:07 2015 +0100 Build system: cabalise deriveConstants + genprimopcode This is needed for #10374 (but doesn't fix it yet). Also rename DeriveConstants.hs to Main.hs, because the build system has trouble with Main modules not called Main.hs. Differential Revision: https://phabricator.haskell.org/D1380 >--------------------------------------------------------------- 314395e00be10e6343840c215a4779aeec2542df utils/deriveConstants/{DeriveConstants.hs => Main.hs} | 0 .../deriveConstants.cabal} | 10 ++++------ utils/deriveConstants/ghc.mk | 7 ++++--- .../ghctags.cabal => genprimopcode/genprimopcode.cabal} | 15 +++++++-------- utils/genprimopcode/ghc.mk | 7 ++++--- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/Main.hs similarity index 100% rename from utils/deriveConstants/DeriveConstants.hs rename to utils/deriveConstants/Main.hs diff --git a/utils/dll-split/dll-split.cabal b/utils/deriveConstants/deriveConstants.cabal similarity index 78% copy from utils/dll-split/dll-split.cabal copy to utils/deriveConstants/deriveConstants.cabal index 290af06..72afb72 100644 --- a/utils/dll-split/dll-split.cabal +++ b/utils/deriveConstants/deriveConstants.cabal @@ -1,4 +1,4 @@ -Name: dll-split +Name: deriveConstants Version: 0.1 Copyright: XXX License: BSD3 @@ -6,17 +6,15 @@ License: BSD3 Author: XXX Maintainer: XXX Synopsis: XXX -Description: - XXX +Description: XXX Category: Development build-type: Simple cabal-version: >=1.10 -Executable dll-split +Executable deriveConstants Default-Language: Haskell2010 Main-Is: Main.hs - Build-Depends: base >= 4 && < 5, containers, + process, filepath - diff --git a/utils/deriveConstants/ghc.mk b/utils/deriveConstants/ghc.mk index 968282e..e278999 100644 --- a/utils/deriveConstants/ghc.mk +++ b/utils/deriveConstants/ghc.mk @@ -10,10 +10,11 @@ # # ----------------------------------------------------------------------------- -utils/deriveConstants_dist_MODULES = DeriveConstants -utils/deriveConstants_dist_PROGNAME = deriveConstants +utils/deriveConstants_USES_CABAL = YES +utils/deriveConstants_PACKAGE = deriveConstants +utils/deriveConstants_dist_PROGNAME = deriveConstants +utils/deriveConstants_dist_INSTALL = NO utils/deriveConstants_dist_INSTALL_INPLACE = YES -utils/deriveConstants_HC_OPTS += -package process -package containers $(eval $(call build-prog,utils/deriveConstants,dist,0)) diff --git a/utils/ghctags/ghctags.cabal b/utils/genprimopcode/genprimopcode.cabal similarity index 62% copy from utils/ghctags/ghctags.cabal copy to utils/genprimopcode/genprimopcode.cabal index 7901aa2..adc5230 100644 --- a/utils/ghctags/ghctags.cabal +++ b/utils/genprimopcode/genprimopcode.cabal @@ -1,4 +1,4 @@ -Name: ghctags +Name: genprimopcode Version: 0.1 Copyright: XXX License: BSD3 @@ -11,13 +11,12 @@ Category: Development build-type: Simple cabal-version: >=1.10 -Executable ghctags +Executable genprimopcode Default-Language: Haskell2010 - Main-Is: Main.hs - + Other-Modules: Lexer + Parser + ParserM + Syntax Build-Depends: base >= 4 && < 5, - containers, - Cabal >= 1.22 && <1.24, - ghc - + array diff --git a/utils/genprimopcode/ghc.mk b/utils/genprimopcode/ghc.mk index 4b9ebef..790c75d 100644 --- a/utils/genprimopcode/ghc.mk +++ b/utils/genprimopcode/ghc.mk @@ -10,9 +10,10 @@ # # ----------------------------------------------------------------------------- -utils/genprimopcode_dist_MODULES = Lexer Main ParserM Parser Syntax -utils/genprimopcode_dist_PROGNAME = genprimopcode -utils/genprimopcode_dist_HC_OPTS = -package array +utils/genprimopcode_USES_CABAL = YES +utils/genprimopcode_PACKAGE = genprimopcode +utils/genprimopcode_dist_PROGNAME = genprimopcode +utils/genprimopcode_dist_INSTALL = NO utils/genprimopcode_dist_INSTALL_INPLACE = YES $(eval $(call build-prog,utils/genprimopcode,dist,0)) From git at git.haskell.org Fri Oct 30 19:20:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:11 +0000 (UTC) Subject: [commit: ghc] master: Fix segfault due to reading non-existent memory (2624298) Message-ID: <20151030192011.907863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2624298a0d81e348b879c521b9fae3f389ebab08/ghc >--------------------------------------------------------------- commit 2624298a0d81e348b879c521b9fae3f389ebab08 Author: Simon Marlow Date: Fri Oct 30 19:53:44 2015 +0100 Fix segfault due to reading non-existent memory It was possible to read non-existent memory, if we try to read the srt_offset field of an info table when there is no SRT, and the info table is right at the start of the text section. This actually happened to me, I'm not sure why it never happened before. Test Plan: validate Reviewers: rwbarton, ezyang, austin, bgamari Reviewed By: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1401 >--------------------------------------------------------------- 2624298a0d81e348b879c521b9fae3f389ebab08 rts/sm/Scav.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index c441a3d..a28d842 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -359,22 +359,34 @@ STATIC_INLINE GNUC_ATTR_HOT void scavenge_thunk_srt(const StgInfoTable *info) { StgThunkInfoTable *thunk_info; + nat bitmap; if (!major_gc) return; thunk_info = itbl_to_thunk_itbl(info); - scavenge_srt((StgClosure **)GET_SRT(thunk_info), thunk_info->i.srt_bitmap); + bitmap = thunk_info->i.srt_bitmap; + if (bitmap) { + // don't read srt_offset if bitmap==0, because it doesn't exist + // and so the memory might not be readable. + scavenge_srt((StgClosure **)GET_SRT(thunk_info), bitmap); + } } STATIC_INLINE GNUC_ATTR_HOT void scavenge_fun_srt(const StgInfoTable *info) { StgFunInfoTable *fun_info; + nat bitmap; if (!major_gc) return; fun_info = itbl_to_fun_itbl(info); - scavenge_srt((StgClosure **)GET_FUN_SRT(fun_info), fun_info->i.srt_bitmap); + bitmap = fun_info->i.srt_bitmap; + if (bitmap) { + // don't read srt_offset if bitmap==0, because it doesn't exist + // and so the memory might not be readable. + scavenge_srt((StgClosure **)GET_FUN_SRT(fun_info), bitmap); + } } /* ----------------------------------------------------------------------------- From git at git.haskell.org Fri Oct 30 19:20:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:14 +0000 (UTC) Subject: [commit: ghc] master: CmmParse: Expose popcnt operations (42e8528) Message-ID: <20151030192014.C50003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/42e85284b7be4aa298cff51119f33a72c0e3bd7a/ghc >--------------------------------------------------------------- commit 42e85284b7be4aa298cff51119f33a72c0e3bd7a Author: Ben Gamari Date: Fri Oct 30 19:53:52 2015 +0100 CmmParse: Expose popcnt operations Make various population count operations available via C-- syntax under the names %popcnt{8,16,32,64}. Fixes #11037. Reviewers: simonmar, austin, ekmett Reviewed By: austin, ekmett Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1402 GHC Trac Issues: #11037 >--------------------------------------------------------------- 42e85284b7be4aa298cff51119f33a72c0e3bd7a compiler/cmm/CmmParse.y | 7 ++++++- testsuite/tests/codeGen/should_run/{T5149.hs => PopCnt.hs} | 5 +++-- .../Capi_Ctype_001.stdout => codeGen/should_run/PopCnt.stdout} | 2 +- testsuite/tests/codeGen/should_run/PopCnt_cmm.cmm | 9 +++++++++ testsuite/tests/codeGen/should_run/all.T | 2 ++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 555aed2..11e68bd 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -981,7 +981,12 @@ callishMachOps = listToUFM $ ("prefetch0", (,) $ MO_Prefetch_Data 0), ("prefetch1", (,) $ MO_Prefetch_Data 1), ("prefetch2", (,) $ MO_Prefetch_Data 2), - ("prefetch3", (,) $ MO_Prefetch_Data 3) + ("prefetch3", (,) $ MO_Prefetch_Data 3), + + ( "popcnt8", (,) $ MO_PopCnt W8 ), + ( "popcnt16", (,) $ MO_PopCnt W16 ), + ( "popcnt32", (,) $ MO_PopCnt W32 ), + ( "popcnt64", (,) $ MO_PopCnt W64 ) -- ToDo: the rest, maybe -- edit: which rest? diff --git a/testsuite/tests/codeGen/should_run/T5149.hs b/testsuite/tests/codeGen/should_run/PopCnt.hs similarity index 51% copy from testsuite/tests/codeGen/should_run/T5149.hs copy to testsuite/tests/codeGen/should_run/PopCnt.hs index c0c88e3..e6c99a4 100644 --- a/testsuite/tests/codeGen/should_run/T5149.hs +++ b/testsuite/tests/codeGen/should_run/PopCnt.hs @@ -3,6 +3,7 @@ module Main where import GHC.Exts -foreign import prim "f5149" f :: Int# -> Int# -> Double# -> Int# +foreign import prim "do_popcnt32" popcnt32 :: Int# -> Int# + +main = print (I# (popcnt32 0xffff#)) -main = print (I# (f 1# 2# 1.0##)) diff --git a/testsuite/tests/ffi/should_run/Capi_Ctype_001.stdout b/testsuite/tests/codeGen/should_run/PopCnt.stdout similarity index 60% copy from testsuite/tests/ffi/should_run/Capi_Ctype_001.stdout copy to testsuite/tests/codeGen/should_run/PopCnt.stdout index dc3ed24..b5794c5 100644 --- a/testsuite/tests/ffi/should_run/Capi_Ctype_001.stdout +++ b/testsuite/tests/codeGen/should_run/PopCnt.stdout @@ -1,2 +1,2 @@ -6 16 + diff --git a/testsuite/tests/codeGen/should_run/PopCnt_cmm.cmm b/testsuite/tests/codeGen/should_run/PopCnt_cmm.cmm new file mode 100644 index 0000000..21e02fa --- /dev/null +++ b/testsuite/tests/codeGen/should_run/PopCnt_cmm.cmm @@ -0,0 +1,9 @@ +#include "Cmm.h" + +do_popcnt32 (W_ x) +{ + W_ res; + (res) = prim %popcnt32(x); + R1 = res; + jump %ENTRY_CODE(Sp(0)) [R1]; +} diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 13eda78..defd9b2 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -139,3 +139,5 @@ test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) test('T10870', normal, compile_and_run, ['']) +test('PopCnt', omit_ways(['ghci']), multi_compile_and_run, + ['PopCnt', [('PopCnt_cmm.cmm', '')], '']) \ No newline at end of file From git at git.haskell.org Fri Oct 30 19:20:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:17 +0000 (UTC) Subject: [commit: ghc] master: Linker: Clean up USE_MMAP usage (3e2c227) Message-ID: <20151030192017.684F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3e2c227ebc42f7ab51046cb424c8642a46050daf/ghc >--------------------------------------------------------------- commit 3e2c227ebc42f7ab51046cb424c8642a46050daf Author: Erik de Castro Lopo Date: Fri Oct 30 19:54:04 2015 +0100 Linker: Clean up USE_MMAP usage Test Plan: Validate on powerpc/linux, x86_64/linux and x86_64/darwin Reviewers: austin, bgamari, thomie Reviewed By: thomie Subscribers: Phyx, thomie Differential Revision: https://phabricator.haskell.org/D1398 >--------------------------------------------------------------- 3e2c227ebc42f7ab51046cb424c8642a46050daf rts/Linker.c | 64 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index e7bb8f0..34bae5b 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -65,12 +65,12 @@ defined(openbsd_HOST_OS ) || defined(darwin_HOST_OS ) || \ defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS ) || \ defined(solaris2_HOST_OS))) -/* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support +/* Don't use mmap on powerpc/darwin as the mmap there doesn't support * reallocating but we need to allocate jump islands just after each * object images. Otherwise relative branches to jump islands can fail * due to 24-bits displacement overflow. */ -#define USE_MMAP +#define USE_MMAP 1 #include #include @@ -78,13 +78,17 @@ #include #endif +#else + +#define USE_MMAP 0 + #endif /* PowerPC has relative branch instructions with only 24 bit displacements * and therefore needs jump islands contiguous with each object code module. */ -#if (defined(USE_MMAP) && defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) +#if (USE_MMAP && defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) #define USE_CONTIGUOUS_MMAP 1 #else #define USE_CONTIGUOUS_MMAP 0 @@ -158,11 +162,9 @@ static HsInt isAlreadyLoaded( pathchar *path ); static HsInt loadOc( ObjectCode* oc ); static ObjectCode* mkOc( pathchar *path, char *image, int imageSize, rtsBool mapped, char *archiveMemberName -#ifndef USE_MMAP -#ifdef darwin_HOST_OS +#if (USE_MMAP == 0) && defined (darwin_HOST_OS) , int misalignment #endif -#endif ); // Use wchar_t for pathnames on Windows (#5697) @@ -234,7 +236,7 @@ static int ocGetNames_MachO ( ObjectCode* oc ); static int ocResolve_MachO ( ObjectCode* oc ); static int ocRunInit_MachO ( ObjectCode* oc ); -#ifndef USE_MMAP +#if (USE_MMAP == 0) static int machoGetMisalignment( FILE * ); #endif #if NEED_SYMBOL_EXTRAS @@ -247,7 +249,7 @@ static void machoInitSymbolsWithoutUnderscore( void ); static void freeProddableBlocks (ObjectCode *oc); -#ifdef USE_MMAP +#if USE_MMAP /** * An allocated page being filled by the allocator */ @@ -559,7 +561,7 @@ initLinker_ (int retain_cafs) addDLLHandle(WSTR("*.exe"), GetModuleHandle(NULL)); #endif -#ifdef USE_MMAP +#if USE_MMAP m32_allocator_init(&allocator); #endif @@ -1014,7 +1016,7 @@ void ghci_enquire ( char* addr ) } #endif -#ifdef USE_MMAP +#if USE_MMAP #define ROUND_UP(x,size) ((x + size - 1) & ~(size - 1)) #define ROUND_DOWN(x,size) (x & ~(size - 1)) @@ -1379,7 +1381,7 @@ static void freeOcStablePtrs (ObjectCode *oc) static void freePreloadObjectFile (ObjectCode *oc) { -#ifdef USE_MMAP +#if USE_MMAP if (oc->imageMapped) { munmap(oc->image, oc->fileSize); @@ -1429,7 +1431,7 @@ void freeObjectCode (ObjectCode *oc) for (i=0; i < oc->n_sections; i++) { if (oc->sections[i].start != NULL) { switch(oc->sections[i].alloc){ -#ifdef USE_MMAP +#if USE_MMAP case SECTION_MMAP: munmap(oc->sections[i].mapped_start, oc->sections[i].mapped_size); @@ -1455,7 +1457,7 @@ void freeObjectCode (ObjectCode *oc) /* Free symbol_extras. On x86_64 Windows, symbol_extras are allocated * alongside the image, so we don't need to free. */ #if NEED_SYMBOL_EXTRAS && (!defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)) -#ifdef USE_MMAP +#if USE_MMAP if (!USE_CONTIGUOUS_MMAP && oc->symbol_extras != NULL) { m32_free(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras); @@ -1474,11 +1476,9 @@ void freeObjectCode (ObjectCode *oc) static ObjectCode* mkOc( pathchar *path, char *image, int imageSize, rtsBool mapped, char *archiveMemberName -#ifndef USE_MMAP -#ifdef darwin_HOST_OS +#if (USE_MMAP == 0) && defined (darwin_HOST_OS) , int misalignment #endif -#endif ) { ObjectCode* oc; @@ -1518,11 +1518,9 @@ mkOc( pathchar *path, char *image, int imageSize, #endif oc->imageMapped = mapped; -#ifndef USE_MMAP -#ifdef darwin_HOST_OS +#if (USE_MMAP == 0) && defined (darwin_HOST_OS) oc->misalignment = misalignment; #endif -#endif /* chain it onto the list of objects */ oc->next = NULL; @@ -1580,7 +1578,7 @@ static HsInt loadArchive_ (pathchar *path) #else #error Unknown Darwin architecture #endif -#if !defined(USE_MMAP) +#if (USE_MMAP == 0) int misalignment; #endif #endif @@ -1864,7 +1862,7 @@ static HsInt loadArchive_ (pathchar *path) #endif memberSize); #elif defined(darwin_HOST_OS) -#if defined(USE_MMAP) +#if USE_MMAP image = mmapForLinker(memberSize, MAP_ANONYMOUS, -1, 0); #else /* See loadObj() */ @@ -1931,7 +1929,7 @@ static HsInt loadArchive_ (pathchar *path) path, (int)thisFileNameSize, fileName); oc = mkOc(path, image, memberSize, rtsFalse, archiveMemberName -#if !defined(USE_MMAP) && defined(darwin_HOST_OS) +#if (USE_MMAP == 0) && defined(darwin_HOST_OS) , misalignment #endif ); @@ -1952,7 +1950,7 @@ static HsInt loadArchive_ (pathchar *path) barf("loadArchive: GNU-variant index found, but already have an index, while reading filename from `%s'", path); } IF_DEBUG(linker, debugBelch("loadArchive: Found GNU-variant file index\n")); -#ifdef USE_MMAP +#if USE_MMAP gnuFileIndex = mmapForLinker(memberSize + 1, MAP_ANONYMOUS, -1, 0); #else gnuFileIndex = stgMallocBytes(memberSize + 1, "loadArchive(image)"); @@ -1996,14 +1994,14 @@ static HsInt loadArchive_ (pathchar *path) stgFree(fileName); if (gnuFileIndex != NULL) { -#ifdef USE_MMAP +#if USE_MMAP munmap(gnuFileIndex, gnuFileIndexSize + 1); #else stgFree(gnuFileIndex); #endif } -#ifdef USE_MMAP +#if USE_MMAP m32_allocator_flush(&allocator); #endif @@ -2032,7 +2030,7 @@ preloadObjectFile (pathchar *path) int r; void *image; ObjectCode *oc; -#if !defined(USE_MMAP) && defined(darwin_HOST_OS) +#if (USE_MMAP == 0) && defined(darwin_HOST_OS) int misalignment; #endif @@ -2044,7 +2042,7 @@ preloadObjectFile (pathchar *path) fileSize = st.st_size; -#ifdef USE_MMAP +#if USE_MMAP int fd; /* On many architectures malloc'd memory isn't executable, so we need to use @@ -2123,7 +2121,7 @@ preloadObjectFile (pathchar *path) #endif /* USE_MMAP */ oc = mkOc(path, image, fileSize, rtsTrue, NULL -#if !defined(USE_MMAP) && defined(darwin_HOST_OS) +#if (USE_MMAP == 0) && defined(darwin_HOST_OS) , misalignment #endif ); @@ -2468,14 +2466,14 @@ addSection (Section *s, SectionKind kind, SectionAlloc alloc, static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) { StgWord n; -#ifndef USE_MMAP +#if (USE_MMAP == 0) int misalignment = 0; #ifdef darwin_HOST_OS int aligned; #endif #endif -#ifdef USE_MMAP +#if USE_MMAP if (USE_CONTIGUOUS_MMAP) { n = roundUpToPage(oc->fileSize); @@ -2504,7 +2502,7 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) if( count > 0 ) { -#ifdef USE_MMAP +#if USE_MMAP n = roundUpToPage(oc->fileSize); oc->symbol_extras = m32_alloc(&allocator, @@ -6291,7 +6289,7 @@ ocGetNames_MachO(ObjectCode* oc) if((sections[i].flags & SECTION_TYPE) == S_ZEROFILL) { -#ifdef USE_MMAP +#if USE_MMAP char * zeroFillArea = mmapForLinker(sections[i].size, MAP_ANONYMOUS, -1, 0); if (zeroFillArea == NULL) return 0; memset(zeroFillArea, 0, sections[i].size); @@ -6594,7 +6592,7 @@ machoInitSymbolsWithoutUnderscore(void) } #endif -#ifndef USE_MMAP +#if (USE_MMAP == 0) /* * Figure out by how much to shift the entire Mach-O file in memory * when loading so that its single segment ends up 16-byte-aligned From git at git.haskell.org Fri Oct 30 19:20:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:20 +0000 (UTC) Subject: [commit: ghc] master: Insert an empty line between two STG definitions in dump output. (1c80db5) Message-ID: <20151030192020.0E3733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1c80db59dd46a281b0f47abdaedf2bb5915d9e59/ghc >--------------------------------------------------------------- commit 1c80db59dd46a281b0f47abdaedf2bb5915d9e59 Author: ?mer Sinan A?acan Date: Fri Oct 30 19:54:10 2015 +0100 Insert an empty line between two STG definitions in dump output. (Simplifier and desugarer do this already) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1395 >--------------------------------------------------------------- 1c80db59dd46a281b0f47abdaedf2bb5915d9e59 compiler/stgSyn/StgSyn.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/stgSyn/StgSyn.hs b/compiler/stgSyn/StgSyn.hs index d04a157..1c6a00f 100644 --- a/compiler/stgSyn/StgSyn.hs +++ b/compiler/stgSyn/StgSyn.hs @@ -49,6 +49,7 @@ module StgSyn ( import Bitmap import CoreSyn ( AltCon, Tickish ) import CostCentre ( CostCentreStack ) +import Data.List ( intersperse ) import DataCon import DynFlags import FastString @@ -646,7 +647,7 @@ pprStgBinding :: StgBinding -> SDoc pprStgBinding bind = pprGenStgBinding bind pprStgBindings :: [StgBinding] -> SDoc -pprStgBindings binds = vcat (map pprGenStgBinding binds) +pprStgBindings binds = vcat $ intersperse blankLine (map pprGenStgBinding binds) instance (Outputable bdee) => Outputable (GenStgArg bdee) where ppr = pprStgArg From git at git.haskell.org Fri Oct 30 19:20:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:22 +0000 (UTC) Subject: [commit: ghc] master: Unify: Add Outputable instance for UnifyResultM (56f9ef4) Message-ID: <20151030192022.ADB3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/56f9ef414c9d827cd4fccfd7ab2657bced887b3d/ghc >--------------------------------------------------------------- commit 56f9ef414c9d827cd4fccfd7ab2657bced887b3d Author: Ben Gamari Date: Fri Oct 30 19:54:22 2015 +0100 Unify: Add Outputable instance for UnifyResultM Reviewers: simonpj, austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1389 >--------------------------------------------------------------- 56f9ef414c9d827cd4fccfd7ab2657bced887b3d compiler/types/Unify.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index de22066..87681e0 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -30,6 +30,8 @@ import Type import TyCon import TypeRep import Util ( filterByList ) +import Outputable +import FastString (sLit) import Control.Monad (liftM, foldM, ap) #if __GLASGOW_HASKELL__ < 709 @@ -475,6 +477,11 @@ tcUnifyTysFG :: (TyVar -> BindFlag) tcUnifyTysFG bind_fn tys1 tys2 = initUM bind_fn (unify_tys tys1 tys2) +instance Outputable a => Outputable (UnifyResultM a) where + ppr SurelyApart = ptext (sLit "SurelyApart") + ppr (Unifiable x) = ptext (sLit "Unifiable") <+> ppr x + ppr (MaybeApart x) = ptext (sLit "MaybeApart") <+> ppr x + {- ************************************************************************ * * From git at git.haskell.org Fri Oct 30 19:20:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:28 +0000 (UTC) Subject: [commit: ghc] master: driver: use PROGBITS type for .debug-ghc-link-info section (f78b477) Message-ID: <20151030192028.5E67F3A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f78b477bd0ba1f85089c515259c9e3145abd1f7b/ghc >--------------------------------------------------------------- commit f78b477bd0ba1f85089c515259c9e3145abd1f7b Author: Sylvain HENRY Date: Fri Oct 30 19:55:24 2015 +0100 driver: use PROGBITS type for .debug-ghc-link-info section Previously the `.debug-ghc-link-info` section was of type `SHT_NOTE` but this is not compliant with the ELF specification, which requires that `NOTE` sections are in a particular record-based format. We mark this section as `PROGBITS` instead, which is defined as implying no particular format. Fixes #11022. Reviewers: bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie, hsyl20 Differential Revision: https://phabricator.haskell.org/D1375 GHC Trac Issues: #11022 >--------------------------------------------------------------- f78b477bd0ba1f85089c515259c9e3145abd1f7b compiler/main/DriverPipeline.hs | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 697353e..60897a3 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -456,6 +456,7 @@ platformSupportsSavingLinkOpts os | os == OSSolaris2 = False -- see #5382 | otherwise = osElfTarget os +-- See Note [LinkInfo section] ghcLinkInfoSectionName :: String ghcLinkInfoSectionName = ".debug-ghc-link-info" -- if we use the ".debug" prefix, then strip will strip it by default @@ -1659,9 +1660,11 @@ mkNoteObjsToLinkIntoBinary dflags dep_packages = do where link_opts info = hcat [ + -- LinkInfo section must be of type "progbits" + -- See Note [LinkInfo section] text "\t.section ", text ghcLinkInfoSectionName, text ",\"\",", - text elfSectionNote, + text elfSectionProgBits, text "\n", text "\t.ascii \"", info', text "\"\n", @@ -1681,15 +1684,14 @@ mkNoteObjsToLinkIntoBinary dflags dep_packages = do escape :: String -> String escape = concatMap (charToC.fromIntegral.ord) - elfSectionNote :: String - elfSectionNote = case platformArch (targetPlatform dflags) of - ArchARM _ _ _ -> "%note" - _ -> "@note" + elfSectionProgBits :: String + elfSectionProgBits = case platformArch (targetPlatform dflags) of + ArchARM _ _ _ -> "%progbits" + _ -> "@progbits" --- The "link info" is a string representing the parameters of the --- link. We save this information in the binary, and the next time we --- link, if nothing else has changed, we use the link info stored in --- the existing binary to decide whether to re-link or not. +-- | Return the "link info" string +-- +-- See Note [LinkInfo section] getLinkInfo :: DynFlags -> [UnitId] -> IO String getLinkInfo dflags dep_packages = do package_link_opts <- getPackageLinkOpts dflags dep_packages @@ -1708,6 +1710,22 @@ getLinkInfo dflags dep_packages = do -- return (show link_info) + +{- Note [LinkInfo section] + ~~~~~~~~~~~~~~~~~~~~~~~ + +The "link info" is a string representing the parameters of the link. We save +this information in the binary, and the next time we link, if nothing else has +changed, we use the link info stored in the existing binary to decide whether +to re-link or not. + +The "link info" string is stored in a ELF section called ".debug-ghc-link-info" +(see ghcLinkInfoSectionName) with the SHT_PROGBITS type. It used to be of type +SHT_NOTE without following their specified record-based format (see #11022). + +-} + + ----------------------------------------------------------------------------- -- Look for the /* GHC_PACKAGES ... */ comment at the top of a .hc file From git at git.haskell.org Fri Oct 30 19:20:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:20:25 +0000 (UTC) Subject: [commit: ghc] master: Move win32 tarball download logic to script (aa289d2) Message-ID: <20151030192025.BEFDA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aa289d2a1bea3c30719710530c5a4409230f90d4/ghc >--------------------------------------------------------------- commit aa289d2a1bea3c30719710530c5a4409230f90d4 Author: Ben Gamari Date: Fri Oct 30 19:54:45 2015 +0100 Move win32 tarball download logic to script This allows it to be used by users and packagers to grab the tarballs necessary to generate a source tarball. Test Plan: try it Reviewers: thomie, austin, Phyx Reviewed By: thomie, austin, Phyx Subscribers: erikd Differential Revision: https://phabricator.haskell.org/D1378 >--------------------------------------------------------------- aa289d2a1bea3c30719710530c5a4409230f90d4 configure.ac | 110 +++++++++++------------------------- mk/get-win32-tarballs.sh | 144 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+), 78 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 aa289d2a1bea3c30719710530c5a4409230f90d4 From git at git.haskell.org Fri Oct 30 19:45:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:45:39 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: suggest quoting $(TEST_HC) (59e728b) Message-ID: <20151030194539.43FF63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/59e728bc0b47116e3c9a8b21b14dc3198531b9a9/ghc >--------------------------------------------------------------- commit 59e728bc0b47116e3c9a8b21b14dc3198531b9a9 Author: Thomas Miedema Date: Fri Oct 30 20:22:24 2015 +0100 Testsuite: suggest quoting $(TEST_HC) Test Plan: it works Reviewers: bgamari, rwbarton, austin Reviewed By: austin Subscribers: rwbarton Differential Revision: https://phabricator.haskell.org/D1377 >--------------------------------------------------------------- 59e728bc0b47116e3c9a8b21b14dc3198531b9a9 bindisttest/install | 3 +++ ghc.mk | 6 +++-- inplace/test | 3 +++ inplace/test spaces | 1 + mk/tree.mk | 3 +++ testsuite/.gitignore | 2 ++ testsuite/mk/boilerplate.mk | 61 ++++++++++++++++++++++++++++++++++++------ testsuite/tests/cabal/Makefile | 4 +-- 8 files changed, 71 insertions(+), 12 deletions(-) diff --git a/bindisttest/install b/bindisttest/install new file mode 100755 index 0000000..cccdc75 --- /dev/null +++ b/bindisttest/install @@ -0,0 +1,3 @@ +# See Note [Spaces in TEST_HC]. +echo +echo 'Possible fix: put quotes around $(TEST_HC) in your Makefile.' diff --git a/ghc.mk b/ghc.mk index 595356a..bf521b2 100644 --- a/ghc.mk +++ b/ghc.mk @@ -1380,8 +1380,10 @@ distclean : clean # Not sure why this is being cleaned here. $(call removeTrees,includes/dist-derivedconstants) -# Finally, clean the inplace tree. - $(call removeTrees,inplace) +# Also clean Windows-only inplace directories. +# Don't delete 'inplace' itself, it contains source files. + $(call removeTrees,inplace/mingw) + $(call removeTrees,inplace/perl) maintainer-clean : distclean $(call removeFiles,configure mk/config.h.in) diff --git a/inplace/test b/inplace/test new file mode 100755 index 0000000..cccdc75 --- /dev/null +++ b/inplace/test @@ -0,0 +1,3 @@ +# See Note [Spaces in TEST_HC]. +echo +echo 'Possible fix: put quotes around $(TEST_HC) in your Makefile.' diff --git a/inplace/test spaces b/inplace/test spaces new file mode 120000 index 0000000..c5e82d7 --- /dev/null +++ b/inplace/test spaces @@ -0,0 +1 @@ +bin \ No newline at end of file diff --git a/mk/tree.mk b/mk/tree.mk index 887e643..b333e64 100644 --- a/mk/tree.mk +++ b/mk/tree.mk @@ -27,6 +27,9 @@ INPLACE_PERL = $(INPLACE)/perl # ################################################################################ +# See Note [Spaces in TEST_HC]. +# Directory contains multiple spaces, to test that multiple spaces aren't +# getting collapsed into a single space. BIN_DIST_INST_SUBDIR = "install dir" BIN_DIST_INST_DIR = bindisttest/$(BIN_DIST_INST_SUBDIR) diff --git a/testsuite/.gitignore b/testsuite/.gitignore index d9f7dcc..9c3f91f 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -57,6 +57,8 @@ tmp.d *bindisttest_install___dir_bin_ghc.exe.mk mk/ghcconfig*_bin_ghc*.mk mk/ghcconfig*_bin_ghc*.exe.mk +mk/ghcconfig*_test___spaces_ghc*.mk +mk/ghcconfig*_test___spaces_ghc*.exe.mk *.imports # ----------------------------------------------------------------------------- diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk index 8872e52..055c856 100644 --- a/testsuite/mk/boilerplate.mk +++ b/testsuite/mk/boilerplate.mk @@ -44,15 +44,59 @@ endef ifeq "$(TEST_HC)" "" -STAGE1_GHC := $(abspath $(TOP)/../inplace/bin/ghc-stage1) -STAGE2_GHC := $(abspath $(TOP)/../inplace/bin/ghc-stage2) -STAGE3_GHC := $(abspath $(TOP)/../inplace/bin/ghc-stage3) - -ifneq "$(wildcard $(STAGE1_GHC) $(STAGE1_GHC).exe)" "" - +# Note [Spaces in TEST_HC] +# +# Tests should be able to handle paths with spaces. +# +# One of the things ./validate (without --fast) does is check if binary +# distributions can succesfully be installed and used in paths containing +# spaces. +# +# It does so in the following way: +# * create a binary distribution in 'bindistprep/'. +# * install that binary distribution in 'bindisttest/install dir/' +# * run the testsuite with BINDIST=YES +# +# BINDIST=YES tells the testsuite driver to use +# 'bindisttest/install dir/bin/ghc' instead of 'inplace/bin/ghc-stage2' as +# TEST_HC. +# +# Before, if a GHC developer forgot to quote TEST_HC in their Makefile when +# adding a new test, the test would fail with a puzzling "command not found: +# bindisttest/install" error (but only when validating). +# +# Therefore, we now: +# * make sure 'bindisttest/install' does exist, and show a nice message when +# it is executed. +# * let the default value of TEST_HC also contain spaces +# (i.e. 'inplace/test spaces/ghc-stage2'), such that the test always +# fails, also without BINDIST=YES, and again show a nice message when it +# indeed does so, through 'inplace/test'. + +# The `wildcard` function requires spaces to be escaped. Other gnu make +# functions can't seem to handle spaces at all (e.g. `abspath`). +STAGE1_TEST_SPACES := $(TOP)/../inplace/test\ \ \ spaces/ghc-stage1 +STAGE1_NORMAL := $(TOP)/../inplace/bin/ghc-stage1 + +ifneq "$(wildcard $(STAGE1_TEST_SPACES) $(STAGE1_NORMAL))" "" IMPLICIT_COMPILER = NO IN_TREE_COMPILER = YES + +ifneq "$(wildcard $(STAGE1_TEST_SPACES))" "" +# See Note [Spaces in TEST_HC]. +STAGE1_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage1 +STAGE2_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage2 +STAGE3_GHC := $(abspath $(TOP)/../)/inplace/test spaces/ghc-stage3 +else +# Maybe we're on Windows (no symlink support), or in a bindist or sdist, which +# don't have the 'test spaces' symlink. +STAGE1_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage1 +STAGE2_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage2 +STAGE3_GHC := $(abspath $(TOP)/../)/inplace/bin/ghc-stage3 +endif + ifeq "$(BINDIST)" "YES" +# See Note [Spaces in TEST_HC]. TEST_HC := $(abspath $(TOP)/../)/bindisttest/install dir/bin/ghc else ifeq "$(stage)" "1" TEST_HC := $(STAGE1_GHC) @@ -69,7 +113,8 @@ IN_TREE_COMPILER = NO TEST_HC := $(shell which ghc) endif -else +else # neq "$(TEST_HC)" "" + ifeq "$(TEST_HC)" "ghc" IMPLICIT_COMPILER = YES else @@ -95,7 +140,7 @@ override TEST_HC := $(shell which '$(TEST_HC)') else override TEST_HC := $(TEST_HC_REALPATH) endif -endif +endif # "$(TEST_HC)" "" # We can't use $(dir ...) here as TEST_HC might be in a path # containing spaces diff --git a/testsuite/tests/cabal/Makefile b/testsuite/tests/cabal/Makefile index 7644bd8..635a94b 100644 --- a/testsuite/tests/cabal/Makefile +++ b/testsuite/tests/cabal/Makefile @@ -240,9 +240,9 @@ ghcpkg02: rm -rf $(PACKAGE_CONF_ghcpkg02) $(GHC_PKG_ghcpkg02) init $(PACKAGE_CONF_ghcpkg02) set -e; \ - for i in `$(GHC_PKG) list --global --simple-output -v0`; do \ + for i in `'$(GHC_PKG)' list --global --simple-output -v0`; do \ echo Updating $$i; \ - $(GHC_PKG) describe --global $$i | $(GHC_PKG_ghcpkg02) update --global --force -; \ + '$(GHC_PKG)' describe --global $$i | $(GHC_PKG_ghcpkg02) update --global --force -; \ done PKGCONF07=local07.package.conf From git at git.haskell.org Fri Oct 30 19:45:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 19:45:42 +0000 (UTC) Subject: [commit: ghc] master: Generate Typeable info at definition sites (91c6b1f) Message-ID: <20151030194542.7DDA83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/91c6b1f54aea658b0056caec45655475897f1972/ghc >--------------------------------------------------------------- commit 91c6b1f54aea658b0056caec45655475897f1972 Author: Ben Gamari Date: Fri Oct 30 20:22:42 2015 +0100 Generate Typeable info at definition sites This is the second attempt at merging D757. This patch implements the idea floated in Trac #9858, namely that we should generate type-representation information at the data type declaration site, rather than when solving a Typeable constraint. However, this turned out quite a bit harder than I expected. I still think it's the right thing to do, and it's done now, but it was quite a struggle. See particularly * Note [Grand plan for Typeable] in TcTypeable (which is a new module) * Note [The overall promotion story] in DataCon (clarifies existing stuff) The most painful bit was that to generate Typeable instances (ie TyConRepName bindings) for every TyCon is tricky for types in ghc-prim etc: * We need to have enough data types around to *define* a TyCon * Many of these types are wired-in Also, to minimise the code generated for each data type, I wanted to generate pure data, not CAFs with unpackCString# stuff floating about. Performance ~~~~~~~~~~~ Three perf/compiler tests start to allocate quite a bit more. This isn't surprising, because they all allocate zillions of data types, with practically no other code, esp. T1969 * T1969: GHC allocates 19% more * T4801: GHC allocates 13% more * T5321FD: GHC allocates 13% more * T9675: GHC allocates 11% more * T783: GHC allocates 11% more * T5642: GHC allocates 10% more I'm treating this as acceptable. The payoff comes in Typeable-heavy code. Remaining to do ~~~~~~~~~~~~~~~ * I think that "TyCon" and "Module" are over-generic names to use for the runtime type representations used in GHC.Typeable. Better might be "TrTyCon" and "TrModule". But I have not yet done this * Add more info the the "TyCon" e.g. source location where it was defined * Use the new "Module" type to help with Trac Trac #10068 * It would be possible to generate TyConRepName (ie Typeable instances) selectively rather than all the time. We'd need to persist the information in interface files. Lacking a motivating reason I have not done this, but it would not be difficult. Refactoring ~~~~~~~~~~~ As is so often the case, I ended up refactoring more than I intended. In particular * In TyCon, a type *family* (whether type or data) is repesented by a FamilyTyCon * a algebraic data type (including data/newtype instances) is represented by AlgTyCon This wasn't true before; a data family was represented as an AlgTyCon. There are some corresponding changes in IfaceSyn. * Also get rid of the (unhelpfully named) tyConParent. * In TyCon define 'Promoted', isomorphic to Maybe, used when things are optionally promoted; and use it elsewhere in GHC. * Cleanup handling of knownKeyNames * Each TyCon, including promoted TyCons, contains its TyConRepName, if it has one. This is, in effect, the name of its Typeable instance. Updates haddock submodule Test Plan: Let Harbormaster validate Reviewers: austin, hvr, goldfire Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1404 GHC Trac Issues: #9858 >--------------------------------------------------------------- 91c6b1f54aea658b0056caec45655475897f1972 compiler/basicTypes/ConLike.hs | 2 +- compiler/basicTypes/DataCon.hs | 222 ++++++++--- compiler/basicTypes/OccName.hs | 19 +- compiler/basicTypes/Unique.hs | 51 ++- compiler/coreSyn/MkCore.hs | 8 +- compiler/deSugar/DsBinds.hs | 281 +++++++------ compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsUtils.hs | 14 +- compiler/ghc.cabal.in | 1 + compiler/hsSyn/HsUtils.hs | 6 +- compiler/iface/BuildTyCl.hs | 42 +- compiler/iface/IfaceSyn.hs | 101 +++-- compiler/iface/MkIface.hs | 10 +- compiler/iface/TcIface.hs | 89 +++-- compiler/main/HscMain.hs | 13 +- compiler/main/HscTypes.hs | 13 +- compiler/prelude/PrelInfo.hs | 111 +++--- compiler/prelude/PrelNames.hs | 88 +++-- compiler/prelude/THNames.hs | 105 +++-- compiler/prelude/TysPrim.hs | 38 +- compiler/prelude/TysWiredIn.hs | 55 ++- compiler/simplCore/FloatIn.hs | 4 +- compiler/typecheck/TcBinds.hs | 36 +- compiler/typecheck/TcEnv.hs | 5 +- compiler/typecheck/TcEvidence.hs | 69 ++-- compiler/typecheck/TcGenGenerics.hs | 41 +- compiler/typecheck/TcHsSyn.hs | 27 +- compiler/typecheck/TcHsType.hs | 8 +- compiler/typecheck/TcInstDcls.hs | 19 +- compiler/typecheck/TcInteract.hs | 440 ++++++++++++--------- compiler/typecheck/TcPatSyn.hs | 9 +- compiler/typecheck/TcRnDriver.hs | 40 +- compiler/typecheck/TcRnMonad.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 7 +- compiler/typecheck/TcTyClsDecls.hs | 112 +++--- compiler/typecheck/TcTyDecls.hs | 119 ++---- compiler/typecheck/TcTypeNats.hs | 12 +- compiler/typecheck/TcTypeable.hs | 206 ++++++++++ compiler/types/TyCon.hs | 412 ++++++++++--------- compiler/types/Type.hs | 9 + compiler/utils/Binary.hs | 11 +- compiler/vectorise/Vectorise/Generic/PData.hs | 4 +- compiler/vectorise/Vectorise/Type/Env.hs | 4 +- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 7 +- ghc/InteractiveUI.hs | 4 +- libraries/base/Data/Typeable.hs | 3 +- libraries/base/Data/Typeable/Internal.hs | 330 ++++++++++------ libraries/base/GHC/Show.hs | 10 + libraries/base/GHC/Stack/Types.hs | 13 + libraries/ghc-prim/GHC/Classes.hs | 36 +- libraries/ghc-prim/GHC/IntWord64.hs | 3 + libraries/ghc-prim/GHC/Magic.hs | 2 + libraries/ghc-prim/GHC/Tuple.hs | 3 + libraries/ghc-prim/GHC/Types.hs | 60 ++- testsuite/tests/codeGen/should_run/cgrun057.stderr | 2 +- .../tests/deSugar/should_compile/T2431.stderr | 29 +- testsuite/tests/deriving/should_fail/T9687.stderr | 4 +- testsuite/tests/ghci.debugger/scripts/T2740.stdout | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 4 +- .../tests/ghci.debugger/scripts/break009.stdout | 4 +- .../tests/ghci.debugger/scripts/break010.stdout | 4 +- .../tests/ghci.debugger/scripts/break011.stdout | 8 +- .../tests/ghci.debugger/scripts/break012.stdout | 16 +- .../tests/ghci.debugger/scripts/break018.stdout | 4 +- .../ghci.debugger/scripts/break022/break022.stdout | 2 +- .../tests/ghci.debugger/scripts/break028.stdout | 6 +- .../tests/ghci.debugger/scripts/print018.stdout | 6 +- .../tests/ghci.debugger/scripts/print019.stderr | 4 +- .../tests/ghci.debugger/scripts/print031.stdout | 2 +- testsuite/tests/ghci/scripts/T4175.stdout | 4 +- testsuite/tests/ghci/scripts/T5417.stdout | 2 - testsuite/tests/ghci/scripts/T8674.stdout | 4 +- .../indexed-types/should_compile/T3017.stderr | 0 .../tests/numeric/should_compile/T7116.stdout | 29 +- .../should_fail/overloadedlistsfail01.stderr | 4 +- .../should_compile/DataFamilyInstanceLHS.stderr | 2 - testsuite/tests/perf/compiler/all.T | 54 ++- testsuite/tests/perf/should_run/all.T | 6 +- testsuite/tests/polykinds/T8132.stderr | 4 +- testsuite/tests/quasiquotation/T7918.stdout | 3 + testsuite/tests/roles/should_compile/Roles1.stderr | 61 +++ .../tests/roles/should_compile/Roles13.stderr | 53 ++- .../tests/roles/should_compile/Roles14.stderr | 7 + testsuite/tests/roles/should_compile/Roles2.stderr | 13 + testsuite/tests/roles/should_compile/Roles3.stderr | 25 ++ testsuite/tests/roles/should_compile/Roles4.stderr | 13 + testsuite/tests/roles/should_compile/T8958.stderr | 9 +- .../tests/simplCore/should_compile/T3234.stderr | 4 +- .../tests/simplCore/should_compile/T3717.stderr | 29 +- .../tests/simplCore/should_compile/T3772.stdout | 29 +- .../tests/simplCore/should_compile/T4908.stderr | 29 +- .../tests/simplCore/should_compile/T4930.stderr | 29 +- .../tests/simplCore/should_compile/T7360.stderr | 47 ++- .../tests/simplCore/should_compile/T8274.stdout | 8 + .../tests/simplCore/should_compile/T9400.stderr | 17 +- .../tests/simplCore/should_compile/rule2.stderr | 3 +- .../simplCore/should_compile/spec-inline.stderr | 29 +- .../tests/stranal/should_compile/T10694.stdout | 3 + .../stranal/sigs/BottomFromInnerLambda.stderr | 1 + testsuite/tests/stranal/sigs/DmdAnalGADTs.stderr | 2 + testsuite/tests/stranal/sigs/HyperStrUse.stderr | 1 + testsuite/tests/stranal/sigs/StrAnalExample.stderr | 1 + testsuite/tests/stranal/sigs/T8569.stderr | 2 + testsuite/tests/stranal/sigs/T8598.stderr | 1 + testsuite/tests/stranal/sigs/UnsatFun.stderr | 1 + testsuite/tests/th/TH_Roles2.stderr | 8 + .../tests/typecheck/should_compile/holes2.stderr | 6 +- testsuite/tests/typecheck/should_fail/T5095.stderr | 2 +- .../tests/typecheck/should_fail/tcfail072.stderr | 4 +- .../tests/typecheck/should_fail/tcfail133.stderr | 7 +- utils/haddock | 2 +- 111 files changed, 2655 insertions(+), 1350 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 91c6b1f54aea658b0056caec45655475897f1972 From git at git.haskell.org Fri Oct 30 22:14:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 22:14:20 +0000 (UTC) Subject: [commit: ghc] master: Reimplement shadowing on a per database basis. (39b71e8) Message-ID: <20151030221420.1AEC23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39b71e81ec1044518f065d0055676d713521e483/ghc >--------------------------------------------------------------- commit 39b71e81ec1044518f065d0055676d713521e483 Author: Edward Z. Yang Date: Tue Oct 27 14:47:33 2015 -0700 Reimplement shadowing on a per database basis. Summary: This commit reimplements shadowing on package databases by doing the shadowing calculation on a per-database basis: specifically, if a later package database shadows a package from the earlier databases, we first remove that package (and its transitive dependencies) before merging the databases together. This should also fix bootstrapping GHC HEAD with HEAD. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: ggreif, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1385 >--------------------------------------------------------------- 39b71e81ec1044518f065d0055676d713521e483 compiler/main/DynFlags.hs | 2 +- compiler/main/Packages.hs | 196 ++++++++++++++++++++++-------------- testsuite/tests/cabal/Makefile | 14 +-- testsuite/tests/cabal/shadow.stderr | 8 +- testsuite/tests/cabal/shadow.stdout | 2 +- 5 files changed, 134 insertions(+), 88 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 39b71e81ec1044518f065d0055676d713521e483 From git at git.haskell.org Fri Oct 30 23:06:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:06:24 +0000 (UTC) Subject: [commit: ghc] master: rts: Make MBLOCK_SPACE_SIZE dynamic (f5974c8) Message-ID: <20151030230624.89E7C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f5974c88451783d4c1fb69444b10d7053be142bf/ghc >--------------------------------------------------------------- commit f5974c88451783d4c1fb69444b10d7053be142bf Author: Ben Gamari Date: Fri Oct 30 20:48:53 2015 +0100 rts: Make MBLOCK_SPACE_SIZE dynamic Previously this was introduced in D524 as a compile-time constant. Sadly, this isn't flexible enough to allow for environments where ulimits restrict the maximum address space size (see, for instance, Consequently, we are forced to make this dynamic. In principle this shouldn't be so terrible as we can place both the beginning and end addresses within the same cache line, likely incurring only one or so additional instruction in HEAP_ALLOCED. Test Plan: validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1353 GHC Trac Issues: #10877 >--------------------------------------------------------------- f5974c88451783d4c1fb69444b10d7053be142bf rts/posix/OSMem.c | 19 ++++++++++--------- rts/sm/HeapAlloc.h | 28 +++++++++++++--------------- rts/sm/MBlock.c | 26 +++++++++++++++++++------- rts/sm/OSMem.h | 10 +++++----- rts/win32/OSMem.c | 6 +++--- 5 files changed, 50 insertions(+), 39 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 f5974c88451783d4c1fb69444b10d7053be142bf From git at git.haskell.org Fri Oct 30 23:06:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:06:27 +0000 (UTC) Subject: [commit: ghc] master: Add failing test for #11039 (fce758c) Message-ID: <20151030230627.8D5393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fce758c5a5a54e8cfa491c5168893854bf7e974d/ghc >--------------------------------------------------------------- commit fce758c5a5a54e8cfa491c5168893854bf7e974d Author: Matthew Pickering Date: Fri Oct 30 21:09:33 2015 +0100 Add failing test for #11039 Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1406 GHC Trac Issues: #11039 >--------------------------------------------------------------- fce758c5a5a54e8cfa491c5168893854bf7e974d testsuite/tests/patsyn/should_fail/T11039.hs | 7 +++++++ testsuite/tests/patsyn/should_fail/all.T | 1 + 2 files changed, 8 insertions(+) diff --git a/testsuite/tests/patsyn/should_fail/T11039.hs b/testsuite/tests/patsyn/should_fail/T11039.hs new file mode 100644 index 0000000..69e8d2b --- /dev/null +++ b/testsuite/tests/patsyn/should_fail/T11039.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE PatternSynonyms #-} +module Foo () where + +data A a = A a + +pattern Q :: () => (A ~ f) => a -> f a +pattern Q a = A a diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T index b960e37..7e3446f 100644 --- a/testsuite/tests/patsyn/should_fail/all.T +++ b/testsuite/tests/patsyn/should_fail/all.T @@ -16,3 +16,4 @@ test('records-mixing-fields', normal, compile_fail, ['']) test('records-exquant', normal, compile_fail, ['']) test('records-poly-update', normal, compile_fail, ['']) test('mixed-pat-syn-record-sels', normal, compile_fail, ['']) +test('T11039', [expect_broken(11039)], compile_fail, ['']) From git at git.haskell.org Fri Oct 30 23:06:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:06:31 +0000 (UTC) Subject: [commit: ghc] master: Make type-class dictionary let binds deterministic (a5cb27f) Message-ID: <20151030230631.6AB953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a5cb27f323a0c78f61db1a3c5338045b0981850b/ghc >--------------------------------------------------------------- commit a5cb27f323a0c78f61db1a3c5338045b0981850b Author: Bartosz Nitka Date: Fri Oct 30 23:40:21 2015 +0100 Make type-class dictionary let binds deterministic When generating dictionary let binds in dsTcEvBinds we may end up generating them in arbitrary order according to Unique order. Consider: ``` let $dEq = GHC.Classes.$fEqInt in let $$dNum = GHC.Num.$fNumInt in ... ``` vs ``` let $dNum = GHC.Num.$fNumInt in let $dEq = GHC.Classes.$fEqInt in ... ``` The way this change fixes it is by using `UniqDFM` - a type of deterministic finite maps of things keyed on `Unique`s. This way when you pull out evidence variables corresponding to type-class dictionaries they are in deterministic order. Currently it's the order of insertion and the way it's implemented is by tagging the values with the time of insertion. Test Plan: I've added a new test case to reproduce the issue. ./validate Reviewers: ezyang, simonmar, austin, simonpj, bgamari Reviewed By: simonmar, simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1396 GHC Trac Issues: #4012 >--------------------------------------------------------------- a5cb27f323a0c78f61db1a3c5338045b0981850b compiler/basicTypes/VarEnv.hs | 28 +++++ compiler/ghc.cabal.in | 1 + compiler/ghc.mk | 1 + compiler/typecheck/TcEvidence.hs | 32 ++++-- compiler/utils/UniqDFM.hs | 118 +++++++++++++++++++++ testsuite/tests/determinism/determ003/A.hs | 22 ++++ testsuite/tests/determinism/determ003/Makefile | 13 +++ testsuite/tests/determinism/determ003/all.T | 4 + .../determ003.stdout} | 0 9 files changed, 212 insertions(+), 7 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 a5cb27f323a0c78f61db1a3c5338045b0981850b From git at git.haskell.org Fri Oct 30 23:09:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:09:38 +0000 (UTC) Subject: [commit: ghc] master: testsuite: 'threaded2' tests require '-N' RTS option support (d9d201c) Message-ID: <20151030230938.AE8F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d9d201c1be186efdaef0d4495c048e3f8440070b/ghc >--------------------------------------------------------------- commit d9d201c1be186efdaef0d4495c048e3f8440070b Author: Sergei Trofimovich Date: Fri Oct 30 21:09:39 2015 +0000 testsuite: 'threaded2' tests require '-N' RTS option support Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- d9d201c1be186efdaef0d4495c048e3f8440070b testsuite/tests/codeGen/should_run/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index defd9b2..e9296e9 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -134,7 +134,7 @@ test('CmmSwitchTest', when(fast(), skip), compile_and_run, ['']) # Skipping WAY=ghci, because it is not broken. test('T10245', [omit_ways(['ghci']), expect_broken(10246)], compile_and_run, ['']) test('T10246', expect_broken(10246), compile_and_run, ['']) -test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], +test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2']), req_smp], compile_and_run, ['-feager-blackholing']) test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) From git at git.haskell.org Fri Oct 30 23:09:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:09:41 +0000 (UTC) Subject: [commit: ghc] master: testsuite: performGC requires SMP support for 'qg' option (e03e22c) Message-ID: <20151030230941.500913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e03e22c2c69d66c7f098de1951e7da2771a9109d/ghc >--------------------------------------------------------------- commit e03e22c2c69d66c7f098de1951e7da2771a9109d Author: Sergei Trofimovich Date: Fri Oct 30 21:04:49 2015 +0000 testsuite: performGC requires SMP support for 'qg' option Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- e03e22c2c69d66c7f098de1951e7da2771a9109d testsuite/tests/concurrent/should_run/all.T | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index 1ef566d..760ac18 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -104,7 +104,7 @@ test('allocLimit4', [ extra_run_opts('+RTS -xq300k -RTS'), omit_ways(['ghci']) ], compile_and_run, ['']) -test('performGC', [ only_ways(['threaded1','threaded2']) +test('performGC', [ only_ways(['threaded1','threaded2']), req_smp , extra_run_opts('400 +RTS -qg -RTS') ], compile_and_run, ['']) @@ -244,18 +244,13 @@ test('conc067', ignore_output, compile_and_run, ['']) # than one CPU. test('conc068', [ omit_ways('threaded2'), exit_code(1) ], compile_and_run, ['']) -if (ghc_with_smp == 0): - skip_if_not_smp = skip -else: - skip_if_not_smp = normal - # Commented out, instead of marked expect_broken, because it fails only # sometimes. See #10860. #test('setnumcapabilities001', # [ only_ways(['threaded1','threaded2']), # extra_run_opts('4 12 2000'), # reqlib('parallel'), -# skip_if_not_smp ], +# req_smp ], # compile_and_run, ['']) # omit ghci, which can't handle unboxed tuples: From git at git.haskell.org Fri Oct 30 23:09:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 30 Oct 2015 23:09:43 +0000 (UTC) Subject: [commit: ghc] master: unreg: handle CmmStack in C codegen (unbreaks '-g') (e0071c3) Message-ID: <20151030230943.E50623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e0071c3a3063380b0136ffc5bff503a42485c94f/ghc >--------------------------------------------------------------- commit e0071c3a3063380b0136ffc5bff503a42485c94f Author: Sergei Trofimovich Date: Fri Oct 30 21:36:04 2015 +0000 unreg: handle CmmStack in C codegen (unbreaks '-g') The patch makes $ make test TEST="debug T10667" not to fail on CmmStack code generation phase Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- e0071c3a3063380b0136ffc5bff503a42485c94f compiler/cmm/PprC.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs index 76659ca..365aa59 100644 --- a/compiler/cmm/PprC.hs +++ b/compiler/cmm/PprC.hs @@ -180,6 +180,7 @@ pprStmt stmt = -- large. CmmTick _ -> empty + CmmUnwind{} -> empty CmmAssign dest src -> pprAssign dflags dest src From git at git.haskell.org Sat Oct 31 09:58:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 09:58:56 +0000 (UTC) Subject: [commit: ghc] master: Update primitive/vector submodules (8995865) Message-ID: <20151031095856.3C9283A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/89958657ee5af52313b7eb4d32d4d9a377e05634/ghc >--------------------------------------------------------------- commit 89958657ee5af52313b7eb4d32d4d9a377e05634 Author: Herbert Valerio Riedel Date: Sat Oct 31 10:58:28 2015 +0100 Update primitive/vector submodules This is needed to prepare for #11026 as these updates relax the upper bounds on `base` to allow for `base-4.9.0.0` >--------------------------------------------------------------- 89958657ee5af52313b7eb4d32d4d9a377e05634 libraries/primitive | 2 +- libraries/vector | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/primitive b/libraries/primitive index 29cb0db..0359ea1 160000 --- a/libraries/primitive +++ b/libraries/primitive @@ -1 +1 @@ -Subproject commit 29cb0db59803c9d9181f7c4ce35ef1c6cbc6ccfb +Subproject commit 0359ea15842d4e6bef27c0d621964507e4bfd219 diff --git a/libraries/vector b/libraries/vector index c0308f1..552ff11 160000 --- a/libraries/vector +++ b/libraries/vector @@ -1 +1 @@ -Subproject commit c0308f1c4f57859d9a8b10d504afe56eebbb27c5 +Subproject commit 552ff11c2bd905faff53b2e34900cbbbf59955c8 From git at git.haskell.org Sat Oct 31 12:52:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 12:52:41 +0000 (UTC) Subject: [commit: ghc] master: Update parallel submodule (62f0fbc) Message-ID: <20151031125241.127BA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/62f0fbc943307d8522e6c8333caf37c6569ee873/ghc >--------------------------------------------------------------- commit 62f0fbc943307d8522e6c8333caf37c6569ee873 Author: Herbert Valerio Riedel Date: Sat Oct 31 13:51:10 2015 +0100 Update parallel submodule This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0` >--------------------------------------------------------------- 62f0fbc943307d8522e6c8333caf37c6569ee873 libraries/parallel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/parallel b/libraries/parallel index f606922..ec04d05 160000 --- a/libraries/parallel +++ b/libraries/parallel @@ -1 +1 @@ -Subproject commit f6069229df73045770fe4521991b9d22fd58e680 +Subproject commit ec04d059b13fc348789d87adfbabb9351f8574db From git at git.haskell.org Sat Oct 31 15:40:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 15:40:47 +0000 (UTC) Subject: [commit: ghc] master: Add subWordC# on x86ish (8160f42) Message-ID: <20151031154047.87E533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8160f42b8dad33e47b4c73ed3f9bf889462e7bfe/ghc >--------------------------------------------------------------- commit 8160f42b8dad33e47b4c73ed3f9bf889462e7bfe Author: Nikita Karetnikov Date: Sat Oct 31 12:27:54 2015 +0100 Add subWordC# on x86ish This adds a subWordC# primop which implements subtraction with overflow reporting. Reviewers: tibbe, goldfire, rwbarton, bgamari, austin, hvr Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1334 GHC Trac Issues: #10962 >--------------------------------------------------------------- 8160f42b8dad33e47b4c73ed3f9bf889462e7bfe compiler/cmm/CmmMachOp.hs | 1 + compiler/cmm/PprC.hs | 1 + compiler/codeGen/StgCmmPrim.hs | 17 +++++++++++++++++ compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 13 +++++++++++-- compiler/nativeGen/PPC/CodeGen.hs | 1 + compiler/nativeGen/SPARC/CodeGen.hs | 1 + compiler/nativeGen/X86/CodeGen.hs | 15 ++++++++++----- compiler/prelude/primops.txt.pp | 5 +++++ libraries/base/GHC/Natural.hs | 7 ------- libraries/integer-gmp/src/GHC/Integer/Type.hs | 7 ------- testsuite/tests/numeric/should_run/T10962.hs | 16 ++++++++++++++++ testsuite/tests/numeric/should_run/T10962.stdout-ws-32 | 2 ++ testsuite/tests/numeric/should_run/T10962.stdout-ws-64 | 2 ++ testsuite/tests/numeric/should_run/all.T | 1 + 14 files changed, 68 insertions(+), 21 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 8160f42b8dad33e47b4c73ed3f9bf889462e7bfe From git at git.haskell.org Sat Oct 31 15:44:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 15:44:49 +0000 (UTC) Subject: [commit: ghc] master: Make ghc-cabal's `System.Directory` import more robust (7a48e6c) Message-ID: <20151031154449.15A783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7a48e6caad54609f1bbefc3bd60e8352edcd2cc7/ghc >--------------------------------------------------------------- commit 7a48e6caad54609f1bbefc3bd60e8352edcd2cc7 Author: Herbert Valerio Riedel Date: Sat Oct 31 16:13:50 2015 +0100 Make ghc-cabal's `System.Directory` import more robust Starting with directory-1.2.5 there will be a nameclash with `withCurrentDirectory` and `MIN_VERSION_filepath()` isn't available at bootstrap-time with the current GHC build-system. By using explicit import lists we avoid CPP altogether >--------------------------------------------------------------- 7a48e6caad54609f1bbefc3bd60e8352edcd2cc7 utils/ghc-cabal/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 6e3e10c..6da7733 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -29,7 +29,7 @@ import qualified Data.ByteString.Lazy.Char8 as BS import Data.List import Data.Maybe import System.IO -import System.Directory +import System.Directory (setCurrentDirectory, getCurrentDirectory, doesFileExist) import System.Environment import System.Exit (exitWith, ExitCode(..)) import System.FilePath From git at git.haskell.org Sat Oct 31 17:13:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 17:13:04 +0000 (UTC) Subject: [commit: ghc] master: Fix documentation build on windows (6bef55c) Message-ID: <20151031171304.2D0FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6bef55c6b561080c5ddff73f2c501e40acee86ef/ghc >--------------------------------------------------------------- commit 6bef55c6b561080c5ddff73f2c501e40acee86ef Author: Tamar Christina Date: Sat Oct 31 18:12:42 2015 +0100 Fix documentation build on windows Summary: Fix building new Sphinx documenation on Windows in msys2 using Awson's patch on #11021. Install Sphinx using `pacman -S mingw-w64-$(uname -m)-python2-sphinx` Test Plan: Apply patch and ./validate Reviewers: thomie, bgamari, austin Reviewed By: thomie, bgamari Subscribers: erikd Differential Revision: https://phabricator.haskell.org/D1408 GHC Trac Issues: #11021 >--------------------------------------------------------------- 6bef55c6b561080c5ddff73f2c501e40acee86ef configure.ac | 14 +++++++++++--- utils/mkUserGuidePart/Main.hs | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 82524b8..65e5d77 100644 --- a/configure.ac +++ b/configure.ac @@ -725,11 +725,19 @@ then fi dnl ** check for Sphinx toolchain -AC_PATH_PROG(SPHINXBUILD,sphinx-build) -AC_CACHE_CHECK([for version of sphinx-build], fp_cv_sphinx_version, +if test "$HostOS" = "mingw32" +then +SphinxBin=sphinx-build2 +else +SphinxBin=sphinx-build +fi; + +AC_SUBST([SphinxBin]) +AC_PATH_PROG(SPHINXBUILD,${SphinxBin}) +AC_CACHE_CHECK([for version of ${SphinxBin}], fp_cv_sphinx_version, changequote(, )dnl [if test -n "$SPHINXBUILD"; then - fp_cv_sphinx_version=`"$SPHINXBUILD" --version 2>&1 | sed 's/Sphinx\( (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' | head -n1`; + fp_cv_sphinx_version=`"$SPHINXBUILD" --version 2>&1 | sed 's/Sphinx\( (sphinx-build[2]\?)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' | head -n1`; fi; changequote([, ])dnl ]) diff --git a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs index 9bc8caa..dd72c27 100644 --- a/utils/mkUserGuidePart/Main.hs +++ b/utils/mkUserGuidePart/Main.hs @@ -7,6 +7,11 @@ import Types hiding (flag) import Table import Options +import System.IO + +writeFileUtf8 :: FilePath -> String -> IO () +writeFileUtf8 f txt = withFile f WriteMode (\ hdl -> hSetEncoding hdl utf8 >> hPutStr hdl txt) + -- | A ReStructuredText fragment type ReST = String @@ -27,7 +32,7 @@ usersGuideFile fname = "docs/users_guide/"++fname writeRestFile :: FilePath -> ReST -> IO () writeRestFile fname content = - writeFile fname $ unlines + writeFileUtf8 fname $ unlines [ ".. This file is generated by utils/mkUserGuidePart" , "" , content From git at git.haskell.org Sat Oct 31 18:51:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 18:51:26 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Report a custom type error if a class parameter is (type error). (1ed610a) Message-ID: <20151031185126.9B7643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/1ed610a0f7cf0014f1b87260abdde3e885ca8899/ghc >--------------------------------------------------------------- commit 1ed610a0f7cf0014f1b87260abdde3e885ca8899 Author: Iavor S. Diatchki Date: Sat Oct 31 11:51:23 2015 -0700 Report a custom type error if a class parameter is (type error). If you try to show something that evaluates to type error, we'd like to see the type error, rather than saying "No instance for `Show (type error)`" >--------------------------------------------------------------- 1ed610a0f7cf0014f1b87260abdde3e885ca8899 compiler/typecheck/TcErrors.hs | 3 +++ compiler/typecheck/TcRnTypes.hs | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 80efe56..6aca014 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -465,6 +465,9 @@ mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct =<< render msgT | Just (_,_,t2) <- getEqPredTys_maybe ctT , Just msg <- getMsg t2 = msg + | Just (_,ts) <- getClassPredTys_maybe ctT + , msg : _ <- mapMaybe getMsg ts = msg + -- TypeError msg | Just msg <- getMsg ctT = msg diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 8c0153f..8212d0c 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1445,12 +1445,13 @@ isTypeHoleCt _ = False -- | The following constraints are considered to be a custom type error: -- 1. TypeError msg --- 2. TypeError msg ~ Something --- 3. Something ~ TypeError msg +-- 2. TypeError msg ~ Something (and the other way around) +-- 3. C (TypeError msg) (for any parameter of class constraint) isUserTypeErrorCt :: Ct -> Bool isUserTypeErrorCt ct - | Just (_,t1,t2) <- getEqPredTys_maybe ctT = isTyErr t1 || isTyErr t2 - | otherwise = isTyErr ctT + | Just (_,t1,t2) <- getEqPredTys_maybe ctT = isTyErr t1 || isTyErr t2 + | Just (_,ts) <- getClassPredTys_maybe ctT = any isTyErr ts + | otherwise = isTyErr ctT where ctT = ctPred ct isTyErr t = case splitTyConApp_maybe t of From git at git.haskell.org Sat Oct 31 19:16:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 19:16:51 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Refactor to avoid code duplication; rendering is now a pure function. (3a68b8b) Message-ID: <20151031191651.6BFB23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/3a68b8bb8b8f193430cdd131382366600a4b78c3/ghc >--------------------------------------------------------------- commit 3a68b8bb8b8f193430cdd131382366600a4b78c3 Author: Iavor S. Diatchki Date: Sat Oct 31 12:16:47 2015 -0700 Refactor to avoid code duplication; rendering is now a pure function. >--------------------------------------------------------------- 3a68b8bb8b8f193430cdd131382366600a4b78c3 compiler/typecheck/TcErrors.hs | 84 ++++++++++++++++------------------------- compiler/typecheck/TcRnTypes.hs | 23 ++++++----- 2 files changed, 47 insertions(+), 60 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 6aca014..c60406b 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -33,7 +33,6 @@ import PrelNames( typeableClassName , typeErrorShowTypeDataConName , typeErrorAppendDataConName , typeErrorVAppendDataConName - , errorMessageTypeErrorFamName ) import Id import Var @@ -51,7 +50,7 @@ import DynFlags import StaticFlags ( opt_PprStyle_Debug ) import ListSetOps ( equivClasses ) -import Control.Monad ( when, liftM2, guard ) +import Control.Monad ( when ) import Data.Maybe import Data.List ( partition, mapAccumL, nub, sortBy ) @@ -450,55 +449,38 @@ mkUserTypeErrorReporter ctxt = mapM_ $ \ct -> maybeReportError ctxt =<< mkUserTypeError ctxt ct mkUserTypeError :: ReportErrCtxt -> Ct -> TcM ErrMsg -mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct =<< render msgT - where - ctT = ctPred ct - getMsg t = do (tc,[_,msg]) <- splitTyConApp_maybe t - guard (tyConName tc == errorMessageTypeErrorFamName) - return msg - - msgT -- TypeError msg ~ Something - | Just (_,t1,_) <- getEqPredTys_maybe ctT - , Just msg <- getMsg t1 = msg - - -- Something ~ TypeError msg - | Just (_,_,t2) <- getEqPredTys_maybe ctT - , Just msg <- getMsg t2 = msg - - | Just (_,ts) <- getClassPredTys_maybe ctT - , msg : _ <- mapMaybe getMsg ts = msg - - -- TypeError msg - | Just msg <- getMsg ctT = msg - - | otherwise = pprPanic "mkUserTypeError" (ppr ctT) - - - - render ty = case splitTyConApp_maybe ty of - - -- Text "Something" - Just (tc,[txt]) - | tyConName tc == typeErrorTextDataConName - , Just str <- isStrLitTy txt -> return (ftext str) - - -- ShowType t - Just (tc,[_k,t]) - | tyConName tc == typeErrorShowTypeDataConName -> - return (ppr t) - - -- t1 :<>: t2 - Just (tc,[t1,t2]) - | tyConName tc == typeErrorAppendDataConName -> - liftM2 (<>) (render t1) (render t2) - - -- t1 :$$: t2 - Just (tc,[t1,t2]) - | tyConName tc == typeErrorVAppendDataConName -> - liftM2 ($$) (render t1) (render t2) - - -- An uneavaluated type function - _ -> return (ppr ty) +mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct + $ renderUserTypeError + $ case getUserTypeErrorMsg ct of + Just msg -> msg + Nothing -> pprPanic "mkUserTypeError" (ppr ct) + +-- | Render a type corresponding to a user type error into a SDoc. +renderUserTypeError :: Type -> SDoc +renderUserTypeError ty = + case splitTyConApp_maybe ty of + + -- Text "Something" + Just (tc,[txt]) + | tyConName tc == typeErrorTextDataConName + , Just str <- isStrLitTy txt -> ftext str + + -- ShowType t + Just (tc,[_k,t]) + | tyConName tc == typeErrorShowTypeDataConName -> ppr t + + -- t1 :<>: t2 + Just (tc,[t1,t2]) + | tyConName tc == typeErrorAppendDataConName -> + renderUserTypeError t1 <> renderUserTypeError t2 + + -- t1 :$$: t2 + Just (tc,[t1,t2]) + | tyConName tc == typeErrorVAppendDataConName -> + renderUserTypeError t1 $$ renderUserTypeError t2 + + -- An uneavaluated type function + _ -> ppr ty mkGroupReporter :: (ReportErrCtxt -> [Ct] -> TcM ErrMsg) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 8212d0c..232f9df 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -61,7 +61,7 @@ module TcRnTypes( isCDictCan_Maybe, isCFunEqCan_maybe, isCIrredEvCan, isCNonCanonical, isWantedCt, isDerivedCt, isGivenCt, isHoleCt, isOutOfScopeCt, isExprHoleCt, isTypeHoleCt, - isUserTypeErrorCt, + isUserTypeErrorCt, getUserTypeErrorMsg, ctEvidence, ctLoc, setCtLoc, ctPred, ctFlavour, ctEqRel, ctOrigin, mkNonCanonical, mkNonCanonicalCt, ctEvPred, ctEvLoc, ctEvOrigin, ctEvEqRel, @@ -148,7 +148,7 @@ import GHC.Fingerprint import PrelNames(errorMessageTypeErrorFamName) import Data.Set (Set) -import Control.Monad (ap, liftM) +import Control.Monad (ap, liftM, guard, msum) #ifdef GHCI import Data.Map ( Map ) @@ -1447,17 +1447,22 @@ isTypeHoleCt _ = False -- 1. TypeError msg -- 2. TypeError msg ~ Something (and the other way around) -- 3. C (TypeError msg) (for any parameter of class constraint) -isUserTypeErrorCt :: Ct -> Bool -isUserTypeErrorCt ct - | Just (_,t1,t2) <- getEqPredTys_maybe ctT = isTyErr t1 || isTyErr t2 - | Just (_,ts) <- getClassPredTys_maybe ctT = any isTyErr ts +getUserTypeErrorMsg :: Ct -> Maybe Type +getUserTypeErrorMsg ct + | Just (_,t1,t2) <- getEqPredTys_maybe ctT = oneOf [t1,t2] + | Just (_,ts) <- getClassPredTys_maybe ctT = oneOf ts | otherwise = isTyErr ctT where ctT = ctPred ct - isTyErr t = case splitTyConApp_maybe t of - Just (tc,_) -> tyConName tc == errorMessageTypeErrorFamName - _ -> False + isTyErr t = do (tc,[_,msg]) <- splitTyConApp_maybe t + guard (tyConName tc == errorMessageTypeErrorFamName) + return msg + oneOf xs = msum (map isTyErr xs) +isUserTypeErrorCt :: Ct -> Bool +isUserTypeErrorCt ct = case getUserTypeErrorMsg ct of + Just _ -> True + _ -> False instance Outputable Ct where ppr ct = ppr (cc_ev ct) <+> parens (text ct_sort) From git at git.haskell.org Sat Oct 31 19:25:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 19:25:07 +0000 (UTC) Subject: [commit: ghc] master: Signals: Ensure libdw session is freed (e2a78ee) Message-ID: <20151031192507.ACA9C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e2a78eec37ccabea9c1269fd408a0e692d9c927f/ghc >--------------------------------------------------------------- commit e2a78eec37ccabea9c1269fd408a0e692d9c927f Author: Ben Gamari Date: Sat Oct 31 16:39:57 2015 +0100 Signals: Ensure libdw session is freed >--------------------------------------------------------------- e2a78eec37ccabea9c1269fd408a0e692d9c927f rts/posix/Signals.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 89195e2..247feba 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -540,6 +540,7 @@ backtrace_handler(int sig STG_UNUSED) Backtrace *bt = libdw_get_backtrace(session); libdw_print_backtrace(session, stderr, bt); backtrace_free(bt); + libdw_free(session); #else fprintf(stderr, "This build does not support backtraces.\n"); #endif From git at git.haskell.org Sat Oct 31 20:18:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 20:18:48 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Move custom printing of `TypeError` with custom printing of tycons. (6a4c0e4) Message-ID: <20151031201848.94D073A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/6a4c0e4b5b30b60e9804df9024fc0041f5bffffb/ghc >--------------------------------------------------------------- commit 6a4c0e4b5b30b60e9804df9024fc0041f5bffffb Author: Iavor S. Diatchki Date: Sat Oct 31 12:47:26 2015 -0700 Move custom printing of `TypeError` with custom printing of tycons. >--------------------------------------------------------------- 6a4c0e4b5b30b60e9804df9024fc0041f5bffffb compiler/types/TypeRep.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/types/TypeRep.hs b/compiler/types/TypeRep.hs index 8b05555..c5bfec3 100644 --- a/compiler/types/TypeRep.hs +++ b/compiler/types/TypeRep.hs @@ -573,9 +573,7 @@ instance Outputable TyLit where ppr_type :: TyPrec -> Type -> SDoc ppr_type _ (TyVarTy tv) = ppr_tvar tv -ppr_type p (TyConApp tc tys) - | tyConName tc == errorMessageTypeErrorFamName = text "(type error)" - | otherwise = pprTyTcApp p tc tys +ppr_type p (TyConApp tc tys) = pprTyTcApp p tc tys ppr_type p (LitTy l) = ppr_tylit p l ppr_type p ty@(ForAllTy {}) = ppr_forall_type p ty @@ -715,6 +713,8 @@ pprTyTcApp p tc tys if gopt Opt_PrintExplicitKinds dflags then pprTcApp p ppr_type tc tys else pprTyList p ty1 ty2 + | tc `hasKey` errorMessageTypeErrorFamKey = text "(type error)" + | otherwise = pprTcApp p ppr_type tc tys @@ -724,6 +724,7 @@ pprTcApp _ pp tc [ty] | tc `hasKey` listTyConKey = pprPromotionQuote tc <> brackets (pp TopPrec ty) | tc `hasKey` parrTyConKey = pprPromotionQuote tc <> paBrackets (pp TopPrec ty) + pprTcApp p pp tc tys | Just sort <- tyConTuple_maybe tc , tyConArity tc == length tys From git at git.haskell.org Sat Oct 31 20:18:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 20:18:51 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Move recognition of `TypeError msg` to Type.hs (cfc359e) Message-ID: <20151031201851.36F533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/cfc359e1fdf8137a2ff6fec99acb17202c1a5802/ghc >--------------------------------------------------------------- commit cfc359e1fdf8137a2ff6fec99acb17202c1a5802 Author: Iavor S. Diatchki Date: Sat Oct 31 12:48:24 2015 -0700 Move recognition of `TypeError msg` to Type.hs >--------------------------------------------------------------- cfc359e1fdf8137a2ff6fec99acb17202c1a5802 compiler/typecheck/TcErrors.hs | 4 ++-- compiler/typecheck/TcRnTypes.hs | 10 +++------- compiler/types/Type.hs | 14 +++++++++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index c60406b..d83a0dd 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -452,8 +452,8 @@ mkUserTypeError :: ReportErrCtxt -> Ct -> TcM ErrMsg mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct $ renderUserTypeError $ case getUserTypeErrorMsg ct of - Just msg -> msg - Nothing -> pprPanic "mkUserTypeError" (ppr ct) + Just (_,msg) -> msg + Nothing -> pprPanic "mkUserTypeError" (ppr ct) -- | Render a type corresponding to a user type error into a SDoc. renderUserTypeError :: Type -> SDoc diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 232f9df..9e51a9b 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -145,7 +145,6 @@ import Outputable import ListSetOps import FastString import GHC.Fingerprint -import PrelNames(errorMessageTypeErrorFamName) import Data.Set (Set) import Control.Monad (ap, liftM, guard, msum) @@ -1447,17 +1446,14 @@ isTypeHoleCt _ = False -- 1. TypeError msg -- 2. TypeError msg ~ Something (and the other way around) -- 3. C (TypeError msg) (for any parameter of class constraint) -getUserTypeErrorMsg :: Ct -> Maybe Type +getUserTypeErrorMsg :: Ct -> Maybe (Kind, Type) getUserTypeErrorMsg ct | Just (_,t1,t2) <- getEqPredTys_maybe ctT = oneOf [t1,t2] | Just (_,ts) <- getClassPredTys_maybe ctT = oneOf ts - | otherwise = isTyErr ctT + | otherwise = isUserErrorTy ctT where ctT = ctPred ct - isTyErr t = do (tc,[_,msg]) <- splitTyConApp_maybe t - guard (tyConName tc == errorMessageTypeErrorFamName) - return msg - oneOf xs = msum (map isTyErr xs) + oneOf xs = msum (map isUserErrorTy xs) isUserTypeErrorCt :: Ct -> Bool isUserTypeErrorCt ct = case getUserTypeErrorMsg ct of diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index a2feeef..b4da6af 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -38,6 +38,8 @@ module Type ( mkNumLitTy, isNumLitTy, mkStrLitTy, isStrLitTy, + isUserErrorTy, + coAxNthLHS, -- (Newtypes) @@ -164,7 +166,8 @@ import TysPrim import {-# SOURCE #-} TysWiredIn ( eqTyCon, coercibleTyCon, typeNatKind, typeSymbolKind ) import PrelNames ( eqTyConKey, coercibleTyConKey, ipTyConKey, openTypeKindTyConKey, - constraintKindTyConKey, liftedTypeKindTyConKey ) + constraintKindTyConKey, liftedTypeKindTyConKey, + errorMessageTypeErrorFamName ) import CoAxiom -- others @@ -447,6 +450,15 @@ isStrLitTy ty | Just ty1 <- tcView ty = isStrLitTy ty1 isStrLitTy (LitTy (StrTyLit s)) = Just s isStrLitTy _ = Nothing + +-- | Is this type a custom user error? +-- If so, give us the kind and the error message. +isUserErrorTy :: Type -> Maybe (Kind,Type) +isUserErrorTy t = do (tc,[k,msg]) <- splitTyConApp_maybe t + guard (tyConName tc == errorMessageTypeErrorFamName) + return (k,msg) + + {- --------------------------------------------------------------------- FunTy From git at git.haskell.org Sat Oct 31 20:18:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 20:18:53 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Remove unused imports (7778508) Message-ID: <20151031201853.DE51C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/7778508c1e66ee724a1865ccdf96c52e773adcd9/ghc >--------------------------------------------------------------- commit 7778508c1e66ee724a1865ccdf96c52e773adcd9 Author: Iavor S. Diatchki Date: Sat Oct 31 13:16:10 2015 -0700 Remove unused imports >--------------------------------------------------------------- 7778508c1e66ee724a1865ccdf96c52e773adcd9 compiler/typecheck/TcRnTypes.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 9e51a9b..c3b9fdb 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -115,7 +115,7 @@ import TcEvidence import Type import CoAxiom ( Role ) import Class ( Class ) -import TyCon ( TyCon, tyConName ) +import TyCon ( TyCon ) import ConLike ( ConLike(..) ) import DataCon ( DataCon, dataConUserType, dataConOrigArgTys ) import PatSyn ( PatSyn, patSynType ) @@ -147,7 +147,7 @@ import FastString import GHC.Fingerprint import Data.Set (Set) -import Control.Monad (ap, liftM, guard, msum) +import Control.Monad (ap, liftM, msum) #ifdef GHCI import Data.Map ( Map ) From git at git.haskell.org Sat Oct 31 20:18:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 20:18:56 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Move custom rendering for `ErrorMessage` to Type.hs (65c7b4d) Message-ID: <20151031201856.878453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/65c7b4ddaa5a248a3a87e19f2211f05eef616031/ghc >--------------------------------------------------------------- commit 65c7b4ddaa5a248a3a87e19f2211f05eef616031 Author: Iavor S. Diatchki Date: Sat Oct 31 13:16:51 2015 -0700 Move custom rendering for `ErrorMessage` to Type.hs >--------------------------------------------------------------- 65c7b4ddaa5a248a3a87e19f2211f05eef616031 compiler/typecheck/TcErrors.hs | 36 ++---------------------------------- compiler/types/Type.hs | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index d83a0dd..5fdd7de 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -28,12 +28,7 @@ import TcEvidence import Name import RdrName ( lookupGRE_Name, GlobalRdrEnv, mkRdrUnqual ) import Class( className ) -import PrelNames( typeableClassName - , typeErrorTextDataConName - , typeErrorShowTypeDataConName - , typeErrorAppendDataConName - , typeErrorVAppendDataConName - ) +import PrelNames( typeableClassName ) import Id import Var import VarSet @@ -450,38 +445,11 @@ mkUserTypeErrorReporter ctxt mkUserTypeError :: ReportErrCtxt -> Ct -> TcM ErrMsg mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct - $ renderUserTypeError + $ pprUserTypeErrorTy $ case getUserTypeErrorMsg ct of Just (_,msg) -> msg Nothing -> pprPanic "mkUserTypeError" (ppr ct) --- | Render a type corresponding to a user type error into a SDoc. -renderUserTypeError :: Type -> SDoc -renderUserTypeError ty = - case splitTyConApp_maybe ty of - - -- Text "Something" - Just (tc,[txt]) - | tyConName tc == typeErrorTextDataConName - , Just str <- isStrLitTy txt -> ftext str - - -- ShowType t - Just (tc,[_k,t]) - | tyConName tc == typeErrorShowTypeDataConName -> ppr t - - -- t1 :<>: t2 - Just (tc,[t1,t2]) - | tyConName tc == typeErrorAppendDataConName -> - renderUserTypeError t1 <> renderUserTypeError t2 - - -- t1 :$$: t2 - Just (tc,[t1,t2]) - | tyConName tc == typeErrorVAppendDataConName -> - renderUserTypeError t1 $$ renderUserTypeError t2 - - -- An uneavaluated type function - _ -> ppr ty - mkGroupReporter :: (ReportErrCtxt -> [Ct] -> TcM ErrMsg) -- Make error message for a group diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index b4da6af..3bb3856 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -38,7 +38,7 @@ module Type ( mkNumLitTy, isNumLitTy, mkStrLitTy, isStrLitTy, - isUserErrorTy, + isUserErrorTy, pprUserTypeErrorTy, coAxNthLHS, @@ -167,7 +167,12 @@ import {-# SOURCE #-} TysWiredIn ( eqTyCon, coercibleTyCon, typeNatKind, typeSym import PrelNames ( eqTyConKey, coercibleTyConKey, ipTyConKey, openTypeKindTyConKey, constraintKindTyConKey, liftedTypeKindTyConKey, - errorMessageTypeErrorFamName ) + errorMessageTypeErrorFamName, + typeErrorTextDataConName, + typeErrorShowTypeDataConName, + typeErrorAppendDataConName, + typeErrorVAppendDataConName + ) import CoAxiom -- others @@ -458,6 +463,35 @@ isUserErrorTy t = do (tc,[k,msg]) <- splitTyConApp_maybe t guard (tyConName tc == errorMessageTypeErrorFamName) return (k,msg) +-- | Render a type corresponding to a user type error into a SDoc. +pprUserTypeErrorTy :: Type -> SDoc +pprUserTypeErrorTy ty = + case splitTyConApp_maybe ty of + + -- Text "Something" + Just (tc,[txt]) + | tyConName tc == typeErrorTextDataConName + , Just str <- isStrLitTy txt -> ftext str + + -- ShowType t + Just (tc,[_k,t]) + | tyConName tc == typeErrorShowTypeDataConName -> ppr t + + -- t1 :<>: t2 + Just (tc,[t1,t2]) + | tyConName tc == typeErrorAppendDataConName -> + pprUserTypeErrorTy t1 <> pprUserTypeErrorTy t2 + + -- t1 :$$: t2 + Just (tc,[t1,t2]) + | tyConName tc == typeErrorVAppendDataConName -> + pprUserTypeErrorTy t1 $$ pprUserTypeErrorTy t2 + + -- An uneavaluated type function + _ -> ppr ty + + + {- --------------------------------------------------------------------- From git at git.haskell.org Sat Oct 31 20:18:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 20:18:59 +0000 (UTC) Subject: [commit: ghc] wip/custom-type-errors: Check that inferred and user-specified types od not mention `TypeError` directly (064875e) Message-ID: <20151031201859.2BFCE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/custom-type-errors Link : http://ghc.haskell.org/trac/ghc/changeset/064875e5ccddb3c3190c4f03f93763bafad2ef3a/ghc >--------------------------------------------------------------- commit 064875e5ccddb3c3190c4f03f93763bafad2ef3a Author: Iavor S. Diatchki Date: Sat Oct 31 13:18:44 2015 -0700 Check that inferred and user-specified types od not mention `TypeError` directly >--------------------------------------------------------------- 064875e5ccddb3c3190c4f03f93763bafad2ef3a compiler/typecheck/TcValidity.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 62449be..3b5d206 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -232,6 +232,16 @@ checkAmbiguity ctxt ty mk_msg ty = pprSigCtxt ctxt (ptext (sLit "the ambiguity check for")) (ppr ty) ambig_msg = ptext (sLit "To defer the ambiguity check to use sites, enable AllowAmbiguousTypes") + +checkUserTypeError :: Type -> TcM () +checkUserTypeError = check + where + check ty + | Just (_,msg) <- isUserErrorTy ty = failWithTc (pprUserTypeErrorTy msg) + | Just (_,ts) <- splitTyConApp_maybe ty = mapM_ check ts + | Just (t1,t2) <- splitAppTy_maybe ty = check t1 >> check t2 + | otherwise = return () + {- ************************************************************************ * * @@ -312,6 +322,8 @@ checkValidType ctxt ty -- the kind of an ill-formed type such as (a~Int) ; check_kind ctxt ty + ; checkUserTypeError ty + -- Check for ambiguous types. See Note [When to call checkAmbiguity] -- NB: this will happen even for monotypes, but that should be cheap; -- and there may be nested foralls for the subtype test to examine From git at git.haskell.org Sat Oct 31 21:28:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 21:28:55 +0000 (UTC) Subject: [commit: ghc] master: Remove Data.List.NonEmpty.{words, unwords, lines, unlines} (8f02baa) Message-ID: <20151031212855.96BD13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8f02baac9ea3d8cf8dfbadd2bc3af799ddbc0367/ghc >--------------------------------------------------------------- commit 8f02baac9ea3d8cf8dfbadd2bc3af799ddbc0367 Author: Herbert Valerio Riedel Date: Sat Oct 31 21:55:26 2015 +0100 Remove Data.List.NonEmpty.{words,unwords,lines,unlines} This change mirrors the change that occured for the recent `semigroups-0.18` release, i.e. https://github.com/ekmett/semigroups/commit/7a000212847b0d309892f34e4754a25ddec7100b This removal addresses concerns raised in #10365 >--------------------------------------------------------------- 8f02baac9ea3d8cf8dfbadd2bc3af799ddbc0367 libraries/base/Data/List/NonEmpty.hs | 37 +++--------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs index d8bad07..9bcdcbf 100644 --- a/libraries/base/Data/List/NonEmpty.hs +++ b/libraries/base/Data/List/NonEmpty.hs @@ -85,11 +85,6 @@ module Data.List.NonEmpty ( , zip -- :: NonEmpty a -> NonEmpty b -> NonEmpty (a,b) , zipWith -- :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c , unzip -- :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b) - -- * Functions on streams of characters - , words -- :: NonEmpty Char -> NonEmpty String - , unwords -- :: NonEmpty String -> NonEmpty Char - , lines -- :: NonEmpty Char -> NonEmpty String - , unlines -- :: NonEmpty String -> NonEmpty Char -- * Converting to and from a list , fromList -- :: [a] -> NonEmpty a , toList -- :: NonEmpty a -> [a] @@ -100,10 +95,10 @@ module Data.List.NonEmpty ( import Prelude hiding (break, cycle, drop, dropWhile, filter, foldl, foldr, head, init, iterate, - last, length, lines, map, repeat, reverse, + last, length, map, repeat, reverse, scanl, scanl1, scanr, scanr1, span, - splitAt, tail, take, takeWhile, unlines, - unwords, unzip, words, zip, zipWith, (!!)) + splitAt, tail, take, takeWhile, + unzip, zip, zipWith, (!!)) import qualified Prelude import Control.Applicative (Alternative, many) @@ -462,32 +457,6 @@ zipWith f ~(x :| xs) ~(y :| ys) = f x y :| List.zipWith f xs ys unzip :: Functor f => f (a,b) -> (f a, f b) unzip xs = (fst <$> xs, snd <$> xs) --- | The 'words' function breaks a stream of characters into a --- stream of words, which were delimited by white space. --- --- /Beware/: if the input contains no words (i.e. is entirely --- whitespace), this will cause an error. -words :: NonEmpty Char -> NonEmpty String -words = lift List.words - --- | The 'unwords' function is an inverse operation to 'words'. It --- joins words with separating spaces. --- --- /Beware/: the input @(\"\" :| [])@ will cause an error. -unwords :: NonEmpty String -> NonEmpty Char -unwords = lift List.unwords - --- | The 'lines' function breaks a stream of characters into a stream --- of strings at newline characters. The resulting strings do not --- contain newlines. -lines :: NonEmpty Char -> NonEmpty String -lines = lift List.lines - --- | The 'unlines' function is an inverse operation to 'lines'. It --- joins lines, after appending a terminating newline to each. -unlines :: NonEmpty String -> NonEmpty Char -unlines = lift List.unlines - -- | The 'nub' function removes duplicate elements from a list. In -- particular, it keeps only the first occurence of each element. -- (The name 'nub' means \'essence\'.) From git at git.haskell.org Sat Oct 31 22:15:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 22:15:57 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: More progress (93c12b3) Message-ID: <20151031221557.9D7FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/93c12b3b11adbd9db116e82726598e794094ca7d/ghc >--------------------------------------------------------------- commit 93c12b3b11adbd9db116e82726598e794094ca7d Author: Simon Peyton Jones Date: Sat Oct 31 19:08:58 2015 +0000 More progress including haddock submodule >--------------------------------------------------------------- 93c12b3b11adbd9db116e82726598e794094ca7d compiler/hsSyn/HsBinds.hs | 16 ++++------ compiler/typecheck/TcBinds.hs | 2 +- .../tests/indexed-types/should_compile/Records.hs | 13 ++++++--- .../parser/should_fail/NoPatternSynonyms.stderr | 2 +- .../should_compile/ExtraConstraints3.stderr | 14 ++++----- .../tests/partial-sigs/should_fail/T10045.stderr | 7 +++-- .../tests/partial-sigs/should_fail/T10615.stderr | 34 ++++++++++++---------- .../tests/partial-sigs/should_fail/T10999.stderr | 6 ++-- testsuite/tests/typecheck/should_fail/T5300.hs | 4 +-- utils/haddock | 2 +- 10 files changed, 52 insertions(+), 48 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 93c12b3b11adbd9db116e82726598e794094ca7d From git at git.haskell.org Sat Oct 31 22:16:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 22:16:00 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: Merge with HEAD (7ca373d) Message-ID: <20151031221600.B94733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/7ca373d496e5de0da1ea93fffc8a90fc86c53310/ghc >--------------------------------------------------------------- commit 7ca373d496e5de0da1ea93fffc8a90fc86c53310 Merge: 93c12b3 6bef55c Author: Simon Peyton Jones Date: Sat Oct 31 19:18:20 2015 +0000 Merge with HEAD >--------------------------------------------------------------- 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 7ca373d496e5de0da1ea93fffc8a90fc86c53310 From git at git.haskell.org Sat Oct 31 22:16:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 22:16:03 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor: More progress (b1d372a) Message-ID: <20151031221603.6B3FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/spj-wildcard-refactor Link : http://ghc.haskell.org/trac/ghc/changeset/b1d372a627c6c9527c9da12ce049c4ec98a3f6de/ghc >--------------------------------------------------------------- commit b1d372a627c6c9527c9da12ce049c4ec98a3f6de Author: Simon Peyton Jones Date: Sat Oct 31 22:15:40 2015 +0000 More progress Update haddock submodule >--------------------------------------------------------------- b1d372a627c6c9527c9da12ce049c4ec98a3f6de compiler/typecheck/TcExpr.hs | 12 ++++++------ utils/haddock | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 7ed0cf1..3c8a6ee 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -973,7 +973,7 @@ tcApp (L loc (HsVar fun)) args res_ty -- with type signatures, see Note [Disambiguating record fields] tcApp (L loc (HsRecFld (Ambiguous lbl _))) args@(L _ arg:_) res_ty | Just sig_ty <- obviousSig arg - = do { sig_tc_ty <- tcHsSigType ExprSigCtxt sig_ty + = do { sig_tc_ty <- tcHsSigWcType ExprSigCtxt sig_ty ; sel_name <- disambiguateSelector lbl sig_tc_ty ; tcApp (L loc (HsRecFld (Unambiguous lbl sel_name))) args res_ty } @@ -1645,7 +1645,7 @@ disambiguateRecordBinds record_expr record_tau rbnds res_ty -- If so, try to extract a parent TyCon from it | Just {} <- obviousSig (unLoc record_expr) , Just tc <- tyConOf fam_inst_envs record_tau - -> RecSelData tc + -> return (RecSelData tc) -- Nothing else we can try... _ -> failWithTc badOverloadedUpdate @@ -1711,10 +1711,10 @@ lookupParents rdr -- A type signature on the argument of an ambiguous record selector or -- the record expression in an update must be "obvious", i.e. the -- outermost constructor ignoring parentheses. -obviousSig :: HsExpr Name -> Maybe (LHsType Name) -obviousSig (ExprWithTySig _ ty _) = Just ty -obviousSig (HsPar p) = obviousSig (unLoc p) -obviousSig _ = Nothing +obviousSig :: HsExpr Name -> Maybe (LHsSigWcType Name) +obviousSig (ExprWithTySig _ ty) = Just ty +obviousSig (HsPar p) = obviousSig (unLoc p) +obviousSig _ = Nothing {- diff --git a/utils/haddock b/utils/haddock index b2d4b23..0413c54 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit b2d4b230c2446d241fd8730cd158e4fe6b7305df +Subproject commit 0413c544b60c063ef286777d3008c4e33b4afbcd From git at git.haskell.org Sat Oct 31 22:16:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 22:16:05 +0000 (UTC) Subject: [commit: ghc] wip/spj-wildcard-refactor's head updated: More progress (b1d372a) Message-ID: <20151031221605.B0F5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/spj-wildcard-refactor' now includes: 0a16374 Disambiguate record selectors by type signature 1f1c7c6 Build system: rename runghc.hs to Main.hs b05ab1a Build system: cleanup a few .cabal files 314395e Build system: cabalise deriveConstants + genprimopcode 2624298 Fix segfault due to reading non-existent memory 42e8528 CmmParse: Expose popcnt operations 3e2c227 Linker: Clean up USE_MMAP usage 1c80db5 Insert an empty line between two STG definitions in dump output. 56f9ef4 Unify: Add Outputable instance for UnifyResultM aa289d2 Move win32 tarball download logic to script f78b477 driver: use PROGBITS type for .debug-ghc-link-info section 59e728b Testsuite: suggest quoting $(TEST_HC) 91c6b1f Generate Typeable info at definition sites 39b71e8 Reimplement shadowing on a per database basis. f5974c8 rts: Make MBLOCK_SPACE_SIZE dynamic fce758c Add failing test for #11039 a5cb27f Make type-class dictionary let binds deterministic e03e22c testsuite: performGC requires SMP support for 'qg' option d9d201c testsuite: 'threaded2' tests require '-N' RTS option support e0071c3 unreg: handle CmmStack in C codegen (unbreaks '-g') 8995865 Update primitive/vector submodules 62f0fbc Update parallel submodule 8160f42 Add subWordC# on x86ish 7a48e6c Make ghc-cabal's `System.Directory` import more robust 6bef55c Fix documentation build on windows 93c12b3 More progress 7ca373d Merge with HEAD b1d372a More progress From git at git.haskell.org Sat Oct 31 22:25:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 22:25:16 +0000 (UTC) Subject: [commit: ghc] master: disable large address space on OpenBSD (bc7cc25) Message-ID: <20151031222516.E87143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc7cc25676a8edd7be8cab30d4f26b3dd064f717/ghc >--------------------------------------------------------------- commit bc7cc25676a8edd7be8cab30d4f26b3dd064f717 Author: Karel Gardas Date: Sat Oct 31 23:16:53 2015 +0100 disable large address space on OpenBSD Summary: This patch disables large address space on OpenBSD. The motivation for this is that OpenBSD does not support MAP_NORESERVE. The flag is supported only for source code compatibility reasons but is otherwise completely ignored by the OS and its mmap syscall. Reviewers: austin, bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1411 >--------------------------------------------------------------- bc7cc25676a8edd7be8cab30d4f26b3dd064f717 configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 65e5d77..bc18c12 100644 --- a/configure.ac +++ b/configure.ac @@ -1046,6 +1046,11 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; then if test "x$EnableLargeAddressSpace" = "xyes" ; then if test "$ghc_host_os" = "darwin" ; then use_large_address_space=yes + elif test "$ghc_host_os" = "openbsd" ; then + # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE. + # The flag MAP_NORESERVE is supported for source compatibility reasons, + # but is completely ignored by OS mmap + use_large_address_space=no else AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[], [ From git at git.haskell.org Sat Oct 31 23:11:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 31 Oct 2015 23:11:25 +0000 (UTC) Subject: [commit: ghc] master: llvmGen: Fix build with Clang (da1a8da) Message-ID: <20151031231125.C0DD13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/da1a8da78df3ea8715dc95a874ca6050f06b1908/ghc >--------------------------------------------------------------- commit da1a8da78df3ea8715dc95a874ca6050f06b1908 Author: Erik de Castro Lopo Date: Sun Nov 1 00:11:02 2015 +0100 llvmGen: Fix build with Clang Another weird case of Clang not accepting whitespace in CPP that GCC accepts without a problem. Test Plan: Build with Clang and GCC Reviewers: austin, thomie, hvr, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1409 >--------------------------------------------------------------- da1a8da78df3ea8715dc95a874ca6050f06b1908 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index b754a93..cde3276 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -476,11 +476,11 @@ genCallWithOverflow :: ForeignTarget -> Width -> [CmmFormal] -> [CmmActual] -> LlvmM StmtData genCallWithOverflow t@(PrimTarget op) w [dstV, dstO] [lhs, rhs] = do -- So far this was only tested for the following four CallishMachOps. - MASSERT( (op `elem` [ MO_Add2 w + MASSERT((op `elem` [ MO_Add2 w , MO_AddIntC w , MO_SubIntC w , MO_SubWordC w - ]) ) + ])) let width = widthToLlvmInt w -- This will do most of the work of generating the call to the intrinsic and -- extracting the values from the struct.