From git at git.haskell.org Fri Feb 1 05:54:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:22 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16212-fixed' created Message-ID: <20190201055422.85AFB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16212-fixed Referencing: e476f0dd5477f8b1d109f2382b32ab07e3971491 From git at git.haskell.org Fri Feb 1 05:54:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:24 +0000 (UTC) Subject: [commit: ghc] branch 'wip/sgraf-no-exnstr' created Message-ID: <20190201055424.8617B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/sgraf-no-exnstr Referencing: ad3dd4c2890fd207d87588106e7236d4ec3cb77d From git at git.haskell.org Fri Feb 1 05:54:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:27 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Revert "Batch merge" (172a593) Message-ID: <20190201055427.BB5D33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/172a59335fa6c76b17fb6795e87fbc7fcfd198e6/ghc >--------------------------------------------------------------- commit 172a59335fa6c76b17fb6795e87fbc7fcfd198e6 Author: Ben Gamari Date: Wed Jan 30 10:05:19 2019 -0500 Revert "Batch merge" This reverts commit 76c8fd674435a652c75a96c85abbf26f1f221876. >--------------------------------------------------------------- 172a59335fa6c76b17fb6795e87fbc7fcfd198e6 .gitlab-ci.yml | 54 +----- .gitlab/push-test-metrics.sh | 65 ------- compiler/hieFile/HieAst.hs | 84 ++------- compiler/nativeGen/X86/CodeGen.hs | 83 +++------ compiler/nativeGen/X86/Instr.hs | 6 - compiler/nativeGen/X86/Ppr.hs | 2 - compiler/parser/RdrHsSyn.hs | 41 ++--- docs/users_guide/8.8.1-notes.rst | 4 - docs/users_guide/runtime_control.rst | 28 +-- docs/users_guide/separate_compilation.rst | 5 - docs/users_guide/using.rst | 10 -- hadrian/build.cabal.bat | 2 +- hadrian/build.cabal.sh | 2 +- hadrian/src/Settings/Flavours/Development.hs | 5 +- includes/rts/Flags.h | 12 -- libraries/base/Data/Bits.hs | 8 - libraries/base/GHC/Int.hs | 13 -- libraries/base/GHC/RTS/Flags.hsc | 3 - libraries/base/GHC/Word.hs | 13 -- libraries/base/tests/IO/T12010/test.T | 3 +- libraries/base/tests/IO/all.T | 9 +- rts/Linker.c | 90 +++++----- rts/LinkerInternals.h | 4 - rts/RtsFlags.c | 11 -- rts/linker/Elf.c | 112 ++++++------ rts/linker/Elf.h | 2 +- rts/linker/MachO.c | 40 ++--- rts/linker/MachO.h | 2 +- rts/linker/PEi386.c | 2 +- rts/linker/PEi386.h | 2 +- rts/linker/SymbolExtras.c | 84 ++++----- rts/linker/SymbolExtras.h | 2 +- rts/sm/OSMem.h | 10 +- testsuite/driver/perf_notes.py | 200 +-------------------- testsuite/driver/runtests.py | 36 +--- testsuite/driver/testglobals.py | 12 +- testsuite/driver/testlib.py | 78 ++++---- testsuite/driver/testutil.py | 2 +- .../tests/annotations/should_compile/th/all.T | 4 +- testsuite/tests/cabal/T12485/all.T | 2 +- testsuite/tests/cabal/all.T | 33 ++-- testsuite/tests/cmm/opt/all.T | 2 +- testsuite/tests/codeGen/should_compile/all.T | 10 +- testsuite/tests/codeGen/should_run/T15038/all.T | 3 +- testsuite/tests/deSugar/should_compile/all.T | 7 +- testsuite/tests/dependent/should_compile/all.T | 3 +- testsuite/tests/deriving/should_compile/all.T | 5 +- testsuite/tests/deriving/should_fail/all.T | 5 +- testsuite/tests/determinism/T13807/all.T | 2 +- testsuite/tests/determinism/determ002/all.T | 2 +- testsuite/tests/determinism/determ003/all.T | 2 +- testsuite/tests/determinism/determ005/all.T | 2 +- testsuite/tests/determinism/determ006/all.T | 2 +- testsuite/tests/determinism/determ007/all.T | 2 +- testsuite/tests/determinism/determ008/all.T | 2 +- testsuite/tests/determinism/determ009/all.T | 2 +- testsuite/tests/determinism/determ010/all.T | 2 +- testsuite/tests/determinism/determ011/all.T | 2 +- testsuite/tests/determinism/determ012/all.T | 2 +- testsuite/tests/determinism/determ013/all.T | 2 +- testsuite/tests/determinism/determ014/all.T | 2 +- testsuite/tests/determinism/determ015/all.T | 2 +- testsuite/tests/determinism/determ016/all.T | 2 +- testsuite/tests/determinism/determ017/all.T | 2 +- testsuite/tests/determinism/determ018/all.T | 2 +- testsuite/tests/determinism/determ019/all.T | 2 +- testsuite/tests/determinism/determ021/all.T | 3 +- testsuite/tests/determinism/determ022/all.T | 2 +- testsuite/tests/driver/T13392/all.T | 2 +- testsuite/tests/driver/T13710/all.T | 3 +- testsuite/tests/driver/T1372/all.T | 2 +- testsuite/tests/driver/T13803/all.T | 3 +- testsuite/tests/driver/T13914/all.T | 3 +- testsuite/tests/driver/T14075/all.T | 3 +- testsuite/tests/driver/T15970/all.T | 2 +- testsuite/tests/driver/T1959/test.T | 2 +- testsuite/tests/driver/T3007/all.T | 3 +- testsuite/tests/driver/T437/all.T | 2 +- testsuite/tests/driver/T5147/all.T | 2 +- testsuite/tests/driver/T7373/all.T | 4 +- testsuite/tests/driver/T7835/all.T | 2 +- testsuite/tests/driver/T8184/all.T | 3 +- testsuite/tests/driver/T9562/all.T | 4 +- testsuite/tests/driver/all.T | 189 ++++++++++--------- testsuite/tests/driver/bug1677/all.T | 2 +- testsuite/tests/driver/conflicting_flags/test.T | 3 +- testsuite/tests/driver/dynamicToo/all.T | 4 +- .../tests/driver/dynamicToo/dynamicToo001/test.T | 2 +- .../tests/driver/dynamicToo/dynamicToo002/test.T | 4 +- .../tests/driver/dynamicToo/dynamicToo004/test.T | 3 +- .../tests/driver/dynamicToo/dynamicToo005/test.T | 4 +- testsuite/tests/driver/dynamic_flags_001/all.T | 4 +- testsuite/tests/driver/linkwhole/all.T | 2 +- testsuite/tests/driver/recomp001/all.T | 4 +- testsuite/tests/driver/recomp002/all.T | 4 +- testsuite/tests/driver/recomp003/all.T | 3 +- testsuite/tests/driver/recomp004/all.T | 3 +- testsuite/tests/driver/recomp005/all.T | 7 +- testsuite/tests/driver/recomp006/all.T | 4 +- testsuite/tests/driver/recomp007/all.T | 4 +- testsuite/tests/driver/recomp008/all.T | 7 +- testsuite/tests/driver/recomp009/all.T | 2 +- testsuite/tests/driver/recomp010/all.T | 2 +- testsuite/tests/driver/recomp011/all.T | 2 +- testsuite/tests/driver/recomp012/all.T | 2 +- testsuite/tests/driver/recomp013/all.T | 2 +- testsuite/tests/driver/recomp015/all.T | 3 +- testsuite/tests/driver/recomp016/all.T | 4 +- testsuite/tests/driver/recomp017/all.T | 2 +- testsuite/tests/driver/recomp018/all.T | 2 +- testsuite/tests/driver/retc001/all.T | 3 +- testsuite/tests/driver/retc002/all.T | 4 +- testsuite/tests/driver/retc003/all.T | 2 +- testsuite/tests/dynlibs/all.T | 12 +- testsuite/tests/ffi/should_run/all.T | 8 +- testsuite/tests/gadt/all.T | 6 +- testsuite/tests/generics/all.T | 3 +- testsuite/tests/ghc-api/T10052/all.T | 2 +- testsuite/tests/ghc-api/T4891/all.T | 2 +- testsuite/tests/ghc-api/T7478/all.T | 4 +- testsuite/tests/ghc-api/all.T | 10 +- testsuite/tests/ghc-api/annotations-literals/all.T | 4 +- testsuite/tests/ghc-api/annotations/T11018.stdout | 11 +- testsuite/tests/ghc-api/annotations/T16212.stdout | 35 +--- testsuite/tests/ghc-api/annotations/Test16212.hs | 2 - testsuite/tests/ghc-api/annotations/all.T | 65 +++---- testsuite/tests/ghc-api/apirecomp001/all.T | 3 +- testsuite/tests/ghc-api/show-srcspan/all.T | 2 +- testsuite/tests/ghc-e/should_fail/all.T | 21 ++- testsuite/tests/ghc-e/should_run/all.T | 29 +-- testsuite/tests/ghci/linking/Makefile | 5 - testsuite/tests/ghci/linking/T15729.c | 4 - testsuite/tests/ghci/linking/T15729.hs | 14 -- testsuite/tests/ghci/linking/T15729.stdout | 2 - testsuite/tests/ghci/linking/all.T | 28 +-- testsuite/tests/ghci/linking/dyn/all.T | 20 ++- testsuite/tests/ghci/prog004/prog004.T | 3 +- testsuite/tests/ghci/scripts/all.T | 16 +- testsuite/tests/ghci/should_run/all.T | 3 +- testsuite/tests/hp2ps/all.T | 2 +- testsuite/tests/hpc/all.T | 2 +- testsuite/tests/hsc2hs/all.T | 21 +-- .../indexed-types/should_compile/T13092b/all.T | 3 +- testsuite/tests/indexed-types/should_compile/all.T | 28 ++- .../tests/indexed-types/should_fail/T13092/all.T | 2 +- .../tests/indexed-types/should_fail/T13092c/all.T | 2 +- .../tests/indexed-types/should_fail/T13102/all.T | 2 +- testsuite/tests/indexed-types/should_fail/all.T | 9 +- testsuite/tests/layout/all.T | 19 +- testsuite/tests/lib/integer/all.T | 9 +- .../llvm/should_run/subsections_via_symbols/all.T | 3 +- testsuite/tests/module/all.T | 18 +- testsuite/tests/module/base01/all.T | 4 +- testsuite/tests/module/mod175/all.T | 2 +- testsuite/tests/numeric/should_compile/all.T | 6 +- testsuite/tests/numeric/should_run/all.T | 2 +- testsuite/tests/parser/should_compile/T7476/all.T | 2 +- testsuite/tests/patsyn/should_compile/T13350/all.T | 3 +- testsuite/tests/perf/compiler/all.T | 5 +- testsuite/tests/perf/should_run/all.T | 7 +- testsuite/tests/plugins/all.T | 46 ++--- testsuite/tests/polykinds/all.T | 14 +- testsuite/tests/printer/all.T | 112 ++++++------ testsuite/tests/profiling/should_compile/all.T | 2 +- testsuite/tests/profiling/should_run/all.T | 8 +- testsuite/tests/quasiquotation/all.T | 6 +- testsuite/tests/rename/prog006/all.T | 3 +- testsuite/tests/rename/should_compile/all.T | 19 +- testsuite/tests/rename/should_fail/all.T | 3 +- testsuite/tests/roles/should_fail/all.T | 4 +- testsuite/tests/rts/T10672/all.T | 4 +- testsuite/tests/rts/T11223/all.T | 45 +++-- testsuite/tests/rts/T12031/all.T | 2 +- testsuite/tests/rts/T12771/all.T | 2 +- testsuite/tests/rts/T13082/all.T | 4 +- testsuite/tests/rts/T14611/all.T | 2 +- testsuite/tests/rts/T15261/all.T | 4 +- testsuite/tests/rts/T15894/all.T | 2 +- testsuite/tests/rts/T8308/all.T | 3 +- testsuite/tests/rts/all.T | 61 ++++--- testsuite/tests/runghc/all.T | 12 +- testsuite/tests/safeHaskell/safeLanguage/all.T | 4 +- testsuite/tests/showIface/all.T | 8 +- .../tests/simplCore/should_compile/T16038/test.T | 3 +- testsuite/tests/simplCore/should_compile/all.T | 122 ++++++++----- testsuite/tests/stranal/should_compile/all.T | 5 +- testsuite/tests/stranal/should_run/all.T | 2 +- testsuite/tests/th/T2014/all.T | 4 +- testsuite/tests/th/TH_linker/all.T | 3 +- testsuite/tests/th/all.T | 20 ++- testsuite/tests/typecheck/T13168/all.T | 3 +- testsuite/tests/typecheck/bug1465/all.T | 2 +- testsuite/tests/typecheck/should_compile/all.T | 29 +-- testsuite/tests/typecheck/should_fail/all.T | 2 +- testsuite/tests/unboxedsums/all.T | 3 +- testsuite/tests/utils/should_run/all.T | 2 +- utils/ghc-pkg/Main.hs | 2 +- utils/hsc2hs | 2 +- 198 files changed, 1097 insertions(+), 1521 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 172a59335fa6c76b17fb6795e87fbc7fcfd198e6 From git at git.haskell.org Fri Feb 1 05:54:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:30 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Avoid compiling Hadrian dependencies with profiling on Cabal/Windows (924a460) Message-ID: <20190201055430.C21D33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/924a46075aa5d1835ea37b199f77d605cbc0cf05/ghc >--------------------------------------------------------------- commit 924a46075aa5d1835ea37b199f77d605cbc0cf05 Author: Neil Mitchell Date: Wed Jan 16 11:20:27 2019 -0500 Avoid compiling Hadrian dependencies with profiling on Cabal/Windows >--------------------------------------------------------------- 924a46075aa5d1835ea37b199f77d605cbc0cf05 hadrian/build.cabal.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian/build.cabal.bat b/hadrian/build.cabal.bat index 3344791..aa0acab 100644 --- a/hadrian/build.cabal.bat +++ b/hadrian/build.cabal.bat @@ -1,6 +1,6 @@ @echo off set CABAL=cabal -set CABFLAGS=--disable-documentation --disable-profiling +set CABFLAGS=--disable-documentation --disable-profiling --disable-library-profiling rem It is currently more robust to pass Cabal an absolute path to the project file. set PROJ="%CD%/hadrian/cabal.project" From git at git.haskell.org Fri Feb 1 05:54:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:33 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: make ghc-pkg shut up (f00b35f) Message-ID: <20190201055433.D322A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/f00b35f4ddcc61fb1b1f09854bbbf38934ff0865/ghc >--------------------------------------------------------------- commit f00b35f4ddcc61fb1b1f09854bbbf38934ff0865 Author: Moritz Angermann Date: Wed Jan 23 10:59:38 2019 +0800 make ghc-pkg shut up >--------------------------------------------------------------- f00b35f4ddcc61fb1b1f09854bbbf38934ff0865 utils/ghc-pkg/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 8b7655b..534bbac 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1822,7 +1822,7 @@ liftIO k = V (k >>= \a -> return (a,[],[])) reportValidateErrors :: Verbosity -> [ValidateError] -> [ValidateWarning] -> String -> Maybe Force -> IO Bool reportValidateErrors verbosity es ws prefix mb_force = do - mapM_ (warn . (prefix++)) ws + when (verbosity >= Normal) $ mapM_ (warn . (prefix++)) ws oks <- mapM report es return (and oks) where From git at git.haskell.org Fri Feb 1 05:54:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:37 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Performance tests: recover a baseline from ancestor commits and CI results. (cc2261d) Message-ID: <20190201055437.62C4F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/cc2261d42f6a954d88e355aaad41f001f65c95da/ghc >--------------------------------------------------------------- commit cc2261d42f6a954d88e355aaad41f001f65c95da Author: David Eichmann Date: Tue Jan 22 09:57:23 2019 -0500 Performance tests: recover a baseline from ancestor commits and CI results. gitlab-ci: push performance metrics as git notes to the "GHC Performance Notes" repository. >--------------------------------------------------------------- cc2261d42f6a954d88e355aaad41f001f65c95da .gitlab-ci.yml | 30 +++++- .gitlab/push-test-metrics.sh | 65 +++++++++++++ testsuite/driver/perf_notes.py | 200 ++++++++++++++++++++++++++++++++++++++-- testsuite/driver/runtests.py | 36 ++++++-- testsuite/driver/testglobals.py | 12 ++- testsuite/driver/testlib.py | 69 ++++++-------- testsuite/driver/testutil.py | 2 +- 7 files changed, 352 insertions(+), 62 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 cc2261d42f6a954d88e355aaad41f001f65c95da From git at git.haskell.org Fri Feb 1 05:54:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:40 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: gitlab-ci: Use build cleanup logic on Darwin as well (cfbd39b) Message-ID: <20190201055440.6B9593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d/ghc >--------------------------------------------------------------- commit cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d Author: Ben Gamari Date: Mon Jan 21 10:55:48 2019 -0500 gitlab-ci: Use build cleanup logic on Darwin as well We use the shell executor on Darwin as well as Windows. See https://gitlab.com/gitlab-org/gitlab-runner/issues/3856. >--------------------------------------------------------------- cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d .gitlab-ci.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 389906e..4a8cb62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -408,8 +408,8 @@ validate-x86_64-windows: - ghc.tar.xz - junit.xml -# Note [Cleanup on Windows] -# ~~~~~~~~~~~~~~~~~~~~~~~~~ +# Note [Cleaning up after shell executor] +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # As noted in [1], gitlab-runner's shell executor doesn't clean up its working # directory after builds. Unfortunately, we are forced to use the shell executor @@ -419,7 +419,7 @@ validate-x86_64-windows: # # [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856 -# See Note [Cleanup on Windows] +# See Note [Cleanup after shell executor] cleanup-windows: stage: cleanup tags: @@ -440,3 +440,21 @@ cleanup-windows: - del %BUILD_DIR%\* /F /Q - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p" - exit /b 0 + +# See Note [Cleanup after shell executor] +cleanup-darwin: + stage: cleanup + tags: + - x86_64-darwin + when: always + before_script: + - echo "Time to clean up" + script: + - echo "Let's go" + after_script: + - BUILD_DIR=$CI_PROJECT_DIR + - echo "Cleaning $BUILD_DIR" + - cd $HOME + - rm -Rf $BUILD_DIR/* + - exit 0 + From git at git.haskell.org Fri Feb 1 05:54:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:43 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: testsuite: Use makefile_test (513a449) Message-ID: <20190201055443.8E4033A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/513a449c9dd10887d6dc757d55286749b2594b09/ghc >--------------------------------------------------------------- commit 513a449c9dd10887d6dc757d55286749b2594b09 Author: Ben Gamari Date: Sun Jan 20 23:46:13 2019 -0500 testsuite: Use makefile_test This eliminates most uses of run_command in the testsuite in favor of the more structured makefile_test. >--------------------------------------------------------------- 513a449c9dd10887d6dc757d55286749b2594b09 libraries/base/tests/IO/T12010/test.T | 3 +- libraries/base/tests/IO/all.T | 9 +- testsuite/driver/testlib.py | 2 +- .../tests/annotations/should_compile/th/all.T | 4 +- testsuite/tests/cabal/T12485/all.T | 2 +- testsuite/tests/cabal/all.T | 33 ++-- testsuite/tests/cmm/opt/all.T | 2 +- testsuite/tests/codeGen/should_compile/all.T | 10 +- testsuite/tests/codeGen/should_run/T15038/all.T | 3 +- testsuite/tests/deSugar/should_compile/all.T | 7 +- testsuite/tests/dependent/should_compile/all.T | 3 +- testsuite/tests/deriving/should_compile/all.T | 5 +- testsuite/tests/deriving/should_fail/all.T | 5 +- testsuite/tests/determinism/T13807/all.T | 2 +- testsuite/tests/determinism/determ002/all.T | 2 +- testsuite/tests/determinism/determ003/all.T | 2 +- testsuite/tests/determinism/determ005/all.T | 2 +- testsuite/tests/determinism/determ006/all.T | 2 +- testsuite/tests/determinism/determ007/all.T | 2 +- testsuite/tests/determinism/determ008/all.T | 2 +- testsuite/tests/determinism/determ009/all.T | 2 +- testsuite/tests/determinism/determ010/all.T | 2 +- testsuite/tests/determinism/determ011/all.T | 2 +- testsuite/tests/determinism/determ012/all.T | 2 +- testsuite/tests/determinism/determ013/all.T | 2 +- testsuite/tests/determinism/determ014/all.T | 2 +- testsuite/tests/determinism/determ015/all.T | 2 +- testsuite/tests/determinism/determ016/all.T | 2 +- testsuite/tests/determinism/determ017/all.T | 2 +- testsuite/tests/determinism/determ018/all.T | 2 +- testsuite/tests/determinism/determ019/all.T | 2 +- testsuite/tests/determinism/determ021/all.T | 3 +- testsuite/tests/determinism/determ022/all.T | 2 +- testsuite/tests/driver/T13392/all.T | 2 +- testsuite/tests/driver/T13710/all.T | 3 +- testsuite/tests/driver/T1372/all.T | 2 +- testsuite/tests/driver/T13803/all.T | 3 +- testsuite/tests/driver/T13914/all.T | 3 +- testsuite/tests/driver/T14075/all.T | 3 +- testsuite/tests/driver/T15970/all.T | 2 +- testsuite/tests/driver/T1959/test.T | 2 +- testsuite/tests/driver/T3007/all.T | 3 +- testsuite/tests/driver/T437/all.T | 2 +- testsuite/tests/driver/T5147/all.T | 2 +- testsuite/tests/driver/T7373/all.T | 4 +- testsuite/tests/driver/T7835/all.T | 2 +- testsuite/tests/driver/T8184/all.T | 3 +- testsuite/tests/driver/T9562/all.T | 4 +- testsuite/tests/driver/all.T | 189 ++++++++++----------- testsuite/tests/driver/bug1677/all.T | 2 +- testsuite/tests/driver/conflicting_flags/test.T | 3 +- testsuite/tests/driver/dynamicToo/all.T | 4 +- .../tests/driver/dynamicToo/dynamicToo001/test.T | 2 +- .../tests/driver/dynamicToo/dynamicToo002/test.T | 4 +- .../tests/driver/dynamicToo/dynamicToo004/test.T | 3 +- .../tests/driver/dynamicToo/dynamicToo005/test.T | 4 +- testsuite/tests/driver/dynamic_flags_001/all.T | 4 +- testsuite/tests/driver/linkwhole/all.T | 2 +- testsuite/tests/driver/recomp001/all.T | 4 +- testsuite/tests/driver/recomp002/all.T | 4 +- testsuite/tests/driver/recomp003/all.T | 3 +- testsuite/tests/driver/recomp004/all.T | 3 +- testsuite/tests/driver/recomp005/all.T | 7 +- testsuite/tests/driver/recomp006/all.T | 4 +- testsuite/tests/driver/recomp007/all.T | 4 +- testsuite/tests/driver/recomp008/all.T | 7 +- testsuite/tests/driver/recomp009/all.T | 2 +- testsuite/tests/driver/recomp010/all.T | 2 +- testsuite/tests/driver/recomp011/all.T | 2 +- testsuite/tests/driver/recomp012/all.T | 2 +- testsuite/tests/driver/recomp013/all.T | 2 +- testsuite/tests/driver/recomp015/all.T | 3 +- testsuite/tests/driver/recomp016/all.T | 4 +- testsuite/tests/driver/recomp017/all.T | 2 +- testsuite/tests/driver/recomp018/all.T | 2 +- testsuite/tests/driver/retc001/all.T | 3 +- testsuite/tests/driver/retc002/all.T | 4 +- testsuite/tests/driver/retc003/all.T | 2 +- testsuite/tests/dynlibs/all.T | 12 +- testsuite/tests/ffi/should_run/all.T | 8 +- testsuite/tests/gadt/all.T | 6 +- testsuite/tests/generics/all.T | 3 +- testsuite/tests/ghc-api/T10052/all.T | 2 +- testsuite/tests/ghc-api/T4891/all.T | 2 +- testsuite/tests/ghc-api/T7478/all.T | 4 +- testsuite/tests/ghc-api/all.T | 10 +- testsuite/tests/ghc-api/annotations-literals/all.T | 4 +- testsuite/tests/ghc-api/annotations/all.T | 65 +++---- testsuite/tests/ghc-api/apirecomp001/all.T | 3 +- testsuite/tests/ghc-api/show-srcspan/all.T | 2 +- testsuite/tests/ghc-e/should_fail/all.T | 21 +-- testsuite/tests/ghc-e/should_run/all.T | 29 ++-- testsuite/tests/ghci/linking/all.T | 23 +-- testsuite/tests/ghci/linking/dyn/all.T | 20 +-- testsuite/tests/ghci/prog004/prog004.T | 3 +- testsuite/tests/ghci/scripts/all.T | 16 +- testsuite/tests/ghci/should_run/all.T | 3 +- testsuite/tests/hp2ps/all.T | 2 +- testsuite/tests/hpc/all.T | 2 +- testsuite/tests/hsc2hs/all.T | 21 ++- .../indexed-types/should_compile/T13092b/all.T | 3 +- testsuite/tests/indexed-types/should_compile/all.T | 28 +-- .../tests/indexed-types/should_fail/T13092/all.T | 2 +- .../tests/indexed-types/should_fail/T13092c/all.T | 2 +- .../tests/indexed-types/should_fail/T13102/all.T | 2 +- testsuite/tests/indexed-types/should_fail/all.T | 9 +- testsuite/tests/layout/all.T | 19 +-- testsuite/tests/lib/integer/all.T | 9 +- .../llvm/should_run/subsections_via_symbols/all.T | 3 +- testsuite/tests/module/all.T | 18 +- testsuite/tests/module/base01/all.T | 4 +- testsuite/tests/module/mod175/all.T | 2 +- testsuite/tests/numeric/should_compile/all.T | 6 +- testsuite/tests/numeric/should_run/all.T | 2 +- testsuite/tests/parser/should_compile/T7476/all.T | 2 +- testsuite/tests/patsyn/should_compile/T13350/all.T | 3 +- testsuite/tests/perf/compiler/all.T | 5 +- testsuite/tests/perf/should_run/all.T | 7 +- testsuite/tests/plugins/all.T | 44 ++--- testsuite/tests/polykinds/all.T | 14 +- testsuite/tests/printer/all.T | 112 ++++++------ testsuite/tests/profiling/should_compile/all.T | 2 +- testsuite/tests/profiling/should_run/all.T | 8 +- testsuite/tests/quasiquotation/all.T | 6 +- testsuite/tests/rename/prog006/all.T | 3 +- testsuite/tests/rename/should_compile/all.T | 19 +-- testsuite/tests/rename/should_fail/all.T | 3 +- testsuite/tests/roles/should_fail/all.T | 4 +- testsuite/tests/rts/T10672/all.T | 4 +- testsuite/tests/rts/T11223/all.T | 45 ++--- testsuite/tests/rts/T12031/all.T | 2 +- testsuite/tests/rts/T12771/all.T | 2 +- testsuite/tests/rts/T13082/all.T | 4 +- testsuite/tests/rts/T14611/all.T | 2 +- testsuite/tests/rts/T15261/all.T | 4 +- testsuite/tests/rts/T15894/all.T | 2 +- testsuite/tests/rts/T8308/all.T | 3 +- testsuite/tests/rts/all.T | 61 +++---- testsuite/tests/runghc/all.T | 12 +- testsuite/tests/safeHaskell/safeLanguage/all.T | 4 +- testsuite/tests/showIface/all.T | 8 +- .../tests/simplCore/should_compile/T16038/test.T | 3 +- testsuite/tests/simplCore/should_compile/all.T | 122 +++++-------- testsuite/tests/stranal/should_compile/all.T | 5 +- testsuite/tests/stranal/should_run/all.T | 2 +- testsuite/tests/th/T2014/all.T | 4 +- testsuite/tests/th/TH_linker/all.T | 3 +- testsuite/tests/th/all.T | 20 +-- testsuite/tests/typecheck/T13168/all.T | 3 +- testsuite/tests/typecheck/bug1465/all.T | 2 +- testsuite/tests/typecheck/should_compile/all.T | 29 ++-- testsuite/tests/typecheck/should_fail/all.T | 2 +- testsuite/tests/unboxedsums/all.T | 3 +- testsuite/tests/utils/should_run/all.T | 2 +- 154 files changed, 617 insertions(+), 790 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 513a449c9dd10887d6dc757d55286749b2594b09 From git at git.haskell.org Fri Feb 1 05:54:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:46 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: testsuite: Introduce makefile_test (bdb559a) Message-ID: <20190201055446.C64593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/bdb559a60a18318b6130f399f158739118237f9b/ghc >--------------------------------------------------------------- commit bdb559a60a18318b6130f399f158739118237f9b Author: Ben Gamari Date: Sun Jan 20 22:54:48 2019 -0500 testsuite: Introduce makefile_test >--------------------------------------------------------------- bdb559a60a18318b6130f399f158739118237f9b testsuite/driver/testlib.py | 7 +++++++ testsuite/tests/plugins/all.T | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 4a87f0a..d29024d 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1002,6 +1002,13 @@ def badResult(result): def run_command( name, way, cmd ): return simple_run( name, '', override_options(cmd), '' ) +def makefile_test( name, way, target=None ): + if target is None: + target = name + + cmd = '$MAKE -s --no-print-directory {target}'.format(target=target) + return run_command(name, way, cmd) + # ----------------------------------------------------------------------------- # GHCi tests diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 30b8fd6..7a5be65 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -214,4 +214,4 @@ test('T16104', [extra_files(['T16104-plugin/']), pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}') ], - run_command, ['$MAKE -s --no-print-directory T16104']) + makefile_test, []) From git at git.haskell.org Fri Feb 1 05:54:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:50 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Compile count{Leading, Trailing}Zeros to corresponding x86_64 instructions under -mbmi2 (c1d9416) Message-ID: <20190201055450.01DF13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/c1d9416f2672b8d844141c0393fe773676749777/ghc >--------------------------------------------------------------- commit c1d9416f2672b8d844141c0393fe773676749777 Author: Dmitry Ivanov Date: Sat Dec 8 16:45:02 2018 +0100 Compile count{Leading,Trailing}Zeros to corresponding x86_64 instructions under -mbmi2 This works similarly to existing implementation for popCount. Trac ticket: #16086. >--------------------------------------------------------------- c1d9416f2672b8d844141c0393fe773676749777 compiler/nativeGen/X86/CodeGen.hs | 83 ++++++++++++++++++++++++++------------- compiler/nativeGen/X86/Instr.hs | 6 +++ compiler/nativeGen/X86/Ppr.hs | 2 + docs/users_guide/using.rst | 10 +++++ libraries/base/Data/Bits.hs | 8 ++++ libraries/base/GHC/Int.hs | 13 ++++++ libraries/base/GHC/Word.hs | 13 ++++++ 7 files changed, 107 insertions(+), 28 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c1d9416f2672b8d844141c0393fe773676749777 From git at git.haskell.org Fri Feb 1 05:54:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:53 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Avoid compiling Hadrian dependencies with profiling on Cabal/Linux (c85d708) Message-ID: <20190201055453.0EA903A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/c85d708c36d6a362d45a4e47ae3fefe18120df89/ghc >--------------------------------------------------------------- commit c85d708c36d6a362d45a4e47ae3fefe18120df89 Author: Neil Mitchell Date: Wed Jan 16 11:21:00 2019 -0500 Avoid compiling Hadrian dependencies with profiling on Cabal/Linux >--------------------------------------------------------------- c85d708c36d6a362d45a4e47ae3fefe18120df89 hadrian/build.cabal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian/build.cabal.sh b/hadrian/build.cabal.sh index f28c3e0..13ef927 100755 --- a/hadrian/build.cabal.sh +++ b/hadrian/build.cabal.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash CABAL=cabal -CABFLAGS="--disable-documentation --disable-profiling" +CABFLAGS="--disable-documentation --disable-profiling --disable-library-profiling" # It is currently more robust to pass Cabal an absolute path to the project file. PROJ="$PWD/hadrian/cabal.project" From git at git.haskell.org Fri Feb 1 05:54:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:56 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: API Annotations: Parens not attached correctly for ClassDecl (4bf35da) Message-ID: <20190201055456.2FEAE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/4bf35da4fccd2a21153a1c19bfa80006e99e02a1/ghc >--------------------------------------------------------------- commit 4bf35da4fccd2a21153a1c19bfa80006e99e02a1 Author: Alan Zimmerman Date: Thu Jan 24 10:14:55 2019 +0200 API Annotations: Parens not attached correctly for ClassDecl The parens around the kinded tyvars should be attached to the class declaration as a whole, they are attached to the tyvar instead, outside the span. An annotation must always be within or after the span it is contained in. Closes #16212 >--------------------------------------------------------------- 4bf35da4fccd2a21153a1c19bfa80006e99e02a1 compiler/parser/RdrHsSyn.hs | 41 ++++++++++++----------- testsuite/tests/ghc-api/annotations/T11018.stdout | 11 +++--- testsuite/tests/ghc-api/annotations/T16212.stdout | 35 ++++++++++++++----- testsuite/tests/ghc-api/annotations/Test16212.hs | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 4 +-- utils/hsc2hs | 2 +- 6 files changed, 57 insertions(+), 38 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4bf35da4fccd2a21153a1c19bfa80006e99e02a1 From git at git.haskell.org Fri Feb 1 05:54:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:54:59 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Use `NameEnv Id` instead of `Map Name Id` (6fa3866) Message-ID: <20190201055459.3E6E53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/6fa38663d1abb22e988159ce3f80c824de3b243d/ghc >--------------------------------------------------------------- commit 6fa38663d1abb22e988159ce3f80c824de3b243d Author: Alec Theriault Date: Thu Jan 24 13:59:18 2019 -0800 Use `NameEnv Id` instead of `Map Name Id` This is more consistent with the rest of the GHC codebase. >--------------------------------------------------------------- 6fa38663d1abb22e988159ce3f80c824de3b243d compiler/hieFile/HieAst.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 401b861..35440f0 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -28,6 +28,7 @@ import HscTypes import Module ( ModuleName, ml_hs_file ) import MonadUtils ( concatMapM, liftIO ) import Name ( Name, nameSrcSpan, setNameLoc ) +import NameEnv ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv ) import SrcLoc import TcHsSyn ( hsPatType ) import Type ( Type ) @@ -60,11 +61,11 @@ We don't care about the distinction between mono and poly bindings, so we replace all occurrences of the mono name with the poly name. -} newtype HieState = HieState - { name_remapping :: M.Map Name Id + { name_remapping :: NameEnv Id } initState :: HieState -initState = HieState M.empty +initState = HieState emptyNameEnv class ModifyState a where -- See Note [Name Remapping] addSubstitution :: a -> a -> HieState -> HieState @@ -74,7 +75,7 @@ instance ModifyState Name where instance ModifyState Id where addSubstitution mono poly hs = - hs{name_remapping = M.insert (varName mono) poly (name_remapping hs)} + hs{name_remapping = extendNameEnv (name_remapping hs) (varName mono) poly} modifyState :: ModifyState (IdP p) => [ABExport p] -> HieState -> HieState modifyState = foldr go id @@ -377,7 +378,9 @@ instance ToHie (Context (Located Var)) where C context (L (RealSrcSpan span) name') -> do m <- asks name_remapping - let name = M.findWithDefault name' (varName name') m + let name = case lookupNameEnv m (varName name') of + Just var -> var + Nothing-> name' pure [Node (NodeInfo S.empty [] $ @@ -392,7 +395,7 @@ instance ToHie (Context (Located Name)) where toHie c = case c of C context (L (RealSrcSpan span) name') -> do m <- asks name_remapping - let name = case M.lookup name' m of + let name = case lookupNameEnv m name' of Just var -> varName var Nothing -> name' pure From git at git.haskell.org Fri Feb 1 05:55:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:02 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Include type info for only some exprs in HIE files (5ed48d2) Message-ID: <20190201055502.57E903A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/5ed48d25decc9dec29659482644b136cff91606e/ghc >--------------------------------------------------------------- commit 5ed48d25decc9dec29659482644b136cff91606e Author: Alec Theriault Date: Thu Jan 24 17:33:52 2019 -0800 Include type info for only some exprs in HIE files This commit relinquishes some some type information in `.hie` files in exchange for better performance. See #16233 for more on this. Using `.hie` files to generate hyperlinked sources is a crucial milestone towards Hi Haddock (the initiative to move Haddock to work over `.hi` files and embed docstrings in those). Unfortunately, even after much optimization on the Haddock side, the `.hie` based solution is still considerably slower and more memory hungry than the existing implementation - and the @.hie@ code is to blame. This changes `.hie` file generation to track type information for only a limited subset of expressions (specifically, those that might eventually turn into hyperlinks in the Haddock's hyperlinker backend). >--------------------------------------------------------------- 5ed48d25decc9dec29659482644b136cff91606e compiler/hieFile/HieAst.hs | 71 +++++++++++++++++++++++++++---- docs/users_guide/separate_compilation.rst | 5 +++ 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 35440f0..b6b5f0c 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -30,8 +30,9 @@ import MonadUtils ( concatMapM, liftIO ) import Name ( Name, nameSrcSpan, setNameLoc ) import NameEnv ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv ) import SrcLoc -import TcHsSyn ( hsPatType ) -import Type ( Type ) +import TcHsSyn ( hsLitType, hsPatType ) +import Type ( mkFunTys, Type ) +import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) import HieTypes @@ -435,13 +436,67 @@ instance HasType (LPat GhcTc) where instance HasType (LHsExpr GhcRn) where getTypeNode (L spn e) = makeNode e spn +-- | This instance tries to construct 'HieAST' nodes which include the type of +-- the expression. It is not yet possible to do this efficiently for all +-- expression forms, so we skip filling in the type for those inputs. +-- +-- 'HsApp', for example, doesn't have any type information available directly on +-- the node. Our next recourse would be to desugar it into a 'CoreExpr' then +-- query the type of that. Yet both the desugaring call and the type query both +-- involve recursive calls to the function and argument! This is particularly +-- problematic when you realize that the HIE traversal will eventually visit +-- those nodes too and ask for their types again. +-- +-- Since the above is quite costly, we just skip cases where computing the +-- expression's type is going to be expensive. +-- +-- See #16233 instance HasType (LHsExpr GhcTc) where - getTypeNode e@(L spn e') = lift $ do - hs_env <- Hsc $ \e w -> return (e,w) - (_,mbe) <- liftIO $ deSugarExpr hs_env e - case mbe of - Just te -> makeTypeNode e' spn (exprType te) - Nothing -> makeNode e' spn + getTypeNode e@(L spn e') = lift $ + -- Some expression forms have their type immediately available + let tyOpt = case e' of + HsLit _ l -> Just (hsLitType l) + HsOverLit _ o -> Just (overLitType o) + + HsLam _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy) + HsLamCase _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy) + HsCase _ _ (MG { mg_ext = groupTy }) -> Just (mg_res_ty groupTy) + + ExplicitList ty _ _ -> Just (mkListTy ty) + ExplicitSum ty _ _ _ -> Just (mkSumTy ty) + HsDo ty _ _ -> Just ty + HsMultiIf ty _ -> Just ty + + _ -> Nothing + + in + case tyOpt of + _ | skipDesugaring e' -> fallback + | otherwise -> do + hs_env <- Hsc $ \e w -> return (e,w) + (_,mbe) <- liftIO $ deSugarExpr hs_env e + maybe fallback (makeTypeNode e' spn . exprType) mbe + where + fallback = makeNode e' spn + + matchGroupType :: MatchGroupTc -> Type + matchGroupType (MatchGroupTc args res) = mkFunTys args res + + -- | Skip desugaring of these expressions for performance reasons. + -- + -- See impact on Haddock output (esp. missing type annotations or links) + -- before marking more things here as 'False'. See impact on Haddock + -- performance before marking more things as 'True'. + skipDesugaring :: HsExpr a -> Bool + skipDesugaring e = case e of + HsVar{} -> False + HsUnboundVar{} -> False + HsConLikeOut{} -> False + HsRecFld{} -> False + HsOverLabel{} -> False + HsIPVar{} -> False + HsWrap{} -> False + _ -> True instance ( ToHie (Context (Located (IdP a))) , ToHie (MatchGroup a (LHsExpr a)) diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst index 338c438..8c997f0 100644 --- a/docs/users_guide/separate_compilation.rst +++ b/docs/users_guide/separate_compilation.rst @@ -588,6 +588,11 @@ The GHC API exposes functions for reading and writing these files. that are being written out. These include testing things properties such as variables not occuring outside of their expected scopes. +The format in which GHC currently stores its typechecked AST, makes it costly +to collect the types for some expressions nodes. For the sake of performance, +GHC currently chooses to skip over these, so not all expression nodes should be +expected to have type information on them. See :ghc-ticket:`16233` for more. + .. _recomp: The recompilation checker From git at git.haskell.org Fri Feb 1 05:55:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:05 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Only build vanilla way in devel2 flavour (e7e5f4a) Message-ID: <20190201055505.72AF23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/e7e5f4aebec2f095071a1949bb4595744754ee04/ghc >--------------------------------------------------------------- commit e7e5f4aebec2f095071a1949bb4595744754ee04 Author: Matthew Pickering Date: Fri Jan 25 15:48:54 2019 +0000 Only build vanilla way in devel2 flavour Fixes #16210 >--------------------------------------------------------------- e7e5f4aebec2f095071a1949bb4595744754ee04 hadrian/src/Settings/Flavours/Development.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs index 5919026..9ad4b6b 100644 --- a/hadrian/src/Settings/Flavours/Development.hs +++ b/hadrian/src/Settings/Flavours/Development.hs @@ -8,7 +8,10 @@ import {-# SOURCE #-} Settings.Default developmentFlavour :: Stage -> Flavour developmentFlavour ghcStage = defaultFlavour { name = "devel" ++ show (fromEnum ghcStage) - , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs } + , args = defaultBuilderArgs <> developmentArgs ghcStage <> defaultPackageArgs + , libraryWays = pure [vanilla] + , rtsWays = pure [vanilla, threaded] + , dynamicGhcPrograms = return False } developmentArgs :: Stage -> Args developmentArgs ghcStage = do From git at git.haskell.org Fri Feb 1 05:55:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:09 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Allocate bss section within proper range of other sections (740534d) Message-ID: <20190201055509.D49423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/740534d43cf9f1635c60f6311b7e0d89af962617/ghc >--------------------------------------------------------------- commit 740534d43cf9f1635c60f6311b7e0d89af962617 Author: Zejun Wu Date: Fri Dec 28 20:47:33 2018 -0800 Allocate bss section within proper range of other sections Summary: This re-applies {D5195} and {D5235}, they were reverted as part of diff stack to unbreak i386. The proper fix is done in {D5289}. Allocate bss section within proper range of other sections: * when `+RTS -xp` is passed, allocate it contiguously as we did for jump islands * when we mmap the code to lower 2Gb, we should allocate bss section there too Test Plan: 1. `./validate` 2. with ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` `TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos. 3. Also test in a use case where we used to encouter error like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) = b90282ba ``` and now, everything works fine. Reviewers: simonmar, bgamari, angerman, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15729 Differential Revision: https://phabricator.haskell.org/D5290 >--------------------------------------------------------------- 740534d43cf9f1635c60f6311b7e0d89af962617 rts/Linker.c | 22 +++++---- rts/LinkerInternals.h | 4 ++ rts/linker/Elf.c | 73 ++++++++++++++++++------------ rts/linker/Elf.h | 2 +- rts/linker/MachO.c | 19 ++++---- rts/linker/MachO.h | 2 +- rts/linker/PEi386.c | 2 +- rts/linker/PEi386.h | 2 +- rts/linker/SymbolExtras.c | 31 ++++++------- rts/linker/SymbolExtras.h | 2 +- rts/sm/OSMem.h | 10 +++- testsuite/tests/ghci/linking/Makefile | 5 ++ testsuite/tests/ghci/linking/T15729.c | 4 ++ testsuite/tests/ghci/linking/T15729.hs | 14 ++++++ testsuite/tests/ghci/linking/T15729.stdout | 2 + testsuite/tests/ghci/linking/all.T | 5 ++ 16 files changed, 127 insertions(+), 72 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 740534d43cf9f1635c60f6311b7e0d89af962617 From git at git.haskell.org Fri Feb 1 05:55:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:13 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Add a RTS option -xp to load PIC object anywhere in address space (e29b1ee) Message-ID: <20190201055513.09E173A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/e29b1ee72d77d5a06ac949f9dcc80108243a25c0/ghc >--------------------------------------------------------------- commit e29b1ee72d77d5a06ac949f9dcc80108243a25c0 Author: Zejun Wu Date: Fri Dec 28 20:37:13 2018 -0800 Add a RTS option -xp to load PIC object anywhere in address space Summary: This re-applies {D5195} with fixes for i386: * Fix unused label warnings, see {D5230} or {D5273} * Fix a silly bug introduced by moving `#if` {P190} Add a RTS option -xp to load PIC object anywhere in address space. We do this by relaxing the requirement of <0x80000000 result of `mmapForLinker` and implying USE_CONTIGUOUS_MMAP. We also need to change calls to `ocInit` and `ocGetNames` to avoid dangling pointers when the address of `oc->image` is changed by `ocAllocateSymbolExtra`. Test Plan: See {D5195}, also test under i386: ``` $ uname -a Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28 20:45:30 CEST 2018 i686 GNU/Linux $ cd testsuite/tests/th/ && make test ... ``` will run `./validate` on stacked diff. Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5289 >--------------------------------------------------------------- e29b1ee72d77d5a06ac949f9dcc80108243a25c0 docs/users_guide/8.8.1-notes.rst | 4 ++ docs/users_guide/runtime_control.rst | 28 +++++++++++- includes/rts/Flags.h | 12 ++++++ libraries/base/GHC/RTS/Flags.hsc | 3 ++ rts/Linker.c | 84 ++++++++++++++++++------------------ rts/RtsFlags.c | 11 +++++ rts/linker/Elf.c | 25 ++--------- rts/linker/MachO.c | 21 +++++---- rts/linker/SymbolExtras.c | 61 ++++++++++++++++---------- 9 files changed, 155 insertions(+), 94 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 e29b1ee72d77d5a06ac949f9dcc80108243a25c0 From git at git.haskell.org Fri Feb 1 05:55:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:16 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed, wip/sgraf-no-exnstr: Don't use X86_64_ELF_NONPIC_HACK for +RTS -xp (6e96aa2) Message-ID: <20190201055516.1AEAA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16212-fixed,wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/6e96aa2d503ddeeef1fa1f37b45d5c744522b64d/ghc >--------------------------------------------------------------- commit 6e96aa2d503ddeeef1fa1f37b45d5c744522b64d Author: Zejun Wu Date: Fri Dec 28 20:48:31 2018 -0800 Don't use X86_64_ELF_NONPIC_HACK for +RTS -xp Summary: When `+RTS -xp` is passed, when don't need the X86_64_ELF_NONPIC_HACK, becasue the relocation offset should only be out of range if * the object file was not compiled with `-fPIC -fexternal-dynamic-refs`; * ghc generates non-pic code while it should (e.g. #15723) In either case, we should print an error message rather that silently attempt to use a hacky workaround that may not work. This could have made debugging #15723 and #15729 much easier. Test Plan: Run this in a case where ghci used to crash becasue of T15723. Now we see helpful message like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: stmzm2zi4zi4zi1zmJQn4hNPyYjP5m9AcbI88Ve_ControlziConcurrentziSTMziTMVar_readTMVar_C61n_cc = 9b95ffac ``` Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar, bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5233 >--------------------------------------------------------------- 6e96aa2d503ddeeef1fa1f37b45d5c744522b64d rts/linker/Elf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rts/linker/Elf.c b/rts/linker/Elf.c index 6de531a..b647d20 100644 --- a/rts/linker/Elf.c +++ b/rts/linker/Elf.c @@ -53,11 +53,13 @@ * SILENTLY generate crashing code for data references. This hack is * enabled by X86_64_ELF_NONPIC_HACK. * - * One workaround is to use shared Haskell libraries. This is - * coming. Another workaround is to keep the static libraries but - * compile them with -fPIC, because that will generate PIC references - * to data which can be relocated. The PIC code is still too green to - * do this systematically, though. + * One workaround is to use shared Haskell libraries. This is the case + * when dynamically-linked GHCi is used. + * + * Another workaround is to keep the static libraries but compile them + * with -fPIC -fexternal-dynamic-refs, because that will generate PIC + * references to data which can be relocated. This is the case when + * +RTS -xp is passed. * * See bug #781 * See thread http://www.haskell.org/pipermail/cvs-ghc/2007-September/038458.html @@ -74,7 +76,7 @@ * Sym*_NeedsProto: the symbol is undefined and we add a dummy * default proto extern void sym(void); */ -#define X86_64_ELF_NONPIC_HACK 1 +#define X86_64_ELF_NONPIC_HACK (!RtsFlags.MiscFlags.linkerAlwaysPic) #if defined(sparc_HOST_ARCH) # define ELF_TARGET_SPARC /* Used inside */ From git at git.haskell.org Fri Feb 1 05:55:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:19 +0000 (UTC) Subject: [commit: ghc] wip/sgraf-no-exnstr: Remove ExnStr and ThrowsExn business (e39688e) Message-ID: <20190201055519.34D9E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/e39688e94b38a2ce5258e5e26533338d21dfc82d/ghc >--------------------------------------------------------------- commit e39688e94b38a2ce5258e5e26533338d21dfc82d Author: Sebastian Graf Date: Thu Jan 31 14:46:42 2019 +0100 Remove ExnStr and ThrowsExn business In #14998, Item 1, we noticed that we could get rid of the last usage of `catchArgDmd` and did so in commit 00b8ecb. Since then, `catchArgDmd` has been dangling around in Demand.hs. This commit finally removes it and the resulting dead code involving `ExnStr` and `ThrowsExn`, which was the original concern of Item 1. >--------------------------------------------------------------- e39688e94b38a2ce5258e5e26533338d21dfc82d compiler/basicTypes/Demand.hs | 278 ++++++++++------------------------------ compiler/coreSyn/CoreArity.hs | 4 +- compiler/coreSyn/MkCore.hs | 5 +- compiler/prelude/primops.txt.pp | 15 +-- compiler/simplCore/Simplify.hs | 4 +- compiler/stranal/WwLib.hs | 2 +- 6 files changed, 77 insertions(+), 231 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 e39688e94b38a2ce5258e5e26533338d21dfc82d From git at git.haskell.org Fri Feb 1 05:55:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:22 +0000 (UTC) Subject: [commit: ghc] wip/T16212-fixed: Expect T16212 to pass (e476f0d) Message-ID: <20190201055522.4A5423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16212-fixed Link : http://ghc.haskell.org/trac/ghc/changeset/e476f0dd5477f8b1d109f2382b32ab07e3971491/ghc >--------------------------------------------------------------- commit e476f0dd5477f8b1d109f2382b32ab07e3971491 Author: Sebastian Graf Date: Thu Jan 31 15:58:58 2019 +0100 Expect T16212 to pass >--------------------------------------------------------------- e476f0dd5477f8b1d109f2382b32ab07e3971491 testsuite/tests/ghc-api/annotations/all.T | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 8002630..c14e3b4 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -59,6 +59,5 @@ test('T13163', [extra_files(['Test13163.hs']), ignore_stderr], makefile_test, ['T13163']) test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) -# Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212 -test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212']) +test('T16212', [extra_files(['Test16212.hs']), + ignore_stderr], makefile_test) From git at git.haskell.org Fri Feb 1 05:55:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:25 +0000 (UTC) Subject: [commit: ghc] wip/sgraf-no-exnstr: Fix test output (8cc62c3) Message-ID: <20190201055525.60C103A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/8cc62c3bee1155a767448488964dd18680343fa8/ghc >--------------------------------------------------------------- commit 8cc62c3bee1155a767448488964dd18680343fa8 Author: Sebastian Graf Date: Thu Jan 31 16:19:03 2019 +0100 Fix test output >--------------------------------------------------------------- 8cc62c3bee1155a767448488964dd18680343fa8 testsuite/tests/deSugar/should_compile/T2431.stderr | 2 +- testsuite/tests/simplCore/should_compile/spec-inline.stderr | 2 +- testsuite/tests/stranal/sigs/UnsatFun.stderr | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 3c1c232..54308c6 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -17,7 +17,7 @@ T2431.$WRefl -- RHS size: {terms: 4, types: 8, coercions: 0, joins: 0/0} absurd :: forall a. (Int :~: Bool) -> a -[GblId, Arity=1, Caf=NoCafRefs, Str=x, Unf=OtherCon []] +[GblId, Arity=1, Caf=NoCafRefs, Str=b, Unf=OtherCon []] absurd = \ (@ a) (x :: Int :~: Bool) -> case x of { } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index d978cc5..07b04c2 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -54,7 +54,7 @@ lvl = "spec-inline.hs:(19,5)-(29,25)|function go"# -- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0} Roman.foo3 :: Int -[GblId, Str=x] +[GblId, Str=b] Roman.foo3 = Control.Exception.Base.patError @ 'GHC.Types.LiftedRep @ Int lvl diff --git a/testsuite/tests/stranal/sigs/UnsatFun.stderr b/testsuite/tests/stranal/sigs/UnsatFun.stderr index 1ea2fa4..9fb8ab3 100644 --- a/testsuite/tests/stranal/sigs/UnsatFun.stderr +++ b/testsuite/tests/stranal/sigs/UnsatFun.stderr @@ -1,8 +1,8 @@ ==================== Strictness signatures ==================== UnsatFun.$trModule: m -UnsatFun.f: x -UnsatFun.g: x +UnsatFun.f: b +UnsatFun.g: b UnsatFun.g': UnsatFun.g3: m UnsatFun.h: @@ -13,8 +13,8 @@ UnsatFun.h3: m ==================== Strictness signatures ==================== UnsatFun.$trModule: m -UnsatFun.f: x -UnsatFun.g: x +UnsatFun.f: b +UnsatFun.g: b UnsatFun.g': UnsatFun.g3: m UnsatFun.h: From git at git.haskell.org Fri Feb 1 05:55:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:29 +0000 (UTC) Subject: [commit: ghc] wip/sgraf-no-exnstr: Add regression test for #14171 (e9c6424) Message-ID: <20190201055529.12B293A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/e9c6424275946d6373c65c28309f51ac72b9bbc8/ghc >--------------------------------------------------------------- commit e9c6424275946d6373c65c28309f51ac72b9bbc8 Author: Sebastian Graf Date: Thu Jan 31 18:00:35 2019 +0100 Add regression test for #14171 >--------------------------------------------------------------- e9c6424275946d6373c65c28309f51ac72b9bbc8 testsuite/tests/stranal/should_run/T14171.hs | 16 ++++++++++++++++ testsuite/tests/stranal/should_run/all.T | 1 + 2 files changed, 17 insertions(+) diff --git a/testsuite/tests/stranal/should_run/T14171.hs b/testsuite/tests/stranal/should_run/T14171.hs new file mode 100644 index 0000000..edee083 --- /dev/null +++ b/testsuite/tests/stranal/should_run/T14171.hs @@ -0,0 +1,16 @@ +module Main where + +import Control.Concurrent.STM +import Control.Concurrent.STM.TVar + +chkLoop :: TVar String -> STM () +chkLoop v = do + val <- readTVar v + if (length val == 2) then retry else return () + +main :: IO () +main = do + v <- newTVarIO "hi" + atomically $ do + chkLoop v `orElse` return () + error "you're expected to see this" diff --git a/testsuite/tests/stranal/should_run/all.T b/testsuite/tests/stranal/should_run/all.T index f33adac..278b91b 100644 --- a/testsuite/tests/stranal/should_run/all.T +++ b/testsuite/tests/stranal/should_run/all.T @@ -20,5 +20,6 @@ test('T11555a', normal, compile_and_run, ['']) test('T12368', exit_code(1), compile_and_run, ['']) test('T12368a', exit_code(1), compile_and_run, ['']) test('T13380', [expect_broken(13380), exit_code(1)], compile_and_run, ['']) +test('T14171', [expect_broken(14171), exit_code(1)], compile_and_run, ['']) test('T14290', normal, compile_and_run, ['']) test('T14285', normal, multimod_compile_and_run, ['T14285', '']) From git at git.haskell.org Fri Feb 1 05:55:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Feb 2019 05:55:32 +0000 (UTC) Subject: [commit: ghc] wip/sgraf-no-exnstr: Elaborate Note [Exceptions and strictness] (ad3dd4c) Message-ID: <20190201055532.4372F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/sgraf-no-exnstr Link : http://ghc.haskell.org/trac/ghc/changeset/ad3dd4c2890fd207d87588106e7236d4ec3cb77d/ghc >--------------------------------------------------------------- commit ad3dd4c2890fd207d87588106e7236d4ec3cb77d Author: Sebastian Graf Date: Thu Jan 31 18:39:48 2019 +0100 Elaborate Note [Exceptions and strictness] >--------------------------------------------------------------- ad3dd4c2890fd207d87588106e7236d4ec3cb77d compiler/basicTypes/Demand.hs | 54 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 06cb5c9..2b0b876 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -124,7 +124,53 @@ mkJointDmds ss as = zipWithEqual "mkJointDmds" mkJointDmd ss as Note [Exceptions and strictness] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We used to smart about catching exceptions, but we aren't anymore. -See Trac #14998 for more background. +See Trac #14998 for the way it's resolved at the moment. + +Here's a historic break-down: + +Appearently, exception handling prim-ops didn't used to have any special +strictness signatures, thus defaulting to topSig, which assumes they use their +arguments lazily. Joachim was the first to realise that we could provide richer +information. Thus, in 0558911f91c (Dec 13), he added signatures to +primops.txt.pp indicating that functions like `catch#` and `catchRetry#` call +their argument, which is useful information for usage analysis. Still with a +'Lazy' strictness demand (i.e. 'lazyApply1Dmd'), though, and the world was fine. + +In 7c0fff4 (July 15), Simon argued that giving `catch#` et al. a +'strictApply1Dmd' leads to substantial performance gains. That was at the cost +of correctness, as Trac #10712 proved. So, back to 'lazyApply1Dmd' in +28638dfe79e (Dec 15). + +Motivated to reproduce the gains of 7c0fff4 without the breakage of Trac #10712, +Ben added a new 'catchArgDmd', which basically said to call its argument +strictly, but also swallow any thrown exceptions in 'postProcessDmdResult'. +This was realized by extending the 'Str' constructor of 'ArgStr' with a 'ExnStr' +field, indicating that it catches the exception, and adding a 'ThrowsExn' +constructor to the 'Termination' lattice as an element between 'Dunno' and +'Diverges'. Then along came Trac #11555 and finally #13330, so we had to revert +to 'lazyApply1Dmd' again in 701256df88c (Mar 17). + +This left the other variants like 'catchRetry#' having 'catchArgDmd', which is +where #14998 picked up. Item 1 was concerned with measuring the impact of also +making `catchRetry#` and `catchSTM#` have 'lazyApply1Dmd'. The result was that +there was none; the performance gains stemmed the (change in) definition of +'catchException', the semantics of which would probably make the saner default +for 'catch'. We removed the last usages of 'catchArgDmd' in 00b8ecb7 (Apr 18). + +There was a lot of dead code resulting from that change, that we removed in this +commit (as of this writing): We got rid of 'ThrowsExn' and 'ExnStr' again and +removed any code that was dealing with the peculiarities. + +So history keeps telling us that the only possibly correct strictness annotation +for the first argument of 'catch#' is 'lazyApply1Dmd', because 'catch#' really +is not strict in its argument: Just try this in GHCi + + :set -XScopedTypeVariables + import Control.Exception + catch undefined (\(_ :: SomeException) -> putStrLn "you'll see this") + +Any analysis that assumes otherwise will be broken in some way or another +(beyond `-fno-pendantic-bottoms`). -} -- | Vanilla strictness domain @@ -1242,8 +1288,8 @@ postProcessDmdType du@(JD { sd = ss }) (DmdType fv _ res_ty) Diverges -> Diverges postProcessDmdResult :: Str () -> DmdResult -> DmdResult -postProcessDmdResult Lazy _ = topRes -postProcessDmdResult _ res = res +postProcessDmdResult Lazy _ = topRes +postProcessDmdResult _ res = res postProcessDmdEnv :: DmdShell -> DmdEnv -> DmdEnv postProcessDmdEnv ds@(JD { sd = ss, ud = us }) env @@ -1273,7 +1319,7 @@ postProcessDmd (JD { sd = ss, ud = us }) (JD { sd = s, ud = a}) = JD { sd = s', ud = a' } where s' = case ss of - Lazy -> Lazy + Lazy -> Lazy Str _ -> s a' = case us of Abs -> Abs From git at git.haskell.org Sat Feb 2 08:58:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:32 +0000 (UTC) Subject: [commit: ghc] branch 'wip/trac-16270' created Message-ID: <20190202085832.EAD183A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/trac-16270 Referencing: 03b1eba80e0eb3146414a4d389b8205aa2f21161 From git at git.haskell.org Sat Feb 2 08:58:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:34 +0000 (UTC) Subject: [commit: ghc] branch 'wip/exceptions-note' created Message-ID: <20190202085834.EB1443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/exceptions-note Referencing: d8f701886da00066b4fa10568bda88514dc69937 From git at git.haskell.org Sat Feb 2 08:58:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:36 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hadrian-import-packages' created Message-ID: <20190202085836.EC1483A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hadrian-import-packages Referencing: 638e1aefae88045c30134cf7c69df3f893049263 From git at git.haskell.org Sat Feb 2 08:58:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:38 +0000 (UTC) Subject: [commit: ghc] branch 'wip/splice-parsing' created Message-ID: <20190202085838.EC8723A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/splice-parsing Referencing: 846f2c918466f2b65af4aa56dd862dddb54b3613 From git at git.haskell.org Sat Feb 2 08:58:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:40 +0000 (UTC) Subject: [commit: ghc] branch 'wip/alp/hadrian-validate' created Message-ID: <20190202085840.EDFB63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/alp/hadrian-validate Referencing: 33663fe2db68e31f1a61fbb4c613751a26b1ee1e From git at git.haskell.org Sat Feb 2 08:58:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:44 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Fix syntax in CODEOWNERS file (deab6d6) Message-ID: <20190202085844.0D4CF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/deab6d64eac085b2e0ec68bfb3eeeda608dfb85a/ghc >--------------------------------------------------------------- commit deab6d64eac085b2e0ec68bfb3eeeda608dfb85a Author: Matthew Pickering Date: Wed Jan 30 07:28:08 2019 -0500 Fix syntax in CODEOWNERS file [skip ci] >--------------------------------------------------------------- deab6d64eac085b2e0ec68bfb3eeeda608dfb85a CODEOWNERS | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 26b9608..df18b1f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,44 +5,44 @@ * @bgamari # Build system -/hadrian @snowleopard @alp @DavidEichmann @angerman +/hadrian/ @snowleopard @alp @DavidEichmann @angerman /configure.ac @angerman @hvr /aclocal.m4 @angerman @hvr /config.sub @angerman @hvr # RTS-like things -/rts @bgamari @simonmar @osa1 @Phyx @angerman -/rts/linker @angerman @Phyx -/includes @bgamari @simonmar @osa1 +/rts/ @bgamari @simonmar @osa1 @Phyx @angerman +/rts/linker/ @angerman @Phyx +/includes/ @bgamari @simonmar @osa1 # The compiler -/compiler/typecheck @simonpj @goldfire -/compiler/rename @simonpj @goldfire -/compiler/typecheck/TcDeriv* @RyanGlScott -/compiler/nativeGen @simonmar @bgamari @AndreasK -/compiler/llvmGen @angerman -/compiler/codeGen @simonmar @osa1 -/compiler/cmm @simonmar @osa1 -/compiler/ghci @simonmar -/compiler/simplCore/CallArity.hs @nomeata -/compiler/utils/UnVarGraph.hs @nomeata -/compiler/simplCore/Exitify.hs @nomeata -/compiler/simplStg/StgCse.hs @nomeata +/compiler/typecheck/ @simonpj @goldfire +/compiler/rename/ @simonpj @goldfire +/compiler/types/ @simonpj @goldfire +/compiler/deSugar/ @simonpj @goldfire +/compiler/typecheck/TcDeriv* @RyanGlScott +/compiler/nativeGen/ @simonmar @bgamari @AndreasK +/compiler/llvmGen/ @angerman +/compiler/codeGen/ @simonmar @osa1 +/compiler/cmm/ @simonmar @osa1 +/compiler/ghci/ @simonmar +/compiler/simplCore/CallArity.hs @nomeata +/compiler/utils/UnVarGraph.hs @nomeata +/compiler/simplCore/Exitify.hs @nomeata +/compiler/simplStg/StgCse.hs @nomeata /compiler/simplStg/StgLiftLams.hs @sgraf -/compiler/cmm/CmmSwitch.hs @nomeata -/compiler/stranal/DmdAnal.hs @simonpj @sgraf -/compiler/types @simonpj @goldfire -/compiler/deSugar @simonpj @goldfire -/compiler/hsSyn/Convert.hs @goldfire +/compiler/cmm/CmmSwitch.hs @nomeata +/compiler/stranal/DmdAnal.hs @simonpj @sgraf +/compiler/hsSyn/Convert.hs @goldfire # Core libraries -/libraries/base @hvr -/libraries/template-haskell @goldfire +/libraries/base/ @hvr +/libraries/template-haskell/ @goldfire # Internal utilities and libraries -/libraries/libiserv @angerman @simonmar -/utils/iserv-proxy @angerman @simonmar -/utils/iserv @angerman @simonmar -/utils/gen-dll @Phyx -/utils/fs @Phyx +/libraries/libiserv/ @angerman @simonmar +/utils/iserv-proxy/ @angerman @simonmar +/utils/iserv/ @angerman @simonmar +/utils/gen-dll/ @Phyx +/utils/fs/ @Phyx From git at git.haskell.org Sat Feb 2 08:58:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:47 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Optimize pprASCII (d887f37) Message-ID: <20190202085847.22EA13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/d887f3749c4c9c0f30fb9805cf8953efbcd44b82/ghc >--------------------------------------------------------------- commit d887f3749c4c9c0f30fb9805cf8953efbcd44b82 Author: Sylvain Henry Date: Fri Jan 18 00:01:45 2019 +0100 Optimize pprASCII * Use `ByteString.foldr` instead of `(List.foldr . BS.unpack)` * Avoid calling `chr` and its test that checks for invalid Unicode codepoints: we stay in the ASCII range so we know we're ok * Avoid calling `isPrint` (unsafe FFI call): we can check the ASCII printable range directly * Use bit operations (`unsafeShiftR`, `.&.`) instead of `div` and `mod` >--------------------------------------------------------------- d887f3749c4c9c0f30fb9805cf8953efbcd44b82 compiler/nativeGen/PprBase.hs | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/compiler/nativeGen/PprBase.hs b/compiler/nativeGen/PprBase.hs index 4cdccee..afd16f8 100644 --- a/compiler/nativeGen/PprBase.hs +++ b/compiler/nativeGen/PprBase.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE MagicHash #-} + ----------------------------------------------------------------------------- -- -- Pretty-printing assembly language @@ -33,9 +35,11 @@ import Data.Array.ST import Control.Monad.ST import Data.Word -import Data.Char +import Data.Bits import Data.ByteString (ByteString) import qualified Data.ByteString as BS +import GHC.Exts +import GHC.Word @@ -98,21 +102,28 @@ pprASCII str -- the literal SDoc directly. -- See Trac #14741 -- and Note [Pretty print ASCII when AsmCodeGen] - = text $ foldr (\w s -> (do1 . fromIntegral) w ++ s) "" (BS.unpack str) + = text $ BS.foldr (\w s -> do1 w ++ s) "" str where - do1 :: Int -> String - do1 w | '\t' <- chr w = "\\t" - | '\n' <- chr w = "\\n" - | '"' <- chr w = "\\\"" - | '\\' <- chr w = "\\\\" - | isPrint (chr w) = [chr w] + do1 :: Word8 -> String + do1 w | 0x09 == w = "\\t" + | 0x0A == w = "\\n" + | 0x22 == w = "\\\"" + | 0x5C == w = "\\\\" + -- ASCII printable characters range + | w >= 0x20 && w <= 0x7E = [chr' w] | otherwise = '\\' : octal w - octal :: Int -> String - octal w = [ chr (ord '0' + (w `div` 64) `mod` 8) - , chr (ord '0' + (w `div` 8) `mod` 8) - , chr (ord '0' + w `mod` 8) + -- we know that the Chars we create are in the ASCII range + -- so we bypass the check in "chr" + chr' :: Word8 -> Char + chr' (W8# w#) = C# (chr# (word2Int# w#)) + + octal :: Word8 -> String + octal w = [ chr' (ord0 + (w `unsafeShiftR` 6) .&. 0x07) + , chr' (ord0 + (w `unsafeShiftR` 3) .&. 0x07) + , chr' (ord0 + w .&. 0x07) ] + ord0 = 0x30 -- = ord '0' {- Note [Pretty print ASCII when AsmCodeGen] From git at git.haskell.org Sat Feb 2 08:58:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:50 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update text submodule (038de6a) Message-ID: <20190202085850.2A49C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/038de6abf41b6fa9555af86e5b4837000da524a2/ghc >--------------------------------------------------------------- commit 038de6abf41b6fa9555af86e5b4837000da524a2 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update text submodule >--------------------------------------------------------------- 038de6abf41b6fa9555af86e5b4837000da524a2 libraries/text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/text b/libraries/text index 69d625b..1127b30 160000 --- a/libraries/text +++ b/libraries/text @@ -1 +1 @@ -Subproject commit 69d625b9caa34fd8b384a4599ee98f5f53f20fbb +Subproject commit 1127b30e1e0affa08f056e35ad17957b12982ba3 From git at git.haskell.org Sat Feb 2 08:58:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:53 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update stm submodule (713271d) Message-ID: <20190202085853.33BC63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/713271dbb031ad27b74f1675a2e776355d0bd484/ghc >--------------------------------------------------------------- commit 713271dbb031ad27b74f1675a2e776355d0bd484 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update stm submodule >--------------------------------------------------------------- 713271dbb031ad27b74f1675a2e776355d0bd484 libraries/stm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/stm b/libraries/stm index 5f4d7c6..f9979c9 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 5f4d7c6d07a760d935c9d96e62999f1ad38a5e43 +Subproject commit f9979c926ca539362b5a2412359750e8b498e53a From git at git.haskell.org Sat Feb 2 08:58:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:56 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update parsec submodule (ffd2035) Message-ID: <20190202085856.3AD843A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/ffd2035c34589d311e3dc96c8ff747122dfd592f/ghc >--------------------------------------------------------------- commit ffd2035c34589d311e3dc96c8ff747122dfd592f Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update parsec submodule >--------------------------------------------------------------- ffd2035c34589d311e3dc96c8ff747122dfd592f libraries/parsec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/parsec b/libraries/parsec index 34f9e98..3fafb06 160000 --- a/libraries/parsec +++ b/libraries/parsec @@ -1 +1 @@ -Subproject commit 34f9e98c64cae99abeabbd3d34cec5469f87291a +Subproject commit 3fafb06cf1af74d0c877da6948af3c2bffd0f2bd From git at git.haskell.org Sat Feb 2 08:58:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:58:59 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Add O2 to hsCompiler on stage0 for most hadrian flavours. (1be81c5) Message-ID: <20190202085859.47ACC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/1be81c50b51d0c9c651cbdd14bb7cf6884d011ff/ghc >--------------------------------------------------------------- commit 1be81c50b51d0c9c651cbdd14bb7cf6884d011ff Author: klebinger.andreas at gmx.at Date: Fri Jan 25 01:27:05 2019 +0100 Add O2 to hsCompiler on stage0 for most hadrian flavours. >--------------------------------------------------------------- 1be81c50b51d0c9c651cbdd14bb7cf6884d011ff hadrian/doc/flavours.md | 9 ++++----- hadrian/src/Settings/Flavours/Development.hs | 3 ++- hadrian/src/Settings/Flavours/Performance.hs | 2 +- hadrian/src/Settings/Flavours/Profiled.hs | 2 +- hadrian/src/Settings/Flavours/Quick.hs | 2 +- hadrian/src/Settings/Flavours/QuickCross.hs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index f276dbb..cb864a0 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -50,8 +50,8 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O0
-H64m -O + -O2 -O - -O @@ -72,7 +72,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O
-H64m -O2 - -O + -O2 -O2 -O -O2 @@ -83,8 +83,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O0
-H64m -O - -O - -O + -O2 -O -O @@ -105,7 +104,7 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O
-H64m -dcore-lint - + -O2 -O0
-DDEBUG -O0
-DDEBUG diff --git a/hadrian/src/Settings/Flavours/Development.hs b/hadrian/src/Settings/Flavours/Development.hs index 9ad4b6b..5fcc88b 100644 --- a/hadrian/src/Settings/Flavours/Development.hs +++ b/hadrian/src/Settings/Flavours/Development.hs @@ -19,5 +19,6 @@ developmentArgs ghcStage = do sourceArgs SourceArgs { hsDefault = pure ["-O", "-H64m"] , hsLibrary = notStage0 ? arg "-dcore-lint" - , hsCompiler = succ stage == ghcStage ? pure ["-O0", "-DDEBUG"] + , hsCompiler = mconcat [stage0 ? arg "-O2", + succ stage == ghcStage ? pure ["-O0", "-DDEBUG"]] , hsGhc = succ stage == ghcStage ? pure ["-O0", "-DDEBUG"] } diff --git a/hadrian/src/Settings/Flavours/Performance.hs b/hadrian/src/Settings/Flavours/Performance.hs index 64ab4bc..aee5ddf 100644 --- a/hadrian/src/Settings/Flavours/Performance.hs +++ b/hadrian/src/Settings/Flavours/Performance.hs @@ -14,5 +14,5 @@ performanceArgs :: Args performanceArgs = sourceArgs SourceArgs { hsDefault = pure ["-O", "-H64m"] , hsLibrary = notStage0 ? arg "-O2" - , hsCompiler = mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2"] + , hsCompiler = pure ["-O2"] , hsGhc = mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2"] } diff --git a/hadrian/src/Settings/Flavours/Profiled.hs b/hadrian/src/Settings/Flavours/Profiled.hs index 91b7f3b..4634a5a 100644 --- a/hadrian/src/Settings/Flavours/Profiled.hs +++ b/hadrian/src/Settings/Flavours/Profiled.hs @@ -19,5 +19,5 @@ profiledArgs = sourceArgs SourceArgs , naturalInBaseFixArgs ] , hsLibrary = notStage0 ? arg "-O" - , hsCompiler = arg "-O" + , hsCompiler = mconcat [stage0 ? arg "-O2", notStage0 ? arg "-O"] , hsGhc = arg "-O" } diff --git a/hadrian/src/Settings/Flavours/Quick.hs b/hadrian/src/Settings/Flavours/Quick.hs index 59b58eb..16ff99a 100644 --- a/hadrian/src/Settings/Flavours/Quick.hs +++ b/hadrian/src/Settings/Flavours/Quick.hs @@ -30,5 +30,5 @@ quickArgs = sourceArgs SourceArgs , naturalInBaseFixArgs ] , hsLibrary = notStage0 ? arg "-O" - , hsCompiler = stage0 ? arg "-O" + , hsCompiler = stage0 ? arg "-O2" , hsGhc = stage0 ? arg "-O" } diff --git a/hadrian/src/Settings/Flavours/QuickCross.hs b/hadrian/src/Settings/Flavours/QuickCross.hs index 7572be2..3f2776e 100644 --- a/hadrian/src/Settings/Flavours/QuickCross.hs +++ b/hadrian/src/Settings/Flavours/QuickCross.hs @@ -31,7 +31,7 @@ quickCrossArgs = sourceArgs SourceArgs , naturalInBaseFixArgs ] , hsLibrary = notStage0 ? mconcat [ arg "-O", arg "-fllvm" ] - , hsCompiler = stage0 ? arg "-O" + , hsCompiler = stage0 ? arg "-O2" , hsGhc = mconcat [ stage0 ? arg "-O" , stage1 ? mconcat [ arg "-O0", arg "-fllvm" ] ] } From git at git.haskell.org Sat Feb 2 08:59:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:02 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Replace BlockSequence with OrdList in BlockLayout.hs (ff2d601) Message-ID: <20190202085902.94CCE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/ff2d6018348c6d316b87c596a4010b316501b91c/ghc >--------------------------------------------------------------- commit ff2d6018348c6d316b87c596a4010b316501b91c Author: klebinger.andreas at gmx.at Date: Thu Jan 24 23:02:51 2019 +0100 Replace BlockSequence with OrdList in BlockLayout.hs OrdList does the same thing and more so there is no reason to have both. >--------------------------------------------------------------- ff2d6018348c6d316b87c596a4010b316501b91c compiler/nativeGen/BlockLayout.hs | 99 +++++++++------------------------------ compiler/utils/OrdList.hs | 23 ++++++++- 2 files changed, 45 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 ff2d6018348c6d316b87c596a4010b316501b91c From git at git.haskell.org Sat Feb 2 08:59:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:05 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Small optimizations to BlockLayout. (438c11c) Message-ID: <20190202085905.ACA053A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/438c11cc5ef4b3afa4afe98dd649ce5fd93bb971/ghc >--------------------------------------------------------------- commit 438c11cc5ef4b3afa4afe98dd649ce5fd93bb971 Author: klebinger.andreas at gmx.at Date: Fri Jan 25 00:08:21 2019 +0100 Small optimizations to BlockLayout. * Remove `takeL/R 1` occurences by lastOL/headOL. * Make BlockChain a OrdList newtype by removing the set of blocks. Initially BlockChain contained both, a set for membership test and a ordered list of blocks. The set is not used for any performance sensitive lookups so we get rid of it. >--------------------------------------------------------------- 438c11cc5ef4b3afa4afe98dd649ce5fd93bb971 compiler/nativeGen/BlockLayout.hs | 70 +++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/compiler/nativeGen/BlockLayout.hs b/compiler/nativeGen/BlockLayout.hs index 6ff0e06..51ff34d 100644 --- a/compiler/nativeGen/BlockLayout.hs +++ b/compiler/nativeGen/BlockLayout.hs @@ -222,27 +222,25 @@ type FrontierMap = LabelMap ([BlockId],BlockChain) -- -- We use OrdList instead of [] to allow fast append on both sides -- when combining chains. -data BlockChain - = BlockChain - { chainMembers :: !LabelSet - , chainBlocks :: !(OrdList BlockId) - } +newtype BlockChain + = BlockChain { chainBlocks :: (OrdList BlockId) } instance Eq (BlockChain) where - (BlockChain s1 _) == (BlockChain s2 _) - = s1 == s2 + (BlockChain blks1) == (BlockChain blks2) + = fromOL blks1 == fromOL blks2 + +-- Useful for things like sets and debugging purposes, sorts by blocks +-- in the chain. +instance Ord (BlockChain) where + (BlockChain lbls1) `compare` (BlockChain lbls2) + = (fromOL lbls1) `compare` (fromOL lbls2) instance Outputable (BlockChain) where - ppr (BlockChain _ blks) = + ppr (BlockChain blks) = parens (text "Chain:" <+> ppr (fromOL $ blks) ) data WeightedEdge = WeightedEdge !BlockId !BlockId EdgeWeight deriving (Eq) --- Useful for things like sets and debugging purposes, sorts by blocks --- in the chain. -instance Ord (BlockChain) where - (BlockChain lbls1 _) `compare` (BlockChain lbls2 _) - = lbls1 `compare` lbls2 -- | Non deterministic! (Uniques) Sorts edges by weight and nodes. instance Ord WeightedEdge where @@ -270,54 +268,48 @@ noDups chains = else pprTrace "Duplicates:" (ppr (map toList dups) $$ text "chains" <+> ppr chains ) False inFront :: BlockId -> BlockChain -> Bool -inFront bid (BlockChain _ seq) +inFront bid (BlockChain seq) = headOL seq == bid chainMember :: BlockId -> BlockChain -> Bool chainMember bid chain - = setMember bid . chainMembers $ chain + = elem bid $ fromOL . chainBlocks $ chain +-- = setMember bid . chainMembers $ chain chainSingleton :: BlockId -> BlockChain chainSingleton lbl - = BlockChain (setSingleton lbl) (unitOL lbl) + = BlockChain (unitOL lbl) chainSnoc :: BlockChain -> BlockId -> BlockChain -chainSnoc (BlockChain lbls blks) lbl - = BlockChain (setInsert lbl lbls) (blks `snocOL` lbl) +chainSnoc (BlockChain blks) lbl + = BlockChain (blks `snocOL` lbl) chainConcat :: BlockChain -> BlockChain -> BlockChain -chainConcat (BlockChain lbls1 blks1) (BlockChain lbls2 blks2) - = BlockChain (setUnion lbls1 lbls2) (blks1 `appOL` blks2) +chainConcat (BlockChain blks1) (BlockChain blks2) + = BlockChain (blks1 `appOL` blks2) chainToBlocks :: BlockChain -> [BlockId] -chainToBlocks (BlockChain _ blks) = fromOL blks +chainToBlocks (BlockChain blks) = fromOL blks -- | Given the Chain A -> B -> C -> D and we break at C -- we get the two Chains (A -> B, C -> D) as result. breakChainAt :: BlockId -> BlockChain -> (BlockChain,BlockChain) -breakChainAt bid (BlockChain lbls blks) - | not (setMember bid lbls) +breakChainAt bid (BlockChain blks) + | not (bid == head rblks) = panic "Block not in chain" | otherwise - = let (lblks, rblks) = break (\lbl -> lbl == bid) - (fromOL blks) - --TODO: Remove old - --lblSet :: [GenBasicBlock i] -> BlockChain - --lblSet blks = - -- setFromList - --(map (\(BasicBlock lbl _) -> lbl) $ toList blks) - in - (BlockChain (setFromList lblks) (toOL lblks), - BlockChain (setFromList rblks) (toOL rblks)) + = (BlockChain (toOL lblks), + BlockChain (toOL rblks)) + where + (lblks, rblks) = break (\lbl -> lbl == bid) (fromOL blks) takeR :: Int -> BlockChain -> [BlockId] -takeR n (BlockChain _ blks) = +takeR n (BlockChain blks) = take n . fromOLReverse $ blks - takeL :: Int -> BlockChain -> [BlockId] -takeL n (BlockChain _ blks) = --error "TODO: takeLn" +takeL n (BlockChain blks) = take n . fromOL $ blks -- | For a given list of chains try to fuse chains with strong @@ -329,7 +321,7 @@ fuseChains :: WeightedEdgeList -> LabelMap BlockChain -> (LabelMap BlockChain, Set.Set WeightedEdge) fuseChains weights chains = let fronts = mapFromList $ - map (\chain -> (head $ takeL 1 chain,chain)) $ + map (\chain -> (headOL . chainBlocks $ chain,chain)) $ mapElems chains :: LabelMap BlockChain (chains', used, _) = applyEdges weights chains fronts Set.empty in (chains', used) @@ -348,8 +340,8 @@ fuseChains weights chains , Just c2 <- mapLookup to chainsFront , c1 /= c2 = let newChain = chainConcat c1 c2 - front = head $ takeL 1 newChain - end = head $ takeR 1 newChain + front = headOL . chainBlocks $ newChain + end = lastOL . chainBlocks $ newChain chainsFront' = mapInsert front newChain $ mapDelete to chainsFront chainsEnd' = mapInsert end newChain $ From git at git.haskell.org Sat Feb 2 08:59:08 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:08 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update haskeline submodule (229f097) Message-ID: <20190202085908.B2DF73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/229f097d3343067ecd64bc989416b8d996809529/ghc >--------------------------------------------------------------- commit 229f097d3343067ecd64bc989416b8d996809529 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:36 2019 +0100 Update haskeline submodule >--------------------------------------------------------------- 229f097d3343067ecd64bc989416b8d996809529 libraries/haskeline | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/haskeline b/libraries/haskeline index 84a7b2b..fdc6c2c 160000 --- a/libraries/haskeline +++ b/libraries/haskeline @@ -1 +1 @@ -Subproject commit 84a7b2b0afb9325cfcedc3ca56603539f0e8af3e +Subproject commit fdc6c2cced525b8f8a95f38bfc45d9362785e9ae From git at git.haskell.org Sat Feb 2 08:59:11 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:11 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update deepseq submodule (edca783) Message-ID: <20190202085911.C7D153A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/edca78379f9f66a24adca63732f69f9ae45df69d/ghc >--------------------------------------------------------------- commit edca78379f9f66a24adca63732f69f9ae45df69d Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:36 2019 +0100 Update deepseq submodule >--------------------------------------------------------------- edca78379f9f66a24adca63732f69f9ae45df69d libraries/deepseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/deepseq b/libraries/deepseq index 4f03181..a2d507a 160000 --- a/libraries/deepseq +++ b/libraries/deepseq @@ -1 +1 @@ -Subproject commit 4f031810fc0eaf5ba12d805ff8df7f15e561e407 +Subproject commit a2d507af21a8f538b7c2fa129f0ce7ab6a7667dc From git at git.haskell.org Sat Feb 2 08:59:14 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:14 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Use ByteString to represent Cmm string literals (#16198) (4fa3229) Message-ID: <20190202085914.EA1F83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/4fa32293c9d2658ce504b8fe6d909db2acf59983/ghc >--------------------------------------------------------------- commit 4fa32293c9d2658ce504b8fe6d909db2acf59983 Author: Sylvain Henry Date: Thu Jan 17 13:34:32 2019 +0100 Use ByteString to represent Cmm string literals (#16198) Also used ByteString in some other relevant places >--------------------------------------------------------------- 4fa32293c9d2658ce504b8fe6d909db2acf59983 compiler/basicTypes/DataCon.hs | 16 ++++++++---- compiler/basicTypes/Literal.hs | 2 +- compiler/basicTypes/Module.hs | 6 ++--- compiler/cmm/Cmm.hs | 7 +++-- compiler/cmm/CmmInfo.hs | 4 +-- compiler/cmm/CmmParse.y | 8 +++--- compiler/cmm/CmmUtils.hs | 7 ++--- compiler/cmm/PprC.hs | 6 +++-- compiler/cmm/PprCmmDecl.hs | 7 +++-- compiler/cmm/SMRep.hs | 17 +++--------- compiler/codeGen/StgCmm.hs | 3 +-- compiler/codeGen/StgCmmClosure.hs | 10 ++++---- compiler/codeGen/StgCmmUtils.hs | 10 ++++---- compiler/coreSyn/CoreOpt.hs | 2 +- compiler/coreSyn/MkCore.hs | 2 +- compiler/deSugar/Coverage.hs | 5 ++-- compiler/deSugar/MatchLit.hs | 2 +- compiler/hsSyn/HsUtils.hs | 3 +-- compiler/llvmGen/LlvmCodeGen/Data.hs | 4 ++- compiler/main/PackageConfig.hs | 4 +-- compiler/nativeGen/Dwarf/Types.hs | 3 ++- compiler/nativeGen/PprBase.hs | 6 +++-- compiler/nativeGen/SPARC/Ppr.hs | 3 ++- compiler/prelude/TysWiredIn.hs | 2 +- compiler/typecheck/TcEvTerm.hs | 2 +- compiler/typecheck/TcTyDecls.hs | 2 +- compiler/utils/Binary.hs | 2 +- compiler/utils/BufWrite.hs | 2 +- compiler/utils/FastString.hs | 30 +++++++++------------- libraries/ghci/GHCi/InfoTable.hsc | 13 +++++++--- libraries/ghci/GHCi/Message.hs | 2 +- .../tests/plugins/simple-plugin/Simple/Plugin.hs | 2 +- 32 files changed, 97 insertions(+), 97 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 4fa32293c9d2658ce504b8fe6d909db2acf59983 From git at git.haskell.org Sat Feb 2 08:59:17 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:17 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Hadrian: Update instructions for building on Windows (780bcda) Message-ID: <20190202085917.F28343A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/780bcdaf66db9d7103ded03773609074ad92df54/ghc >--------------------------------------------------------------- commit 780bcdaf66db9d7103ded03773609074ad92df54 Author: Andrey Mokhov Date: Sun Jan 27 22:34:30 2019 +0000 Hadrian: Update instructions for building on Windows The `hadrian/doc/windows.md` file has falled out of date. In particular it still points to the old GitHub repository, and uses incorrect path to GHC. This patch fixes it. >--------------------------------------------------------------- 780bcdaf66db9d7103ded03773609074ad92df54 hadrian/README.md | 2 +- hadrian/doc/windows.md | 47 ++++++++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/hadrian/README.md b/hadrian/README.md index a3b8a1b..7b6646d 100644 --- a/hadrian/README.md +++ b/hadrian/README.md @@ -262,7 +262,7 @@ projects), as well as Well-Typed. [issues]: https://github.com/snowleopard/hadrian/issues [ghc-preparation]: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation [ghc-windows-quick-build]: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows#AQuickBuild -[windows-build]: https://github.com/snowleopard/hadrian/blob/master/doc/windows.md +[windows-build]: https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/doc/windows.md [ghc-split-objs-bug]: https://ghc.haskell.org/trac/ghc/ticket/11315 [test-issue]: https://github.com/snowleopard/hadrian/issues/197 [validation-issue]: https://github.com/snowleopard/hadrian/issues/187 diff --git a/hadrian/doc/windows.md b/hadrian/doc/windows.md index 0ad2086..aa59bc5 100644 --- a/hadrian/doc/windows.md +++ b/hadrian/doc/windows.md @@ -1,15 +1,13 @@ # Building GHC on Windows -[![Windows status](https://img.shields.io/appveyor/ci/snowleopard/hadrian/master.svg?label=Windows)](https://ci.appveyor.com/project/snowleopard/hadrian) +Here is how you can build GHC, from source, on Windows with minimal requirements. +We only assume that `git` and `stack` are installed (see +[prerequisites](https://github.com/snowleopard/hadrian/blob/master/doc/windows.md#prerequisites)). -Here is how you can build GHC, from source, on Windows. We assume that `git` and `stack` are installed -(see [prerequisites](https://github.com/snowleopard/hadrian/blob/master/doc/windows.md#prerequisites)). - -```sh -# Get GHC and Hadrian sources; git core.autocrlf should be set to false (see Prerequisites section) +``` +# Get GHC sources; git core.autocrlf should be set to false (see Prerequisites section) git clone --recursive git://git.haskell.org/ghc.git cd ghc -git clone git://github.com/snowleopard/hadrian # Download and install the bootstrapping GHC and MSYS2 cd hadrian @@ -27,30 +25,33 @@ stack exec hadrian -- --directory ".." -j --flavour=quickest --configure # Test GHC cd .. -inplace\bin\ghc-stage2 -e 1+2 +_build\stage1\bin\ghc -e 1+2 ``` -The entire process should take about 20 minutes. Note, this will build GHC without -optimisations. If you need an optimised GHC, drop the `--flavour=quickest` flag from -the build command line (this will slow down the build to about an hour). +The entire process should take about 20 minutes. Note, this will build GHC +without optimisations. If you need an optimised GHC, drop the `--flavour=quickest` +flag from the build command line (this will slow down the build to about an hour). These are currently not the [official GHC building instructions](https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows), but are much simpler and may also be more robust. -The `stack build` and `stack exec hadrian` commands can be replaced by an invocation -of Hadrian's Stack-based build script: `build.stack.bat -j --flavour=quickest`. Use this -script if you plan to work on Hadrian and/or rebuild GHC often. +The `stack build` and `stack exec hadrian` commands can be replaced by an +invocation of Hadrian's Stack-based build script: +`build.stack.bat -j --flavour=quickest`. Use this script if you plan to work on +Hadrian and/or rebuild GHC often. ## Prerequisites -The above works on a clean machine with `git` and `stack` installed (tested with default -installation settings), which you can get from https://git-scm.com/download/win and +The above works on a clean machine with `git` and `stack` installed (tested with +default installation settings), which you can get from +https://git-scm.com/download/win and https://www.stackage.org/stack/windows-x86_64-installer. -Note that `git` should be configured to check out Unix-style line endings. The default behaviour -of `git` on Windows is to check out Windows-style line endings which can cause issues during the -build. This can be changed using the following command: +Note that `git` should be configured to check out Unix-style line endings. The +default behaviour of `git` on Windows is to check out Windows-style line endings +which can cause issues during the build. This can be changed using the following +command: git config --global core.autocrlf false @@ -61,10 +62,10 @@ If you would like to restore the default behaviour later run: ## Testing These instructions have been tested on a clean Windows 10 machine using the -[free VirtualBox image](https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/), -and are also routinely tested on -[Hadrian's AppVeyor CI instance](https://ci.appveyor.com/project/snowleopard/hadrian/history). +[free VirtualBox image](https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/). + +**TODO:** It would be useful to test the instructions routinely on CI. ## Notes -Beware of the [current limitations of Hadrian](https://github.com/snowleopard/hadrian#current-limitations). +Beware of the [current limitations of Hadrian](https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/README.md#current-limitations). From git at git.haskell.org Sat Feb 2 08:59:21 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:21 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Use O2 on stage1 for faster overall build times with make. (92c7e70) Message-ID: <20190202085921.0D2683A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/92c7e70ff3135b79485be2d36cfac3d2441c29df/ghc >--------------------------------------------------------------- commit 92c7e70ff3135b79485be2d36cfac3d2441c29df Author: klebinger.andreas at gmx.at Date: Thu Jan 24 20:20:39 2019 +0100 Use O2 on stage1 for faster overall build times with make. Build times when using the quick flavour: stage1 opt | time (wall) | time (user) -O1 | 13m | 53m -O2 | 13m | 51m So even when we compile stage2 with -O0 (quick) using -O2 on stage1 is already faster. The difference is even bigger when freezing stage1 and doing multiple builds or compiling stage2 with optimizations. >--------------------------------------------------------------- 92c7e70ff3135b79485be2d36cfac3d2441c29df mk/flavours/bench-cross-ncg.mk | 2 +- mk/flavours/bench.mk | 2 +- mk/flavours/devel2.mk | 2 +- mk/flavours/perf.mk | 2 +- mk/flavours/prof.mk | 2 +- mk/flavours/quick-cross-ncg.mk | 2 +- mk/flavours/quick.mk | 2 +- mk/flavours/quickest.mk | 2 +- mk/flavours/validate.mk | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mk/flavours/bench-cross-ncg.mk b/mk/flavours/bench-cross-ncg.mk index 6b686af..0d42938 100644 --- a/mk/flavours/bench-cross-ncg.mk +++ b/mk/flavours/bench-cross-ncg.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 GhcLibHcOpts = -O2 BUILD_PROF_LIBS = NO diff --git a/mk/flavours/bench.mk b/mk/flavours/bench.mk index 0a7cf80..73015aa 100644 --- a/mk/flavours/bench.mk +++ b/mk/flavours/bench.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 GhcLibHcOpts = -O2 BUILD_PROF_LIBS = NO diff --git a/mk/flavours/devel2.mk b/mk/flavours/devel2.mk index 34808a3..dc8be47 100644 --- a/mk/flavours/devel2.mk +++ b/mk/flavours/devel2.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 -DDEBUG GhcLibHcOpts = -O -dcore-lint BUILD_PROF_LIBS = NO diff --git a/mk/flavours/perf.mk b/mk/flavours/perf.mk index 06fcc24..ec314bd 100644 --- a/mk/flavours/perf.mk +++ b/mk/flavours/perf.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O2 GhcLibHcOpts = -O2 BUILD_PROF_LIBS = YES diff --git a/mk/flavours/prof.mk b/mk/flavours/prof.mk index 67f89e6..c7e0e28 100644 --- a/mk/flavours/prof.mk +++ b/mk/flavours/prof.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O0 -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O GhcLibHcOpts = -O BUILD_PROF_LIBS = YES diff --git a/mk/flavours/quick-cross-ncg.mk b/mk/flavours/quick-cross-ncg.mk index 97352cc..5ca88c0 100644 --- a/mk/flavours/quick-cross-ncg.mk +++ b/mk/flavours/quick-cross-ncg.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O0 -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 GhcLibHcOpts = -O BUILD_PROF_LIBS = NO diff --git a/mk/flavours/quick.mk b/mk/flavours/quick.mk index 735de6a..30322cd 100644 --- a/mk/flavours/quick.mk +++ b/mk/flavours/quick.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O0 -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 GhcLibHcOpts = -O BUILD_PROF_LIBS = NO diff --git a/mk/flavours/quickest.mk b/mk/flavours/quickest.mk index 61e091c..5204acb 100644 --- a/mk/flavours/quickest.mk +++ b/mk/flavours/quickest.mk @@ -1,5 +1,5 @@ SRC_HC_OPTS = -O0 -H64m -GhcStage1HcOpts = -O +GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O0 GhcLibHcOpts = -O0 BUILD_PROF_LIBS = NO diff --git a/mk/flavours/validate.mk b/mk/flavours/validate.mk index 2ff7c20..a1470cd 100644 --- a/mk/flavours/validate.mk +++ b/mk/flavours/validate.mk @@ -1,6 +1,6 @@ SRC_HC_OPTS = -O0 -H64m SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage # See Trac 11487 -GhcStage1HcOpts = -O -DDEBUG +GhcStage1HcOpts = -O2 -DDEBUG GhcStage2HcOpts = -O -dcore-lint -dno-debug-output GhcLibHcOpts = -O -dcore-lint -dno-debug-output BUILD_PROF_LIBS = NO From git at git.haskell.org Sat Feb 2 08:59:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:24 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: PPC NCG: Promote integers to word size in C calls (4376d88) Message-ID: <20190202085924.0DC423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/4376d8811418d91bb4d19d61801e95a449b98378/ghc >--------------------------------------------------------------- commit 4376d8811418d91bb4d19d61801e95a449b98378 Author: Peter Trommler Date: Wed Jan 23 23:13:57 2019 +0100 PPC NCG: Promote integers to word size in C calls Fixes #16222 >--------------------------------------------------------------- 4376d8811418d91bb4d19d61801e95a449b98378 compiler/cmm/CmmType.hs | 8 ++++++-- compiler/nativeGen/PPC/CodeGen.hs | 36 +++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/compiler/cmm/CmmType.hs b/compiler/cmm/CmmType.hs index 77d894b..0d6e770 100644 --- a/compiler/cmm/CmmType.hs +++ b/compiler/cmm/CmmType.hs @@ -4,7 +4,8 @@ module CmmType , cInt , cmmBits, cmmFloat , typeWidth, cmmEqType, cmmEqType_ignoring_ptrhood - , isFloatType, isGcPtrType, isWord32, isWord64, isFloat64, isFloat32 + , isFloatType, isGcPtrType, isBitsType + , isWord32, isWord64, isFloat64, isFloat32 , Width(..) , widthInBits, widthInBytes, widthInLog, widthFromBytes @@ -132,13 +133,16 @@ cInt :: DynFlags -> CmmType cInt dflags = cmmBits (cIntWidth dflags) ------------ Predicates ---------------- -isFloatType, isGcPtrType :: CmmType -> Bool +isFloatType, isGcPtrType, isBitsType :: CmmType -> Bool isFloatType (CmmType FloatCat _) = True isFloatType _other = False isGcPtrType (CmmType GcPtrCat _) = True isGcPtrType _other = False +isBitsType (CmmType BitsCat _) = True +isBitsType _ = False + isWord32, isWord64, isFloat32, isFloat64 :: CmmType -> Bool -- isWord64 is true of 64-bit non-floats (both gc-ptrs and otherwise) -- isFloat32 and 64 are obvious diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs index c6e5304..516a49a 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/nativeGen/PPC/CodeGen.hs @@ -1634,15 +1634,13 @@ genCCall' genCCall' dflags gcp target dest_regs args - = ASSERT(not $ any (`elem` [II16]) $ map cmmTypeFormat argReps) - -- we rely on argument promotion in the codeGen - do + = do (finalStack,passArgumentsCode,usedRegs) <- passArguments - (zip args argReps) - allArgRegs - (allFPArgRegs platform) - initialStackOffset - (toOL []) [] + (zip3 args argReps argHints) + allArgRegs + (allFPArgRegs platform) + initialStackOffset + nilOL [] (labelOrExpr, reduceToFF32) <- case target of ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do @@ -1733,6 +1731,7 @@ genCCall' dflags gcp target dest_regs args _ -> panic "genCall': unknown calling conv." argReps = map (cmmExprType dflags) args + (argHints, _) = foreignTargetHints target roundTo a x | x `mod` a == 0 = x | otherwise = x + a - (x `mod` a) @@ -1769,7 +1768,7 @@ genCCall' dflags gcp target dest_regs args _ -> panic "maybeNOP: Unknown PowerPC 64-bit ABI" passArguments [] _ _ stackOffset accumCode accumUsed = return (stackOffset, accumCode, accumUsed) - passArguments ((arg,arg_ty):args) gprs fprs stackOffset + passArguments ((arg,arg_ty,_):args) gprs fprs stackOffset accumCode accumUsed | isWord64 arg_ty && target32Bit (targetPlatform dflags) = do @@ -1811,9 +1810,9 @@ genCCall' dflags gcp target dest_regs args stackCode accumUsed GCP64ELF _ -> panic "passArguments: 32 bit code" - passArguments ((arg,rep):args) gprs fprs stackOffset accumCode accumUsed + passArguments ((arg,rep,hint):args) gprs fprs stackOffset accumCode accumUsed | reg : _ <- regs = do - register <- getRegister arg + register <- getRegister arg_pro let code = case register of Fixed _ freg fcode -> fcode `snocOL` MR reg freg Any _ acode -> acode reg @@ -1833,14 +1832,25 @@ genCCall' dflags gcp target dest_regs args (accumCode `appOL` code) (reg : accumUsed) | otherwise = do - (vr, code) <- getSomeReg arg + (vr, code) <- getSomeReg arg_pro passArguments args (drop nGprs gprs) (drop nFprs fprs) (stackOffset' + stackBytes) - (accumCode `appOL` code `snocOL` ST (cmmTypeFormat rep) vr stackSlot) + (accumCode `appOL` code + `snocOL` ST format_pro vr stackSlot) accumUsed where + arg_pro + | isBitsType rep = CmmMachOp (conv_op (typeWidth rep) (wordWidth dflags)) [arg] + | otherwise = arg + format_pro + | isBitsType rep = intFormat (wordWidth dflags) + | otherwise = cmmTypeFormat rep + conv_op = case hint of + SignedHint -> MO_SS_Conv + _ -> MO_UU_Conv + stackOffset' = case gcp of GCPAIX -> -- The 32bit PowerOPEN ABI is happy with From git at git.haskell.org Sat Feb 2 08:59:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:27 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update hsc2hs submodule (9bcef36) Message-ID: <20190202085927.1A3673A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/9bcef368fe64131aa407644e1a03a10fe36bc9bd/ghc >--------------------------------------------------------------- commit 9bcef368fe64131aa407644e1a03a10fe36bc9bd Author: Herbert Valerio Riedel Date: Sun Jan 27 15:33:22 2019 +0100 Update hsc2hs submodule >--------------------------------------------------------------- 9bcef368fe64131aa407644e1a03a10fe36bc9bd utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index a816333..fac8b62 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit a816333ae67c54b98cce4ed22621242714967b3e +Subproject commit fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d6 From git at git.haskell.org Sat Feb 2 08:59:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:30 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: hWaitForInput-accurate-stdin test (98ff301) Message-ID: <20190202085930.830DD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/98ff3010a642366ab8e0c563fc20debc8858dc83/ghc >--------------------------------------------------------------- commit 98ff3010a642366ab8e0c563fc20debc8858dc83 Author: Ben Gamari Date: Wed Jan 30 23:36:17 2019 -0500 hWaitForInput-accurate-stdin test >--------------------------------------------------------------- 98ff3010a642366ab8e0c563fc20debc8858dc83 libraries/base/tests/all.T | 1 + .../base/tests/hWaitForInput-accurate-stdin.hs | 51 ++++++++++++++++++++++ ....stdout => hWaitForInput-accurate-stdin.stdout} | 0 3 files changed, 52 insertions(+) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index a6cb96d..25e851b 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -202,6 +202,7 @@ test('T8089', compile_and_run, ['']) test('hWaitForInput-accurate-socket', reqlib('unix'), compile_and_run, ['']) test('T8684', expect_broken(8684), compile_and_run, ['']) +test('hWaitForInput-accurate-stdin', normal, compile_and_run, ['']) test('T9826',normal, compile_and_run,['']) test('T9848', [ collect_stats('bytes allocated') diff --git a/libraries/base/tests/hWaitForInput-accurate-stdin.hs b/libraries/base/tests/hWaitForInput-accurate-stdin.hs new file mode 100644 index 0000000..f38a0b3 --- /dev/null +++ b/libraries/base/tests/hWaitForInput-accurate-stdin.hs @@ -0,0 +1,51 @@ +{-# LANGUAGE CPP #-} + +import Control.Concurrent +import Control.Monad +import GHC.Clock +import System.Environment +import System.Exit +import System.IO +import System.Process +import System.Timeout + +-- IMPORTANT: Re-run this test _manually_ on windows if/when you change +-- the code in `libraries/base/cbits/inputReady.c` that mentions +-- `FILE_TYPE_CHAR`. Only when you run the code manually, in cmd.exe +-- or PowerShell, does this code path get activated. +-- Running this code in mintty does not count. +main :: IO () +main = do + args <- getArgs + case args of + [] -> do + let cp = + (shell + ((if isLinuxHost + then ("./" ++) + else id) + "hWaitForInput-accurate-stdin --read-from-stdin")) + {std_in = CreatePipe} + (_, _, _, ph) <- createProcess cp + waitForProcess ph >>= exitWith + ("--read-from-stdin":_) -> do + let nanoSecondsPerSecond = 1000 * 1000 * 1000 + let milliSecondsPerSecond = 1000 + let timeToSpend = 1 + let timeToSpendNano = timeToSpend * nanoSecondsPerSecond + let timeToSpendMilli = timeToSpend * milliSecondsPerSecond + start <- getMonotonicTimeNSec + b <- hWaitForInput stdin timeToSpendMilli + end <- getMonotonicTimeNSec + let timeSpentNano = fromIntegral $ end - start + let delta = timeSpentNano - timeToSpendNano + -- We can never wait for a shorter amount of time than specified + putStrLn $ "delta >= 0: " ++ show (delta >= 0) + _ -> error "should not happen." + +isLinuxHost :: Bool +#if defined(mingw32_HOST_OS) +isLinuxHost = False +#else +isLinuxHost = True +#endif diff --git a/libraries/base/tests/hWaitForInput-accurate-socket.stdout b/libraries/base/tests/hWaitForInput-accurate-stdin.stdout similarity index 100% copy from libraries/base/tests/hWaitForInput-accurate-socket.stdout copy to libraries/base/tests/hWaitForInput-accurate-stdin.stdout From git at git.haskell.org Sat Feb 2 08:59:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:33 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update process submodule (4a9e14b) Message-ID: <20190202085933.98E473A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/4a9e14be001f9e3af68b66552afec6808bdb3bb9/ghc >--------------------------------------------------------------- commit 4a9e14be001f9e3af68b66552afec6808bdb3bb9 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update process submodule >--------------------------------------------------------------- 4a9e14be001f9e3af68b66552afec6808bdb3bb9 libraries/process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/process b/libraries/process index 36a3ad5..d860209 160000 --- a/libraries/process +++ b/libraries/process @@ -1 +1 @@ -Subproject commit 36a3ad577e31e8c3336c7464b252fc2c9b01a20c +Subproject commit d860209e53c1b40b7c251fc8378886bbcb394402 From git at git.haskell.org Sat Feb 2 08:59:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:36 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update unix submodule (03030bc) Message-ID: <20190202085936.BDBF03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/03030bcf46cde81cea6a263c6971bc9f68f97740/ghc >--------------------------------------------------------------- commit 03030bcf46cde81cea6a263c6971bc9f68f97740 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update unix submodule >--------------------------------------------------------------- 03030bcf46cde81cea6a263c6971bc9f68f97740 .gitmodules | 1 + libraries/unix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 42ed8bf9..d2ab9ed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,6 +82,7 @@ path = libraries/unix url = ../packages/unix.git ignore = untracked + branch = 2.7 [submodule "libraries/parallel"] path = libraries/parallel url = ../packages/parallel.git diff --git a/libraries/unix b/libraries/unix index dbada98..a102df2 160000 --- a/libraries/unix +++ b/libraries/unix @@ -1 +1 @@ -Subproject commit dbada9890c1d58111af7d4ebb2a67d38a3a6a872 +Subproject commit a102df29c107e8f853129dd40fbbb487e1818149 From git at git.haskell.org Sat Feb 2 08:59:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:39 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Introduce GhciMonad and generalize types of functions in GHCi.UI (e08974e) Message-ID: <20190202085939.D8AE53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/e08974e81ccc84b5887d13cc4752fde9a78c51fb/ghc >--------------------------------------------------------------- commit e08974e81ccc84b5887d13cc4752fde9a78c51fb Author: Zejun Wu Date: Mon Jan 21 16:28:01 2019 -0800 Introduce GhciMonad and generalize types of functions in GHCi.UI Summary: Introduce `GhciMonad`, which is bascially `GhcMonad` + `HasGhciState`. Generalize the commands and help functions defined in `GHCi.UI` so they can be used as both `GHCi a` and `InputT GHCi a`. The long term plan is to move reusable bits to ghci library and make it easier to build a customized interactive ui which carries customized state and provides customized commands. Most changes are trivial in this diff by relaxing the type constraint or add/remove lift as necessary. The non-trivial changes are: * Change `HasGhciState` to `GhciMonad` and expose it. * Implementation of `reifyGHCi`. Test Plan: ./validate Reviewers: simonmar, hvr, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5433 >--------------------------------------------------------------- e08974e81ccc84b5887d13cc4752fde9a78c51fb ghc/GHCi/UI.hs | 403 ++++++++++++++++++++++++++------------------------- ghc/GHCi/UI/Monad.hs | 81 ++++++----- 2 files changed, 250 insertions(+), 234 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 e08974e81ccc84b5887d13cc4752fde9a78c51fb From git at git.haskell.org Sat Feb 2 08:59:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:43 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Hadrian: Fix outdated link. (21462a3) Message-ID: <20190202085943.0D0393A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/21462a3a4edede710582b8038695667d2b9d0159/ghc >--------------------------------------------------------------- commit 21462a3a4edede710582b8038695667d2b9d0159 Author: Andrey Mokhov Date: Sun Jan 27 22:42:23 2019 +0000 Hadrian: Fix outdated link. >--------------------------------------------------------------- 21462a3a4edede710582b8038695667d2b9d0159 hadrian/doc/windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian/doc/windows.md b/hadrian/doc/windows.md index aa59bc5..bf7707c 100644 --- a/hadrian/doc/windows.md +++ b/hadrian/doc/windows.md @@ -2,7 +2,7 @@ Here is how you can build GHC, from source, on Windows with minimal requirements. We only assume that `git` and `stack` are installed (see -[prerequisites](https://github.com/snowleopard/hadrian/blob/master/doc/windows.md#prerequisites)). +[prerequisites](https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/doc/windows.md#prerequisites)). ``` # Get GHC sources; git core.autocrlf should be set to false (see Prerequisites section) From git at git.haskell.org Sat Feb 2 08:59:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:47 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Add -fdefer-diagnostics to defer and group diagnostic messages in make-mode (0593e93) Message-ID: <20190202085947.AA0AE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/0593e9389c4e5fd4386ebd74a746ef9659401ac6/ghc >--------------------------------------------------------------- commit 0593e9389c4e5fd4386ebd74a746ef9659401ac6 Author: Zejun Wu Date: Fri Dec 28 00:10:22 2018 -0800 Add -fdefer-diagnostics to defer and group diagnostic messages in make-mode When loading many modules in parallel there can a lot of warnings and errors get mixed up with regular output. When the compilation fails, the relevant error message can be thousands of lines backward and is hard to find. When the compilation successes, warning message is likely to be ignored as it is not seen. We can address this by deferring the warning and error message after the compilation. We also put errors after warnings so it is more visible. This idea was originally proposed by Bartosz Nitka in https://phabricator.haskell.org/D4219. >--------------------------------------------------------------- 0593e9389c4e5fd4386ebd74a746ef9659401ac6 compiler/main/DynFlags.hs | 2 ++ compiler/main/GhcMake.hs | 39 ++++++++++++++++++++-- docs/users_guide/using.rst | 12 +++++++ testsuite/tests/ghci/prog018/A.hs | 8 +++++ testsuite/tests/ghci/prog018/B.hs | 7 ++++ testsuite/tests/ghci/prog018/C.hs | 6 ++++ .../should_compile => ghci/prog018}/Makefile | 0 testsuite/tests/ghci/prog018/prog018.T | 3 ++ testsuite/tests/ghci/prog018/prog018.script | 4 +++ testsuite/tests/ghci/prog018/prog018.stdout | 23 +++++++++++++ 10 files changed, 102 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 0593e9389c4e5fd4386ebd74a746ef9659401ac6 From git at git.haskell.org Sat Feb 2 08:59:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:50 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Update terminfo submodule (8673432) Message-ID: <20190202085950.B584C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/86734329c4e0bdf5a8c0e92930de21d8d777758d/ghc >--------------------------------------------------------------- commit 86734329c4e0bdf5a8c0e92930de21d8d777758d Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update terminfo submodule >--------------------------------------------------------------- 86734329c4e0bdf5a8c0e92930de21d8d777758d libraries/terminfo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/terminfo b/libraries/terminfo index 27e8275..7049b26 160000 --- a/libraries/terminfo +++ b/libraries/terminfo @@ -1 +1 @@ -Subproject commit 27e82750fac178fc6e049fe44be6de45f24814ae +Subproject commit 7049b2625a490feda9bcb201a5a811d790f06cd0 From git at git.haskell.org Sat Feb 2 08:59:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:54 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: testsuite: Add test for #14828 (5b970d8) Message-ID: <20190202085954.4D2DC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/5b970d8e06c1433066a8c587116f0b22c0f30e22/ghc >--------------------------------------------------------------- commit 5b970d8e06c1433066a8c587116f0b22c0f30e22 Author: Ben Gamari Date: Tue Jan 22 16:58:04 2019 -0500 testsuite: Add test for #14828 >--------------------------------------------------------------- 5b970d8e06c1433066a8c587116f0b22c0f30e22 testsuite/tests/ghci/scripts/T14828.script | 18 ++++++++++++++++++ testsuite/tests/ghci/scripts/all.T | 1 + 2 files changed, 19 insertions(+) diff --git a/testsuite/tests/ghci/scripts/T14828.script b/testsuite/tests/ghci/scripts/T14828.script new file mode 100644 index 0000000..bb0650f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T14828.script @@ -0,0 +1,18 @@ +:t foldl +:print foldl + +:t fmap +:print fmap + +:t return +:print return + +:t pure +:print pure + +:m + Data.Monoid +:p mempty +:p mappend + +:m + Data.List +:p foldl' \ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 2cb93b8..575d9eb 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -291,3 +291,4 @@ test('T15941', normal, ghci_script, ['T15941.script']) test('T16030', normal, ghci_script, ['T16030.script']) test('T11606', normal, ghci_script, ['T11606.script']) test('T16089', normal, ghci_script, ['T16089.script']) +test('T14828', expect_broken(14828), ghci_script, ['T14828.script']) From git at git.haskell.org Sat Feb 2 08:59:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 08:59:57 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Revert "Performance tests: recover a baseline from ancestor commits and CI results." (ebe2d34) Message-ID: <20190202085957.746593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/ebe2d344899e2165182d3c41b0796ec022561790/ghc >--------------------------------------------------------------- commit ebe2d344899e2165182d3c41b0796ec022561790 Author: Ben Gamari Date: Thu Jan 31 19:47:53 2019 -0500 Revert "Performance tests: recover a baseline from ancestor commits and CI results." Unfortunately this has broken all future commits due to spurious(?) performance changes which I have been unable to work around. This reverts commit cc2261d42f6a954d88e355aaad41f001f65c95da. >--------------------------------------------------------------- ebe2d344899e2165182d3c41b0796ec022561790 .gitlab-ci.yml | 30 +----- .gitlab/push-test-metrics.sh | 65 ------------- testsuite/driver/perf_notes.py | 200 ++-------------------------------------- testsuite/driver/runtests.py | 36 ++------ testsuite/driver/testglobals.py | 12 +-- testsuite/driver/testlib.py | 69 ++++++++------ testsuite/driver/testutil.py | 2 +- 7 files changed, 62 insertions(+), 352 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 ebe2d344899e2165182d3c41b0796ec022561790 From git at git.haskell.org Sat Feb 2 09:00:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:01 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/hadrian-import-packages, wip/splice-parsing, wip/trac-16270: Fix #16219: TemplateHaskell causes indefinite package build error (d6d735c) Message-ID: <20190202090001.E22153A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/hadrian-import-packages,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/d6d735c1114082b9e9cc1ba7da87c49f52891320/ghc >--------------------------------------------------------------- commit d6d735c1114082b9e9cc1ba7da87c49f52891320 Author: Edward Z. Yang Date: Thu Jan 31 20:00:50 2019 -0500 Fix #16219: TemplateHaskell causes indefinite package build error It should work to write an indefinite package using TemplateHaskell, so long as all of the actual TH code lives outside of the package. However, cleverness we had to build TH code even when building with -fno-code meant that we attempted to build object code for modules in an indefinite package, even when the signatures were not instantiated. This patch disables said logic in the event that an indefinite package is being typechecked. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #16219 Differential Revision: https://phabricator.haskell.org/D5475 >--------------------------------------------------------------- d6d735c1114082b9e9cc1ba7da87c49f52891320 compiler/main/GhcMake.hs | 3 ++ compiler/main/Packages.hs | 1 + .../cabal08/p1 => backpack/cabal/T16219}/LICENSE | 4 +- .../backpack/cabal/{T15594 => T16219}/Makefile | 6 +-- .../backpack/cabal/{T14304 => T16219}/Setup.hs | 0 testsuite/tests/backpack/cabal/T16219/all.T | 9 +++++ .../backpack/cabal/T16219/backpack-issue.cabal | 47 ++++++++++++++++++++++ .../backpack/cabal/T16219/library-a-impl/A.hs | 6 +++ .../backpack/cabal/T16219/library-a/A/Sig.hsig | 5 +++ .../tests/backpack/cabal/T16219/library-a/B.hs | 6 +++ .../tests/backpack/cabal/T16219/library-b/C.hs | 10 +++++ 11 files changed, 91 insertions(+), 6 deletions(-) diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs index 85925b3..a6fe5c7 100644 --- a/compiler/main/GhcMake.hs +++ b/compiler/main/GhcMake.hs @@ -2045,6 +2045,9 @@ enableCodeGenForTH target nodemap = , ms_hspp_opts = dflags at DynFlags {hscTarget = HscNothing} } <- ms + -- Don't enable codegen for TH on indefinite packages; we + -- can't compile anything anyway! See #16219. + , not (isIndefinite dflags) , ms_mod `Set.member` needs_codegen_set = do let new_temp_file suf dynsuf = do diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 70c9c26..44258de 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -58,6 +58,7 @@ module Packages ( pprPackages, pprPackagesSimple, pprModuleMap, + isIndefinite, isDllName ) where diff --git a/testsuite/tests/cabal/cabal08/p1/LICENSE b/testsuite/tests/backpack/cabal/T16219/LICENSE similarity index 93% copy from testsuite/tests/cabal/cabal08/p1/LICENSE copy to testsuite/tests/backpack/cabal/T16219/LICENSE index c8cc6ab..9488e98 100644 --- a/testsuite/tests/cabal/cabal08/p1/LICENSE +++ b/testsuite/tests/backpack/cabal/T16219/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015, Edward Z. Yang +Copyright (c) 2019, Isaac Elliott All rights reserved. @@ -13,7 +13,7 @@ modification, are permitted provided that the following conditions are met: disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Edward Z. Yang nor the names of other + * Neither the name of Isaac Elliott nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/testsuite/tests/backpack/cabal/T15594/Makefile b/testsuite/tests/backpack/cabal/T16219/Makefile similarity index 83% copy from testsuite/tests/backpack/cabal/T15594/Makefile copy to testsuite/tests/backpack/cabal/T16219/Makefile index 57ef67f..e98af4b 100644 --- a/testsuite/tests/backpack/cabal/T15594/Makefile +++ b/testsuite/tests/backpack/cabal/T16219/Makefile @@ -1,17 +1,15 @@ -TOP=/home/ezyang/Dev/ghc-known-nat/testsuite +TOP=/../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk SETUP='$(PWD)/Setup' -v0 CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst' -T15594: clean +T16219: clean '$(GHC_PKG)' init tmp.d '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup $(CONFIGURE) $(SETUP) build - $(SETUP) copy - $(SETUP) register ifneq "$(CLEANUP)" "" $(MAKE) -s --no-print-directory clean endif diff --git a/testsuite/tests/backpack/cabal/T14304/Setup.hs b/testsuite/tests/backpack/cabal/T16219/Setup.hs similarity index 100% copy from testsuite/tests/backpack/cabal/T14304/Setup.hs copy to testsuite/tests/backpack/cabal/T16219/Setup.hs diff --git a/testsuite/tests/backpack/cabal/T16219/all.T b/testsuite/tests/backpack/cabal/T16219/all.T new file mode 100644 index 0000000..29dd8a4 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/all.T @@ -0,0 +1,9 @@ +if config.cleanup: + cleanup = 'CLEANUP=1' +else: + cleanup = 'CLEANUP=0' + +test('T16219', + extra_files(['Setup.hs', 'backpack-issue.cabal', 'library-a', 'library-a-impl', 'library-b']), + run_command, + ['$MAKE -s --no-print-directory T16219 ' + cleanup]) diff --git a/testsuite/tests/backpack/cabal/T16219/backpack-issue.cabal b/testsuite/tests/backpack/cabal/T16219/backpack-issue.cabal new file mode 100644 index 0000000..4c3f673 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/backpack-issue.cabal @@ -0,0 +1,47 @@ +-- Initial backpack-issue.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/ + +name: backpack-issue +version: 0.1.0.0 +-- synopsis: +-- description: +license: BSD3 +license-file: LICENSE +author: Isaac Elliott +maintainer: isaace71295 at gmail.com +-- copyright: +-- category: +build-type: Simple +extra-source-files: CHANGELOG.md +cabal-version: >=2 + +library library-a + signatures: A.Sig + exposed-modules: B + build-depends: base >=4.12 && <4.13 + hs-source-dirs: library-a + default-language: Haskell2010 + +library library-a-impl + exposed-modules: A + build-depends: base >=4.12 && <4.13 + hs-source-dirs: library-a-impl + default-language: Haskell2010 + +library library-b + exposed-modules: C + build-depends: base >=4.12 && <4.13 + , library-a + hs-source-dirs: library-b + default-language: Haskell2010 + extensions: TemplateHaskell + +library + mixins: library-a requires (A.Sig as A) + , library-b requires (A.Sig as A) + reexported-modules: A, B, C + build-depends: base >=4.12 && <4.13 + , library-a + , library-a-impl + , library-b + default-language: Haskell2010 diff --git a/testsuite/tests/backpack/cabal/T16219/library-a-impl/A.hs b/testsuite/tests/backpack/cabal/T16219/library-a-impl/A.hs new file mode 100644 index 0000000..6598c36 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/library-a-impl/A.hs @@ -0,0 +1,6 @@ +module A where + +newtype A = A { unA :: Int } + +showA :: A -> String +showA = show . unA diff --git a/testsuite/tests/backpack/cabal/T16219/library-a/A/Sig.hsig b/testsuite/tests/backpack/cabal/T16219/library-a/A/Sig.hsig new file mode 100644 index 0000000..ce90fea --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/library-a/A/Sig.hsig @@ -0,0 +1,5 @@ +signature A.Sig where + +data A + +showA :: A -> String diff --git a/testsuite/tests/backpack/cabal/T16219/library-a/B.hs b/testsuite/tests/backpack/cabal/T16219/library-a/B.hs new file mode 100644 index 0000000..ad89656 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/library-a/B.hs @@ -0,0 +1,6 @@ +module B where + +import A.Sig + +exclaimA :: A -> String +exclaimA = (++ "!") . showA diff --git a/testsuite/tests/backpack/cabal/T16219/library-b/C.hs b/testsuite/tests/backpack/cabal/T16219/library-b/C.hs new file mode 100644 index 0000000..4d4f7e8 --- /dev/null +++ b/testsuite/tests/backpack/cabal/T16219/library-b/C.hs @@ -0,0 +1,10 @@ +{-# language TemplateHaskell #-} +module C where + +import Data.Char (toUpper) + +import A.Sig +import B + +veryExclaimA :: A -> String +veryExclaimA = fmap toUpper . exclaimA From git at git.haskell.org Sat Feb 2 09:00:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:05 +0000 (UTC) Subject: [commit: ghc] wip/alp/hadrian-validate: first attempt at a validate script (587e810) Message-ID: <20190202090005.0B9C73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/alp/hadrian-validate Link : http://ghc.haskell.org/trac/ghc/changeset/587e8103d17b65334e9c2b289596d7341e15f8dc/ghc >--------------------------------------------------------------- commit 587e8103d17b65334e9c2b289596d7341e15f8dc Author: Alp Mestanogullari Date: Fri Feb 1 09:53:34 2019 +0100 first attempt at a validate script >--------------------------------------------------------------- 587e8103d17b65334e9c2b289596d7341e15f8dc hadrian/src/CommandLine.hs | 72 ++++++------ hadrian/src/Oracles/TestSettings.hs | 38 ++++++- hadrian/src/Rules/BinaryDist.hs | 68 +++++++----- hadrian/src/Rules/Program.hs | 3 +- hadrian/src/Rules/Test.hs | 84 ++++++++------ hadrian/src/Settings/Builders/Make.hs | 8 +- hadrian/src/Settings/Builders/RunTest.hs | 87 +++++++-------- hadrian/src/Settings/Default.hs | 3 + validate | 182 +++++++++++++++++++++---------- 9 files changed, 332 insertions(+), 213 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 587e8103d17b65334e9c2b289596d7341e15f8dc From git at git.haskell.org Sat Feb 2 09:00:08 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:08 +0000 (UTC) Subject: [commit: ghc] wip/hadrian-import-packages: Update user-settings.md with a pointer to `Packages` (638e1ae) Message-ID: <20190202090008.189CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hadrian-import-packages Link : http://ghc.haskell.org/trac/ghc/changeset/638e1aefae88045c30134cf7c69df3f893049263/ghc >--------------------------------------------------------------- commit 638e1aefae88045c30134cf7c69df3f893049263 Author: Sebastian Graf Date: Fri Feb 1 04:48:41 2019 -0500 Update user-settings.md with a pointer to `Packages` [skip ci] >--------------------------------------------------------------- 638e1aefae88045c30134cf7c69df3f893049263 hadrian/doc/user-settings.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index 6c6aab7..49e560c 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -107,6 +107,10 @@ path component, excluding any separators. Users can add and remove packages from particular build stages. As an example, below we add package `base` to Stage0 and remove package `haskeline` from Stage1: ```haskell +... +import Packages +... + userFlavour :: Flavour userFlavour = defaultFlavour { name = "user", packages = modifiedPackages } @@ -136,7 +140,7 @@ You can choose which integer library to use when builing GHC using the (default) and `integerSimple`. ```haskell userFlavour :: Flavour -userFlavour = defaultFlavour { name = "user", integerLibrary = integerSimple } +userFlavour = defaultFlavour { name = "user", integerLibrary = pure integerSimple } ``` ### Specifying the final stage to build From git at git.haskell.org Sat Feb 2 09:00:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:12 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note, wip/splice-parsing, wip/trac-16270: Remove ExnStr and ThrowsExn business (ef6b283) Message-ID: <20190202090012.35CB73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/exceptions-note,wip/splice-parsing,wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/ef6b28339b18597a2df1ce39116f1d4e4533804c/ghc >--------------------------------------------------------------- commit ef6b28339b18597a2df1ce39116f1d4e4533804c Author: Sebastian Graf Date: Fri Feb 1 06:46:32 2019 -0500 Remove ExnStr and ThrowsExn business >--------------------------------------------------------------- ef6b28339b18597a2df1ce39116f1d4e4533804c compiler/basicTypes/Demand.hs | 330 ++++++++------------- compiler/coreSyn/CoreArity.hs | 4 +- compiler/coreSyn/MkCore.hs | 5 +- compiler/prelude/primops.txt.pp | 15 +- compiler/simplCore/Simplify.hs | 4 +- compiler/stranal/WwLib.hs | 2 +- .../tests/deSugar/should_compile/T2431.stderr | 2 +- .../simplCore/should_compile/spec-inline.stderr | 2 +- testsuite/tests/stranal/should_run/T14171.hs | 16 + testsuite/tests/stranal/should_run/all.T | 1 + testsuite/tests/stranal/sigs/UnsatFun.stderr | 8 +- 11 files changed, 149 insertions(+), 240 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 ef6b28339b18597a2df1ce39116f1d4e4533804c From git at git.haskell.org Sat Feb 2 09:00:15 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:15 +0000 (UTC) Subject: [commit: ghc] wip/exceptions-note: Polished Note [Exceptions and strictness] (d8f7018) Message-ID: <20190202090015.478E63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exceptions-note Link : http://ghc.haskell.org/trac/ghc/changeset/d8f701886da00066b4fa10568bda88514dc69937/ghc >--------------------------------------------------------------- commit d8f701886da00066b4fa10568bda88514dc69937 Author: Sebastian Graf Date: Fri Feb 1 13:25:42 2019 +0100 Polished Note [Exceptions and strictness] [ci skip] >--------------------------------------------------------------- d8f701886da00066b4fa10568bda88514dc69937 compiler/basicTypes/Demand.hs | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 2b0b876..52bdf67 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -126,9 +126,9 @@ Note [Exceptions and strictness] We used to smart about catching exceptions, but we aren't anymore. See Trac #14998 for the way it's resolved at the moment. -Here's a historic break-down: +Here's a historic breakdown: -Appearently, exception handling prim-ops didn't used to have any special +Apparently, exception handling prim-ops didn't use to have any special strictness signatures, thus defaulting to topSig, which assumes they use their arguments lazily. Joachim was the first to realise that we could provide richer information. Thus, in 0558911f91c (Dec 13), he added signatures to @@ -142,25 +142,37 @@ of correctness, as Trac #10712 proved. So, back to 'lazyApply1Dmd' in 28638dfe79e (Dec 15). Motivated to reproduce the gains of 7c0fff4 without the breakage of Trac #10712, -Ben added a new 'catchArgDmd', which basically said to call its argument -strictly, but also swallow any thrown exceptions in 'postProcessDmdResult'. -This was realized by extending the 'Str' constructor of 'ArgStr' with a 'ExnStr' -field, indicating that it catches the exception, and adding a 'ThrowsExn' -constructor to the 'Termination' lattice as an element between 'Dunno' and -'Diverges'. Then along came Trac #11555 and finally #13330, so we had to revert -to 'lazyApply1Dmd' again in 701256df88c (Mar 17). +Ben opened Trac #11222. Simon made the demand analyser "understand catch" in +9915b656 (Jan 16) by adding a new 'catchArgDmd', which basically said to call +its argument strictly, but also swallow any thrown exceptions in +'postProcessDmdResult'. This was realized by extending the 'Str' constructor of +'ArgStr' with a 'ExnStr' field, indicating that it catches the exception, and +adding a 'ThrowsExn' constructor to the 'Termination' lattice as an element +between 'Dunno' and 'Diverges'. Then along came Trac #11555 and finally #13330, +so we had to revert to 'lazyApply1Dmd' again in 701256df88c (Mar 17). This left the other variants like 'catchRetry#' having 'catchArgDmd', which is where #14998 picked up. Item 1 was concerned with measuring the impact of also making `catchRetry#` and `catchSTM#` have 'lazyApply1Dmd'. The result was that -there was none; the performance gains stemmed the (change in) definition of -'catchException', the semantics of which would probably make the saner default -for 'catch'. We removed the last usages of 'catchArgDmd' in 00b8ecb7 (Apr 18). - -There was a lot of dead code resulting from that change, that we removed in this -commit (as of this writing): We got rid of 'ThrowsExn' and 'ExnStr' again and +there was none. We removed the last usages of 'catchArgDmd' in 00b8ecb7 +(Apr 18). There was a lot of dead code resulting from that change, that we +removed in ef6b283 (Jan 19): We got rid of 'ThrowsExn' and 'ExnStr' again and removed any code that was dealing with the peculiarities. +Where did the speed-ups vanish to? In Trac #14998, item 3 established that +turning 'catch#' strict in its first argument didn't bring back any of the +alleged performance benefits. Item 2 of that ticket finally found out that it +was entirely due to 'catchException's new (since Trac #11555) definition, which +was simply + + catchException !io handler = catch io handler + +While 'catchException' is arguably the saner semantics for 'catch', it is an +internal helper function in "GHC.IO". Its use in +"GHC.IO.Handle.Internals.do_operation" made for the huge allocation differences: +Remove the bang and you find the regressions we originally wanted to avoid with +'catchArgDmd'. See also #exceptions_and_strictness# in "GHC.IO". + So history keeps telling us that the only possibly correct strictness annotation for the first argument of 'catch#' is 'lazyApply1Dmd', because 'catch#' really is not strict in its argument: Just try this in GHCi From git at git.haskell.org Sat Feb 2 09:00:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:18 +0000 (UTC) Subject: [commit: ghc] wip/alp/hadrian-validate: wip (33663fe) Message-ID: <20190202090018.73B963A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/alp/hadrian-validate Link : http://ghc.haskell.org/trac/ghc/changeset/33663fe2db68e31f1a61fbb4c613751a26b1ee1e/ghc >--------------------------------------------------------------- commit 33663fe2db68e31f1a61fbb4c613751a26b1ee1e Author: Alp Mestanogullari Date: Fri Feb 1 18:52:27 2019 +0100 wip >--------------------------------------------------------------- 33663fe2db68e31f1a61fbb4c613751a26b1ee1e hadrian/src/Rules/Test.hs | 7 ++++++- hadrian/src/Settings/Builders/RunTest.hs | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs index f7d8d5e..870e615 100644 --- a/hadrian/src/Rules/Test.hs +++ b/hadrian/src/Rules/Test.hs @@ -47,9 +47,9 @@ testRules = do root -/- timeoutPath ~> timeoutProgBuilder "test" ~> do - -- needTestBuilders -- TODO : Should we remove the previosly generated config file? + needTestBuilders -- Prepare Ghc configuration file for input compiler. need [root -/- ghcConfigPath, root -/- timeoutPath] @@ -66,6 +66,10 @@ testRules = do makePath <- builderPath $ Make "" top <- topDirectory ghcFlags <- runTestGhcFlags + let ghciFlags = ghcFlags ++ unwords + [ "--interactive", "-v0", "-ignore-dot-ghci" + , "-fno-ghci-history" + ] -- where to get those from? checkPprPath <- needFile Stage0 checkPpr @@ -79,6 +83,7 @@ testRules = do setEnv "PYTHON" pythonPath setEnv "TEST_HC" ghcPath setEnv "TEST_HC_OPTS" ghcFlags + setEnv "TEST_HC_OPTS_INTERACTIVE" ghciFlags setEnv "CHECK_PPR" (top checkPprPath) setEnv "CHECK_API_ANNOTATIONS" (top annotationsPath) diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 05b6555..0862359 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -38,13 +38,15 @@ runTestGhcFlags = do -- Take flags to send to the Haskell compiler from test.mk. -- See: https://github.com/ghc/ghc/blob/master/testsuite/mk/test.mk#L37 unwords <$> sequence - [ pure " -dcore-lint -dcmm-lint -no-user-package-db -rtsopts" + [ pure "-dcore-lint -dstg-lint -dcmm-lint" + , pure "-no-user-package-db -rtsopts" , pure ghcOpts , pure ghcExtraFlags , ifMinGhcVer "711" "-fno-warn-missed-specialisations" , ifMinGhcVer "711" "-fshow-warning-groups" , ifMinGhcVer "801" "-fdiagnostics-color=never" , ifMinGhcVer "801" "-fno-diagnostics-show-caret" + , pure "-Werror=compat" , pure "-dno-debug-output" ] @@ -93,8 +95,9 @@ runTestBuilderArgs = builder RunTest ? do , pure ["--rootdir=" ++ test | test <- libTests] , arg "-e", arg $ "windows=" ++ show windows , arg "-e", arg $ "darwin=" ++ show darwin - , arg "-e", arg $ "config.local=" ++ - show (elem testGhc ["stage1", "stage2"]) + , arg "-e", arg $ "config.local=False" + , arg "-e", arg $ "config.exeext=" ++ + show (if windows then "exe" else "") , arg "-e", arg $ "config.cleanup=False" -- Don't clean up for now. , arg "-e", arg $ "config.compiler_debugged=" ++ quote (yesNo debugged) , arg "-e", arg $ "ghc_debugged=" ++ quote (yesNo debugged) From git at git.haskell.org Sat Feb 2 09:00:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:22 +0000 (UTC) Subject: [commit: ghc] wip/trac-16270: Report multiple errors (03b1eba) Message-ID: <20190202090022.7D6333A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/trac-16270 Link : http://ghc.haskell.org/trac/ghc/changeset/03b1eba80e0eb3146414a4d389b8205aa2f21161/ghc >--------------------------------------------------------------- commit 03b1eba80e0eb3146414a4d389b8205aa2f21161 Author: Vladislav Zavialov Date: Fri Feb 1 20:39:57 2019 +0300 Report multiple errors >--------------------------------------------------------------- 03b1eba80e0eb3146414a4d389b8205aa2f21161 compiler/parser/Lexer.x | 13 +++++++- compiler/parser/RdrHsSyn.hs | 36 ++++++++++------------ testsuite/tests/parser/should_fail/T16270.hs | 29 ++++++++++++++++++ testsuite/tests/parser/should_fail/T16270.stderr | 38 ++++++++++++++++++++++++ testsuite/tests/parser/should_fail/all.T | 1 + 5 files changed, 96 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 03b1eba80e0eb3146414a4d389b8205aa2f21161 From git at git.haskell.org Sat Feb 2 09:00:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Feb 2019 09:00:25 +0000 (UTC) Subject: [commit: ghc] wip/splice-parsing: Refactor splice_exp in Parser.y (846f2c9) Message-ID: <20190202090025.9618A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/splice-parsing Link : http://ghc.haskell.org/trac/ghc/changeset/846f2c918466f2b65af4aa56dd862dddb54b3613/ghc >--------------------------------------------------------------- commit 846f2c918466f2b65af4aa56dd862dddb54b3613 Author: Vladislav Zavialov Date: Fri Feb 1 09:25:45 2019 +0300 Refactor splice_exp in Parser.y >--------------------------------------------------------------- 846f2c918466f2b65af4aa56dd862dddb54b3613 compiler/basicTypes/SrcLoc.hs | 6 ++++++ compiler/hsSyn/HsUtils.hs | 14 +++----------- compiler/parser/Parser.y | 24 +++++++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs index 696395f..bcf2fcb 100644 --- a/compiler/basicTypes/SrcLoc.hs +++ b/compiler/basicTypes/SrcLoc.hs @@ -77,6 +77,9 @@ module SrcLoc ( getLoc, unLoc, unRealSrcSpan, getRealSrcSpan, + -- ** Modifying Located + mapLoc, + -- ** Combining and comparing Located values eqLocated, cmpLocated, combineLocs, addCLoc, leftmost_smallest, leftmost_largest, rightmost, @@ -527,6 +530,9 @@ data GenLocated l e = L l e type Located = GenLocated SrcSpan type RealLocated = GenLocated RealSrcSpan +mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b +mapLoc = fmap + unLoc :: HasSrcSpan a => a -> SrcSpanLess a unLoc (dL->L _ e) = e diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 2219ca6..febd5ac 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -67,7 +67,7 @@ module HsUtils( unitRecStmtTc, -- Template Haskell - mkHsSpliceTy, mkHsSpliceE, mkHsSpliceTE, mkUntypedSplice, + mkUntypedSplice, mkTypedSplice, mkHsQuasiQuote, unqualQuasiQuote, -- Collecting binders @@ -346,16 +346,8 @@ unqualSplice = mkRdrUnqual (mkVarOccFS (fsLit "splice")) mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs mkUntypedSplice hasParen e = HsUntypedSplice noExt hasParen unqualSplice e -mkHsSpliceE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs -mkHsSpliceE hasParen e = HsSpliceE noExt (mkUntypedSplice hasParen e) - -mkHsSpliceTE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs -mkHsSpliceTE hasParen e - = HsSpliceE noExt (HsTypedSplice noExt hasParen unqualSplice e) - -mkHsSpliceTy :: SpliceDecoration -> LHsExpr GhcPs -> HsType GhcPs -mkHsSpliceTy hasParen e = HsSpliceTy noExt - (HsUntypedSplice noExt hasParen unqualSplice e) +mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs +mkTypedSplice hasParen e = HsTypedSplice noExt hasParen unqualSplice e mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs mkHsQuasiQuote quoter span quote diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 0751567..ce5c523 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2025,12 +2025,8 @@ atype :: { LHsType GhcPs } [mo $1,mc $3] } | '[' ktype ']' {% ams (sLL $1 $> $ HsListTy noExt $2) [mos $1,mcs $3] } | '(' ktype ')' {% ams (sLL $1 $> $ HsParTy noExt $2) [mop $1,mcp $3] } - | quasiquote { sL1 $1 (HsSpliceTy noExt (unLoc $1) ) } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTy HasParens $2) - [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_SPLICE {%ams (sLL $1 $> $ mkHsSpliceTy HasDollar $ sL1 $1 $ HsVar noExt $ - (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1)))) - [mj AnnThIdSplice $1] } + | quasiquote { mapLoc (HsSpliceTy noExt) $1 } + | splice_untyped { mapLoc (HsSpliceTy noExt) $1 } -- see Note [Promotion] for the followings | SIMPLEQUOTE qcon_nowiredlist {% ams (sLL $1 $> $ HsTyVar noExt IsPromoted $2) [mj AnnSimpleQuote $1,mj AnnName $2] } | SIMPLEQUOTE '(' ktype ',' comma_types1 ')' @@ -2749,17 +2745,23 @@ aexp2 :: { LHsExpr GhcPs } [mu AnnOpenB $1,mu AnnCloseB $4] } splice_exp :: { LHsExpr GhcPs } - : TH_ID_SPLICE {% ams (sL1 $1 $ mkHsSpliceE HasDollar + : splice_untyped { mapLoc (HsSpliceE noExt) $1 } + | splice_typed { mapLoc (HsSpliceE noExt) $1 } + +splice_untyped :: { Located (HsSplice GhcPs) } + : TH_ID_SPLICE {% ams (sL1 $1 $ mkUntypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1))))) [mj AnnThIdSplice $1] } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceE HasParens $2) + | '$(' exp ')' {% ams (sLL $1 $> $ mkUntypedSplice HasParens $2) [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkHsSpliceTE HasDollar + +splice_typed :: { Located (HsSplice GhcPs) } + : TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkTypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_TY_SPLICE $1))))) [mj AnnThIdTySplice $1] } - | '$$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTE HasParens $2) + | '$$(' exp ')' {% ams (sLL $1 $> $ mkTypedSplice HasParens $2) [mj AnnOpenPTE $1,mj AnnCloseP $3] } cmdargs :: { [LHsCmdTop GhcPs] } @@ -3810,7 +3812,7 @@ warnSpaceAfterBang span = do -- When two single quotes don't followed by tyvar or gtycon, we report the -- error as empty character literal, or TH quote that missing proper type -- variable or constructor. See Trac #13450. -reportEmptyDoubleQuotes :: SrcSpan -> P (Located (HsExpr GhcPs)) +reportEmptyDoubleQuotes :: SrcSpan -> P a reportEmptyDoubleQuotes span = do thQuotes <- getBit ThQuotesBit if thQuotes From git at git.haskell.org Sun Feb 3 11:25:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:18 +0000 (UTC) Subject: [commit: ghc] branch 'wip/exp-cmd-frame' created Message-ID: <20190203112518.355313A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/exp-cmd-frame Referencing: f5fbe75ec2f85fabe34acea12d82ab8c7d66969e From git at git.haskell.org Sun Feb 3 11:25:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:20 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16265' created Message-ID: <20190203112520.30E183A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16265 Referencing: 3200c30f1f7af2a3fa54773129cb21a5c72527d2 From git at git.haskell.org Sun Feb 3 11:25:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:22 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ppr-cmd-space' created Message-ID: <20190203112522.339653A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ppr-cmd-space Referencing: a4cd9cee822394fbee300300d6a248e8fa51ac94 From git at git.haskell.org Sun Feb 3 11:25:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:24 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16227' created Message-ID: <20190203112524.334A13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16227 Referencing: 15104d331a98ef1c7717a4a64abab9765daa8df3 From git at git.haskell.org Sun Feb 3 11:25:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:26 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16258' created Message-ID: <20190203112526.346CD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16258 Referencing: bc73f4939587240e40305fa22a39742ff1e0410b From git at git.haskell.org Sun Feb 3 11:25:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:30 +0000 (UTC) Subject: [commit: ghc] wip/T16227, wip/T16258, wip/T16265, wip/exp-cmd-frame, wip/ppr-cmd-space: Reject oversaturated VKAs in type family equations (f0cd728) Message-ID: <20190203112530.8D3353A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16227,wip/T16258,wip/T16265,wip/exp-cmd-frame,wip/ppr-cmd-space Link : http://ghc.haskell.org/trac/ghc/changeset/f0cd728fde9bb582930a616cff8d0c5a178c5e14/ghc >--------------------------------------------------------------- commit f0cd728fde9bb582930a616cff8d0c5a178c5e14 Author: Ryan Scott Date: Fri Feb 1 19:10:55 2019 -0500 Reject oversaturated VKAs in type family equations >--------------------------------------------------------------- f0cd728fde9bb582930a616cff8d0c5a178c5e14 compiler/typecheck/TcTyClsDecls.hs | 3 + compiler/typecheck/TcValidity.hs | 68 +++++++++++++++++++++- testsuite/tests/typecheck/should_compile/all.T | 1 - .../{should_compile => should_fail}/T15793.hs | 0 .../tests/typecheck/should_fail/T15793.stderr | 5 ++ testsuite/tests/typecheck/should_fail/T16255.hs | 21 +++++++ .../tests/typecheck/should_fail/T16255.stderr | 10 ++++ testsuite/tests/typecheck/should_fail/all.T | 2 + 8 files changed, 108 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 f0cd728fde9bb582930a616cff8d0c5a178c5e14 From git at git.haskell.org Sun Feb 3 11:25:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:33 +0000 (UTC) Subject: [commit: ghc] wip/exp-cmd-frame: Refactor splice_exp in Parser.y (04e65d2) Message-ID: <20190203112533.92EEB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-cmd-frame Link : http://ghc.haskell.org/trac/ghc/changeset/04e65d289405563dc0f055973d689a2551bbbdbb/ghc >--------------------------------------------------------------- commit 04e65d289405563dc0f055973d689a2551bbbdbb Author: Vladislav Zavialov Date: Fri Feb 1 09:25:45 2019 +0300 Refactor splice_exp in Parser.y >--------------------------------------------------------------- 04e65d289405563dc0f055973d689a2551bbbdbb compiler/basicTypes/SrcLoc.hs | 6 ++++++ compiler/hsSyn/HsUtils.hs | 11 ++++++----- compiler/parser/Parser.y | 24 +++++++++++++----------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs index 696395f..bcf2fcb 100644 --- a/compiler/basicTypes/SrcLoc.hs +++ b/compiler/basicTypes/SrcLoc.hs @@ -77,6 +77,9 @@ module SrcLoc ( getLoc, unLoc, unRealSrcSpan, getRealSrcSpan, + -- ** Modifying Located + mapLoc, + -- ** Combining and comparing Located values eqLocated, cmpLocated, combineLocs, addCLoc, leftmost_smallest, leftmost_largest, rightmost, @@ -527,6 +530,9 @@ data GenLocated l e = L l e type Located = GenLocated SrcSpan type RealLocated = GenLocated RealSrcSpan +mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b +mapLoc = fmap + unLoc :: HasSrcSpan a => a -> SrcSpanLess a unLoc (dL->L _ e) = e diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 2219ca6..80195e1 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -67,7 +67,7 @@ module HsUtils( unitRecStmtTc, -- Template Haskell - mkHsSpliceTy, mkHsSpliceE, mkHsSpliceTE, mkUntypedSplice, + mkHsSpliceTy, mkHsSpliceE, mkHsSpliceTE, mkUntypedSplice, mkTypedSplice, mkHsQuasiQuote, unqualQuasiQuote, -- Collecting binders @@ -346,16 +346,17 @@ unqualSplice = mkRdrUnqual (mkVarOccFS (fsLit "splice")) mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs mkUntypedSplice hasParen e = HsUntypedSplice noExt hasParen unqualSplice e +mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs +mkTypedSplice hasParen e = HsTypedSplice noExt hasParen unqualSplice e + mkHsSpliceE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs mkHsSpliceE hasParen e = HsSpliceE noExt (mkUntypedSplice hasParen e) mkHsSpliceTE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs -mkHsSpliceTE hasParen e - = HsSpliceE noExt (HsTypedSplice noExt hasParen unqualSplice e) +mkHsSpliceTE hasParen e = HsSpliceE noExt (mkTypedSplice hasParen e) mkHsSpliceTy :: SpliceDecoration -> LHsExpr GhcPs -> HsType GhcPs -mkHsSpliceTy hasParen e = HsSpliceTy noExt - (HsUntypedSplice noExt hasParen unqualSplice e) +mkHsSpliceTy hasParen e = HsSpliceTy noExt (mkUntypedSplice hasParen e) mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs mkHsQuasiQuote quoter span quote diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 0751567..ce5c523 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2025,12 +2025,8 @@ atype :: { LHsType GhcPs } [mo $1,mc $3] } | '[' ktype ']' {% ams (sLL $1 $> $ HsListTy noExt $2) [mos $1,mcs $3] } | '(' ktype ')' {% ams (sLL $1 $> $ HsParTy noExt $2) [mop $1,mcp $3] } - | quasiquote { sL1 $1 (HsSpliceTy noExt (unLoc $1) ) } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTy HasParens $2) - [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_SPLICE {%ams (sLL $1 $> $ mkHsSpliceTy HasDollar $ sL1 $1 $ HsVar noExt $ - (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1)))) - [mj AnnThIdSplice $1] } + | quasiquote { mapLoc (HsSpliceTy noExt) $1 } + | splice_untyped { mapLoc (HsSpliceTy noExt) $1 } -- see Note [Promotion] for the followings | SIMPLEQUOTE qcon_nowiredlist {% ams (sLL $1 $> $ HsTyVar noExt IsPromoted $2) [mj AnnSimpleQuote $1,mj AnnName $2] } | SIMPLEQUOTE '(' ktype ',' comma_types1 ')' @@ -2749,17 +2745,23 @@ aexp2 :: { LHsExpr GhcPs } [mu AnnOpenB $1,mu AnnCloseB $4] } splice_exp :: { LHsExpr GhcPs } - : TH_ID_SPLICE {% ams (sL1 $1 $ mkHsSpliceE HasDollar + : splice_untyped { mapLoc (HsSpliceE noExt) $1 } + | splice_typed { mapLoc (HsSpliceE noExt) $1 } + +splice_untyped :: { Located (HsSplice GhcPs) } + : TH_ID_SPLICE {% ams (sL1 $1 $ mkUntypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1))))) [mj AnnThIdSplice $1] } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceE HasParens $2) + | '$(' exp ')' {% ams (sLL $1 $> $ mkUntypedSplice HasParens $2) [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkHsSpliceTE HasDollar + +splice_typed :: { Located (HsSplice GhcPs) } + : TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkTypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_TY_SPLICE $1))))) [mj AnnThIdTySplice $1] } - | '$$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTE HasParens $2) + | '$$(' exp ')' {% ams (sLL $1 $> $ mkTypedSplice HasParens $2) [mj AnnOpenPTE $1,mj AnnCloseP $3] } cmdargs :: { [LHsCmdTop GhcPs] } @@ -3810,7 +3812,7 @@ warnSpaceAfterBang span = do -- When two single quotes don't followed by tyvar or gtycon, we report the -- error as empty character literal, or TH quote that missing proper type -- variable or constructor. See Trac #13450. -reportEmptyDoubleQuotes :: SrcSpan -> P (Located (HsExpr GhcPs)) +reportEmptyDoubleQuotes :: SrcSpan -> P a reportEmptyDoubleQuotes span = do thQuotes <- getBit ThQuotesBit if thQuotes From git at git.haskell.org Sun Feb 3 11:25:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:36 +0000 (UTC) Subject: [commit: ghc] wip/exp-cmd-frame: WIP: ECFrame (f5fbe75) Message-ID: <20190203112536.A2B4D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-cmd-frame Link : http://ghc.haskell.org/trac/ghc/changeset/f5fbe75ec2f85fabe34acea12d82ab8c7d66969e/ghc >--------------------------------------------------------------- commit f5fbe75ec2f85fabe34acea12d82ab8c7d66969e Author: Vladislav Zavialov Date: Fri Feb 1 20:03:54 2019 +0300 WIP: ECFrame >--------------------------------------------------------------- f5fbe75ec2f85fabe34acea12d82ab8c7d66969e compiler/parser/Lexer.x | 13 +- compiler/parser/Parser.y | 365 +++++++++++++++++++++++++++----------------- compiler/parser/RdrHsSyn.hs | 52 ++++++- 3 files changed, 290 insertions(+), 140 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 f5fbe75ec2f85fabe34acea12d82ab8c7d66969e From git at git.haskell.org Sun Feb 3 11:25:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:39 +0000 (UTC) Subject: [commit: ghc] wip/T16258: Cmm: Promote stack arguments to word size (bc73f49) Message-ID: <20190203112539.AAF793A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16258 Link : http://ghc.haskell.org/trac/ghc/changeset/bc73f4939587240e40305fa22a39742ff1e0410b/ghc >--------------------------------------------------------------- commit bc73f4939587240e40305fa22a39742ff1e0410b Author: Peter Trommler Date: Thu Jan 31 09:43:08 2019 +0100 Cmm: Promote stack arguments to word size >--------------------------------------------------------------- bc73f4939587240e40305fa22a39742ff1e0410b compiler/cmm/MkGraph.hs | 57 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs index bcd03bf..4677527 100644 --- a/compiler/cmm/MkGraph.hs +++ b/compiler/cmm/MkGraph.hs @@ -327,7 +327,20 @@ copyIn dflags conv area formals extra_stk ci (reg, RegisterParam r) = CmmAssign (CmmLocal reg) (CmmReg (CmmGlobal r)) - ci (reg, StackParam off) = + ci (reg, StackParam off) + | isBitsType $ localRegType reg = + let + stack_slot = (CmmLoad (CmmStackSlot area off) (cmmBits $ wordWidth dflags)) + local = CmmLocal reg + width = cmmRegWidth dflags local + expr + | width == wordWidth dflags = stack_slot + | width < wordWidth dflags = + CmmMachOp (MO_XX_Conv (wordWidth dflags) width) [stack_slot] + | otherwise = panic "Parameter width greater than word width" + in CmmAssign local expr + + | otherwise = CmmAssign (CmmLocal reg) (CmmLoad (CmmStackSlot area off) ty) where ty = localRegType reg @@ -362,23 +375,23 @@ copyOutOflow dflags conv transfer area actuals updfr_off extra_stack_stuff where (regs, graph) = foldr co ([], mkNop) (setRA ++ args ++ stack_params) - -- See Note [Width of parameters] - co (v, RegisterParam r@(VanillaReg {})) (rs, ms) = - let width = cmmExprWidth dflags v - value - | width == wordWidth dflags = v - | width < wordWidth dflags = - CmmMachOp (MO_XX_Conv width (wordWidth dflags)) [v] - | otherwise = panic "Parameter width greater than word width" - - in (r:rs, mkAssign (CmmGlobal r) value <*> ms) - - -- Non VanillaRegs co (v, RegisterParam r) (rs, ms) = - (r:rs, mkAssign (CmmGlobal r) v <*> ms) + (r:rs, mkAssign (CmmGlobal r) (value v) <*> ms) co (v, StackParam off) (rs, ms) - = (rs, mkStore (CmmStackSlot area off) v <*> ms) + = (rs, mkStore (CmmStackSlot area off) (value v) <*> ms) + + -- See Note [Width of parameters] + value v + | isBitsType $ cmmExprType dflags v + = let width = cmmExprWidth dflags v + v' + | width == wordWidth dflags = v + | width < wordWidth dflags = + CmmMachOp (MO_XX_Conv width (wordWidth dflags)) [v] + | otherwise = panic "Parameter width greater than word width" + in v' + | otherwise = v (setRA, init_offset) = case area of @@ -405,22 +418,26 @@ copyOutOflow dflags conv transfer area actuals updfr_off extra_stack_stuff -- Note [Width of parameters] -- --- Consider passing a small (< word width) primitive like Int8# to a function --- through a register. It's actually non-trivial to do this without --- extending/narrowing: +-- Consider passing a small (< word width) primitive like Int8# to a function. +-- It's actually non-trivial to do this without extending/narrowing: -- * Global registers are considered to have native word width (i.e., 64-bits on --- x86-64), so CmmLint would complain if we assigne an 8-bit parameter to a +-- x86-64), so CmmLint would complain if we assigned an 8-bit parameter to a -- global register. -- * Same problem exists with LLVM IR. -- * Lowering gets harder since on x86-32 not every register exposes its lower -- 8 bits (e.g., for %eax we can use %al, but there isn't a corresponding -- 8-bit register for %edi). So we would either need to extend/narrow anyway, -- or complicate the calling convention. +-- * Passing a small integer in a stack slot, which has native word width, +-- requires extending to word width when writing to the stack and narrowing +-- when reading off the stack (see #16258). -- So instead, we always extend every parameter smaller than native word width -- in copyOutOflow and then truncate it back to the expected width in copyIn. -- Note that we do this in cmm using MO_XX_Conv to avoid requiring -- zero-/sign-extending - it's up to a backend to handle this in a most --- efficient way (e.g., a simple register move) +-- efficient way (e.g., a simple register move or a smaller size store). +-- This convention (of ignoring the upper bits) is different from some C ABIs, +-- e.g. all PowerPC ELF ABIs, that require sign or zero extending parameters. -- -- There was some discussion about this on this PR: -- https://github.com/ghc-proposals/ghc-proposals/pull/74 From git at git.haskell.org Sun Feb 3 11:25:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:42 +0000 (UTC) Subject: [commit: ghc] wip/ppr-cmd-space: Fix missing space in ppr_cmd for HsCmdArrForm (a4cd9ce) Message-ID: <20190203112542.AD37B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ppr-cmd-space Link : http://ghc.haskell.org/trac/ghc/changeset/a4cd9cee822394fbee300300d6a248e8fa51ac94/ghc >--------------------------------------------------------------- commit a4cd9cee822394fbee300300d6a248e8fa51ac94 Author: Vladislav Zavialov Date: Sat Feb 2 17:30:05 2019 +0300 Fix missing space in ppr_cmd for HsCmdArrForm >--------------------------------------------------------------- a4cd9cee822394fbee300300d6a248e8fa51ac94 compiler/hsSyn/HsExpr.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index bae29b0..01ed872 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -1532,8 +1532,8 @@ ppr_cmd (HsCmdArrForm _ (L _ (HsConLikeOut _ c)) Infix _ [arg1, arg2]) = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc (conLikeName c) , pprCmdArg (unLoc arg2)]) ppr_cmd (HsCmdArrForm _ op _ _ args) - = hang (text "(|" <> ppr_lexpr op) - 4 (sep (map (pprCmdArg.unLoc) args) <> text "|)") + = hang (text "(|" <+> ppr_lexpr op) + 4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)") ppr_cmd (XCmd x) = ppr x pprCmdArg :: (OutputableBndrId (GhcPass p)) => HsCmdTop (GhcPass p) -> SDoc From git at git.haskell.org Sun Feb 3 11:25:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:45 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Update user-settings.md with a pointer to `Packages` (6dae133) Message-ID: <20190203112545.B385F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/6dae133fc049fe7a91414cb4ff1afe2db8e91984/ghc >--------------------------------------------------------------- commit 6dae133fc049fe7a91414cb4ff1afe2db8e91984 Author: Sebastian Graf Date: Fri Feb 1 04:48:41 2019 -0500 Update user-settings.md with a pointer to `Packages` [skip ci] >--------------------------------------------------------------- 6dae133fc049fe7a91414cb4ff1afe2db8e91984 hadrian/doc/user-settings.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index 6c6aab7..49e560c 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -107,6 +107,10 @@ path component, excluding any separators. Users can add and remove packages from particular build stages. As an example, below we add package `base` to Stage0 and remove package `haskeline` from Stage1: ```haskell +... +import Packages +... + userFlavour :: Flavour userFlavour = defaultFlavour { name = "user", packages = modifiedPackages } @@ -136,7 +140,7 @@ You can choose which integer library to use when builing GHC using the (default) and `integerSimple`. ```haskell userFlavour :: Flavour -userFlavour = defaultFlavour { name = "user", integerLibrary = integerSimple } +userFlavour = defaultFlavour { name = "user", integerLibrary = pure integerSimple } ``` ### Specifying the final stage to build From git at git.haskell.org Sun Feb 3 11:25:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:48 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Polished Note [Exceptions and strictness] (97231c3) Message-ID: <20190203112548.BE8CD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/97231c3531d01aa6a459f32e570095404b3ea882/ghc >--------------------------------------------------------------- commit 97231c3531d01aa6a459f32e570095404b3ea882 Author: Sebastian Graf Date: Fri Feb 1 13:25:42 2019 +0100 Polished Note [Exceptions and strictness] [ci skip] >--------------------------------------------------------------- 97231c3531d01aa6a459f32e570095404b3ea882 compiler/basicTypes/Demand.hs | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 2b0b876..52bdf67 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -126,9 +126,9 @@ Note [Exceptions and strictness] We used to smart about catching exceptions, but we aren't anymore. See Trac #14998 for the way it's resolved at the moment. -Here's a historic break-down: +Here's a historic breakdown: -Appearently, exception handling prim-ops didn't used to have any special +Apparently, exception handling prim-ops didn't use to have any special strictness signatures, thus defaulting to topSig, which assumes they use their arguments lazily. Joachim was the first to realise that we could provide richer information. Thus, in 0558911f91c (Dec 13), he added signatures to @@ -142,25 +142,37 @@ of correctness, as Trac #10712 proved. So, back to 'lazyApply1Dmd' in 28638dfe79e (Dec 15). Motivated to reproduce the gains of 7c0fff4 without the breakage of Trac #10712, -Ben added a new 'catchArgDmd', which basically said to call its argument -strictly, but also swallow any thrown exceptions in 'postProcessDmdResult'. -This was realized by extending the 'Str' constructor of 'ArgStr' with a 'ExnStr' -field, indicating that it catches the exception, and adding a 'ThrowsExn' -constructor to the 'Termination' lattice as an element between 'Dunno' and -'Diverges'. Then along came Trac #11555 and finally #13330, so we had to revert -to 'lazyApply1Dmd' again in 701256df88c (Mar 17). +Ben opened Trac #11222. Simon made the demand analyser "understand catch" in +9915b656 (Jan 16) by adding a new 'catchArgDmd', which basically said to call +its argument strictly, but also swallow any thrown exceptions in +'postProcessDmdResult'. This was realized by extending the 'Str' constructor of +'ArgStr' with a 'ExnStr' field, indicating that it catches the exception, and +adding a 'ThrowsExn' constructor to the 'Termination' lattice as an element +between 'Dunno' and 'Diverges'. Then along came Trac #11555 and finally #13330, +so we had to revert to 'lazyApply1Dmd' again in 701256df88c (Mar 17). This left the other variants like 'catchRetry#' having 'catchArgDmd', which is where #14998 picked up. Item 1 was concerned with measuring the impact of also making `catchRetry#` and `catchSTM#` have 'lazyApply1Dmd'. The result was that -there was none; the performance gains stemmed the (change in) definition of -'catchException', the semantics of which would probably make the saner default -for 'catch'. We removed the last usages of 'catchArgDmd' in 00b8ecb7 (Apr 18). - -There was a lot of dead code resulting from that change, that we removed in this -commit (as of this writing): We got rid of 'ThrowsExn' and 'ExnStr' again and +there was none. We removed the last usages of 'catchArgDmd' in 00b8ecb7 +(Apr 18). There was a lot of dead code resulting from that change, that we +removed in ef6b283 (Jan 19): We got rid of 'ThrowsExn' and 'ExnStr' again and removed any code that was dealing with the peculiarities. +Where did the speed-ups vanish to? In Trac #14998, item 3 established that +turning 'catch#' strict in its first argument didn't bring back any of the +alleged performance benefits. Item 2 of that ticket finally found out that it +was entirely due to 'catchException's new (since Trac #11555) definition, which +was simply + + catchException !io handler = catch io handler + +While 'catchException' is arguably the saner semantics for 'catch', it is an +internal helper function in "GHC.IO". Its use in +"GHC.IO.Handle.Internals.do_operation" made for the huge allocation differences: +Remove the bang and you find the regressions we originally wanted to avoid with +'catchArgDmd'. See also #exceptions_and_strictness# in "GHC.IO". + So history keeps telling us that the only possibly correct strictness annotation for the first argument of 'catch#' is 'lazyApply1Dmd', because 'catch#' really is not strict in its argument: Just try this in GHCi From git at git.haskell.org Sun Feb 3 11:25:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:51 +0000 (UTC) Subject: [commit: ghc] wip/T16227: testsuite: Skip T15897 in unregisterised way (a4cee71) Message-ID: <20190203112551.BF3A83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16227 Link : http://ghc.haskell.org/trac/ghc/changeset/a4cee7142bc1b5bd19be28fdd88fa45c099e0790/ghc >--------------------------------------------------------------- commit a4cee7142bc1b5bd19be28fdd88fa45c099e0790 Author: Ben Gamari Date: Sat Feb 2 12:52:21 2019 -0500 testsuite: Skip T15897 in unregisterised way As noted in #16227 this test routinely times out when run in the unregisterised way. See also #15467. >--------------------------------------------------------------- a4cee7142bc1b5bd19be28fdd88fa45c099e0790 testsuite/tests/profiling/should_run/all.T | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index f5f696e..f76b8f9 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -146,5 +146,8 @@ test('T12962', [], compile_and_run, ['']) test('T14257', [], makefile_test, ['T14257']) test('T15897', - [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2)], + [extra_ways(['profasm']), only_ways(['profasm']), + run_timeout_multiplier(2), + # Fragile in unregisterised way (#15467, #16227) + when(unregisterised(), skip)], makefile_test, ['T15897']) From git at git.haskell.org Sun Feb 3 11:25:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:54 +0000 (UTC) Subject: [commit: ghc] wip/T16227: testsuite: Use makefile_test for T16212 (15104d3) Message-ID: <20190203112554.C398B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16227 Link : http://ghc.haskell.org/trac/ghc/changeset/15104d331a98ef1c7717a4a64abab9765daa8df3/ghc >--------------------------------------------------------------- commit 15104d331a98ef1c7717a4a64abab9765daa8df3 Author: Ben Gamari Date: Sat Feb 2 14:35:29 2019 -0500 testsuite: Use makefile_test for T16212 >--------------------------------------------------------------- 15104d331a98ef1c7717a4a64abab9765daa8df3 testsuite/tests/ghc-api/annotations/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 8002630..212e218 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -61,4 +61,4 @@ test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) # Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212 test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212']) + ignore_stderr], makefile_test, ['T16212']) From git at git.haskell.org Sun Feb 3 11:25:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:25:57 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Bump hsc2hs for removed unused match (45bd04d) Message-ID: <20190203112557.C93C03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/45bd04d6fde909c66c2ab2347724f36bf2590e6f/ghc >--------------------------------------------------------------- commit 45bd04d6fde909c66c2ab2347724f36bf2590e6f Author: Sebastian Graf Date: Fri Feb 1 12:43:27 2019 +0100 Bump hsc2hs for removed unused match >--------------------------------------------------------------- 45bd04d6fde909c66c2ab2347724f36bf2590e6f utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index fac8b62..efb556c 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d6 +Subproject commit efb556cc2689cae42abadae87d778ae20fbc0a14 From git at git.haskell.org Sun Feb 3 11:26:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:26:00 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Remove unused imports (558550a) Message-ID: <20190203112600.CF7AE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/558550a671f9be2207aeaf4f60f607236ccb840f/ghc >--------------------------------------------------------------- commit 558550a671f9be2207aeaf4f60f607236ccb840f Author: Sebastian Graf Date: Wed Jan 30 13:59:10 2019 +0100 Remove unused imports >--------------------------------------------------------------- 558550a671f9be2207aeaf4f60f607236ccb840f compiler/nativeGen/X86/RegInfo.hs | 3 --- ghc/Main.hs | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/nativeGen/X86/RegInfo.hs b/compiler/nativeGen/X86/RegInfo.hs index 7ca0c0c..339fdd7 100644 --- a/compiler/nativeGen/X86/RegInfo.hs +++ b/compiler/nativeGen/X86/RegInfo.hs @@ -21,9 +21,6 @@ import Unique import UniqFM import X86.Regs -import Debug.Trace -import Numeric (showHex) - mkVirtualReg :: Unique -> Format -> VirtualReg mkVirtualReg u format diff --git a/ghc/Main.hs b/ghc/Main.hs index 456ff90..2202f71 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -31,7 +31,7 @@ import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings ) -- Frontend plugins #if defined(GHCI) -import DynamicLoading ( loadFrontendPlugin ) +import DynamicLoading ( loadFrontendPlugin, initializePlugins ) import Plugins #else import DynamicLoading ( pluginError ) @@ -56,7 +56,6 @@ import Util import Panic import UniqSupply import MonadUtils ( liftIO ) -import DynamicLoading ( initializePlugins ) -- Imports for --abi-hash import LoadIface ( loadUserInterface ) From git at git.haskell.org Sun Feb 3 11:26:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:26:03 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Turn on -Werror when validating (2d79cd1) Message-ID: <20190203112603.D11473A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/2d79cd152161ec090f8408ef3b499cd48231d498/ghc >--------------------------------------------------------------- commit 2d79cd152161ec090f8408ef3b499cd48231d498 Author: Matthew Pickering Date: Wed Jan 30 08:29:26 2019 -0500 Turn on -Werror when validating >--------------------------------------------------------------- 2d79cd152161ec090f8408ef3b499cd48231d498 .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8497632..f225f1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -92,7 +92,7 @@ validate-x86_64-linux-deb8-hadrian: - ./configure $CONFIGURE_ARGS - | THREADS=`mk/detect-cpu-count.sh` - make V=0 -j$THREADS + make V=0 -j$THREADS WERROR=-Werror - | make binary-dist TAR_COMP_OPTS="-1" mv ghc-*.tar.xz ghc.tar.xz From git at git.haskell.org Sun Feb 3 11:26:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:26:06 +0000 (UTC) Subject: [commit: ghc] wip/T16265: Turn on -Wno-unused-imports in make build system (71dae4e) Message-ID: <20190203112606.D344B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/71dae4eb1a4891fc1a428caf70a06830864ffdc3/ghc >--------------------------------------------------------------- commit 71dae4eb1a4891fc1a428caf70a06830864ffdc3 Author: Matthew Pickering Date: Fri Feb 1 19:10:07 2019 +0000 Turn on -Wno-unused-imports in make build system This mirrors Hadrian and it good enough to get us unstuck. >--------------------------------------------------------------- 71dae4eb1a4891fc1a428caf70a06830864ffdc3 mk/warnings.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mk/warnings.mk b/mk/warnings.mk index 0ae81bf..9775df7 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -122,6 +122,9 @@ libraries/parsec_dist-install_EXTRA_HC_OPTS += -Wno-name-shadowing -Wno-unused-m libraries/parsec_dist-install_EXTRA_HC_OPTS += -Wno-unused-do-bind -Wno-missing-signatures libraries/parsec_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports -Wno-type-defaults +# text warns with integer-simple +libraries/text_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports + # Turn of trustworthy-safe warning libraries/base_dist-install_EXTRA_HC_OPTS += -Wno-trustworthy-safe libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -Wno-trustworthy-safe From git at git.haskell.org Sun Feb 3 11:26:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Feb 2019 11:26:10 +0000 (UTC) Subject: [commit: ghc] wip/T16265: API Annotations: parens anns discarded for `(*)` operator (3200c30) Message-ID: <20190203112610.2DAFF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16265 Link : http://ghc.haskell.org/trac/ghc/changeset/3200c30f1f7af2a3fa54773129cb21a5c72527d2/ghc >--------------------------------------------------------------- commit 3200c30f1f7af2a3fa54773129cb21a5c72527d2 Author: Alan Zimmerman Date: Sat Feb 2 16:29:05 2019 +0200 API Annotations: parens anns discarded for `(*)` operator The patch from ​https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Closes #16265 >--------------------------------------------------------------- 3200c30f1f7af2a3fa54773129cb21a5c72527d2 compiler/parser/RdrHsSyn.hs | 4 +-- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ .../annotations/StarBinderAnns.hs} | 0 .../ghc-api/annotations/StarBinderAnns.stdout | 36 ++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/all.T | 7 +++-- 5 files changed, 46 insertions(+), 5 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 45fc5a0..13817d8 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -959,10 +959,10 @@ checkTyClHdr is_cls ty goL (dL->L l ty) acc ann fix = go l ty acc ann fix -- workaround to define '*' despite StarIsType - go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix + go lp (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") - ; return (cL l (Unqual name), acc, fix, ann) } + ; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) } go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix | isRdrTc tc = return (cL l tc, acc, fix, ann) diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 2478f29..2eba3eb 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -149,3 +149,7 @@ T15303: .PHONY: T16212 T16212: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16212.hs + +.PHONY: StarBinderAnns +StarBinderAnns: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" StarBinderAnns.hs diff --git a/testsuite/tests/warnings/should_compile/StarBinder.hs b/testsuite/tests/ghc-api/annotations/StarBinderAnns.hs similarity index 100% copy from testsuite/tests/warnings/should_compile/StarBinder.hs copy to testsuite/tests/ghc-api/annotations/StarBinderAnns.hs diff --git a/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout new file mode 100644 index 0000000..d75f30a --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout @@ -0,0 +1,36 @@ +---Unattached Annotation Problems (should be empty list)--- +[] +---Ann before enclosing span problem (should be empty list)--- +[ + +] + +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((StarBinderAnns.hs:1:1,AnnModule), [StarBinderAnns.hs:4:1-6]), +((StarBinderAnns.hs:1:1,AnnWhere), [StarBinderAnns.hs:4:23-27]), +((StarBinderAnns.hs:4:10-21,AnnCloseP), [StarBinderAnns.hs:4:21]), +((StarBinderAnns.hs:4:10-21,AnnOpenP), [StarBinderAnns.hs:4:10]), +((StarBinderAnns.hs:4:11-20,AnnType), [StarBinderAnns.hs:4:11-14]), +((StarBinderAnns.hs:4:16-20,AnnCloseP), [StarBinderAnns.hs:4:20]), +((StarBinderAnns.hs:4:16-20,AnnOpenP), [StarBinderAnns.hs:4:16]), +((StarBinderAnns.hs:4:16-20,AnnVal), [StarBinderAnns.hs:4:17-19]), +((StarBinderAnns.hs:6:1-19,AnnCloseC), [StarBinderAnns.hs:6:50]), +((StarBinderAnns.hs:6:1-19,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:1-19,AnnFamily), [StarBinderAnns.hs:6:6-11]), +((StarBinderAnns.hs:6:1-19,AnnOpenC), [StarBinderAnns.hs:6:27]), +((StarBinderAnns.hs:6:1-19,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:1-19,AnnSemi), [StarBinderAnns.hs:7:1]), +((StarBinderAnns.hs:6:1-19,AnnType), [StarBinderAnns.hs:6:1-4]), +((StarBinderAnns.hs:6:1-19,AnnWhere), [StarBinderAnns.hs:6:21-25]), +((StarBinderAnns.hs:6:13-15,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:13-15,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:29-31,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-31,AnnOpenP), [StarBinderAnns.hs:6:29]), +((StarBinderAnns.hs:6:29-48,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-48,AnnEqual), [StarBinderAnns.hs:6:37]), +((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29]), +((,AnnEofPos), [StarBinderAnns.hs:7:1]) +] \ No newline at end of file diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 8002630..37667e7 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -59,6 +59,7 @@ test('T13163', [extra_files(['Test13163.hs']), ignore_stderr], makefile_test, ['T13163']) test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) -# Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212 -test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212']) +test('T16212', [extra_files(['Test16212.hs']), + ignore_stderr], makefile_test, ['T16212']) +test('StarBinderAnns', [extra_files(['StarBinderAnns.hs']), + ignore_stderr], makefile_test, ['StarBinderAnns']) From git at git.haskell.org Mon Feb 4 11:30:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:25 +0000 (UTC) Subject: [commit: ghc] branch 'wip/codeowners-parser' created Message-ID: <20190204113025.1324B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/codeowners-parser Referencing: 8419df7cf73efcfa32480cc786965a8ed28aaeb2 From git at git.haskell.org Mon Feb 4 11:30:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:27 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16279' created Message-ID: <20190204113027.12FBB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16279 Referencing: dc16e6fb4ea021ad18f1e1bf07f5bac791de64eb From git at git.haskell.org Mon Feb 4 11:30:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:29 +0000 (UTC) Subject: [commit: ghc] branch 'wip/az-annotations-ghc-8.8' created Message-ID: <20190204113029.142A53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/az-annotations-ghc-8.8 Referencing: ee53d585cb9128b6a17a9d410791b0b50ee2ad76 From git at git.haskell.org Mon Feb 4 11:30:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:32 +0000 (UTC) Subject: [commit: ghc] wip/az-annotations-ghc-8.8, wip/codeowners-parser: docs: change meta-variable of -interactive-print from expr to name (59d622d) Message-ID: <20190204113032.1DFF23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/az-annotations-ghc-8.8,wip/codeowners-parser Link : http://ghc.haskell.org/trac/ghc/changeset/59d622d7f1a982e5f24bb0eb8e72121d3ef2270c/ghc >--------------------------------------------------------------- commit 59d622d7f1a982e5f24bb0eb8e72121d3ef2270c Author: Zejun Wu Date: Wed Jan 30 17:35:50 2019 -0800 docs: change meta-variable of -interactive-print from expr to name `-interactive-print` doesn't accept **expr** as `-e` or `:def` does. It must be a qualified or unqualified **name** in scope. >--------------------------------------------------------------- 59d622d7f1a982e5f24bb0eb8e72121d3ef2270c docs/users_guide/ghci.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index f468e80..05b64f9 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -1181,20 +1181,20 @@ IO ()``, and it works by converting the value to ``String`` using ``show``. This is not ideal in certain cases, like when the output is long, or contains strings with non-ascii characters. -The :ghc-flag:`-interactive-print ⟨expr⟩` flag allows to specify any function +The :ghc-flag:`-interactive-print ⟨name⟩` flag allows to specify any function of type ``C a => a -> IO ()``, for some constraint ``C``, as the function for printing evaluated expressions. The function can reside in any loaded module or any registered package, but only when it resides in a registered package will it survive a :ghci-cmd:`:cd`, :ghci-cmd:`:add`, :ghci-cmd:`:load`, :ghci-cmd:`:reload` or, :ghci-cmd:`:set`. -.. ghc-flag:: -interactive-print ⟨expr⟩ +.. ghc-flag:: -interactive-print ⟨name⟩ :shortdesc: :ref:`Select the function to use for printing evaluated expressions in GHCi ` :type: dynamic :category: - Set the function used by GHCi to print evaluation results. Expression + Set the function used by GHCi to print evaluation results. Given name must be of type ``C a => a -> IO ()``. As an example, suppose we have following special printing module: :: @@ -1224,7 +1224,7 @@ will start an interactive session where values with be printed using A custom pretty printing function can be used, for example, to format tree-like and nested structures in a more readable way. -The :ghc-flag:`-interactive-print ⟨expr⟩` flag can also be used when running +The :ghc-flag:`-interactive-print ⟨name⟩` flag can also be used when running GHC in ``-e mode``: .. code-block:: none From git at git.haskell.org Mon Feb 4 11:30:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:35 +0000 (UTC) Subject: [commit: ghc] wip/codeowners-parser: Fix missing space in ppr_cmd for HsCmdArrForm (59516e4) Message-ID: <20190204113035.261083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/codeowners-parser Link : http://ghc.haskell.org/trac/ghc/changeset/59516e4bbfc0baaa71c83fcd4493c27c422e5d57/ghc >--------------------------------------------------------------- commit 59516e4bbfc0baaa71c83fcd4493c27c422e5d57 Author: Vladislav Zavialov Date: Sat Feb 2 17:30:05 2019 +0300 Fix missing space in ppr_cmd for HsCmdArrForm >--------------------------------------------------------------- 59516e4bbfc0baaa71c83fcd4493c27c422e5d57 compiler/hsSyn/HsExpr.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index bae29b0..01ed872 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -1532,8 +1532,8 @@ ppr_cmd (HsCmdArrForm _ (L _ (HsConLikeOut _ c)) Infix _ [arg1, arg2]) = hang (pprCmdArg (unLoc arg1)) 4 (sep [ pprInfixOcc (conLikeName c) , pprCmdArg (unLoc arg2)]) ppr_cmd (HsCmdArrForm _ op _ _ args) - = hang (text "(|" <> ppr_lexpr op) - 4 (sep (map (pprCmdArg.unLoc) args) <> text "|)") + = hang (text "(|" <+> ppr_lexpr op) + 4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)") ppr_cmd (XCmd x) = ppr x pprCmdArg :: (OutputableBndrId (GhcPass p)) => HsCmdTop (GhcPass p) -> SDoc From git at git.haskell.org Mon Feb 4 11:30:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:39 +0000 (UTC) Subject: [commit: ghc] wip/T16279: Lexer: Alternate Layout Rule injects actual not virtual braces (dc16e6f) Message-ID: <20190204113039.653EE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16279 Link : http://ghc.haskell.org/trac/ghc/changeset/dc16e6fb4ea021ad18f1e1bf07f5bac791de64eb/ghc >--------------------------------------------------------------- commit dc16e6fb4ea021ad18f1e1bf07f5bac791de64eb Author: Alan Zimmerman Date: Sun Feb 3 10:27:42 2019 +0200 Lexer: Alternate Layout Rule injects actual not virtual braces When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279 >--------------------------------------------------------------- dc16e6fb4ea021ad18f1e1bf07f5bac791de64eb compiler/parser/Lexer.x | 28 ++++++++++---------- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++++ .../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 7 ++--- 5 files changed, 54 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 dc16e6fb4ea021ad18f1e1bf07f5bac791de64eb From git at git.haskell.org Mon Feb 4 11:30:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:42 +0000 (UTC) Subject: [commit: ghc] wip/az-annotations-ghc-8.8: API Annotations: more explicit foralls fixup (0a660d3) Message-ID: <20190204113042.DDD223A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-annotations-ghc-8.8 Link : http://ghc.haskell.org/trac/ghc/changeset/0a660d3cb71b8eb9a5fdf36e5d5b01c13aa9af2d/ghc >--------------------------------------------------------------- commit 0a660d3cb71b8eb9a5fdf36e5d5b01c13aa9af2d Author: Alan Zimmerman Date: Thu Jan 24 23:22:59 2019 +0200 API Annotations: more explicit foralls fixup The AnnForall annotations introduced via ​Phab:D4894 are not always attached to the correct SourceSpan. Closes #16230 >--------------------------------------------------------------- 0a660d3cb71b8eb9a5fdf36e5d5b01c13aa9af2d compiler/parser/Parser.y | 43 +++++++------- compiler/parser/RdrHsSyn.hs | 6 +- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T16230.stdout | 66 ++++++++++++++++++++++ .../hie010.hs => ghc-api/annotations/Test16230.hs} | 0 testsuite/tests/ghc-api/annotations/all.T | 5 +- 6 files changed, 98 insertions(+), 26 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 0a660d3cb71b8eb9a5fdf36e5d5b01c13aa9af2d From git at git.haskell.org Mon Feb 4 11:30:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:47 +0000 (UTC) Subject: [commit: ghc] wip/az-annotations-ghc-8.8: API Annotations: AnnAt disconnected for TYPEAPP (7ca7168) Message-ID: <20190204113047.197783A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-annotations-ghc-8.8 Link : http://ghc.haskell.org/trac/ghc/changeset/7ca7168e2c41c456d571b3d26d13debcb0c1b80c/ghc >--------------------------------------------------------------- commit 7ca7168e2c41c456d571b3d26d13debcb0c1b80c Author: Alan Zimmerman Date: Wed Jan 30 16:20:52 2019 +0200 API Annotations: AnnAt disconnected for TYPEAPP For the code type family F1 (a :: k) (f :: k -> Type) :: Type where F1 @Peano a f = T @Peano f a the API annotation for the first @ is not attached to a SourceSpan in the ParsedSource Closes #16236 >--------------------------------------------------------------- 7ca7168e2c41c456d571b3d26d13debcb0c1b80c compiler/deSugar/DsMeta.hs | 6 +- compiler/hieFile/HieAst.hs | 4 +- compiler/hsSyn/Convert.hs | 9 ++- compiler/hsSyn/HsTypes.hs | 19 ++--- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 69 +++++++++++------- compiler/rename/RnTypes.hs | 10 +-- compiler/typecheck/TcExpr.hs | 24 +++--- compiler/typecheck/TcHsType.hs | 9 ++- testsuite/tests/ghc-api/annotations/Makefile | 4 + testsuite/tests/ghc-api/annotations/T16236.stdout | 85 ++++++++++++++++++++++ .../annotations/Test16236.hs} | 3 +- testsuite/tests/ghc-api/annotations/all.T | 2 + .../parser/should_compile/DumpParsedAst.stderr | 3 +- .../parser/should_compile/DumpRenamedAst.stderr | 3 +- utils/haddock | 2 +- 16 files changed, 182 insertions(+), 72 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 7ca7168e2c41c456d571b3d26d13debcb0c1b80c From git at git.haskell.org Mon Feb 4 11:30:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:50 +0000 (UTC) Subject: [commit: ghc] wip/az-annotations-ghc-8.8: API Annotations: parens anns discarded for `(*)` operator (2d7d3b8) Message-ID: <20190204113050.76FE53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-annotations-ghc-8.8 Link : http://ghc.haskell.org/trac/ghc/changeset/2d7d3b86381ef509ac2b7e0a3a152ea80933d028/ghc >--------------------------------------------------------------- commit 2d7d3b86381ef509ac2b7e0a3a152ea80933d028 Author: Alan Zimmerman Date: Sat Feb 2 16:29:05 2019 +0200 API Annotations: parens anns discarded for `(*)` operator The patch from https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Updates haddock submodule Closes #16265 >--------------------------------------------------------------- 2d7d3b86381ef509ac2b7e0a3a152ea80933d028 compiler/parser/RdrHsSyn.hs | 4 +-- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ .../annotations/StarBinderAnns.hs} | 0 .../ghc-api/annotations/StarBinderAnns.stdout | 36 ++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/all.T | 8 +++-- 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 00212c7..fba5863 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -960,10 +960,10 @@ checkTyClHdr is_cls ty goL (dL->L l ty) acc ann fix = go l ty acc ann fix -- workaround to define '*' despite StarIsType - go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix + go lp (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") - ; return (cL l (Unqual name), acc, fix, ann) } + ; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) } go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix | isRdrTc tc = return (cL l tc, acc, fix, ann) diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index ef2b5ea..da3be43 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -157,3 +157,7 @@ T16230: .PHONY: T16236 T16236: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16236.hs + +.PHONY: StarBinderAnns +StarBinderAnns: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" StarBinderAnns.hs diff --git a/testsuite/tests/warnings/should_compile/StarBinder.hs b/testsuite/tests/ghc-api/annotations/StarBinderAnns.hs similarity index 100% copy from testsuite/tests/warnings/should_compile/StarBinder.hs copy to testsuite/tests/ghc-api/annotations/StarBinderAnns.hs diff --git a/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout new file mode 100644 index 0000000..d75f30a --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout @@ -0,0 +1,36 @@ +---Unattached Annotation Problems (should be empty list)--- +[] +---Ann before enclosing span problem (should be empty list)--- +[ + +] + +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((StarBinderAnns.hs:1:1,AnnModule), [StarBinderAnns.hs:4:1-6]), +((StarBinderAnns.hs:1:1,AnnWhere), [StarBinderAnns.hs:4:23-27]), +((StarBinderAnns.hs:4:10-21,AnnCloseP), [StarBinderAnns.hs:4:21]), +((StarBinderAnns.hs:4:10-21,AnnOpenP), [StarBinderAnns.hs:4:10]), +((StarBinderAnns.hs:4:11-20,AnnType), [StarBinderAnns.hs:4:11-14]), +((StarBinderAnns.hs:4:16-20,AnnCloseP), [StarBinderAnns.hs:4:20]), +((StarBinderAnns.hs:4:16-20,AnnOpenP), [StarBinderAnns.hs:4:16]), +((StarBinderAnns.hs:4:16-20,AnnVal), [StarBinderAnns.hs:4:17-19]), +((StarBinderAnns.hs:6:1-19,AnnCloseC), [StarBinderAnns.hs:6:50]), +((StarBinderAnns.hs:6:1-19,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:1-19,AnnFamily), [StarBinderAnns.hs:6:6-11]), +((StarBinderAnns.hs:6:1-19,AnnOpenC), [StarBinderAnns.hs:6:27]), +((StarBinderAnns.hs:6:1-19,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:1-19,AnnSemi), [StarBinderAnns.hs:7:1]), +((StarBinderAnns.hs:6:1-19,AnnType), [StarBinderAnns.hs:6:1-4]), +((StarBinderAnns.hs:6:1-19,AnnWhere), [StarBinderAnns.hs:6:21-25]), +((StarBinderAnns.hs:6:13-15,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:13-15,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:29-31,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-31,AnnOpenP), [StarBinderAnns.hs:6:29]), +((StarBinderAnns.hs:6:29-48,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-48,AnnEqual), [StarBinderAnns.hs:6:37]), +((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29]), +((,AnnEofPos), [StarBinderAnns.hs:7:1]) +] \ No newline at end of file diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index de8d1ce..8635ba1 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -60,8 +60,10 @@ test('T13163', [extra_files(['Test13163.hs']), test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) test('T16212', [extra_files(['Test16212.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212']) + ignore_stderr], makefile_test, ['T16212']) test('T16230', [extra_files(['Test16230.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16230']) + ignore_stderr], makefile_test, ['T16230']) test('T16236', [extra_files(['Test16236.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16236']) + ignore_stderr], makefile_test, ['T16236']) +test('StarBinderAnns', [extra_files(['StarBinderAnns.hs']), + ignore_stderr], makefile_test, ['StarBinderAnns']) From git at git.haskell.org Mon Feb 4 11:30:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:53 +0000 (UTC) Subject: [commit: ghc] wip/codeowners-parser: Add int-index as parser/* codeowner (8419df7) Message-ID: <20190204113053.7BC773A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/codeowners-parser Link : http://ghc.haskell.org/trac/ghc/changeset/8419df7cf73efcfa32480cc786965a8ed28aaeb2/ghc >--------------------------------------------------------------- commit 8419df7cf73efcfa32480cc786965a8ed28aaeb2 Author: Vladislav Zavialov Date: Sun Feb 3 15:50:58 2019 -0500 Add int-index as parser/* codeowner >--------------------------------------------------------------- 8419df7cf73efcfa32480cc786965a8ed28aaeb2 CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/CODEOWNERS b/CODEOWNERS index df18b1f..def8a08 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,6 +16,7 @@ /includes/ @bgamari @simonmar @osa1 # The compiler +/compiler/parser/ @int-index /compiler/typecheck/ @simonpj @goldfire /compiler/rename/ @simonpj @goldfire /compiler/types/ @simonpj @goldfire From git at git.haskell.org Mon Feb 4 11:30:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Feb 2019 11:30:57 +0000 (UTC) Subject: [commit: ghc] wip/az-annotations-ghc-8.8: Lexer: Alternate Layout Rule injects actual not virtual braces (ee53d58) Message-ID: <20190204113057.B94E83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/az-annotations-ghc-8.8 Link : http://ghc.haskell.org/trac/ghc/changeset/ee53d585cb9128b6a17a9d410791b0b50ee2ad76/ghc >--------------------------------------------------------------- commit ee53d585cb9128b6a17a9d410791b0b50ee2ad76 Author: Alan Zimmerman Date: Sun Feb 3 10:27:42 2019 +0200 Lexer: Alternate Layout Rule injects actual not virtual braces When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Likewise, any injected ITsemi should have a zero-width SrcSpan. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279 >--------------------------------------------------------------- ee53d585cb9128b6a17a9d410791b0b50ee2ad76 compiler/parser/Lexer.x | 32 ++++++++++++---------- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++ .../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 2 ++ 5 files changed, 55 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ee53d585cb9128b6a17a9d410791b0b50ee2ad76 From git at git.haskell.org Tue Feb 5 12:23:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:24 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16193' created Message-ID: <20190205122324.1D89D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16193 Referencing: 10fe94e053dd536d37465f4f3e61b03bd9fbe5a6 From git at git.haskell.org Tue Feb 5 12:23:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:26 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-json-profiling-report-i386' created Message-ID: <20190205122326.1F0713A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-json-profiling-report-i386 Referencing: 37c9b806b7aa939b76617669d72e4884e1b547f9 From git at git.haskell.org Tue Feb 5 12:23:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:29 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: Add werror function to Flavour.hs (8dcd00c) Message-ID: <20190205122329.3159C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/8dcd00cef7782c64b5484b106f4fd77c8c87e40a/ghc >--------------------------------------------------------------- commit 8dcd00cef7782c64b5484b106f4fd77c8c87e40a Author: Matthew Pickering Date: Thu Jan 31 11:01:04 2019 +0000 Add werror function to Flavour.hs This function makes it easy to turn on `-Werror` in the correct manner to mimic how CI turns on -Werror. >--------------------------------------------------------------- 8dcd00cef7782c64b5484b106f4fd77c8c87e40a hadrian/doc/user-settings.md | 11 +++++++++++ hadrian/src/Flavour.hs | 8 +++++++- hadrian/src/UserSettings.hs | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index 49e560c..b997cd9 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -102,6 +102,17 @@ patterns such as `"//Prelude.*"` can be used when matching input and output file where `//` matches an arbitrary number of path components and `*` matches an entire path component, excluding any separators. +### Enabling -Werror + +It is useful to enable `-Werror` when building GHC as this setting is +used in the CI to ensure a warning free build. The `werror` function can be +used to easily modify a flavour to turn this setting on. + +``` +devel2WerrorFlavour :: Flavour +devel2WerrorFlavour = werror (developmentFlavour Stage2) +``` + ## Packages Users can add and remove packages from particular build stages. As an example, diff --git a/hadrian/src/Flavour.hs b/hadrian/src/Flavour.hs index e95e0d7..23e2aa8 100644 --- a/hadrian/src/Flavour.hs +++ b/hadrian/src/Flavour.hs @@ -1,4 +1,4 @@ -module Flavour (Flavour (..)) where +module Flavour (Flavour (..), werror) where import Expression @@ -32,3 +32,9 @@ data Flavour = Flavour { ghcProfiled :: Bool, -- | Build GHC with debug information. ghcDebugged :: Bool } + + +-- | Turn on -Werror for packages built with the stage1 compiler. +-- It mimics the CI settings so is useful to turn on when developing. +werror :: Flavour -> Flavour +werror fl = fl { args = args fl <> (builder Ghc ? notStage0 ? arg "-Werror") } diff --git a/hadrian/src/UserSettings.hs b/hadrian/src/UserSettings.hs index 8e0b4fc..c92dd11 100644 --- a/hadrian/src/UserSettings.hs +++ b/hadrian/src/UserSettings.hs @@ -2,6 +2,10 @@ -- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy. -- If you don't copy the file your changes will be tracked by git and you can -- accidentally commit them. +-- +-- See doc/user-settings.md for instructions, and src/Flavour.hs for auxiliary +-- functions for manipulating flavours. +-- Please update doc/user-settings.md when committing changes to this file. module UserSettings ( userFlavours, userPackages, userDefaultFlavour, verboseCommand, buildProgressColour, successColour, finalStage From git at git.haskell.org Tue Feb 5 12:23:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:33 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: Report multiple errors (eeabeb9) Message-ID: <20190205122333.35E9E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/eeabeb92a62b86c6140d901c541355d70ec6a5a6/ghc >--------------------------------------------------------------- commit eeabeb92a62b86c6140d901c541355d70ec6a5a6 Author: Vladislav Zavialov Date: Fri Feb 1 20:39:57 2019 +0300 Report multiple errors >--------------------------------------------------------------- eeabeb92a62b86c6140d901c541355d70ec6a5a6 compiler/parser/Lexer.x | 13 +++++++- compiler/parser/RdrHsSyn.hs | 36 ++++++++++------------ testsuite/tests/parser/should_fail/T16270.hs | 29 ++++++++++++++++++ testsuite/tests/parser/should_fail/T16270.stderr | 38 ++++++++++++++++++++++++ testsuite/tests/parser/should_fail/all.T | 1 + 5 files changed, 96 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 eeabeb92a62b86c6140d901c541355d70ec6a5a6 From git at git.haskell.org Tue Feb 5 12:23:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:36 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: testsuite: Skip T15897 in unregisterised way (461c447) Message-ID: <20190205122336.4A2AC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/461c447db50ba3f7ded59f73e3b5342212089fb2/ghc >--------------------------------------------------------------- commit 461c447db50ba3f7ded59f73e3b5342212089fb2 Author: Ben Gamari Date: Sat Feb 2 12:52:21 2019 -0500 testsuite: Skip T15897 in unregisterised way As noted in #16227 this test routinely times out when run in the unregisterised way. See also #15467. >--------------------------------------------------------------- 461c447db50ba3f7ded59f73e3b5342212089fb2 testsuite/tests/profiling/should_run/all.T | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index f5f696e..f76b8f9 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -146,5 +146,8 @@ test('T12962', [], compile_and_run, ['']) test('T14257', [], makefile_test, ['T14257']) test('T15897', - [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2)], + [extra_ways(['profasm']), only_ways(['profasm']), + run_timeout_multiplier(2), + # Fragile in unregisterised way (#15467, #16227) + when(unregisterised(), skip)], makefile_test, ['T15897']) From git at git.haskell.org Tue Feb 5 12:23:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:39 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: testsuite: Use makefile_test for T16212 (e0c0bde) Message-ID: <20190205122339.547E53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/e0c0bde401cca7707678377243648551d1504bdd/ghc >--------------------------------------------------------------- commit e0c0bde401cca7707678377243648551d1504bdd Author: Ben Gamari Date: Sat Feb 2 14:35:29 2019 -0500 testsuite: Use makefile_test for T16212 >--------------------------------------------------------------- e0c0bde401cca7707678377243648551d1504bdd testsuite/tests/ghc-api/annotations/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 8002630..212e218 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -61,4 +61,4 @@ test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) # Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212 test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), - ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16212']) + ignore_stderr], makefile_test, ['T16212']) From git at git.haskell.org Tue Feb 5 12:23:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:42 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: gitlab-ci: Don't allow x86_64-linux-deb9-llvm to fail (ef25b59) Message-ID: <20190205122342.573EB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/ef25b59a97f419a2ad6457f696e32aef9ffb3a0f/ghc >--------------------------------------------------------------- commit ef25b59a97f419a2ad6457f696e32aef9ffb3a0f Author: Ben Gamari Date: Mon Jan 28 19:26:57 2019 -0500 gitlab-ci: Don't allow x86_64-linux-deb9-llvm to fail >--------------------------------------------------------------- ef25b59a97f419a2ad6457f696e32aef9ffb3a0f .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f225f1e..07a1d47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -237,7 +237,6 @@ nightly-x86_64-linux-deb9: validate-x86_64-linux-deb9-llvm: extends: .validate-linux stage: full-build - allow_failure: true image: ghcci/x86_64-linux-deb9:0.2 variables: BUILD_FLAVOUR: perf-llvm From git at git.haskell.org Tue Feb 5 12:23:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:45 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: testsuite: Mark print037 as broken when GHC is built with LLVM (626b63b) Message-ID: <20190205122345.60ADF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/626b63b28a91b26b51ad47e56fdd7bcfd61e7327/ghc >--------------------------------------------------------------- commit 626b63b28a91b26b51ad47e56fdd7bcfd61e7327 Author: Ben Gamari Date: Mon Jan 28 19:26:10 2019 -0500 testsuite: Mark print037 as broken when GHC is built with LLVM As noted in #16205 this configuration reliably segfaults. >--------------------------------------------------------------- 626b63b28a91b26b51ad47e56fdd7bcfd61e7327 testsuite/driver/testlib.py | 9 +++++++++ testsuite/tests/ghci.debugger/scripts/all.T | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 040e674..dd3b426 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -468,6 +468,15 @@ def have_gdb( ): def have_readelf( ): return config.have_readelf +def integer_gmp( ): + return have_library("integer-gmp") + +def integer_simple( ): + return have_library("integer-simple") + +def llvm_build ( ): + return config.ghc_built_by_llvm + # --- def high_memory_usage(name, opts): diff --git a/testsuite/tests/ghci.debugger/scripts/all.T b/testsuite/tests/ghci.debugger/scripts/all.T index 4095cf2..7240594 100644 --- a/testsuite/tests/ghci.debugger/scripts/all.T +++ b/testsuite/tests/ghci.debugger/scripts/all.T @@ -45,7 +45,10 @@ test('print033', normal, ghci_script, ['print033.script']) test('print034', extra_files(['../GADT.hs', '../Test.hs']), ghci_script, ['print034.script']) test('print035', extra_files(['../Unboxed.hs']), ghci_script, ['print035.script']) test('print036', expect_broken(9046), ghci_script, ['print036.script']) -test('print037', normal, ghci_script, ['print037.script']) +test('print037', when(llvm_build() and integer_gmp() + , expect_broken_for(16205, ['ghci-ext'])) + , ghci_script + , ['print037.script']) test('break001', extra_files(['../Test2.hs']), ghci_script, ['break001.script']) test('break002', extra_files(['../Test2.hs']), ghci_script, ['break002.script']) From git at git.haskell.org Tue Feb 5 12:23:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:49 +0000 (UTC) Subject: [commit: ghc] wip/T16193, wip/fix-json-profiling-report-i386: Add `-fplugin-trustworthy` to avoid marking modules as unsafe (406e43a) Message-ID: <20190205122349.0D1DF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16193,wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/406e43af2f12756c80d583b86326f760f2f584cc/ghc >--------------------------------------------------------------- commit 406e43af2f12756c80d583b86326f760f2f584cc Author: Zejun Wu Date: Wed Jan 30 22:13:42 2019 -0800 Add `-fplugin-trustworthy` to avoid marking modules as unsafe By default, when a module is compiled with plugins, it will be marked as unsafe. With this flag passed, all plugins are treated as trustworthy and the safety inference will no longer be affected. This fixes Trac #16260. >--------------------------------------------------------------- 406e43af2f12756c80d583b86326f760f2f584cc compiler/main/DynFlags.hs | 3 +++ compiler/main/Plugins.hs | 8 +++++--- compiler/typecheck/TcRnDriver.hs | 3 ++- docs/users_guide/extending_ghc.rst | 10 ++++++++++ testsuite/tests/plugins/Makefile | 5 +++++ testsuite/tests/plugins/T16260.hs | 1 + .../bkprun04.stdout => plugins/T16260.stdout} | 2 ++ testsuite/tests/plugins/all.T | 6 ++++++ .../plugins/simple-plugin/Simple/TrustworthyPlugin.hs | 17 +++++++++++++++++ .../tests/plugins/simple-plugin/simple-plugin.cabal | 1 + 10 files changed, 52 insertions(+), 4 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 28d8bf8..a9b4a03 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -648,6 +648,7 @@ data GeneralFlag -- safe haskell flags | Opt_DistrustAllPackages | Opt_PackageTrust + | Opt_PluginTrustworthy | Opt_G_NoStateHack | Opt_G_NoOptCoercion @@ -3512,6 +3513,8 @@ dynamic_flags_deps = [ ------ Plugin flags ------------------------------------------------ , make_ord_flag defGhcFlag "fplugin-opt" (hasArg addPluginModuleNameOption) + , make_ord_flag defGhcFlag "fplugin-trustworthy" + (NoArg (setGeneralFlag Opt_PluginTrustworthy)) , make_ord_flag defGhcFlag "fplugin" (hasArg addPluginModuleName) , make_ord_flag defGhcFlag "fclear-plugins" (noArg clearPluginModuleNames) , make_ord_flag defGhcFlag "ffrontend-opt" (hasArg addFrontendPluginOption) diff --git a/compiler/main/Plugins.hs b/compiler/main/Plugins.hs index de04415..585eab1 100644 --- a/compiler/main/Plugins.hs +++ b/compiler/main/Plugins.hs @@ -91,7 +91,7 @@ data Plugin = Plugin { -- `HsGroup` has been renamed. , typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv - -- ^ Modify the module when it is type checked. This is called add the + -- ^ Modify the module when it is type checked. This is called at the -- very end of typechecking. , spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc) @@ -178,8 +178,10 @@ impurePlugin _args = return ForceRecompile flagRecompile = return . MaybeRecompile . fingerprintFingerprints . map fingerprintString . sort --- | Default plugin: does nothing at all! For compatibility reasons --- you should base all your plugin definitions on this default value. +-- | Default plugin: does nothing at all, except for marking that safe +-- inference has failed unless @-fplugin-trustworthy@ is passed. For +-- compatibility reaso you should base all your plugin definitions on this +-- default value. defaultPlugin :: Plugin defaultPlugin = Plugin { installCoreToDos = const return diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 36ec8dc..c76a486 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -2901,7 +2901,8 @@ runTypecheckerPlugin sum hsc_env gbl_env = do gbl_env mark_plugin_unsafe :: DynFlags -> TcM () -mark_plugin_unsafe dflags = recordUnsafeInfer pluginUnsafe +mark_plugin_unsafe dflags = unless (gopt Opt_PluginTrustworthy dflags) $ + recordUnsafeInfer pluginUnsafe where unsafeText = "Use of plugins makes the module unsafe" pluginUnsafe = unitBag ( mkPlainWarnMsg dflags noSrcSpan diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 04bb2df..b1f7b60 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -216,6 +216,16 @@ be reset with the :ghc-flag:`-fclear-plugins` option. Give arguments to a plugin module; module must be specified with :ghc-flag:`-fplugin=⟨module⟩`. +.. ghc-flag:: -fplugin-trustworthy + :shortdesc: Trust the used plugins and no longer mark the compiled module + as unsafe + :type: dynamic + :category: plugins + + By default, when a module is compiled with plugins, it will be marked as + unsafe. With this flag passed, all plugins are treated as trustworthy + and the safety inference will no longer be affected. + .. ghc-flag:: -fclear-plugins :shortdesc: Clear the list of active plugins :type: dynamic diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile index d913ca5..f58a771 100644 --- a/testsuite/tests/plugins/Makefile +++ b/testsuite/tests/plugins/Makefile @@ -125,3 +125,8 @@ plugin-recomp-change-prof: .PHONY: T16104 T16104: "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16104.hs -package-db T16104-plugin/pkg.T16104-plugin/local.package.conf + +.PHONY: T16260 +T16260: + "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16260.hs -package-db simple-plugin/pkg.T16260/local.package.conf -fplugin Simple.TrustworthyPlugin + "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16260.hs -package-db simple-plugin/pkg.T16260/local.package.conf -fplugin Simple.TrustworthyPlugin -fplugin-trustworthy diff --git a/testsuite/tests/plugins/T16260.hs b/testsuite/tests/plugins/T16260.hs new file mode 100644 index 0000000..9c1b9b3 --- /dev/null +++ b/testsuite/tests/plugins/T16260.hs @@ -0,0 +1 @@ +module T16260 where diff --git a/testsuite/tests/backpack/should_run/bkprun04.stdout b/testsuite/tests/plugins/T16260.stdout similarity index 52% copy from testsuite/tests/backpack/should_run/bkprun04.stdout copy to testsuite/tests/plugins/T16260.stdout index 91d6f80..ae9d3fb 100644 --- a/testsuite/tests/backpack/should_run/bkprun04.stdout +++ b/testsuite/tests/plugins/T16260.stdout @@ -1,2 +1,4 @@ False +None True +Safe diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 7570938..f53d9aa 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -215,3 +215,9 @@ test('T16104', pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}') ], makefile_test, []) + +test('T16260', + [extra_files(['simple-plugin/']), + pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.T16260 TOP={top}') + ], + makefile_test, []) diff --git a/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs new file mode 100644 index 0000000..c2b4568 --- /dev/null +++ b/testsuite/tests/plugins/simple-plugin/Simple/TrustworthyPlugin.hs @@ -0,0 +1,17 @@ +module Simple.TrustworthyPlugin (plugin) where + +import GhcPlugins +import TcRnMonad + +plugin :: Plugin +plugin = defaultPlugin + { renamedResultAction = keepRenamedSource + , typeCheckResultAction = printHaskellSafeMode + } + where + printHaskellSafeMode _ ms tcg = liftIO $ do + let dflags = ms_hspp_opts ms + safe <- finalSafeMode dflags tcg + print $ gopt Opt_PluginTrustworthy dflags + putStrLn $ showPpr dflags safe + return tcg diff --git a/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal b/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal index 0a3c49e..e6f3671 100644 --- a/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal +++ b/testsuite/tests/plugins/simple-plugin/simple-plugin.cabal @@ -20,3 +20,4 @@ Library Simple.DataStructures Simple.SourcePlugin Simple.RemovePlugin + Simple.TrustworthyPlugin From git at git.haskell.org Tue Feb 5 12:23:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:52 +0000 (UTC) Subject: [commit: ghc] wip/fix-json-profiling-report-i386: rts/ProfilerReportJson: Fix format string (37c9b80) Message-ID: <20190205122352.0EB653A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-json-profiling-report-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/37c9b806b7aa939b76617669d72e4884e1b547f9/ghc >--------------------------------------------------------------- commit 37c9b806b7aa939b76617669d72e4884e1b547f9 Author: Ben Gamari Date: Mon Feb 4 21:42:41 2019 -0500 rts/ProfilerReportJson: Fix format string This was warning on i386. >--------------------------------------------------------------- 37c9b806b7aa939b76617669d72e4884e1b547f9 rts/ProfilerReportJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c index a786921..ea7c852 100644 --- a/rts/ProfilerReportJson.c +++ b/rts/ProfilerReportJson.c @@ -66,7 +66,7 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " - "\"alloc\": %" FMT_Word ", " + "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, From git at git.haskell.org Tue Feb 5 12:23:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Feb 2019 12:23:55 +0000 (UTC) Subject: [commit: ghc] wip/T16193: testsuite: Always skip T15897 (10fe94e) Message-ID: <20190205122355.0EC873A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16193 Link : http://ghc.haskell.org/trac/ghc/changeset/10fe94e053dd536d37465f4f3e61b03bd9fbe5a6/ghc >--------------------------------------------------------------- commit 10fe94e053dd536d37465f4f3e61b03bd9fbe5a6 Author: Ben Gamari Date: Mon Feb 4 22:02:52 2019 -0500 testsuite: Always skip T15897 >--------------------------------------------------------------- 10fe94e053dd536d37465f4f3e61b03bd9fbe5a6 testsuite/tests/profiling/should_run/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index f76b8f9..6758c34 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -148,6 +148,6 @@ test('T14257', [], makefile_test, ['T14257']) test('T15897', [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2), - # Fragile in unregisterised way (#15467, #16227) - when(unregisterised(), skip)], + # Takes too long and is quite fragile (#15467, #16193) + skip), makefile_test, ['T15897']) From git at git.haskell.org Wed Feb 6 14:09:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:10 +0000 (UTC) Subject: [commit: ghc] branch 'wip/nonmoving-gc' created Message-ID: <20190206140910.98F543A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/nonmoving-gc Referencing: 3d60f81819c083234345270cce30b2bfaca7f720 From git at git.haskell.org Wed Feb 6 14:09:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:12 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-i386-warning' created Message-ID: <20190206140912.994D33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-i386-warning Referencing: acb56d2e4b30a090b1934307252115e235b5bd88 From git at git.haskell.org Wed Feb 6 14:09:14 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:14 +0000 (UTC) Subject: [commit: ghc] branch 'wip/optsemi-unsafe-coerce' created Message-ID: <20190206140914.9A9BE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/optsemi-unsafe-coerce Referencing: df1f5e41da9496c219c942668a84534752be1a95 From git at git.haskell.org Wed Feb 6 14:09:17 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:17 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-warning, wip/optsemi-unsafe-coerce: Refactor splice_exp in Parser.y (ab49342) Message-ID: <20190206140917.B190E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/fix-i386-warning,wip/optsemi-unsafe-coerce Link : http://ghc.haskell.org/trac/ghc/changeset/ab4934230bb12451f8990d063906f24ab072addc/ghc >--------------------------------------------------------------- commit ab4934230bb12451f8990d063906f24ab072addc Author: Vladislav Zavialov Date: Fri Feb 1 09:25:45 2019 +0300 Refactor splice_exp in Parser.y >--------------------------------------------------------------- ab4934230bb12451f8990d063906f24ab072addc compiler/basicTypes/SrcLoc.hs | 6 ++++++ compiler/hsSyn/HsUtils.hs | 14 +++----------- compiler/parser/Parser.y | 24 +++++++++++++----------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs index 696395f..bcf2fcb 100644 --- a/compiler/basicTypes/SrcLoc.hs +++ b/compiler/basicTypes/SrcLoc.hs @@ -77,6 +77,9 @@ module SrcLoc ( getLoc, unLoc, unRealSrcSpan, getRealSrcSpan, + -- ** Modifying Located + mapLoc, + -- ** Combining and comparing Located values eqLocated, cmpLocated, combineLocs, addCLoc, leftmost_smallest, leftmost_largest, rightmost, @@ -527,6 +530,9 @@ data GenLocated l e = L l e type Located = GenLocated SrcSpan type RealLocated = GenLocated RealSrcSpan +mapLoc :: (a -> b) -> GenLocated l a -> GenLocated l b +mapLoc = fmap + unLoc :: HasSrcSpan a => a -> SrcSpanLess a unLoc (dL->L _ e) = e diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 2219ca6..febd5ac 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -67,7 +67,7 @@ module HsUtils( unitRecStmtTc, -- Template Haskell - mkHsSpliceTy, mkHsSpliceE, mkHsSpliceTE, mkUntypedSplice, + mkUntypedSplice, mkTypedSplice, mkHsQuasiQuote, unqualQuasiQuote, -- Collecting binders @@ -346,16 +346,8 @@ unqualSplice = mkRdrUnqual (mkVarOccFS (fsLit "splice")) mkUntypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs mkUntypedSplice hasParen e = HsUntypedSplice noExt hasParen unqualSplice e -mkHsSpliceE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs -mkHsSpliceE hasParen e = HsSpliceE noExt (mkUntypedSplice hasParen e) - -mkHsSpliceTE :: SpliceDecoration -> LHsExpr GhcPs -> HsExpr GhcPs -mkHsSpliceTE hasParen e - = HsSpliceE noExt (HsTypedSplice noExt hasParen unqualSplice e) - -mkHsSpliceTy :: SpliceDecoration -> LHsExpr GhcPs -> HsType GhcPs -mkHsSpliceTy hasParen e = HsSpliceTy noExt - (HsUntypedSplice noExt hasParen unqualSplice e) +mkTypedSplice :: SpliceDecoration -> LHsExpr GhcPs -> HsSplice GhcPs +mkTypedSplice hasParen e = HsTypedSplice noExt hasParen unqualSplice e mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs mkHsQuasiQuote quoter span quote diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 0751567..ce5c523 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2025,12 +2025,8 @@ atype :: { LHsType GhcPs } [mo $1,mc $3] } | '[' ktype ']' {% ams (sLL $1 $> $ HsListTy noExt $2) [mos $1,mcs $3] } | '(' ktype ')' {% ams (sLL $1 $> $ HsParTy noExt $2) [mop $1,mcp $3] } - | quasiquote { sL1 $1 (HsSpliceTy noExt (unLoc $1) ) } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTy HasParens $2) - [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_SPLICE {%ams (sLL $1 $> $ mkHsSpliceTy HasDollar $ sL1 $1 $ HsVar noExt $ - (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1)))) - [mj AnnThIdSplice $1] } + | quasiquote { mapLoc (HsSpliceTy noExt) $1 } + | splice_untyped { mapLoc (HsSpliceTy noExt) $1 } -- see Note [Promotion] for the followings | SIMPLEQUOTE qcon_nowiredlist {% ams (sLL $1 $> $ HsTyVar noExt IsPromoted $2) [mj AnnSimpleQuote $1,mj AnnName $2] } | SIMPLEQUOTE '(' ktype ',' comma_types1 ')' @@ -2749,17 +2745,23 @@ aexp2 :: { LHsExpr GhcPs } [mu AnnOpenB $1,mu AnnCloseB $4] } splice_exp :: { LHsExpr GhcPs } - : TH_ID_SPLICE {% ams (sL1 $1 $ mkHsSpliceE HasDollar + : splice_untyped { mapLoc (HsSpliceE noExt) $1 } + | splice_typed { mapLoc (HsSpliceE noExt) $1 } + +splice_untyped :: { Located (HsSplice GhcPs) } + : TH_ID_SPLICE {% ams (sL1 $1 $ mkUntypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_SPLICE $1))))) [mj AnnThIdSplice $1] } - | '$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceE HasParens $2) + | '$(' exp ')' {% ams (sLL $1 $> $ mkUntypedSplice HasParens $2) [mj AnnOpenPE $1,mj AnnCloseP $3] } - | TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkHsSpliceTE HasDollar + +splice_typed :: { Located (HsSplice GhcPs) } + : TH_ID_TY_SPLICE {% ams (sL1 $1 $ mkTypedSplice HasDollar (sL1 $1 $ HsVar noExt (sL1 $1 (mkUnqual varName (getTH_ID_TY_SPLICE $1))))) [mj AnnThIdTySplice $1] } - | '$$(' exp ')' {% ams (sLL $1 $> $ mkHsSpliceTE HasParens $2) + | '$$(' exp ')' {% ams (sLL $1 $> $ mkTypedSplice HasParens $2) [mj AnnOpenPTE $1,mj AnnCloseP $3] } cmdargs :: { [LHsCmdTop GhcPs] } @@ -3810,7 +3812,7 @@ warnSpaceAfterBang span = do -- When two single quotes don't followed by tyvar or gtycon, we report the -- error as empty character literal, or TH quote that missing proper type -- variable or constructor. See Trac #13450. -reportEmptyDoubleQuotes :: SrcSpan -> P (Located (HsExpr GhcPs)) +reportEmptyDoubleQuotes :: SrcSpan -> P a reportEmptyDoubleQuotes span = do thQuotes <- getBit ThQuotesBit if thQuotes From git at git.haskell.org Wed Feb 6 14:09:21 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:21 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-warning, wip/optsemi-unsafe-coerce: Fix #14579 by defining tyConAppNeedsKindSig, and using it (e88e083) Message-ID: <20190206140921.D7EAD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/fix-i386-warning,wip/optsemi-unsafe-coerce Link : http://ghc.haskell.org/trac/ghc/changeset/e88e083d62389d5c8d082a25395a3d933ab2f03b/ghc >--------------------------------------------------------------- commit e88e083d62389d5c8d082a25395a3d933ab2f03b Author: Ryan Scott Date: Tue Feb 5 19:57:29 2019 -0500 Fix #14579 by defining tyConAppNeedsKindSig, and using it >--------------------------------------------------------------- e88e083d62389d5c8d082a25395a3d933ab2f03b compiler/hsSyn/HsUtils.hs | 87 +++--- compiler/typecheck/TcSplice.hs | 120 +------- compiler/types/TyCoRep.hs | 305 +++++++++++++++++++-- .../tests/deriving/should_compile/T14578.stderr | 30 +- .../tests/deriving/should_compile/T14579.stderr | 39 +++ testsuite/tests/deriving/should_compile/T14579b.hs | 21 ++ testsuite/tests/deriving/should_compile/all.T | 3 +- testsuite/tests/deriving/should_fail/T15073.stderr | 21 +- utils/haddock | 2 +- 9 files changed, 422 insertions(+), 206 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 e88e083d62389d5c8d082a25395a3d933ab2f03b From git at git.haskell.org Wed Feb 6 14:09:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:24 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Printer: Introduce a few more printing utilities (c668d95) Message-ID: <20190206140924.E5E003A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/c668d9537f6a03903cbecd556e3b48c8c06b063c/ghc >--------------------------------------------------------------- commit c668d9537f6a03903cbecd556e3b48c8c06b063c Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:37:57 2019 -0500 rts/Printer: Introduce a few more printing utilities These include printLargeAndPinnedObjects, printWeakLists, and printStaticObjects. These are generally useful things to have. >--------------------------------------------------------------- c668d9537f6a03903cbecd556e3b48c8c06b063c rts/Printer.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ rts/Printer.h | 3 +++ 2 files changed, 78 insertions(+) diff --git a/rts/Printer.c b/rts/Printer.c index 291f529..2f93ba8 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -646,6 +646,81 @@ void printTSO( StgTSO *tso ) printStack( tso->stackobj ); } +void printStaticObjects( StgClosure *p ) +{ + while (p != END_OF_STATIC_OBJECT_LIST) { + p = UNTAG_STATIC_LIST_PTR(p); + printClosure(p); + + const StgInfoTable *info = get_itbl(p); + p = *STATIC_LINK(info, p); + } +} + +void printWeakLists() +{ + debugBelch("======= WEAK LISTS =======\n"); + + for (uint32_t cap_idx = 0; cap_idx < n_capabilities; ++cap_idx) { + debugBelch("Capability %d:\n", cap_idx); + Capability *cap = capabilities[cap_idx]; + for (StgWeak *weak = cap->weak_ptr_list_hd; weak; weak = weak->link) { + printClosure((StgClosure*)weak); + } + } + + for (uint32_t gen_idx = 0; gen_idx <= oldest_gen->no; ++gen_idx) { + generation *gen = &generations[gen_idx]; + debugBelch("Generation %d current weaks:\n", gen_idx); + for (StgWeak *weak = gen->weak_ptr_list; weak; weak = weak->link) { + printClosure((StgClosure*)weak); + } + debugBelch("Generation %d old weaks:\n", gen_idx); + for (StgWeak *weak = gen->old_weak_ptr_list; weak; weak = weak->link) { + printClosure((StgClosure*)weak); + } + } + + debugBelch("=========================\n"); +} + +void printLargeAndPinnedObjects() +{ + debugBelch("====== PINNED OBJECTS ======\n"); + + for (uint32_t cap_idx = 0; cap_idx < n_capabilities; ++cap_idx) { + debugBelch("Capability %d:\n", cap_idx); + Capability *cap = capabilities[cap_idx]; + + debugBelch("Current pinned object block: %p\n", (void*)cap->pinned_object_block); + // just to check if my understanding is correct + // 4/6/2018: assertion fails + // ASSERT(cap->pinned_object_block == NULL || cap->pinned_object_block->link == NULL); + + for (bdescr *bd = cap->pinned_object_blocks; bd; bd = bd->link) { + debugBelch("%p\n", (void*)bd); + } + } + + debugBelch("====== LARGE OBJECTS =======\n"); + for (uint32_t gen_idx = 0; gen_idx <= oldest_gen->no; ++gen_idx) { + generation *gen = &generations[gen_idx]; + debugBelch("Generation %d current large objects:\n", gen_idx); + for (bdescr *bd = gen->large_objects; bd; bd = bd->link) { + debugBelch("%p: ", (void*)bd); + printClosure((StgClosure*)bd->start); + } + + debugBelch("Generation %d scavenged large objects:\n", gen_idx); + for (bdescr *bd = gen->scavenged_large_objects; bd; bd = bd->link) { + debugBelch("%p: ", (void*)bd); + printClosure((StgClosure*)bd->start); + } + } + + debugBelch("============================\n"); +} + /* -------------------------------------------------------------------------- * Address printing code * diff --git a/rts/Printer.h b/rts/Printer.h index d2eaf01..44c55de 100644 --- a/rts/Printer.h +++ b/rts/Printer.h @@ -25,6 +25,9 @@ extern void printClosure ( const StgClosure *obj ); extern void printStackChunk ( StgPtr sp, StgPtr spLim ); extern void printTSO ( StgTSO *tso ); extern void printMutableList( bdescr *bd ); +extern void printStaticObjects ( StgClosure *obj ); +extern void printWeakLists ( void ); +extern void printLargeAndPinnedObjects ( void ); extern void DEBUG_LoadSymbols( const char *name ); From git at git.haskell.org Wed Feb 6 14:09:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:28 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Capability: A few documentation comments (4a94369) Message-ID: <20190206140928.1D2B13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/4a94369e600014cf0c93d0710b524686449aba4c/ghc >--------------------------------------------------------------- commit 4a94369e600014cf0c93d0710b524686449aba4c Author: Ben Gamari Date: Tue Feb 5 10:43:56 2019 -0500 rts/Capability: A few documentation comments >--------------------------------------------------------------- 4a94369e600014cf0c93d0710b524686449aba4c rts/Capability.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rts/Capability.c b/rts/Capability.c index bda3b0e..a1f994d 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -748,6 +748,8 @@ static Capability * waitForReturnCapability (Task *task) * result of the external call back to the Haskell thread that * made it. * + * pCap is strictly an output. + * * ------------------------------------------------------------------------- */ void waitForCapability (Capability **pCap, Task *task) @@ -840,6 +842,9 @@ void waitForCapability (Capability **pCap, Task *task) * SYNC_GC_PAR), either to do a sequential GC, forkProcess, or * setNumCapabilities. We should give up the Capability temporarily. * + * When yieldCapability returns *pCap will have been updated to the new + * capability held by the caller. + * * ------------------------------------------------------------------------- */ #if defined (THREADED_RTS) From git at git.haskell.org Wed Feb 6 14:09:31 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:31 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Add Note explaining applicability of selector optimisation depth limit (b96cb9c) Message-ID: <20190206140931.277963A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/b96cb9c83a60add4b09dad388d8e1fd2081e2627/ghc >--------------------------------------------------------------- commit b96cb9c83a60add4b09dad388d8e1fd2081e2627 Author: Ben Gamari Date: Tue Jul 3 19:58:37 2018 -0400 rts: Add Note explaining applicability of selector optimisation depth limit This was slightly non-obvious so a note seems deserved. >--------------------------------------------------------------- b96cb9c83a60add4b09dad388d8e1fd2081e2627 rts/sm/Evac.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 2890319..45431fe 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -39,7 +39,19 @@ copy_tag(p, info, src, size, stp, tag) #endif -/* Used to avoid long recursion due to selector thunks +/* Note [Selector optimisation depth limit] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * MAX_THUNK_SELECTOR_DEPTH is used to avoid long recursion of + * eval_thunk_selector due to nested selector thunks. Note that this *only* + * counts nested selector thunks, e.g. `fst (fst (... (fst x)))`. The collector + * will traverse interleaved selector-constructor pairs without limit, e.g. + * + * a = (fst b, _) + * b = (fst c, _) + * c = (fst d, _) + * d = (x, _) + * */ #define MAX_THUNK_SELECTOR_DEPTH 16 @@ -1252,6 +1264,7 @@ selector_loop: // recursively evaluate this selector. We don't want to // recurse indefinitely, so we impose a depth bound. + // See Note [Selector optimisation depth limit]. if (gct->thunk_selector_depth >= MAX_THUNK_SELECTOR_DEPTH) { goto bale_out; } From git at git.haskell.org Wed Feb 6 14:09:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:34 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Printer: Print forwarding pointers (ad8da70) Message-ID: <20190206140934.2F4333A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/ad8da7093ab48089b2509cd87319940ffcfa08ab/ghc >--------------------------------------------------------------- commit ad8da7093ab48089b2509cd87319940ffcfa08ab Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:39:03 2019 -0500 rts/Printer: Print forwarding pointers >--------------------------------------------------------------- ad8da7093ab48089b2509cd87319940ffcfa08ab rts/Printer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rts/Printer.c b/rts/Printer.c index 2f93ba8..e9659ac 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -111,10 +111,15 @@ printThunkObject( StgThunk *obj, char* tag ) void printClosure( const StgClosure *obj ) { - const StgInfoTable *info; - + debugBelch("%p: ", obj); obj = UNTAG_CONST_CLOSURE(obj); - info = get_itbl(obj); + const StgInfoTable* info = get_itbl(obj); + + while (IS_FORWARDING_PTR(info)) { + obj = (StgClosure*)UN_FORWARDING_PTR(obj); + debugBelch("(forwarding to %p) ", (void*)obj); + info = get_itbl(obj); + } switch ( info->type ) { case INVALID_OBJECT: From git at git.haskell.org Wed Feb 6 14:09:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:37 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/GC: Add an obvious assertion during block initialization (f31c198) Message-ID: <20190206140937.332863A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/f31c198d76b9df529f462e83c16ef33612e7bff0/ghc >--------------------------------------------------------------- commit f31c198d76b9df529f462e83c16ef33612e7bff0 Author: Ömer Sinan Ağacan Date: Tue Feb 5 10:40:29 2019 -0500 rts/GC: Add an obvious assertion during block initialization Namely ensure that block descriptors are initialized with valid generation numbers. >--------------------------------------------------------------- f31c198d76b9df529f462e83c16ef33612e7bff0 includes/rts/storage/GC.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index 1571975..81850f1 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -240,9 +240,14 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); /* (needed when dynamic libraries are used). */ extern bool keepCAFs; +#include "rts/Flags.h" + INLINE_HEADER void initBdescr(bdescr *bd, generation *gen, generation *dest) { bd->gen = gen; bd->gen_no = gen->no; bd->dest_no = dest->no; + + ASSERT(gen->no < RtsFlags.GcFlags.generations); + ASSERT(dest->no < RtsFlags.GcFlags.generations); } From git at git.haskell.org Wed Feb 6 14:09:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:40 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/BlockAlloc: Allow aligned allocation requests (31c4e1d) Message-ID: <20190206140940.31D923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/31c4e1df3333170143f8f1e5e257f8d062d3f2d6/ghc >--------------------------------------------------------------- commit 31c4e1df3333170143f8f1e5e257f8d062d3f2d6 Author: Ömer Sinan Ağacan Date: Mon Mar 5 15:57:47 2018 +0300 rts/BlockAlloc: Allow aligned allocation requests This implements support for block group allocations which are aligned to an integral number of blocks. This will be used by the nonmoving garbage collector, which uses the block allocator to allocate the segments which back its heap. These segments are a fixed number of blocks in size, with each segment being aligned to the segment size boundary. This allows us to easily find the segment metadata stored at the beginning of the segment. >--------------------------------------------------------------- 31c4e1df3333170143f8f1e5e257f8d062d3f2d6 includes/rts/storage/Block.h | 7 +++ rts/sm/BlockAlloc.c | 111 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h index ecd6bf5..792a72d 100644 --- a/includes/rts/storage/Block.h +++ b/includes/rts/storage/Block.h @@ -290,6 +290,13 @@ EXTERN_INLINE bdescr* allocBlock(void) bdescr *allocGroupOnNode(uint32_t node, W_ n); +// Allocate n blocks, aligned at n-block boundary. The returned bdescr will +// have this invariant +// +// bdescr->start % BLOCK_SIZE*n == 0 +// +bdescr *allocAlignedGroupOnNode(uint32_t node, W_ n); + EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node); EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node) { diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index bbb4f8a..7f4c8a2 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -310,7 +310,7 @@ setup_tail (bdescr *bd) // Take a free block group bd, and split off a group of size n from // it. Adjust the free list as necessary, and return the new group. static bdescr * -split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln) +split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln /* log_2_ceil(n) */) { bdescr *fg; // free group @@ -325,6 +325,46 @@ split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln) return fg; } +// Take N blocks off the end, free the rest. +static bdescr * +split_block_high (bdescr *bd, W_ n) +{ + ASSERT(bd->blocks > n); + + bdescr* ret = bd + bd->blocks - n; // take n blocks off the end + ret->blocks = n; + ret->start = ret->free = bd->start + (bd->blocks - n)*BLOCK_SIZE_W; + ret->link = NULL; + + bd->blocks -= n; + + setup_tail(ret); + setup_tail(bd); + freeGroup(bd); + + return ret; +} + +// Like `split_block_high`, but takes n blocks off the beginning rather +// than the end. +static bdescr * +split_block_low (bdescr *bd, W_ n) +{ + ASSERT(bd->blocks > n); + + bdescr* bd_ = bd + n; + bd_->blocks = bd->blocks - n; + bd_->start = bd_->free = bd->start + n*BLOCK_SIZE_W; + + bd->blocks = n; + + setup_tail(bd_); + setup_tail(bd); + freeGroup(bd_); + + return bd; +} + /* Only initializes the start pointers on the first megablock and the * blocks field of the first bdescr; callers are responsible for calling * initGroup afterwards. @@ -461,6 +501,75 @@ finish: return bd; } +bdescr * +allocAlignedGroupOnNode (uint32_t node, W_ n) +{ + // allocate enough blocks to have enough space aligned at n-block boundary + // free any slops on the low and high side of this space + + // number of blocks to allocate to make sure we have enough aligned space + uint32_t num_blocks = 2*n - 1; + W_ group_size = n * BLOCK_SIZE; + + bdescr *bd = allocGroupOnNode(node, num_blocks); + + // slop on the low side + W_ slop_low = 0; + if ((uintptr_t)bd->start % group_size != 0) { + slop_low = group_size - ((uintptr_t)bd->start % group_size); + } + + W_ slop_high = (bd->blocks*BLOCK_SIZE) - group_size - slop_low; + + ASSERT((slop_low % BLOCK_SIZE) == 0); + ASSERT((slop_high % BLOCK_SIZE) == 0); + + W_ slop_low_blocks = slop_low / BLOCK_SIZE; + W_ slop_high_blocks = slop_high / BLOCK_SIZE; + + ASSERT(slop_low_blocks + slop_high_blocks + n == num_blocks); + +#ifdef DEBUG + checkFreeListSanity(); + W_ free_before = countFreeList(); +#endif + + if (slop_low_blocks != 0) { + bd = split_block_high(bd, num_blocks - slop_low_blocks); + ASSERT(countBlocks(bd) == num_blocks - slop_low_blocks); + } + +#ifdef DEBUG + ASSERT(countFreeList() == free_before + slop_low_blocks); + checkFreeListSanity(); +#endif + + // At this point the bd should be aligned, but we may have slop on the high side + ASSERT((uintptr_t)bd->start % group_size == 0); + +#ifdef DEBUG + free_before = countFreeList(); +#endif + + if (slop_high_blocks != 0) { + bd = split_block_low(bd, n); + ASSERT(countBlocks(bd) == n); + } + +#ifdef DEBUG + ASSERT(countFreeList() == free_before + slop_high_blocks); + checkFreeListSanity(); +#endif + + // Should still be aligned + ASSERT((uintptr_t)bd->start % group_size == 0); + + // Just to make sure I get this right + ASSERT(Bdescr(bd->start) == bd); + + return bd; +} + STATIC_INLINE uint32_t nodeWithLeastBlocks (void) { From git at git.haskell.org Wed Feb 6 14:09:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:43 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Give stack flags proper macros (4928f58) Message-ID: <20190206140943.3D2423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/4928f580183e06db694c2253560c1e6d72925028/ghc >--------------------------------------------------------------- commit 4928f580183e06db694c2253560c1e6d72925028 Author: Ben Gamari Date: Tue Feb 5 11:01:10 2019 -0500 rts: Give stack flags proper macros This were previously quite unclear and will change a bit under the non-moving collector so let's clear this up now. >--------------------------------------------------------------- 4928f580183e06db694c2253560c1e6d72925028 includes/rts/storage/TSO.h | 5 +++++ rts/PrimOps.cmm | 4 ++-- rts/Threads.c | 4 ++-- rts/sm/Sanity.c | 8 ++++---- rts/sm/Storage.c | 4 ++-- utils/deriveConstants/Main.hs | 3 +++ 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h index 9301858..63d2a11 100644 --- a/includes/rts/storage/TSO.h +++ b/includes/rts/storage/TSO.h @@ -185,6 +185,11 @@ typedef struct StgTSO_ { } *StgTSOPtr; // StgTSO defined in rts/Types.h + +#define STACK_DIRTY 1 +// used by sanity checker to verify that all dirty stacks are on the mutable list +#define STACK_SANE 64 + typedef struct StgStack_ { StgHeader header; StgWord32 stack_size; // stack size in *words* diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 625f5f5..364a075 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1721,7 +1721,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } @@ -1802,7 +1802,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } diff --git a/rts/Threads.c b/rts/Threads.c index 9776353..674ba80 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -85,7 +85,7 @@ createThread(Capability *cap, W_ size) SET_HDR(stack, &stg_STACK_info, cap->r.rCCCS); stack->stack_size = stack_size - sizeofW(StgStack); stack->sp = stack->stack + stack->stack_size; - stack->dirty = 1; + stack->dirty = STACK_DIRTY; tso = (StgTSO *)allocate(cap, sizeofW(StgTSO)); TICK_ALLOC_TSO(); @@ -788,7 +788,7 @@ loop: // indicate that the MVar operation has now completed. tso->_link = (StgTSO*)&stg_END_TSO_QUEUE_closure; - if (stack->dirty == 0) { + if ((stack->dirty & STACK_DIRTY) == 0) { dirty_STACK(cap, stack); } diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 28c9b43..1b13f4f 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -619,9 +619,9 @@ checkGlobalTSOList (bool checkTSOs) stack = tso->stackobj; while (1) { - if (stack->dirty & 1) { - ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & TSO_MARKED)); - stack->dirty &= ~TSO_MARKED; + if (stack->dirty & STACK_DIRTY) { + ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & STACK_SANE)); + stack->dirty &= ~STACK_SANE; } frame = (StgUnderflowFrame*) (stack->stack + stack->stack_size - sizeofW(StgUnderflowFrame)); @@ -656,7 +656,7 @@ checkMutableList( bdescr *mut_bd, uint32_t gen ) ((StgTSO *)p)->flags |= TSO_MARKED; break; case STACK: - ((StgStack *)p)->dirty |= TSO_MARKED; + ((StgStack *)p)->dirty |= STACK_SANE; break; } } diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index dcc5b3a..8a46787 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -1133,8 +1133,8 @@ dirty_TSO (Capability *cap, StgTSO *tso) void dirty_STACK (Capability *cap, StgStack *stack) { - if (stack->dirty == 0) { - stack->dirty = 1; + if (! (stack->dirty & STACK_DIRTY)) { + stack->dirty = STACK_DIRTY; recordClosureMutated(cap,(StgClosure*)stack); } } diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs index 5d5dbc4..335afcd 100644 --- a/utils/deriveConstants/Main.hs +++ b/utils/deriveConstants/Main.hs @@ -307,6 +307,9 @@ wanteds os = concat "sizeofW(StgHeader) - sizeofW(StgProfHeader)" ,constantWord Both "PROF_HDR_SIZE" "sizeofW(StgProfHeader)" + -- Stack flags for C-- + ,constantWord C "STACK_DIRTY" "STACK_DIRTY" + -- Size of a storage manager block (in bytes). ,constantWord Both "BLOCK_SIZE" "BLOCK_SIZE" ,constantWord C "MBLOCK_SIZE" "MBLOCK_SIZE" From git at git.haskell.org Wed Feb 6 14:09:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:46 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/StableName: Expose FOR_EACH_STABLE_NAME, freeSnEntry, SNT_size (03fcfcb) Message-ID: <20190206140946.3C3063A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/03fcfcb8969ba2f40eeb3b038655fb65a5fc9e04/ghc >--------------------------------------------------------------- commit 03fcfcb8969ba2f40eeb3b038655fb65a5fc9e04 Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:40:27 2019 -0500 rts/StableName: Expose FOR_EACH_STABLE_NAME, freeSnEntry, SNT_size These will be needed when we implement sweeping in the nonmoving collector. >--------------------------------------------------------------- 03fcfcb8969ba2f40eeb3b038655fb65a5fc9e04 rts/StableName.c | 25 ++----------------------- rts/StableName.h | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/rts/StableName.c b/rts/StableName.c index 757eb59..383d87e 100644 --- a/rts/StableName.c +++ b/rts/StableName.c @@ -21,7 +21,7 @@ snEntry *stable_name_table = NULL; static snEntry *stable_name_free = NULL; -static unsigned int SNT_size = 0; +unsigned int SNT_size = 0; #define INIT_SNT_SIZE 64 #if defined(THREADED_RTS) @@ -128,7 +128,7 @@ exitStableNameTable(void) #endif } -STATIC_INLINE void +void freeSnEntry(snEntry *sn) { ASSERT(sn->sn_obj == NULL); @@ -218,27 +218,6 @@ lookupStableName (StgPtr p) * Remember old stable name addresses * -------------------------------------------------------------------------- */ -#define FOR_EACH_STABLE_NAME(p, CODE) \ - do { \ - snEntry *p; \ - snEntry *__end_ptr = &stable_name_table[SNT_size]; \ - for (p = stable_name_table + 1; p < __end_ptr; p++) { \ - /* Internal pointers are free slots. */ \ - /* If p->addr == NULL, it's a */ \ - /* stable name where the object has been GC'd, but the */ \ - /* StableName object (sn_obj) is still alive. */ \ - if ((p->addr < (P_)stable_name_table || \ - p->addr >= (P_)__end_ptr)) \ - { \ - /* NOTE: There is an ambiguity here if p->addr == NULL */ \ - /* it is either the last item in the free list or it */ \ - /* is a stable name whose pointee died. sn_obj == NULL */ \ - /* disambiguates as last free list item. */ \ - do { CODE } while(0); \ - } \ - } \ - } while(0) - void rememberOldStableNameAddresses(void) { diff --git a/rts/StableName.h b/rts/StableName.h index 6b5e551..e5903bb 100644 --- a/rts/StableName.h +++ b/rts/StableName.h @@ -11,7 +11,8 @@ #include "BeginPrivate.h" void initStableNameTable ( void ); -void exitStableNameTable ( void ); +void freeSnEntry ( snEntry *sn ); +void exitStableNameTable ( void ); StgWord lookupStableName ( StgPtr p ); void rememberOldStableNameAddresses ( void ); @@ -23,6 +24,29 @@ void updateStableNameTable ( bool full ); void stableNameLock ( void ); void stableNameUnlock ( void ); +extern unsigned int SNT_size; + +#define FOR_EACH_STABLE_NAME(p, CODE) \ + do { \ + snEntry *p; \ + snEntry *__end_ptr = &stable_name_table[SNT_size]; \ + for (p = stable_name_table + 1; p < __end_ptr; p++) { \ + /* Internal pointers are free slots. */ \ + /* If p->addr == NULL, it's a */ \ + /* stable name where the object has been GC'd, but the */ \ + /* StableName object (sn_obj) is still alive. */ \ + if ((p->addr < (P_)stable_name_table || \ + p->addr >= (P_)__end_ptr)) \ + { \ + /* NOTE: There is an ambiguity here if p->addr == NULL */ \ + /* it is either the last item in the free list or it */ \ + /* is a stable name whose pointee died. sn_obj == NULL */ \ + /* disambiguates as last free list item. */ \ + do { CODE } while(0); \ + } \ + } \ + } while(0) + #if defined(THREADED_RTS) // needed by Schedule.c:forkProcess() extern Mutex stable_name_mutex; From git at git.haskell.org Wed Feb 6 14:09:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:49 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Factor out large bitmap walking (cfc0004) Message-ID: <20190206140949.AD4C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/cfc000402c98f6c8775c0d5d66b7f2953c61eb98/ghc >--------------------------------------------------------------- commit cfc000402c98f6c8775c0d5d66b7f2953c61eb98 Author: Ben Gamari Date: Tue Feb 5 10:59:32 2019 -0500 rts: Factor out large bitmap walking This will be needed by the mark phase of the non-moving collector so let's factor it out. >--------------------------------------------------------------- cfc000402c98f6c8775c0d5d66b7f2953c61eb98 rts/sm/HeapUtils.h | 33 +++++++++++++++++++++++++++++++++ rts/sm/Scav.c | 23 +++++++---------------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/rts/sm/HeapUtils.h b/rts/sm/HeapUtils.h new file mode 100644 index 0000000..2e9ca34 --- /dev/null +++ b/rts/sm/HeapUtils.h @@ -0,0 +1,33 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team 1998-2008 + * + * General utilities for walking the heap + * + * ---------------------------------------------------------------------------*/ + +#pragma once + +typedef void (walk_closures_cb)(StgClosure **, void *); + +INLINE_HEADER void +walk_large_bitmap(walk_closures_cb *cb, + StgClosure **p, + StgLargeBitmap *large_bitmap, + StgWord size, + void *user) +{ + uint32_t b = 0; + + for (uint32_t i = 0; i < size; b++) { + StgWord bitmap = large_bitmap->bitmap[b]; + uint32_t j = stg_min(size-i, BITS_IN(W_)); + i += j; + for (; j > 0; j--, p++) { + if ((bitmap & 1) == 0) { + cb(p, user); + } + bitmap = bitmap >> 1; + } + } +} diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 8bc7029..36592af 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -58,6 +58,7 @@ #include "Sanity.h" #include "Capability.h" #include "LdvProfile.h" +#include "HeapUtils.h" #include "Hash.h" #include "sm/MarkWeak.h" @@ -77,6 +78,11 @@ static void scavenge_large_bitmap (StgPtr p, # define scavenge_capability_mut_lists(cap) scavenge_capability_mut_Lists1(cap) #endif +static void do_evacuate(StgClosure **p, void *user STG_UNUSED) +{ + evacuate(p); +} + /* ----------------------------------------------------------------------------- Scavenge a TSO. -------------------------------------------------------------------------- */ @@ -1777,22 +1783,7 @@ scavenge_static(void) static void scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ) { - uint32_t i, j, b; - StgWord bitmap; - - b = 0; - - for (i = 0; i < size; b++) { - bitmap = large_bitmap->bitmap[b]; - j = stg_min(size-i, BITS_IN(W_)); - i += j; - for (; j > 0; j--, p++) { - if ((bitmap & 1) == 0) { - evacuate((StgClosure **)p); - } - bitmap = bitmap >> 1; - } - } + walk_large_bitmap(do_evacuate, (StgClosure **) p, large_bitmap, size, NULL); } From git at git.haskell.org Wed Feb 6 14:09:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:52 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/GC: Expose and clean up gcCAFs (dd02baa) Message-ID: <20190206140952.BC0AA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/dd02baa09b4a24927d68cc4f4ad986e2c3d417df/ghc >--------------------------------------------------------------- commit dd02baa09b4a24927d68cc4f4ad986e2c3d417df Author: Ben Gamari Date: Tue Feb 5 21:17:36 2019 -0500 rts/GC: Expose and clean up gcCAFs >--------------------------------------------------------------- dd02baa09b4a24927d68cc4f4ad986e2c3d417df rts/sm/GC.c | 25 ++++++++----------------- rts/sm/GC.h | 2 ++ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 70d6d8e..d74c387 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -175,10 +175,6 @@ static void collect_gct_blocks (void); static void collect_pinned_object_blocks (void); static void heapOverflow (void); -#if defined(DEBUG) -static void gcCAFs (void); -#endif - /* ----------------------------------------------------------------------------- The mark stack. -------------------------------------------------------------------------- */ @@ -1836,21 +1832,16 @@ resize_nursery (void) #if defined(DEBUG) -static void gcCAFs(void) +void gcCAFs(void) { - StgIndStatic *p, *prev; - - const StgInfoTable *info; - uint32_t i; - - i = 0; - p = debug_caf_list; - prev = NULL; + uint32_t i = 0; + StgIndStatic *prev = NULL; - for (p = debug_caf_list; p != (StgIndStatic*)END_OF_CAF_LIST; - p = (StgIndStatic*)p->saved_info) { - - info = get_itbl((StgClosure*)p); + for (StgIndStatic *p = debug_caf_list; + p != (StgIndStatic*) END_OF_CAF_LIST; + p = (StgIndStatic*) p->saved_info) + { + const StgInfoTable *info = get_itbl((StgClosure*)p); ASSERT(info->type == IND_STATIC); // See Note [STATIC_LINK fields] in Storage.h diff --git a/rts/sm/GC.h b/rts/sm/GC.h index 437a25f..db1ca76 100644 --- a/rts/sm/GC.h +++ b/rts/sm/GC.h @@ -49,6 +49,8 @@ extern uint32_t mutlist_MUTVARS, mutlist_MUTARRS, mutlist_MVARS, mutlist_OTHERS, extern volatile StgWord64 whitehole_gc_spin; extern volatile StgWord64 waitForGcThreads_spin; extern volatile StgWord64 waitForGcThreads_yield; + +void gcCAFs(void); #endif void gcWorkerThread (Capability *cap); From git at git.haskell.org Wed Feb 6 14:09:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:55 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Scav: Expose scavenging functions (0564f8a) Message-ID: <20190206140955.C585D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/0564f8ac1677f374d650645a0ca127ad7e8f858b/ghc >--------------------------------------------------------------- commit 0564f8ac1677f374d650645a0ca127ad7e8f858b Author: Ömer Sinan Ağacan Date: Tue Feb 5 11:46:25 2019 -0500 rts/Scav: Expose scavenging functions To keep the non-moving collector nicely separated from the moving collector its scavenging phase will live in another file, `NonMovingScav.c`. However, it will need to use these functions so let's expose them. >--------------------------------------------------------------- 0564f8ac1677f374d650645a0ca127ad7e8f858b rts/sm/Scav.c | 29 ++++++++++++++++++----------- rts/sm/Scav.h | 14 ++++++++++++++ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 36592af..ef246b7 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -63,8 +63,6 @@ #include "sm/MarkWeak.h" -static void scavenge_stack (StgPtr p, StgPtr stack_end); - static void scavenge_large_bitmap (StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ); @@ -72,10 +70,19 @@ static void scavenge_large_bitmap (StgPtr p, #if defined(THREADED_RTS) && !defined(PARALLEL_GC) # define evacuate(a) evacuate1(a) # define evacuate_BLACKHOLE(a) evacuate_BLACKHOLE1(a) +# define evacuate_static_object(a, b) evacuate_static_object1(a, b) # define scavenge_loop(a) scavenge_loop1(a) # define scavenge_block(a) scavenge_block1(a) # define scavenge_mutable_list(bd,g) scavenge_mutable_list1(bd,g) # define scavenge_capability_mut_lists(cap) scavenge_capability_mut_Lists1(cap) +# define scavengeTSO(tso) scavengeTSO1(tso) +# define scavenge_stack(p, stack_end) scavenge_stack1(p, stack_end) +# define scavenge_fun_srt(info) scavenge_fun_srt1(info) +# define scavenge_fun_srt(info) scavenge_fun_srt1(info) +# define scavenge_thunk_srt(info) scavenge_thunk_srt1(info) +# define scavenge_mut_arr_ptrs(info) scavenge_mut_arr_ptrs1(info) +# define scavenge_PAP(pap) scavenge_PAP1(pap) +# define scavenge_AP(ap) scavenge_AP1(ap) #endif static void do_evacuate(StgClosure **p, void *user STG_UNUSED) @@ -87,7 +94,7 @@ static void do_evacuate(StgClosure **p, void *user STG_UNUSED) Scavenge a TSO. -------------------------------------------------------------------------- */ -static void +void scavengeTSO (StgTSO *tso) { bool saved_eager; @@ -198,7 +205,7 @@ scavenge_compact(StgCompactNFData *str) Mutable arrays of pointers -------------------------------------------------------------------------- */ -static StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a) +StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a) { W_ m; bool any_failed; @@ -348,14 +355,14 @@ scavenge_PAP_payload (StgClosure *fun, StgClosure **payload, StgWord size) return p; } -STATIC_INLINE GNUC_ATTR_HOT StgPtr +GNUC_ATTR_HOT StgPtr scavenge_PAP (StgPAP *pap) { evacuate(&pap->fun); return scavenge_PAP_payload (pap->fun, pap->payload, pap->n_args); } -STATIC_INLINE StgPtr +StgPtr scavenge_AP (StgAP *ap) { evacuate(&ap->fun); @@ -366,7 +373,7 @@ scavenge_AP (StgAP *ap) Scavenge SRTs -------------------------------------------------------------------------- */ -STATIC_INLINE GNUC_ATTR_HOT void +GNUC_ATTR_HOT void scavenge_thunk_srt(const StgInfoTable *info) { StgThunkInfoTable *thunk_info; @@ -380,7 +387,7 @@ scavenge_thunk_srt(const StgInfoTable *info) } } -STATIC_INLINE GNUC_ATTR_HOT void +GNUC_ATTR_HOT void scavenge_fun_srt(const StgInfoTable *info) { StgFunInfoTable *fun_info; @@ -1570,10 +1577,10 @@ static void scavenge_mutable_list(bdescr *bd, generation *gen) { StgPtr p, q; - uint32_t gen_no; - gen_no = gen->no; + uint32_t gen_no = gen->no; gct->evac_gen_no = gen_no; + for (; bd != NULL; bd = bd->link) { for (q = bd->start; q < bd->free; q++) { p = (StgPtr)*q; @@ -1793,7 +1800,7 @@ scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ) AP_STACK_UPDs, since these are just sections of copied stack. -------------------------------------------------------------------------- */ -static void +void scavenge_stack(StgPtr p, StgPtr stack_end) { const StgRetInfoTable* info; diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h index 6d265a7..ba434f0 100644 --- a/rts/sm/Scav.h +++ b/rts/sm/Scav.h @@ -17,10 +17,24 @@ void scavenge_loop (void); void scavenge_capability_mut_lists (Capability *cap); +void scavengeTSO (StgTSO *tso); +void scavenge_stack (StgPtr p, StgPtr stack_end); +void scavenge_fun_srt (const StgInfoTable *info); +void scavenge_thunk_srt (const StgInfoTable *info); +StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a); +StgPtr scavenge_PAP (StgPAP *pap); +StgPtr scavenge_AP (StgAP *ap); #if defined(THREADED_RTS) void scavenge_loop1 (void); void scavenge_capability_mut_Lists1 (Capability *cap); +void scavengeTSO1 (StgTSO *tso); +void scavenge_stack1 (StgPtr p, StgPtr stack_end); +void scavenge_fun_srt1 (const StgInfoTable *info); +void scavenge_thunk_srt1 (const StgInfoTable *info); +StgPtr scavenge_mut_arr_ptrs1 (StgMutArrPtrs *a); +StgPtr scavenge_PAP1 (StgPAP *pap); +StgPtr scavenge_AP1 (StgAP *ap); #endif #include "EndPrivate.h" From git at git.haskell.org Wed Feb 6 14:09:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:09:58 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Unglobalize dead_weak_ptr_list and resurrected_threads (03da1c8) Message-ID: <20190206140958.C1FE03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/03da1c829609933f0a0cfbbe033b8b7e95572fcf/ghc >--------------------------------------------------------------- commit 03da1c829609933f0a0cfbbe033b8b7e95572fcf Author: Ömer Sinan Ağacan Date: Tue Feb 5 12:45:17 2019 -0500 rts: Unglobalize dead_weak_ptr_list and resurrected_threads In the concurrent nonmoving collector we will need the ability to call `traverseWeakPtrList` concurrently with minor generation collections. This global state stands in the way of this. However, refactoring it away is straightforward since this list only persists the length of a single GC. >--------------------------------------------------------------- 03da1c829609933f0a0cfbbe033b8b7e95572fcf rts/sm/Compact.c | 2 +- rts/sm/Compact.h | 4 +++- rts/sm/GC.c | 9 +++++++-- rts/sm/MarkWeak.c | 30 +++++++++++------------------- rts/sm/MarkWeak.h | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index 004e042..bd45489 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -940,7 +940,7 @@ update_bkwd_compact( generation *gen ) } void -compact(StgClosure *static_objects) +compact(StgClosure *static_objects, StgWeak *dead_weak_ptr_list, StgTSO *resurrected_threads) { W_ n, g, blocks; generation *gen; diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h index 63abfc7..ba39c30 100644 --- a/rts/sm/Compact.h +++ b/rts/sm/Compact.h @@ -45,6 +45,8 @@ is_marked(StgPtr p, bdescr *bd) return (*bitmap_word & bit_mask); } -void compact (StgClosure *static_objects); +void compact (StgClosure *static_objects, + StgWeak *dead_weak_ptr_list, + StgTSO *resurrected_threads); #include "EndPrivate.h" diff --git a/rts/sm/GC.c b/rts/sm/GC.c index d74c387..38e2940 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -412,15 +412,20 @@ GarbageCollect (uint32_t collect_gen, * Repeatedly scavenge all the areas we know about until there's no * more scavenging to be done. */ + + StgWeak *dead_weak_ptr_list = NULL; + StgTSO *resurrected_threads = END_TSO_QUEUE; + for (;;) { scavenge_until_all_done(); + // The other threads are now stopped. We might recurse back to // here, but from now on this is the only thread. // must be last... invariant is that everything is fully // scavenged at this point. - if (traverseWeakPtrList()) { // returns true if evaced something + if (traverseWeakPtrList(&dead_weak_ptr_list, &resurrected_threads)) { // returns true if evaced something inc_running(); continue; } @@ -464,7 +469,7 @@ GarbageCollect (uint32_t collect_gen, // Finally: compact or sweep the oldest generation. if (major_gc && oldest_gen->mark) { if (oldest_gen->compact) - compact(gct->scavenged_static_objects); + compact(gct->scavenged_static_objects, dead_weak_ptr_list, resurrected_threads); else sweep(oldest_gen); } diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index d7b8fe6..3aa2887 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -77,15 +77,9 @@ typedef enum { WeakPtrs, WeakThreads, WeakDone } WeakStage; static WeakStage weak_stage; -// List of weak pointers whose key is dead -StgWeak *dead_weak_ptr_list; - -// List of threads found to be unreachable -StgTSO *resurrected_threads; - -static void collectDeadWeakPtrs (generation *gen); +static void collectDeadWeakPtrs (generation *gen, StgWeak **dead_weak_ptr_list); static bool tidyWeakList (generation *gen); -static bool resurrectUnreachableThreads (generation *gen); +static bool resurrectUnreachableThreads (generation *gen, StgTSO **resurrected_threads); static void tidyThreadList (generation *gen); void @@ -100,12 +94,10 @@ initWeakForGC(void) } weak_stage = WeakThreads; - dead_weak_ptr_list = NULL; - resurrected_threads = END_TSO_QUEUE; } bool -traverseWeakPtrList(void) +traverseWeakPtrList(StgWeak **dead_weak_ptr_list, StgTSO **resurrected_threads) { bool flag = false; @@ -140,7 +132,7 @@ traverseWeakPtrList(void) // Resurrect any threads which were unreachable for (g = 0; g <= N; g++) { - if (resurrectUnreachableThreads(&generations[g])) { + if (resurrectUnreachableThreads(&generations[g], resurrected_threads)) { flag = true; } } @@ -175,7 +167,7 @@ traverseWeakPtrList(void) */ if (flag == false) { for (g = 0; g <= N; g++) { - collectDeadWeakPtrs(&generations[g]); + collectDeadWeakPtrs(&generations[g], dead_weak_ptr_list); } weak_stage = WeakDone; // *now* we're done, @@ -190,7 +182,7 @@ traverseWeakPtrList(void) } } -static void collectDeadWeakPtrs (generation *gen) +static void collectDeadWeakPtrs (generation *gen, StgWeak **dead_weak_ptr_list) { StgWeak *w, *next_w; for (w = gen->old_weak_ptr_list; w != NULL; w = next_w) { @@ -201,12 +193,12 @@ static void collectDeadWeakPtrs (generation *gen) } evacuate(&w->finalizer); next_w = w->link; - w->link = dead_weak_ptr_list; - dead_weak_ptr_list = w; + w->link = *dead_weak_ptr_list; + *dead_weak_ptr_list = w; } } -static bool resurrectUnreachableThreads (generation *gen) +static bool resurrectUnreachableThreads (generation *gen, StgTSO **resurrected_threads) { StgTSO *t, *tmp, *next; bool flag = false; @@ -225,8 +217,8 @@ static bool resurrectUnreachableThreads (generation *gen) default: tmp = t; evacuate((StgClosure **)&tmp); - tmp->global_link = resurrected_threads; - resurrected_threads = tmp; + tmp->global_link = *resurrected_threads; + *resurrected_threads = tmp; flag = true; } } diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h index cd58ec9..2756cb0 100644 --- a/rts/sm/MarkWeak.h +++ b/rts/sm/MarkWeak.h @@ -19,7 +19,7 @@ extern StgTSO *resurrected_threads; void collectFreshWeakPtrs ( void ); void initWeakForGC ( void ); -bool traverseWeakPtrList ( void ); +bool traverseWeakPtrList ( StgWeak **dead_weak_ptr_list, StgTSO **resurrected_threads ); void markWeakPtrList ( void ); void scavengeLiveWeak ( StgWeak * ); From git at git.haskell.org Wed Feb 6 14:10:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:01 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Disable aggregate-return warnings from gcc (828c007) Message-ID: <20190206141001.D0AAC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/828c00730ac76f44e6aa72a4b91f08fb10829e08/ghc >--------------------------------------------------------------- commit 828c00730ac76f44e6aa72a4b91f08fb10829e08 Author: Ben Gamari Date: Tue Feb 5 12:48:29 2019 -0500 rts: Disable aggregate-return warnings from gcc This warning is a bit of a relic; there is little reason to avoid aggregate return values in 2019. >--------------------------------------------------------------- 828c00730ac76f44e6aa72a4b91f08fb10829e08 rts/ghc.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rts/ghc.mk b/rts/ghc.mk index ff3f18f..cf29ae5 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -336,6 +336,8 @@ WARNING_OPTS += -Wredundant-decls ifeq "$(GccLT46)" "NO" WARNING_OPTS += -Wundef endif +# Some gccs annoyingly enable this archaic specimen by default +WARNING_OPTS += -Wno-aggregate-return # These ones are hard to avoid: #WARNING_OPTS += -Wconversion From git at git.haskell.org Wed Feb 6 14:10:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:04 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Introduce flag to enable the nonmoving old generation (e2889e8) Message-ID: <20190206141004.D4AEC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/e2889e8aad4a40645f07a052d0892528a53df4c7/ghc >--------------------------------------------------------------- commit e2889e8aad4a40645f07a052d0892528a53df4c7 Author: Ben Gamari Date: Tue Feb 5 00:10:43 2019 -0500 rts: Introduce flag to enable the nonmoving old generation This flag will enable the use of a non-moving oldest generation. >--------------------------------------------------------------- e2889e8aad4a40645f07a052d0892528a53df4c7 docs/users_guide/runtime_control.rst | 16 ++++++++++++++++ includes/rts/Flags.h | 2 ++ rts/RtsFlags.c | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index a5c2f14..467473a 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -289,6 +289,22 @@ collection. Hopefully, you won't need any of these in normal operation, but there are several things that can be tweaked for maximum performance. +.. rts-flag:: -xn + + :default: off + :since: 8.8.1 + + .. index:: + single: concurrent mark and sweep + + Enable the concurrent mark-and-sweep garbage collector for old generation + collectors. Typically GHC uses a stop-the-world copying garbage collector + for all generations. This can cause long pauses in execution during major + garbage collections. :rts-flag:`-xn` enables the use of a concurrent + mark-and-sweep garbage collector for oldest generation collections. + + TODO + .. rts-flag:: -A ⟨size⟩ :default: 1MB diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index 63450d5..0558abd 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -52,6 +52,7 @@ typedef struct _GC_FLAGS { double oldGenFactor; double pcFreeHeap; + bool useNonmoving; uint32_t generations; bool squeezeUpdFrames; @@ -95,6 +96,7 @@ typedef struct _DEBUG_FLAGS { bool weak; /* 'w' */ bool gccafs; /* 'G' */ bool gc; /* 'g' */ + bool nonmoving_gc; /* 'n' */ bool block_alloc; /* 'b' */ bool sanity; /* 'S' warning: might be expensive! */ bool stable; /* 't' */ diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index ff9635a..51c9ca6 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -153,6 +153,7 @@ void initRtsFlagsDefaults(void) RtsFlags.GcFlags.heapSizeSuggestionAuto = false; RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */ RtsFlags.GcFlags.oldGenFactor = 2; + RtsFlags.GcFlags.useNonmoving = false; RtsFlags.GcFlags.generations = 2; RtsFlags.GcFlags.squeezeUpdFrames = true; RtsFlags.GcFlags.compact = false; @@ -176,6 +177,7 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.weak = false; RtsFlags.DebugFlags.gccafs = false; RtsFlags.DebugFlags.gc = false; + RtsFlags.DebugFlags.nonmoving_gc = false; RtsFlags.DebugFlags.block_alloc = false; RtsFlags.DebugFlags.sanity = false; RtsFlags.DebugFlags.stable = false; @@ -294,6 +296,7 @@ usage_text[] = { " -xb Sets the address from which a suitable start for the heap memory", " will be searched from. This is useful if the default address", " clashes with some third-party library.", +" -xn Use the non-moving collector for the old generation.", " -m Minimum % of heap which must be available (default 3%)", " -G Number of generations (default: 2)", " -c Use in-place compaction instead of copying in the oldest generation", @@ -399,6 +402,7 @@ usage_text[] = { " -Dw DEBUG: weak", " -DG DEBUG: gccafs", " -Dg DEBUG: gc", +" -Dn DEBUG: non-moving gc", " -Db DEBUG: block", " -DS DEBUG: sanity", " -Dt DEBUG: stable", @@ -1517,6 +1521,12 @@ error = true; break; #endif + case 'n': + OPTION_SAFE; + RtsFlags.GcFlags.useNonmoving = true; + unchecked_arg_start++; + break; + case 'c': /* Debugging tool: show current cost centre on an exception */ OPTION_SAFE; @@ -1690,6 +1700,9 @@ static void normaliseRtsOpts (void) if (RtsFlags.MiscFlags.generate_dump_file) { RtsFlags.MiscFlags.install_seh_handlers = true; } + + if (RtsFlags.GcFlags.useNonmoving && RtsFlags.GcFlags.generations == 1) + barf("The non-moving collector doesn't support -G1"); } static void errorUsage (void) @@ -1841,6 +1854,9 @@ static void read_debug_flags(const char* arg) case 'g': RtsFlags.DebugFlags.gc = true; break; + case 'n': + RtsFlags.DebugFlags.nonmoving_gc = true; + break; case 'b': RtsFlags.DebugFlags.block_alloc = true; break; From git at git.haskell.org Wed Feb 6 14:10:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:07 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Evac: Expose evacuate_static_object? (e8b48fa) Message-ID: <20190206141007.DD18E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/e8b48fa3969f0a15665e885d9aeeff7f937b13dc/ghc >--------------------------------------------------------------- commit e8b48fa3969f0a15665e885d9aeeff7f937b13dc Author: Ömer Sinan Ağacan Date: Tue Feb 5 12:11:29 2019 -0500 rts/Evac: Expose evacuate_static_object? >--------------------------------------------------------------- e8b48fa3969f0a15665e885d9aeeff7f937b13dc rts/sm/Evac.c | 3 ++- rts/sm/Evac.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 45431fe..991ed3a 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -31,6 +31,7 @@ #if defined(THREADED_RTS) && !defined(PARALLEL_GC) #define evacuate(p) evacuate1(p) #define evacuate_BLACKHOLE(p) evacuate_BLACKHOLE1(p) +#define evacuate_static_object(p, q) evacuate_static_object1(p, q) #define HEAP_ALLOCED_GC(p) HEAP_ALLOCED(p) #endif @@ -339,7 +340,7 @@ evacuate_large(StgPtr p) - link_field must be STATIC_LINK(q) ------------------------------------------------------------------------- */ -STATIC_INLINE void +void evacuate_static_object (StgClosure **link_field, StgClosure *q) { StgWord link = (StgWord)*link_field; diff --git a/rts/sm/Evac.h b/rts/sm/Evac.h index 11f505c..e340cfc 100644 --- a/rts/sm/Evac.h +++ b/rts/sm/Evac.h @@ -34,6 +34,9 @@ REGPARM1 void evacuate (StgClosure **p); REGPARM1 void evacuate1 (StgClosure **p); +void evacuate_static_object(StgClosure **link_field, StgClosure *q); +void evacuate_static_object1(StgClosure **link_field, StgClosure *q); + void evacuate_BLACKHOLE(StgClosure **p); void evacuate_BLACKHOLE1(StgClosure **p); From git at git.haskell.org Wed Feb 6 14:10:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:10 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Introduce debug flag for non-moving GC (614d4ce) Message-ID: <20190206141010.DFDF83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/614d4cec1c01ab1d4b511a90518e90440fa5cf19/ghc >--------------------------------------------------------------- commit 614d4cec1c01ab1d4b511a90518e90440fa5cf19 Author: Ben Gamari Date: Fri Jul 6 21:02:22 2018 -0400 rts: Introduce debug flag for non-moving GC >--------------------------------------------------------------- 614d4cec1c01ab1d4b511a90518e90440fa5cf19 libraries/base/GHC/RTS/Flags.hsc | 33 ++++++++++++++++++--------------- rts/Trace.h | 1 + 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index 12cb828..2fe2dbc 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -149,21 +149,22 @@ data MiscFlags = MiscFlags -- -- @since 4.8.0.0 data DebugFlags = DebugFlags - { scheduler :: Bool -- ^ @s@ - , interpreter :: Bool -- ^ @i@ - , weak :: Bool -- ^ @w@ - , gccafs :: Bool -- ^ @G@ - , gc :: Bool -- ^ @g@ - , block_alloc :: Bool -- ^ @b@ - , sanity :: Bool -- ^ @S@ - , stable :: Bool -- ^ @t@ - , prof :: Bool -- ^ @p@ - , linker :: Bool -- ^ @l@ the object linker - , apply :: Bool -- ^ @a@ - , stm :: Bool -- ^ @m@ - , squeeze :: Bool -- ^ @z@ stack squeezing & lazy blackholing - , hpc :: Bool -- ^ @c@ coverage - , sparks :: Bool -- ^ @r@ + { scheduler :: Bool -- ^ @s@ + , interpreter :: Bool -- ^ @i@ + , weak :: Bool -- ^ @w@ + , gccafs :: Bool -- ^ @G@ + , gc :: Bool -- ^ @g@ + , nonmoving_gc :: Bool -- ^ @n@ + , block_alloc :: Bool -- ^ @b@ + , sanity :: Bool -- ^ @S@ + , stable :: Bool -- ^ @t@ + , prof :: Bool -- ^ @p@ + , linker :: Bool -- ^ @l@ the object linker + , apply :: Bool -- ^ @a@ + , stm :: Bool -- ^ @m@ + , squeeze :: Bool -- ^ @z@ stack squeezing & lazy blackholing + , hpc :: Bool -- ^ @c@ coverage + , sparks :: Bool -- ^ @r@ } deriving ( Show -- ^ @since 4.8.0.0 ) @@ -460,6 +461,8 @@ getDebugFlags = do <*> (toBool <$> (#{peek DEBUG_FLAGS, gc} ptr :: IO CBool)) <*> (toBool <$> + (#{peek DEBUG_FLAGS, nonmoving_gc} ptr :: IO CBool)) + <*> (toBool <$> (#{peek DEBUG_FLAGS, block_alloc} ptr :: IO CBool)) <*> (toBool <$> (#{peek DEBUG_FLAGS, sanity} ptr :: IO CBool)) diff --git a/rts/Trace.h b/rts/Trace.h index 74b960c..a7c0cb2 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -50,6 +50,7 @@ enum CapsetType { CapsetTypeCustom = CAPSET_TYPE_CUSTOM, #define DEBUG_weak RtsFlags.DebugFlags.weak #define DEBUG_gccafs RtsFlags.DebugFlags.gccafs #define DEBUG_gc RtsFlags.DebugFlags.gc +#define DEBUG_nonmoving_gc RtsFlags.DebugFlags.nonmoving_gc #define DEBUG_block_alloc RtsFlags.DebugFlags.alloc #define DEBUG_sanity RtsFlags.DebugFlags.sanity #define DEBUG_stable RtsFlags.DebugFlags.stable From git at git.haskell.org Wed Feb 6 14:10:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:16 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Non-concurrent mark and sweep (bc79c17) Message-ID: <20190206141016.8D20E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/bc79c17fdc4ba398c73f3bdd223ab3596511639d/ghc >--------------------------------------------------------------- commit bc79c17fdc4ba398c73f3bdd223ab3596511639d Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:18:44 2019 -0500 rts: Non-concurrent mark and sweep This implements the core heap structure and a serial mark/sweep collector which can be used to manage the oldest-generation heap. This is the first step towards a concurrent mark-and-sweep collector aimed at low-latency applications. The full design of the collector implemented here is described in detail in a technical note B. Gamari. "A Concurrent Garbage Collector For the Glasgow Haskell Compiler" (2018) The basic heap structure used in this design is heavily inspired by K. Ueno & A. Ohori. "A fully concurrent garbage collector for functional programs on multicore processors." /ACM SIGPLAN Notices/ Vol. 51. No. 9 (presented by ICFP 2016) This design is intended to allow both marking and sweeping concurrent to execution of a multi-core mutator. Unlike the Ueno design, which requires no global synchronization pauses, the collector introduced here requires a stop-the-world pause at the beginning and end of the mark phase. To avoid heap fragmentation, the allocator consists of a number of fixed-size /sub-allocators/. Each of these sub-allocators allocators into its own set of /segments/, themselves allocated from the block allocator. Each segment is broken into a set of fixed-size allocation blocks (which back allocations) in addition to a bitmap (used to track the liveness of blocks) and some additional metadata (used also used to track liveness). This heap structure enables collection via mark-and-sweep, which can be performed concurrently via a snapshot-at-the-beginning scheme (although concurrent collection is not implemented in this patch). The mark queue is a fairly straightforward chunked-array structure. The representation is a bit more verbose than a typical mark queue to accomodate a combination of two features: * a mark FIFO, which improves the locality of marking, reducing one of the major overheads seen in mark/sweep allocators (see [1] for details) * the selector optimization and indirection shortcutting, which requires that we track where we found each reference to an object in case we need to update the reference at a later point (e.g. when we find that it is an indirection). See Note [Origin references in the nonmoving collector] (in `NonMovingMark.h`) for details. Beyond this the mark/sweep is fairly run-of-the-mill. [1] R. Garner, S.M. Blackburn, D. Frampton. "Effective Prefetch for Mark-Sweep Garbage Collection." ISMM 2007. Co-Authored-By: Ben Gamari >--------------------------------------------------------------- bc79c17fdc4ba398c73f3bdd223ab3596511639d includes/rts/storage/Block.h | 11 +- rts/Capability.c | 1 + rts/Capability.h | 1 + rts/RtsStartup.c | 3 + rts/Weak.c | 18 +- rts/sm/Evac.c | 38 +- rts/sm/GC.c | 190 ++++--- rts/sm/GCAux.c | 8 + rts/sm/GCThread.h | 4 +- rts/sm/NonMoving.c | 823 ++++++++++++++++++++++++++++ rts/sm/NonMoving.h | 270 ++++++++++ rts/sm/NonMovingMark.c | 1212 ++++++++++++++++++++++++++++++++++++++++++ rts/sm/NonMovingMark.h | 140 +++++ rts/sm/NonMovingScav.c | 366 +++++++++++++ rts/sm/NonMovingScav.h | 10 + rts/sm/NonMovingSweep.c | 273 ++++++++++ rts/sm/NonMovingSweep.h | 32 ++ rts/sm/Sanity.c | 103 +++- rts/sm/Scav.c | 28 +- rts/sm/Storage.c | 19 +- rts/sm/Storage.h | 1 + 21 files changed, 3457 insertions(+), 94 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 bc79c17fdc4ba398c73f3bdd223ab3596511639d From git at git.haskell.org Wed Feb 6 14:10:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:19 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts/Schedule: Allow synchronization without holding a capability (e29f40a) Message-ID: <20190206141019.8DCB93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/e29f40a2d445c384bdbe5f6c506819428903ddd7/ghc >--------------------------------------------------------------- commit e29f40a2d445c384bdbe5f6c506819428903ddd7 Author: Ben Gamari Date: Thu Jul 19 21:57:14 2018 -0400 rts/Schedule: Allow synchronization without holding a capability The concurrent mark-and-sweep will be performed by a GHC task which will not hold a capability. This is necessary to avoid a concurrent mark from interfering with minor generation collections. However, the major collector must synchronize with the mutators at the end of marking to flush their update remembered sets. This patch extends the `requestSync` mechanism used to synchronize garbage collectors to allow synchronization without holding a capability. This change is fairly straightforward as the capability was previously only required for two reasons: 1. to ensure that we don't try to re-acquire a capability that we the sync requestor already holds. 2. to provide a way to suspend and later resume the sync request if there is already a sync pending. When synchronizing without holding a capability we needn't worry about consideration (1) at all. (2) is slightly trickier and may happen, for instance, when a capability requests a minor collection and shortly thereafter the non-moving mark thread requests a post-mark synchronization. In this case we need to ensure that the non-moving mark thread suspends his request until after the minor GC has concluded to avoid dead-locking. For this we introduce a condition variable, `sync_finished_cond`, which a non-capability-bearing requestor will wait on and which is signalled after a synchronization or GC has finished. >--------------------------------------------------------------- e29f40a2d445c384bdbe5f6c506819428903ddd7 rts/Schedule.c | 90 +++++++++++++++++++++++++++++++++++++++++++--------------- rts/Schedule.h | 6 ++++ 2 files changed, 73 insertions(+), 23 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index 02055d2..683871c 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -110,6 +110,19 @@ Mutex sched_mutex; #define FORKPROCESS_PRIMOP_SUPPORTED #endif +/* + * sync_finished_cond allows threads which do not own any capability (e.g. the + * concurrent mark thread) to participate in the sync protocol. In particular, + * if such a thread requests a sync while sync is already in progress it will + * block on sync_finished_cond, which will be signalled when the sync is + * finished (by releaseAllCapabilities). + */ +#if defined(THREADED_RTS) +static Condition sync_finished_cond; +static Mutex sync_finished_mutex; +#endif + + /* ----------------------------------------------------------------------------- * static function prototypes * -------------------------------------------------------------------------- */ @@ -130,7 +143,6 @@ static void scheduleYield (Capability **pcap, Task *task); static bool requestSync (Capability **pcap, Task *task, PendingSync *sync_type, SyncType *prev_sync_type); static void acquireAllCapabilities(Capability *cap, Task *task); -static void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task); static void startWorkerTasks (uint32_t from USED_IF_THREADS, uint32_t to USED_IF_THREADS); #endif @@ -1368,17 +1380,24 @@ scheduleNeedHeapProfile( bool ready_to_gc ) * change to the system, such as altering the number of capabilities, or * forking. * + * pCap may be NULL in the event that the caller doesn't yet own a capability. + * * To resume after stopAllCapabilities(), use releaseAllCapabilities(). * -------------------------------------------------------------------------- */ #if defined(THREADED_RTS) -static void stopAllCapabilities (Capability **pCap, Task *task) +void stopAllCapabilities (Capability **pCap, Task *task) +{ + stopAllCapabilitiesWith(pCap, task, SYNC_OTHER); +} + +void stopAllCapabilitiesWith (Capability **pCap, Task *task, SyncType sync_type) { bool was_syncing; SyncType prev_sync_type; PendingSync sync = { - .type = SYNC_OTHER, + .type = sync_type, .idle = NULL, .task = task }; @@ -1387,9 +1406,10 @@ static void stopAllCapabilities (Capability **pCap, Task *task) was_syncing = requestSync(pCap, task, &sync, &prev_sync_type); } while (was_syncing); - acquireAllCapabilities(*pCap,task); + acquireAllCapabilities(pCap ? *pCap : NULL, task); pending_sync = 0; + signalCondition(&sync_finished_cond); } #endif @@ -1400,6 +1420,16 @@ static void stopAllCapabilities (Capability **pCap, Task *task) * directly, instead use stopAllCapabilities(). This is used by the GC, which * has some special synchronisation requirements. * + * Note that this can be called in two ways: + * + * - where *pcap points to a capability owned by the caller: in this case + * *prev_sync_type will reflect the in-progress sync type on return, if one + * *was found + * + * - where pcap == NULL: in this case the caller doesn't hold a capability. + * we only return whether or not a pending sync was found and prev_sync_type + * is unchanged. + * * Returns: * false if we successfully got a sync * true if there was another sync request in progress, @@ -1424,13 +1454,25 @@ static bool requestSync ( // After the sync is completed, we cannot read that struct any // more because it has been freed. *prev_sync_type = sync->type; - do { - debugTrace(DEBUG_sched, "someone else is trying to sync (%d)...", - sync->type); - ASSERT(*pcap); - yieldCapability(pcap,task,true); - sync = pending_sync; - } while (sync != NULL); + if (pcap == NULL) { + // The caller does not hold a capability (e.g. may be a concurrent + // mark thread). Consequently we must wait until the pending sync is + // finished before proceeding to ensure we don't loop. + // TODO: Don't busy-wait + ACQUIRE_LOCK(&sync_finished_mutex); + while (pending_sync) { + waitCondition(&sync_finished_cond, &sync_finished_mutex); + } + RELEASE_LOCK(&sync_finished_mutex); + } else { + do { + debugTrace(DEBUG_sched, "someone else is trying to sync (%d)...", + sync->type); + ASSERT(*pcap); + yieldCapability(pcap,task,true); + sync = pending_sync; + } while (sync != NULL); + } // NOTE: task->cap might have changed now return true; @@ -1445,9 +1487,9 @@ static bool requestSync ( /* ----------------------------------------------------------------------------- * acquireAllCapabilities() * - * Grab all the capabilities except the one we already hold. Used - * when synchronising before a single-threaded GC (SYNC_SEQ_GC), and - * before a fork (SYNC_OTHER). + * Grab all the capabilities except the one we already hold (cap may be NULL is + * the caller does not currently hold a capability). Used when synchronising + * before a single-threaded GC (SYNC_SEQ_GC), and before a fork (SYNC_OTHER). * * Only call this after requestSync(), otherwise a deadlock might * ensue if another thread is trying to synchronise. @@ -1477,29 +1519,30 @@ static void acquireAllCapabilities(Capability *cap, Task *task) } } } - task->cap = cap; + task->cap = cap == NULL ? tmpcap : cap; } #endif /* ----------------------------------------------------------------------------- - * releaseAllcapabilities() + * releaseAllCapabilities() * - * Assuming this thread holds all the capabilities, release them all except for - * the one passed in as cap. + * Assuming this thread holds all the capabilities, release them all (except for + * the one passed in as keep_cap, if non-NULL). * -------------------------------------------------------------------------- */ #if defined(THREADED_RTS) -static void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task) +void releaseAllCapabilities(uint32_t n, Capability *keep_cap, Task *task) { uint32_t i; for (i = 0; i < n; i++) { - if (cap->no != i) { - task->cap = capabilities[i]; - releaseCapability(capabilities[i]); + Capability *tmpcap = capabilities[i]; + if (keep_cap != tmpcap) { + task->cap = tmpcap; + releaseCapability(tmpcap); } } - task->cap = cap; + task->cap = keep_cap; } #endif @@ -1801,6 +1844,7 @@ delete_threads_and_gc: // reset pending_sync *before* GC, so that when the GC threads // emerge they don't immediately re-enter the GC. pending_sync = 0; + signalCondition(&sync_finished_cond); GarbageCollect(collect_gen, heap_census, gc_type, cap, idle_cap); #else GarbageCollect(collect_gen, heap_census, 0, cap, NULL); diff --git a/rts/Schedule.h b/rts/Schedule.h index 66cf839..a477229 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -49,6 +49,12 @@ StgWord findRetryFrameHelper (Capability *cap, StgTSO *tso); /* Entry point for a new worker */ void scheduleWorker (Capability *cap, Task *task); +#if defined(THREADED_RTS) +void stopAllCapabilitiesWith (Capability **pCap, Task *task, SyncType sync_type); +void stopAllCapabilities (Capability **pCap, Task *task); +void releaseAllCapabilities(uint32_t n, Capability *keep_cap, Task *task); +#endif + /* The state of the scheduler. This is used to control the sequence * of events during shutdown. See Note [shutdown] in Schedule.c. */ From git at git.haskell.org Wed Feb 6 14:10:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:22 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: testsuite: Add nonmoving WAY (2d1626a) Message-ID: <20190206141022.90F4D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/2d1626abcec420f453b2e8185969cc6a607a430b/ghc >--------------------------------------------------------------- commit 2d1626abcec420f453b2e8185969cc6a607a430b Author: Ben Gamari Date: Tue Feb 5 14:39:52 2019 -0500 testsuite: Add nonmoving WAY This simply runs the compile_and_run tests with `-xn`, enabling the nonmoving oldest generation. >--------------------------------------------------------------- 2d1626abcec420f453b2e8185969cc6a607a430b testsuite/config/ghc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 24294da..5f39c7e 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -24,7 +24,8 @@ config.other_ways = ['prof', 'normal_h', 'profllvm', 'profoptllvm', 'profthreadedllvm', 'debug', 'ghci-ext', 'ghci-ext-prof', - 'ext-interp'] + 'ext-interp', + 'nonmoving'] if ghc_with_native_codegen: config.compile_ways.append('optasm') @@ -94,7 +95,8 @@ config.way_flags = { 'profthreadedllvm' : ['-O', '-prof', '-static', '-fprof-auto', '-threaded', '-fllvm'], 'ghci-ext' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '-fexternal-interpreter', '+RTS', '-I0.1', '-RTS'], 'ghci-ext-prof' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '-fexternal-interpreter', '-prof', '+RTS', '-I0.1', '-RTS'], - 'ext-interp' : ['-fexternal-interpreter'], + 'ext-interp' : ['-fexternal-interpreter'], + 'nonmoving' : ['-debug'], } config.way_rts_flags = { @@ -133,6 +135,7 @@ config.way_rts_flags = { 'ghci-ext' : [], 'ghci-ext-prof' : [], 'ext-interp' : [], + 'nonmoving' : ['-DS -xn'], } # Useful classes of ways that can be used with only_ways(), omit_ways() and From git at git.haskell.org Wed Feb 6 14:10:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:25 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Always disable nonmoving write barrier if !THREADED (4a4251d) Message-ID: <20190206141025.97F3F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/4a4251d90ebf525b71cc2bf4354acaf97ae902b1/ghc >--------------------------------------------------------------- commit 4a4251d90ebf525b71cc2bf4354acaf97ae902b1 Author: Ben Gamari Date: Tue Feb 5 16:39:51 2019 -0500 rts: Always disable nonmoving write barrier if !THREADED >--------------------------------------------------------------- 4a4251d90ebf525b71cc2bf4354acaf97ae902b1 includes/Cmm.h | 5 +++++ rts/sm/NonMovingMark.c | 2 ++ rts/sm/NonMovingMark.h | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/includes/Cmm.h b/includes/Cmm.h index bee0d6d..b844020 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -797,6 +797,11 @@ Misc junk -------------------------------------------------------------------------- */ +#if !defined(THREADED_RTS) +// This is also done in rts/NonMoving.h, but that isn't visible from C-- +#define nonmoving_write_barrier_enabled 0 +#endif + #define NO_TREC stg_NO_TREC_closure #define END_TSO_QUEUE stg_END_TSO_QUEUE_closure #define STM_AWOKEN stg_STM_AWOKEN_closure diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c index 5e67fec..9be320f 100644 --- a/rts/sm/NonMovingMark.c +++ b/rts/sm/NonMovingMark.c @@ -163,7 +163,9 @@ static Condition upd_rem_set_flushed_cond; /* Indicates to mutators that the write barrier must be respected. Set while * concurrent mark is running. */ +#if defined(THREADED_RTS) bool nonmoving_write_barrier_enabled = false; +#endif /* Used to provide the current mark queue to the young generation * collector for scavenging. diff --git a/rts/sm/NonMovingMark.h b/rts/sm/NonMovingMark.h index 2281d07..b11c4fa 100644 --- a/rts/sm/NonMovingMark.h +++ b/rts/sm/NonMovingMark.h @@ -114,7 +114,15 @@ extern StgIndStatic *debug_caf_list_snapshot; extern MarkQueue *current_mark_queue; extern bdescr *upd_rem_set_block_list; + +#if defined(THREADED_RTS) extern bool nonmoving_write_barrier_enabled; +#else +// The write barrier is never needed if !THREADED since we don't perform +// concurrent collection in this case. +#define nonmoving_write_barrier_enabled 0 +#endif + void nonmovingMarkInitUpdRemSet(void); void init_upd_rem_set(UpdRemSet *rset); From git at git.haskell.org Wed Feb 6 14:10:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:29 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Introduce non-moving heap census (8cdc755) Message-ID: <20190206141029.6E4F83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/8cdc755bd3af14f4080e6dbbf35f6e8859c7a834/ghc >--------------------------------------------------------------- commit 8cdc755bd3af14f4080e6dbbf35f6e8859c7a834 Author: Ben Gamari Date: Tue Feb 5 11:52:13 2019 -0500 rts: Introduce non-moving heap census This introduces a simple census of the non-moving heap (not to be confused with the heap census used by the heap profiler). This collects basic heap usage information (number of allocated and free blocks) which is useful when characterising fragmentation of the nonmoving heap. >--------------------------------------------------------------- 8cdc755bd3af14f4080e6dbbf35f6e8859c7a834 rts/sm/NonMoving.c | 5 ++ rts/sm/NonMovingCensus.c | 94 +++++++++++++++++++++++++++++++ rts/{posix/TTY.h => sm/NonMovingCensus.h} | 6 +- 3 files changed, 102 insertions(+), 3 deletions(-) diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c index ede1fe2..2e767e2 100644 --- a/rts/sm/NonMoving.c +++ b/rts/sm/NonMoving.c @@ -21,6 +21,7 @@ #include "NonMoving.h" #include "NonMovingMark.h" #include "NonMovingSweep.h" +#include "NonMovingCensus.h" #include "StablePtr.h" // markStablePtrTable #include "Schedule.h" // markScheduler #include "Weak.h" // dead_weak_ptr_list @@ -684,6 +685,10 @@ static void nonmovingMark_(MarkQueue *mark_queue, StgWeak **dead_weaks, StgTSO * ASSERT(nonmovingHeap.sweep_list == NULL); debugTrace(DEBUG_nonmoving_gc, "Finished sweeping."); traceConcSweepEnd(); +#if defined(DEBUG) + if (RtsFlags.DebugFlags.nonmoving_gc) + nonmovingPrintAllocatorCensus(); +#endif // TODO: Remainder of things done by GarbageCollect (update stats) diff --git a/rts/sm/NonMovingCensus.c b/rts/sm/NonMovingCensus.c new file mode 100644 index 0000000..349ac77 --- /dev/null +++ b/rts/sm/NonMovingCensus.c @@ -0,0 +1,94 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team, 1998-2018 + * + * Non-moving garbage collector and allocator: Accounting census + * + * This is a simple space accounting census useful for characterising + * fragmentation in the nonmoving heap. + * + * ---------------------------------------------------------------------------*/ + +#include "Rts.h" +#include "NonMoving.h" +#include "Trace.h" +#include "NonMovingCensus.h" + +struct NonmovingAllocCensus { + uint32_t n_active_segs; + uint32_t n_filled_segs; + uint32_t n_live_blocks; + uint32_t n_live_words; +}; + +// N.B. This may miss segments in the event of concurrent mutation (e.g. if a +// mutator retires its current segment to the filled list). +static struct NonmovingAllocCensus +nonmovingAllocatorCensus(struct NonmovingAllocator *alloc) +{ + struct NonmovingAllocCensus census = {0, 0, 0, 0}; + + for (struct NonmovingSegment *seg = alloc->filled; + seg != NULL; + seg = seg->link) + { + census.n_filled_segs++; + census.n_live_blocks += nonmovingSegmentBlockCount(seg); + unsigned int n = nonmovingSegmentBlockCount(seg); + for (unsigned int i=0; i < n; i++) { + StgClosure *c = (StgClosure *) nonmovingSegmentGetBlock(seg, i); + census.n_live_words += closure_sizeW(c); + } + } + + for (struct NonmovingSegment *seg = alloc->active; + seg != NULL; + seg = seg->link) + { + census.n_active_segs++; + unsigned int n = nonmovingSegmentBlockCount(seg); + for (unsigned int i=0; i < n; i++) { + if (nonmovingGetMark(seg, i)) { + StgClosure *c = (StgClosure *) nonmovingSegmentGetBlock(seg, i); + census.n_live_words += closure_sizeW(c); + census.n_live_blocks++; + } + } + } + + for (unsigned int cap=0; cap < n_capabilities; cap++) + { + struct NonmovingSegment *seg = alloc->current[cap]; + unsigned int n = nonmovingSegmentBlockCount(seg); + for (unsigned int i=0; i < n; i++) { + if (nonmovingGetMark(seg, i)) { + StgClosure *c = (StgClosure *) nonmovingSegmentGetBlock(seg, i); + census.n_live_words += closure_sizeW(c); + census.n_live_blocks++; + } + } + } + return census; +} + +void nonmovingPrintAllocatorCensus() +{ + for (int i=0; i < NONMOVING_ALLOCA_CNT; i++) { + struct NonmovingAllocCensus census = + nonmovingAllocatorCensus(nonmovingHeap.allocators[i]); + + uint32_t blk_size = 1 << (i + NONMOVING_ALLOCA0); + // We define occupancy as the fraction of space that is used for useful + // data (that is, live and not slop). + double occupancy = 100.0 * census.n_live_words * sizeof(W_) + / (census.n_live_blocks * blk_size); + if (census.n_live_blocks == 0) occupancy = 100; + (void) occupancy; // silence warning if !DEBUG + debugTrace(DEBUG_nonmoving_gc, "Allocator %d (%d bytes - %d bytes): " + "%d active segs, %d filled segs, %d live blocks, %d live words " + "(%2.1f%% occupancy)", + i, 1 << (i + NONMOVING_ALLOCA0 - 1), 1 << (i + NONMOVING_ALLOCA0), + census.n_active_segs, census.n_filled_segs, census.n_live_blocks, census.n_live_words, + occupancy); + } +} diff --git a/rts/posix/TTY.h b/rts/sm/NonMovingCensus.h similarity index 57% copy from rts/posix/TTY.h copy to rts/sm/NonMovingCensus.h index eb1863c..a4f84c4 100644 --- a/rts/posix/TTY.h +++ b/rts/sm/NonMovingCensus.h @@ -1,11 +1,11 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team, 1998-2009 + * (c) The GHC Team, 1998-2018 * - * TTY-related functionality + * Non-moving garbage collector and allocator: Accounting census * * ---------------------------------------------------------------------------*/ #pragma once -RTS_PRIVATE void resetTerminalSettings (void); +void nonmovingPrintAllocatorCensus(void); From git at git.haskell.org Wed Feb 6 14:10:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:32 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: testsuite: Nonmoving collector doesn't support -G1 (3d60f81) Message-ID: <20190206141032.754313A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/3d60f81819c083234345270cce30b2bfaca7f720/ghc >--------------------------------------------------------------- commit 3d60f81819c083234345270cce30b2bfaca7f720 Author: Ben Gamari Date: Tue Feb 5 17:15:57 2019 -0500 testsuite: Nonmoving collector doesn't support -G1 >--------------------------------------------------------------- 3d60f81819c083234345270cce30b2bfaca7f720 testsuite/tests/codeGen/should_run/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 5e8a3a3..01bf622 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -1,5 +1,6 @@ # Test +RTS -G1 here (it isn't tested anywhere else) -setTestOpts(unless(fast(), extra_ways(['g1']))) +##XXX Nonmoving collector doesn't support -G1 +#setTestOpts(unless(fast(), extra_ways(['g1']))) test('cgrun001', normal, compile_and_run, ['']) test('cgrun002', normal, compile_and_run, ['']) From git at git.haskell.org Wed Feb 6 14:10:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:35 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: testsuite: Add nonmoving_thr WAY (c1c040f) Message-ID: <20190206141035.8B7283A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/c1c040f159c1c508a1e537eaddb4210c434d2a1a/ghc >--------------------------------------------------------------- commit c1c040f159c1c508a1e537eaddb4210c434d2a1a Author: Ben Gamari Date: Tue Feb 5 14:40:34 2019 -0500 testsuite: Add nonmoving_thr WAY >--------------------------------------------------------------- c1c040f159c1c508a1e537eaddb4210c434d2a1a testsuite/config/ghc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 5f39c7e..c3d6ba5 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -25,7 +25,7 @@ config.other_ways = ['prof', 'normal_h', 'debug', 'ghci-ext', 'ghci-ext-prof', 'ext-interp', - 'nonmoving'] + 'nonmoving', 'nonmoving_thr'] if ghc_with_native_codegen: config.compile_ways.append('optasm') @@ -97,6 +97,7 @@ config.way_flags = { 'ghci-ext-prof' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '-fexternal-interpreter', '-prof', '+RTS', '-I0.1', '-RTS'], 'ext-interp' : ['-fexternal-interpreter'], 'nonmoving' : ['-debug'], + 'nonmoving_thr': ['-threaded -debug'], } config.way_rts_flags = { @@ -136,6 +137,7 @@ config.way_rts_flags = { 'ghci-ext-prof' : [], 'ext-interp' : [], 'nonmoving' : ['-DS -xn'], + 'nonmoving_thr' : ['-DS -xn -N2'], } # Useful classes of ways that can be used with only_ways(), omit_ways() and From git at git.haskell.org Wed Feb 6 14:10:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:39 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Implement concurrent collection in the nonmoving collector (455447d) Message-ID: <20190206141039.3C4DE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/455447d585a33d0a7e4afa10940a6f919c251c17/ghc >--------------------------------------------------------------- commit 455447d585a33d0a7e4afa10940a6f919c251c17 Author: Ben Gamari Date: Tue Feb 5 11:51:14 2019 -0500 rts: Implement concurrent collection in the nonmoving collector This extends the non-moving collector to allow concurrent collection. The full design of the collector implemented here is described in detail in a technical note B. Gamari. "A Concurrent Garbage Collector For the Glasgow Haskell Compiler" (2018) This extension involves the introduction of a capability-local remembered set, known as the /update remembered set/, which tracks objects which may no longer be visible to the collector due to mutation. To maintain this remembered set we introduce a write barrier on mutations which is enabled while a concurrent mark is underway. The update remembered set representation is similar to that of the nonmoving mark queue, being a chunked array of `MarkEntry`s. Each `Capability` maintains a single accumulator chunk, which it flushed when it (a) is filled, or (b) when the nonmoving collector enters its post-mark synchronization phase. While the write barrier touches a significant amount of code it is conceptually straightforward: the mutator must ensure that the referee of any pointer it overwrites is added to the update remembered set. However, there are a few details: * In the case of objects with a dirty flag (e.g. `MVar`s) we can exploit the fact that only the *first* mutation requires a write barrier. * Weak references, as usual, complicate things. In particular, we must ensure that the referee of a weak object is marked if dereferenced by the mutator. For this we (unfortunately) must introduce a read barrier, as described in Note [Concurrent read barrier on deRefWeak#] (in `NonMovingMark.c`). * Stable names are also a bit tricky as described in Note [Sweeping stable names in the concurrent collector] (`NonMovingSweep.c`). We take quite some pains to ensure that the high thread count often seen in parallel Haskell applications doesn't affect pause times. To this end we allow thread stacks to be marked either by the thread itself (when it is executed or stack-underflows) or the concurrent mark thread (if the thread owning the stack is never scheduled). There is a non-trivial handshake to ensure that this happens without racing which is described in Note [StgStack dirtiness flags and concurrent marking]. Co-Authored-by: Ömer Sinan Ağacan >--------------------------------------------------------------- 455447d585a33d0a7e4afa10940a6f919c251c17 compiler/codeGen/StgCmmPrim.hs | 74 ++++++- includes/Cmm.h | 13 ++ includes/Rts.h | 1 + includes/rts/NonMoving.h | 25 +++ includes/rts/storage/GC.h | 2 +- includes/rts/storage/TSO.h | 47 ++++- includes/stg/MiscClosures.h | 1 + rts/Capability.c | 37 +++- rts/Capability.h | 7 +- rts/Messages.c | 2 +- rts/PrimOps.cmm | 114 ++++++++-- rts/RaiseAsync.c | 2 +- rts/RtsSymbols.c | 3 + rts/STM.c | 41 ++-- rts/Schedule.c | 9 +- rts/ThreadPaused.c | 10 + rts/Threads.c | 24 ++- rts/Updates.h | 8 +- rts/sm/NonMoving.c | 154 ++++++++++++++ rts/sm/NonMovingMark.c | 470 +++++++++++++++++++++++++++++++++++++++-- rts/sm/NonMovingMark.h | 33 +++ rts/sm/Sanity.c | 15 +- rts/sm/Storage.c | 77 ++++++- rts/sm/Storage.h | 4 +- 24 files changed, 1086 insertions(+), 87 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 455447d585a33d0a7e4afa10940a6f919c251c17 From git at git.haskell.org Wed Feb 6 14:10:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:42 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: rts: Tracing support for nonmoving collection events (1816bec) Message-ID: <20190206141042.4821C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/1816becb64b37bff93d6ac3a3d6813a4c29b36fd/ghc >--------------------------------------------------------------- commit 1816becb64b37bff93d6ac3a3d6813a4c29b36fd Author: Ben Gamari Date: Tue Feb 5 11:51:52 2019 -0500 rts: Tracing support for nonmoving collection events This introduces a few events to mark key points in the nonmoving garbage collection cycle. These include: * `EVENT_CONC_MARK_BEGIN`, denoting the beginning of a round of marking. This may happen more than once in a single major collection since we the major collector iterates until it hits a fixed point. * `EVENT_CONC_MARK_END`, denoting the end of a round of marking. * `EVENT_CONC_SYNC_BEGIN`, denoting the beginning of the post-mark synchronization phase * `EVENT_CONC_UPD_REM_SET_FLUSH`, indicating that a capability has flushed its update remembered set. * `EVENT_CONC_SYNC_END`, denoting that all mutators have flushed their update remembered sets. * `EVENT_CONC_SWEEP_BEGIN`, denoting the beginning of the sweep portion of the major collection. * `EVENT_CONC_SWEEP_END`, denoting the end of the sweep portion of the major collection. >--------------------------------------------------------------- 1816becb64b37bff93d6ac3a3d6813a4c29b36fd includes/rts/EventLogFormat.h | 10 ++++++++- rts/Trace.c | 43 +++++++++++++++++++++++++++++++++++ rts/Trace.h | 16 +++++++++++++ rts/eventlog/EventLog.c | 52 ++++++++++++++++++++++++++++++++++++++++++- rts/eventlog/EventLog.h | 7 ++++++ rts/sm/NonMoving.c | 3 +++ rts/sm/NonMovingMark.c | 5 +++++ 7 files changed, 134 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 1816becb64b37bff93d6ac3a3d6813a4c29b36fd From git at git.haskell.org Wed Feb 6 14:10:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:45 +0000 (UTC) Subject: [commit: ghc] wip/nonmoving-gc: testsuite: Don't run T15892 in nonmoving ways (6647ba9) Message-ID: <20190206141045.483063A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/nonmoving-gc Link : http://ghc.haskell.org/trac/ghc/changeset/6647ba90e01bee3ca19037fcd1c2bda1fd9777d2/ghc >--------------------------------------------------------------- commit 6647ba90e01bee3ca19037fcd1c2bda1fd9777d2 Author: Ben Gamari Date: Tue Feb 5 17:06:25 2019 -0500 testsuite: Don't run T15892 in nonmoving ways The nonmoving GC doesn't support `+RTS -G1`, which this test insists on. >--------------------------------------------------------------- 6647ba90e01bee3ca19037fcd1c2bda1fd9777d2 testsuite/tests/codeGen/should_run/all.T | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 7f976b8..5e8a3a3 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -188,7 +188,9 @@ test('T15696_3', normal, compile_and_run, ['-O']) test('T15892', [ ignore_stdout, - # we want to do lots of major GC to make the bug more likely to - # happen, so -G1 -A32k: - extra_run_opts('+RTS -G1 -A32k -RTS') ], + # -G1 is unsupported by the nonmoving GC + omit_ways(['nonmoving', 'nonmoving_thr']), + # we want to do lots of major GC to make the bug more likely to + # happen, so -G1 -A32k: + extra_run_opts('+RTS -G1 -A32k -RTS') ], compile_and_run, ['-O']) From git at git.haskell.org Wed Feb 6 14:10:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:48 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-warning: Add int-index as parser/* codeowner (9292a18) Message-ID: <20190206141048.498923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386-warning Link : http://ghc.haskell.org/trac/ghc/changeset/9292a183fd031d81ac7027eb95dd5a46249845f8/ghc >--------------------------------------------------------------- commit 9292a183fd031d81ac7027eb95dd5a46249845f8 Author: Vladislav Zavialov Date: Sun Feb 3 15:50:58 2019 -0500 Add int-index as parser/* codeowner >--------------------------------------------------------------- 9292a183fd031d81ac7027eb95dd5a46249845f8 CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/CODEOWNERS b/CODEOWNERS index df18b1f..def8a08 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,6 +16,7 @@ /includes/ @bgamari @simonmar @osa1 # The compiler +/compiler/parser/ @int-index /compiler/typecheck/ @simonpj @goldfire /compiler/rename/ @simonpj @goldfire /compiler/types/ @simonpj @goldfire From git at git.haskell.org Wed Feb 6 14:10:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:51 +0000 (UTC) Subject: [commit: ghc] wip/optsemi-unsafe-coerce: Fix optSemi type in Parser.y (df1f5e4) Message-ID: <20190206141051.552C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/optsemi-unsafe-coerce Link : http://ghc.haskell.org/trac/ghc/changeset/df1f5e41da9496c219c942668a84534752be1a95/ghc >--------------------------------------------------------------- commit df1f5e41da9496c219c942668a84534752be1a95 Author: Vladislav Zavialov Date: Tue Feb 5 20:01:36 2019 -0500 Fix optSemi type in Parser.y The definition of 'optSemi' claimed it had type ([Located a],Bool) Note that its production actually returns ([Located Token],Bool): : ';' { ([$1],True) } -- $1 :: Located Token Due to an infelicity in the implementation of 'happy -c', it effectively resulted in 'unsafeCoerce :: Token -> a'. See https://github.com/simonmar/happy/pull/134 If any consumer of 'optSemi' tried to instantiate 'a' to something not representationally equal to 'Token', they would experience a segfault. In addition to that, this definition made it impossible to compile Parser.y without the -c flag (as it's reliant on this bug to cast 'Token' to 'forall a. a'). >--------------------------------------------------------------- df1f5e41da9496c219c942668a84534752be1a95 compiler/parser/Parser.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index ce5c523..2d1e8f3 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1,4 +1,3 @@ - -- -*-haskell-*- -- --------------------------------------------------------------------------- -- (c) The University of Glasgow 1997-2003 @@ -2580,7 +2579,7 @@ exp10 :: { LHsExpr GhcPs } | scc_annot exp {% ams (sLL $1 $> $ HsSCC noExt (snd $ fst $ unLoc $1) (snd $ unLoc $1) $2) (fst $ fst $ unLoc $1) } -optSemi :: { ([Located a],Bool) } +optSemi :: { ([Located Token],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } From git at git.haskell.org Wed Feb 6 14:10:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Feb 2019 14:10:54 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386-warning: RTS: Fix format string in log message (acb56d2) Message-ID: <20190206141054.5BC2C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386-warning Link : http://ghc.haskell.org/trac/ghc/changeset/acb56d2e4b30a090b1934307252115e235b5bd88/ghc >--------------------------------------------------------------- commit acb56d2e4b30a090b1934307252115e235b5bd88 Author: Peter Trommler Date: Wed Feb 6 15:07:05 2019 +0100 RTS: Fix format string in log message >--------------------------------------------------------------- acb56d2e4b30a090b1934307252115e235b5bd88 rts/ProfilerReportJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c index a786921..ea7c852 100644 --- a/rts/ProfilerReportJson.c +++ b/rts/ProfilerReportJson.c @@ -66,7 +66,7 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " - "\"alloc\": %" FMT_Word ", " + "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, From git at git.haskell.org Thu Feb 7 17:11:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:13 +0000 (UTC) Subject: [commit: ghc] branch 'wip/marge_bot_batch_merge_job' created Message-ID: <20190207171114.00CD83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/marge_bot_batch_merge_job Referencing: 4f65c42ce3c80eb52528450a11daf499df0599df From git at git.haskell.org Thu Feb 7 17:11:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:16 +0000 (UTC) Subject: [commit: ghc] branch 'wip/dmd-arity' created Message-ID: <20190207171116.00EEC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/dmd-arity Referencing: 085cd6af4eca15d544afc4e56f988822dae0b13f From git at git.haskell.org Thu Feb 7 17:11:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:19 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Fix #16287 by checking for more unsaturated synonym arguments (c07e7ec) Message-ID: <20190207171119.D5F133A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/c07e7ecbdfc05429fb6ce84c547c0365d2754db7/ghc >--------------------------------------------------------------- commit c07e7ecbdfc05429fb6ce84c547c0365d2754db7 Author: Ryan Scott Date: Tue Feb 5 08:50:59 2019 -0500 Fix #16287 by checking for more unsaturated synonym arguments Trac #16287 shows that we were checking for unsaturated type synonym arguments (in `:kind`) when the argument was to a type synonym, but _not_ when the argument was to some other form of type constructor, such as a data type. The solution is to use the machinery that rejects unsaturated type synonym arguments (previously confined to `check_syn_tc_app`) to `check_arg_type`, which checks these other forms of arguments. While I was in town, I cleaned up `check_syn_tc_app` a bit to only invoke `check_arg_type` so as to minimize the number of different code paths that that function could go down. >--------------------------------------------------------------- c07e7ecbdfc05429fb6ce84c547c0365d2754db7 compiler/typecheck/TcValidity.hs | 47 +++++++++++++------------- testsuite/tests/ghci/should_fail/T16287.script | 10 ++++++ testsuite/tests/ghci/should_fail/T16287.stderr | 12 +++++++ testsuite/tests/ghci/should_fail/all.T | 1 + 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index ca58877..218f539 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -599,13 +599,13 @@ check_type _ (TyVarTy _) = return () check_type ve (AppTy ty1 ty2) = do { check_type ve ty1 - ; check_arg_type ve ty2 } + ; check_arg_type False ve ty2 } check_type ve ty@(TyConApp tc tys) | isTypeSynonymTyCon tc || isTypeFamilyTyCon tc = check_syn_tc_app ve ty tc tys | isUnboxedTupleTyCon tc = check_ubx_tuple ve ty tys - | otherwise = mapM_ (check_arg_type ve) tys + | otherwise = mapM_ (check_arg_type False ve) tys check_type _ (LitTy {}) = return () @@ -693,14 +693,8 @@ check_syn_tc_app (ve at ValidityEnv{ ve_ctxt = ctxt, ve_expand = expand }) tc_arity = tyConArity tc check_arg :: ExpandMode -> KindOrType -> TcM () - check_arg expand - | isTypeFamilyTyCon tc - = check_arg_type ve' - | otherwise - = check_type (ve'{ve_rank = synArgMonoType}) - where - ve' :: ValidityEnv - ve' = ve{ve_ctxt = arg_ctxt, ve_expand = expand} + check_arg expand = + check_arg_type (isTypeSynonymTyCon tc) (ve{ve_expand = expand}) check_args_only, check_expansion_only :: ExpandMode -> TcM () check_args_only expand = mapM_ (check_arg expand) tys @@ -713,15 +707,6 @@ check_syn_tc_app (ve at ValidityEnv{ ve_ctxt = ctxt, ve_expand = expand }) check_type (ve{ve_expand = expand}) ty' Nothing -> pprPanic "check_syn_tc_app" (ppr ty) - arg_ctxt :: UserTypeCtxt - arg_ctxt - | GhciCtxt _ <- ctxt = GhciCtxt False - -- When checking an argument, set the field of GhciCtxt to False to - -- indicate that we are no longer in an outermost position (and thus - -- unsaturated synonyms are no longer allowed). - -- See Note [Unsaturated type synonyms in GHCi] - | otherwise = ctxt - {- Note [Unsaturated type synonyms in GHCi] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -774,7 +759,9 @@ check_ubx_tuple (ve at ValidityEnv{ve_tidy_env = env}) ty tys ; mapM_ (check_type (ve{ve_rank = rank'})) tys } ---------------------------------------- -check_arg_type :: ValidityEnv -> KindOrType -> TcM () +check_arg_type + :: Bool -- ^ Is this the argument to a type synonym? + -> ValidityEnv -> KindOrType -> TcM () -- The sort of type that can instantiate a type variable, -- or be the argument of a type constructor. -- Not an unboxed tuple, but now *can* be a forall (since impredicativity) @@ -793,11 +780,14 @@ check_arg_type :: ValidityEnv -> KindOrType -> TcM () -- But not in user code. -- Anyway, they are dealt with by a special case in check_tau_type -check_arg_type _ (CoercionTy {}) = return () +check_arg_type _ _ (CoercionTy {}) = return () -check_arg_type (ve at ValidityEnv{ve_rank = rank}) ty +check_arg_type type_syn (ve at ValidityEnv{ve_ctxt = ctxt, ve_rank = rank}) ty = do { impred <- xoptM LangExt.ImpredicativeTypes ; let rank' = case rank of -- Predictive => must be monotype + -- Rank-n arguments to type synonyms are OK, provided + -- that LiberalTypeSynonyms is enabled. + _ | type_syn -> synArgMonoType MustBeMonoType -> MustBeMonoType -- Monotype, regardless _other | impred -> ArbitraryRank | otherwise -> tyConArgMonoType @@ -805,8 +795,17 @@ check_arg_type (ve at ValidityEnv{ve_rank = rank}) ty -- so that we don't suggest -XImpredicativeTypes in -- (Ord (forall a.a)) => a -> a -- and so that if it Must be a monotype, we check that it is! - - ; check_type (ve{ve_rank = rank'}) ty } + ctxt' :: UserTypeCtxt + ctxt' + | GhciCtxt _ <- ctxt = GhciCtxt False + -- When checking an argument, set the field of GhciCtxt to + -- False to indicate that we are no longer in an outermost + -- position (and thus unsaturated synonyms are no longer + -- allowed). + -- See Note [Unsaturated type synonyms in GHCi] + | otherwise = ctxt + + ; check_type (ve{ve_ctxt = ctxt', ve_rank = rank'}) ty } ---------------------------------------- forAllTyErr :: TidyEnv -> Rank -> Type -> (TidyEnv, SDoc) diff --git a/testsuite/tests/ghci/should_fail/T16287.script b/testsuite/tests/ghci/should_fail/T16287.script new file mode 100644 index 0000000..9976832 --- /dev/null +++ b/testsuite/tests/ghci/should_fail/T16287.script @@ -0,0 +1,10 @@ +:set -XPolyKinds -XRankNTypes -XTypeFamilies +import Data.Kind +type F1 a = a +type family F2 :: k +data T1 :: (Type -> Type) -> Type +data T2 :: (forall k. k) -> Type +:kind T1 F1 +:kind T2 F2 +:kind Maybe (T1 F1) +:kind Maybe (T2 F2) diff --git a/testsuite/tests/ghci/should_fail/T16287.stderr b/testsuite/tests/ghci/should_fail/T16287.stderr new file mode 100644 index 0000000..13f0852 --- /dev/null +++ b/testsuite/tests/ghci/should_fail/T16287.stderr @@ -0,0 +1,12 @@ + +:1:1: error: + The type synonym ‘F1’ should have 1 argument, but has been given none + +:1:1: error: + The type family ‘F2’ should have no arguments, but has been given none + +:1:1: error: + The type synonym ‘F1’ should have 1 argument, but has been given none + +:1:1: error: + The type family ‘F2’ should have no arguments, but has been given none diff --git a/testsuite/tests/ghci/should_fail/all.T b/testsuite/tests/ghci/should_fail/all.T index 5e0a18c..da01a98 100644 --- a/testsuite/tests/ghci/should_fail/all.T +++ b/testsuite/tests/ghci/should_fail/all.T @@ -3,3 +3,4 @@ test('T10549a', [], ghci_script, ['T10549a.script']) test('T14608', [], ghci_script, ['T14608.script']) test('T15055', normalise_version('ghc'), ghci_script, ['T15055.script']) test('T16013', [], ghci_script, ['T16013.script']) +test('T16287', [], ghci_script, ['T16287.script']) From git at git.haskell.org Thu Feb 7 17:11:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:22 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: testsuite: Mark T14740 and tcfail159 as broken in debugged compiler (71d5ab0) Message-ID: <20190207171122.D8B0D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/71d5ab07fe413fb0d9b04b6b55abc6055c1f0a2e/ghc >--------------------------------------------------------------- commit 71d5ab07fe413fb0d9b04b6b55abc6055c1f0a2e Author: Ben Gamari Date: Sun Dec 30 13:32:50 2018 -0500 testsuite: Mark T14740 and tcfail159 as broken in debugged compiler As noted in #16113, these trigger an assertion in isUnliftedRuntimeRep. >--------------------------------------------------------------- 71d5ab07fe413fb0d9b04b6b55abc6055c1f0a2e testsuite/tests/parser/should_fail/all.T | 2 +- testsuite/tests/typecheck/should_fail/all.T | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 62ff1df..ad23574 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -115,7 +115,7 @@ test('T12610', normal, compile_fail, ['']) test('T13450', normal, compile_fail, ['']) test('T13450TH', normal, compile_fail, ['']) test('T14588', normal, compile_fail, ['']) -test('T14740', normal, compile_fail, ['']) +test('T14740', when(compiler_debugged(), expect_broken(16113)), compile_fail, ['']) test('T15209', normal, compile_fail, ['']) test('NoNumericUnderscores0', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index a87c846..52f02cf 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -143,7 +143,7 @@ test('tcfail156', normal, compile_fail, ['']) test('tcfail157', normal, compile_fail, ['']) # Skip tcfail158 until Trac ticket #15899 fixes the broken test test('tcfail158', skip, compile_fail, ['']) -test('tcfail159', normal, compile_fail, ['']) +test('tcfail159', when(compiler_debugged(), expect_broken(16113)), compile_fail, ['']) test('tcfail160', normal, compile_fail, ['']) test('tcfail161', normal, compile_fail, ['']) test('tcfail162', normal, compile_fail, ['']) From git at git.haskell.org Thu Feb 7 17:11:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:25 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Revert "gitlab-ci: More aggressive artifact expiration" (701cfb3) Message-ID: <20190207171125.DFB6F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/701cfb3e658b64f136f66529c7cb8fa6987076ce/ghc >--------------------------------------------------------------- commit 701cfb3e658b64f136f66529c7cb8fa6987076ce Author: Matthew Pickering Date: Sun Feb 3 11:30:49 2019 +0000 Revert "gitlab-ci: More aggressive artifact expiration" This reverts commit d87b38a2519212aaf8bad927c65abecc509a7212. >--------------------------------------------------------------- 701cfb3e658b64f136f66529c7cb8fa6987076ce .gitlab-ci.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b1f7ef..a9814b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,7 +103,7 @@ validate-x86_64-linux-deb8-hadrian: artifacts: reports: junit: junit.xml - expire_in: 3 day + expire_in: 2 week paths: - ghc.tar.xz - junit.xml @@ -133,7 +133,7 @@ validate-x86_64-darwin: - cp -Rf $HOME/.cabal cabal-cache artifacts: when: always - expire_in: 3 day + expire_in: 2 week cache: key: darwin paths: @@ -169,6 +169,7 @@ validate-aarch64-linux-deb9: allow_failure: true artifacts: when: always + expire_in: 2 week cache: key: linux-aarch64-deb9 tags: @@ -178,7 +179,7 @@ nightly-aarch64-linux-deb9: extends: validate-aarch64-linux-deb9 stage: full-build artifacts: - expire_in: 6 month + expire_in: 2 year variables: TEST_TYPE: slowtest only: @@ -190,6 +191,9 @@ validate-i386-linux-deb9: stage: full-build image: ghcci/i386-linux-deb9:0.1 allow_failure: true + artifacts: + when: always + expire_in: 2 week cache: key: linux-i386-deb9 @@ -202,6 +206,7 @@ nightly-i386-linux-deb9: TEST_TYPE: slowtest artifacts: when: always + expire_in: 2 week only: variables: - $NIGHTLY @@ -222,6 +227,9 @@ validate-x86_64-linux-deb9: extends: .validate-linux stage: build image: ghcci/x86_64-linux-deb9:0.2 + artifacts: + when: always + expire_in: 2 week cache: key: linux-x86_64-deb9 @@ -229,8 +237,7 @@ nightly-x86_64-linux-deb9: extends: validate-x86_64-linux-deb9 stage: build artifacts: - when: always - expire_in: 1 year + expire_in: 2 year variables: TEST_TYPE: slowtest only: @@ -241,9 +248,6 @@ validate-x86_64-linux-deb9-llvm: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-deb9:0.2 - artifacts: - # Don't keep artifacts for LLVM builds - paths: variables: BUILD_FLAVOUR: perf-llvm cache: @@ -255,6 +259,9 @@ validate-x86_64-linux-deb8: image: ghcci/x86_64-linux-deb8:0.1 cache: key: linux-x86_64-deb8 + artifacts: + when: always + expire_in: 2 week validate-x86_64-linux-fedora27: extends: .validate-linux @@ -264,7 +271,7 @@ validate-x86_64-linux-fedora27: key: linux-x86_64-fedora27 artifacts: when: always - expire_in: 3 day + expire_in: 2 week validate-x86_64-linux-deb9-integer-simple: extends: .validate-linux @@ -279,7 +286,7 @@ nightly-x86_64-linux-deb9-integer-simple: extends: validate-x86_64-linux-deb9-integer-simple stage: full-build artifacts: - expire_in: 1 year + expire_in: 2 year variables: TEST_TYPE: slowtest only: From git at git.haskell.org Thu Feb 7 17:11:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:29 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: gitlab-ci: Add a devel2 build (c32de5f) Message-ID: <20190207171129.170723A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/c32de5f4f85bffb07cdd6e8c99b4789e1952b16e/ghc >--------------------------------------------------------------- commit c32de5f4f85bffb07cdd6e8c99b4789e1952b16e Author: Ben Gamari Date: Sat Dec 22 00:59:43 2018 -0500 gitlab-ci: Add a devel2 build >--------------------------------------------------------------- c32de5f4f85bffb07cdd6e8c99b4789e1952b16e .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07a1d47..a9814b1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -213,6 +213,16 @@ nightly-i386-linux-deb9: cache: key: linux-i386-deb9 +# N.B. Has DEBUG assertions enabled in stage2 +validate-x86_64-linux-deb9-debug: + extends: .validate-linux + stage: build + image: ghcci/x86_64-linux-deb9:0.2 + variables: + BUILD_FLAVOUR: devel2 + cache: + key: linux-x86_64-deb9 + validate-x86_64-linux-deb9: extends: .validate-linux stage: build From git at git.haskell.org Thu Feb 7 17:11:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:32 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: testsuite: Mark T11334b as broken in debugged compiler (606db8c) Message-ID: <20190207171132.28FDB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/606db8c2580d40157e0aa6a9352b3d2e18ab6bc6/ghc >--------------------------------------------------------------- commit 606db8c2580d40157e0aa6a9352b3d2e18ab6bc6 Author: Ben Gamari Date: Sun Dec 30 13:28:07 2018 -0500 testsuite: Mark T11334b as broken in debugged compiler As noted in #16112. >--------------------------------------------------------------- 606db8c2580d40157e0aa6a9352b3d2e18ab6bc6 testsuite/tests/dependent/should_fail/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T index f127220..a75886e 100644 --- a/testsuite/tests/dependent/should_fail/all.T +++ b/testsuite/tests/dependent/should_fail/all.T @@ -9,7 +9,7 @@ test('SelfDep', normal, compile_fail, ['']) test('BadTelescope4', normal, compile_fail, ['']) test('RenamingStar', normal, compile_fail, ['']) test('T11407', normal, compile_fail, ['']) -test('T11334b', normal, compile_fail, ['']) +test('T11334b', when(compiler_debugged(), expect_broken(16112)), compile_fail, ['']) test('T11473', normal, compile_fail, ['']) test('T11471', normal, compile_fail, ['']) test('T12174', normal, compile_fail, ['']) From git at git.haskell.org Thu Feb 7 17:11:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:35 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: testsuite: Mark recomp007 as broken in debugged compiler (7e495b4) Message-ID: <20190207171135.339E03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/7e495b402f8350a856abcb2a8a58d694c03c5367/ghc >--------------------------------------------------------------- commit 7e495b402f8350a856abcb2a8a58d694c03c5367 Author: Ben Gamari Date: Sun Dec 30 13:30:32 2018 -0500 testsuite: Mark recomp007 as broken in debugged compiler As noted in #14759, this triggers a warning in ListSetOps. >--------------------------------------------------------------- 7e495b402f8350a856abcb2a8a58d694c03c5367 testsuite/tests/driver/recomp007/all.T | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/driver/recomp007/all.T b/testsuite/tests/driver/recomp007/all.T index 34061ad..14c3371 100644 --- a/testsuite/tests/driver/recomp007/all.T +++ b/testsuite/tests/driver/recomp007/all.T @@ -2,6 +2,7 @@ # See the patch # "Fix a recompilation checking bug when a package dependency changes" -test('recomp007', [extra_files(['Setup.hs', 'a1/', 'a2/', 'b/']), - when(fast(), skip), normalise_slashes], - makefile_test, []) +test('recomp007', [extra_files(['Setup.hs', 'a1/', 'a2/', 'b/']) + , when(compiler_debugged(), expect_broken(14759)) + , when(fast(), skip) + , normalise_slashes], makefile_test, []) From git at git.haskell.org Thu Feb 7 17:11:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:38 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: gitlab-ci: More aggressive artifact expiration (0620e59) Message-ID: <20190207171138.423D03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/0620e59aa2ffff81e13c17c0421c11bd2a8eeee7/ghc >--------------------------------------------------------------- commit 0620e59aa2ffff81e13c17c0421c11bd2a8eeee7 Author: Ben Gamari Date: Sun Dec 30 13:22:38 2018 -0500 gitlab-ci: More aggressive artifact expiration >--------------------------------------------------------------- 0620e59aa2ffff81e13c17c0421c11bd2a8eeee7 .gitlab-ci.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9814b1..3b1f7ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -103,7 +103,7 @@ validate-x86_64-linux-deb8-hadrian: artifacts: reports: junit: junit.xml - expire_in: 2 week + expire_in: 3 day paths: - ghc.tar.xz - junit.xml @@ -133,7 +133,7 @@ validate-x86_64-darwin: - cp -Rf $HOME/.cabal cabal-cache artifacts: when: always - expire_in: 2 week + expire_in: 3 day cache: key: darwin paths: @@ -169,7 +169,6 @@ validate-aarch64-linux-deb9: allow_failure: true artifacts: when: always - expire_in: 2 week cache: key: linux-aarch64-deb9 tags: @@ -179,7 +178,7 @@ nightly-aarch64-linux-deb9: extends: validate-aarch64-linux-deb9 stage: full-build artifacts: - expire_in: 2 year + expire_in: 6 month variables: TEST_TYPE: slowtest only: @@ -191,9 +190,6 @@ validate-i386-linux-deb9: stage: full-build image: ghcci/i386-linux-deb9:0.1 allow_failure: true - artifacts: - when: always - expire_in: 2 week cache: key: linux-i386-deb9 @@ -206,7 +202,6 @@ nightly-i386-linux-deb9: TEST_TYPE: slowtest artifacts: when: always - expire_in: 2 week only: variables: - $NIGHTLY @@ -227,9 +222,6 @@ validate-x86_64-linux-deb9: extends: .validate-linux stage: build image: ghcci/x86_64-linux-deb9:0.2 - artifacts: - when: always - expire_in: 2 week cache: key: linux-x86_64-deb9 @@ -237,7 +229,8 @@ nightly-x86_64-linux-deb9: extends: validate-x86_64-linux-deb9 stage: build artifacts: - expire_in: 2 year + when: always + expire_in: 1 year variables: TEST_TYPE: slowtest only: @@ -248,6 +241,9 @@ validate-x86_64-linux-deb9-llvm: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-deb9:0.2 + artifacts: + # Don't keep artifacts for LLVM builds + paths: variables: BUILD_FLAVOUR: perf-llvm cache: @@ -259,9 +255,6 @@ validate-x86_64-linux-deb8: image: ghcci/x86_64-linux-deb8:0.1 cache: key: linux-x86_64-deb8 - artifacts: - when: always - expire_in: 2 week validate-x86_64-linux-fedora27: extends: .validate-linux @@ -271,7 +264,7 @@ validate-x86_64-linux-fedora27: key: linux-x86_64-fedora27 artifacts: when: always - expire_in: 2 week + expire_in: 3 day validate-x86_64-linux-deb9-integer-simple: extends: .validate-linux @@ -286,7 +279,7 @@ nightly-x86_64-linux-deb9-integer-simple: extends: validate-x86_64-linux-deb9-integer-simple stage: full-build artifacts: - expire_in: 2 year + expire_in: 1 year variables: TEST_TYPE: slowtest only: From git at git.haskell.org Thu Feb 7 17:11:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:41 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: testsuite: Mark T5515 as broken with debugged compiler (aad05fb) Message-ID: <20190207171141.4795F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/aad05fb3b36b93b919622f8a6dc032109d040d16/ghc >--------------------------------------------------------------- commit aad05fb3b36b93b919622f8a6dc032109d040d16 Author: Ben Gamari Date: Mon Jan 28 16:58:15 2019 -0500 testsuite: Mark T5515 as broken with debugged compiler As noted in #16251. >--------------------------------------------------------------- aad05fb3b36b93b919622f8a6dc032109d040d16 testsuite/tests/indexed-types/should_fail/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index 4e29910..8aef2e7 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -69,7 +69,7 @@ test('T2664a', normal, compile, ['']) test('T2544', normal, compile_fail, ['']) test('T1897b', normal, compile_fail, ['']) test('T5439', normal, compile_fail, ['']) -test('T5515', normal, compile_fail, ['']) +test('T5515', when(compiler_debugged(), expect_broken(16251)), compile_fail, ['']) test('T5934', normal, compile_fail, ['']) test('T6123', normal, compile_fail, ['']) test('ExtraTcsUntch', normal, compile_fail, ['']) From git at git.haskell.org Thu Feb 7 17:11:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:45 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Fix #14729 by making the normaliser homogeneous (9f1f6b8) Message-ID: <20190207171145.E83AA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/9f1f6b85e08d0d39ac28c45fb1366d26e7504e9f/ghc >--------------------------------------------------------------- commit 9f1f6b85e08d0d39ac28c45fb1366d26e7504e9f Author: Richard Eisenberg Date: Thu Jan 24 10:22:58 2019 -0500 Fix #14729 by making the normaliser homogeneous This ports the fix to #12919 to the normaliser. (#12919 was about the flattener.) Because the fix is involved, this is done by moving the critical piece of code to Coercion, and then calling this from both the flattener and the normaliser. The key bit is: simplifying type families in a type is always a *homogeneous* operation. See #12919 for a discussion of why this is the Right Way to simplify type families. Also fixes #15549. test case: dependent/should_compile/T14729{,kind} typecheck/should_compile/T15549[ab] >--------------------------------------------------------------- 9f1f6b85e08d0d39ac28c45fb1366d26e7504e9f compiler/deSugar/Check.hs | 8 +- compiler/typecheck/TcFlatten.hs | 371 ++----------------- compiler/types/Coercion.hs | 398 ++++++++++++++++++++- compiler/types/FamInstEnv.hs | 133 +++++-- compiler/types/Type.hs | 6 +- testsuite/tests/dependent/should_compile/T14729.hs | 15 + .../tests/dependent/should_compile/T14729.stderr | 15 + .../dependent/should_compile/T14729kind.script | 6 + .../dependent/should_compile/T14729kind.stdout | 2 + testsuite/tests/dependent/should_compile/all.T | 2 + .../tests/typecheck/should_compile/T15549a.hs | 20 ++ .../tests/typecheck/should_compile/T15549b.hs | 29 ++ testsuite/tests/typecheck/should_compile/all.T | 2 + 13 files changed, 636 insertions(+), 371 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 9f1f6b85e08d0d39ac28c45fb1366d26e7504e9f From git at git.haskell.org Thu Feb 7 17:11:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:48 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Update array submodule (7cefab7) Message-ID: <20190207171148.E83923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/7cefab74559947aa40621054e2e4d818f72a56d4/ghc >--------------------------------------------------------------- commit 7cefab74559947aa40621054e2e4d818f72a56d4 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:36 2019 +0100 Update array submodule >--------------------------------------------------------------- 7cefab74559947aa40621054e2e4d818f72a56d4 libraries/array | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/array b/libraries/array index 82a29b1..8593a10 160000 --- a/libraries/array +++ b/libraries/array @@ -1 +1 @@ -Subproject commit 82a29b198a67f54de2f72d96ca077800afbfbe4f +Subproject commit 8593a10f65020da3854b1c8478082d454b416118 From git at git.haskell.org Thu Feb 7 17:11:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:52 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Update hpc submodule (6b14dcb) Message-ID: <20190207171152.08BCD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/6b14dcbced662a3899c2b620a6a4c93db10358aa/ghc >--------------------------------------------------------------- commit 6b14dcbced662a3899c2b620a6a4c93db10358aa Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update hpc submodule >--------------------------------------------------------------- 6b14dcbced662a3899c2b620a6a4c93db10358aa libraries/hpc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/hpc b/libraries/hpc index 2678098..75f898b 160000 --- a/libraries/hpc +++ b/libraries/hpc @@ -1 +1 @@ -Subproject commit 26780988735bdb8fdbeffb59c4a8d585b9e46c3e +Subproject commit 75f898badf40cddba7b3bcf149648e49095a52f9 From git at git.haskell.org Thu Feb 7 17:11:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:55 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Hadrian: compile libgmp static on Windows (1913872) Message-ID: <20190207171155.0CB353A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/1913872c7673d57a2103c96f5ed76ca00a8d3478/ghc >--------------------------------------------------------------- commit 1913872c7673d57a2103c96f5ed76ca00a8d3478 Author: Tamar Christina Date: Sun Jan 27 21:30:50 2019 +0000 Hadrian: compile libgmp static on Windows >--------------------------------------------------------------- 1913872c7673d57a2103c96f5ed76ca00a8d3478 hadrian/src/Settings/Packages.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 4be0fba..e261dfe 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -137,6 +137,9 @@ packageArgs = do , builder (Cabal Setup) ? mconcat [ flag GmpInTree ? arg "--configure-option=--with-intree-gmp" + -- Windows is always built with inplace GMP until we have dynamic + -- linking working. + , windowsHost ? arg "--configure-option=--with-intree-gmp" , flag GmpFrameworkPref ? arg "--configure-option=--with-gmp-framework-preferred" , arg ("--configure-option=CFLAGS=" ++ includeGmp) From git at git.haskell.org Thu Feb 7 17:11:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:11:58 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Fix test for T16180 on Darwin (fix #16128) (f3e1eb4) Message-ID: <20190207171158.0C9483A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/f3e1eb43dac3e7933a1bd40f47586cdb7052225c/ghc >--------------------------------------------------------------- commit f3e1eb43dac3e7933a1bd40f47586cdb7052225c Author: Sylvain Henry Date: Tue Jan 29 02:14:12 2019 +0100 Fix test for T16180 on Darwin (fix #16128) >--------------------------------------------------------------- f3e1eb43dac3e7933a1bd40f47586cdb7052225c testsuite/tests/th/T16180.hs | 21 ++++++++++----------- testsuite/tests/th/all.T | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/testsuite/tests/th/T16180.hs b/testsuite/tests/th/T16180.hs index 2a4b80c..073ad7a 100644 --- a/testsuite/tests/th/T16180.hs +++ b/testsuite/tests/th/T16180.hs @@ -4,19 +4,18 @@ module Main where import Language.Haskell.TH.Syntax import Foreign.C.String +import Config -- from "ghc" package $(do - -- some architectures require a "_" symbol prefix... - -- GHC defines a LEADING_UNDERSCORE CPP constant to indicate this. - addForeignSource LangAsm - "#if defined(LEADING_UNDERSCORE)\n\ - \.global \"_mydata\"\n\ - \_mydata:\n\ - \#else\n\ - \.global \"mydata\"\n\ - \mydata:\n\ - \#endif\n\ - \.ascii \"Hello world\\0\"\n" + -- some targets (e.g. Darwin) require a "_" symbol prefix... + addForeignSource LangAsm (if cLeadingUnderscore == "YES" + then ".global \"_mydata\"\n\ + \_mydata:\n\ + \.ascii \"Hello world\\0\"\n" + else ".global \"mydata\"\n\ + \mydata:\n\ + \.ascii \"Hello world\\0\"\n" + ) return []) foreign import ccall "&mydata" mystring :: CString diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 59123fa..0d34c69 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -461,5 +461,5 @@ test('T15437', expect_broken(15437), multimod_compile, test('T15985', normal, compile, ['']) test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) -test('T16180', when(opsys('darwin'), expect_broken(16218)), compile_and_run, ['']) +test('T16180', normal, compile_and_run, ['-package ghc']) test('T16183', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Thu Feb 7 17:12:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:01 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Update filepath submodule (e99ac32) Message-ID: <20190207171201.0E1FF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/e99ac32948496554304d6d0b776ebb66692ee81f/ghc >--------------------------------------------------------------- commit e99ac32948496554304d6d0b776ebb66692ee81f Author: Herbert Valerio Riedel Date: Fri Feb 1 22:48:40 2019 +0100 Update filepath submodule >--------------------------------------------------------------- e99ac32948496554304d6d0b776ebb66692ee81f libraries/filepath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/filepath b/libraries/filepath index b10724b..39035d6 160000 --- a/libraries/filepath +++ b/libraries/filepath @@ -1 +1 @@ -Subproject commit b10724be8a907e191d153ad6674415be0c1325fd +Subproject commit 39035d6433fff2356cf65747649666ed9b6e83e1 From git at git.haskell.org Thu Feb 7 17:12:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:04 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Update directory submodule (1dfe356) Message-ID: <20190207171204.125FC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/1dfe35664a0540f2d607cef44dda728c11dbdbc2/ghc >--------------------------------------------------------------- commit 1dfe35664a0540f2d607cef44dda728c11dbdbc2 Author: Herbert Valerio Riedel Date: Fri Feb 1 22:48:07 2019 +0100 Update directory submodule >--------------------------------------------------------------- 1dfe35664a0540f2d607cef44dda728c11dbdbc2 libraries/directory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/directory b/libraries/directory index 19d6dc0..59883e9 160000 --- a/libraries/directory +++ b/libraries/directory @@ -1 +1 @@ -Subproject commit 19d6dc0d33366a8920bf8acc7a0fd3ef533d39c3 +Subproject commit 59883e953d488492487dcda266901080347bbf1e From git at git.haskell.org Thu Feb 7 17:12:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:07 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: rts/ProfilerReportJson: Fix format string (d9b885c) Message-ID: <20190207171207.1234C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/d9b885cd6fcc60660e1a9780e59054eb7520d494/ghc >--------------------------------------------------------------- commit d9b885cd6fcc60660e1a9780e59054eb7520d494 Author: Ben Gamari Date: Mon Feb 4 21:42:41 2019 -0500 rts/ProfilerReportJson: Fix format string This was warning on i386. >--------------------------------------------------------------- d9b885cd6fcc60660e1a9780e59054eb7520d494 rts/ProfilerReportJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c index a786921..ea7c852 100644 --- a/rts/ProfilerReportJson.c +++ b/rts/ProfilerReportJson.c @@ -66,7 +66,7 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " - "\"alloc\": %" FMT_Word ", " + "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, From git at git.haskell.org Thu Feb 7 17:12:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:10 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Cleanup in parser/Ctype.hs (d5a9d9c) Message-ID: <20190207171210.1EBD33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/d5a9d9c54bebeda4363d07ba1b2192498182ad76/ghc >--------------------------------------------------------------- commit d5a9d9c54bebeda4363d07ba1b2192498182ad76 Author: Sylvain Henry Date: Tue Feb 5 15:55:03 2019 +0100 Cleanup in parser/Ctype.hs * GHC now performs constant folding on bit operations like (.|.) so we use them and we remove the misleading comment * we use Word8 instead of Int and we remove the useless conversion to Int32. Hopefully future releases of GHC could transform the big case in `charType` into a value table indexing instead of a jump table. Word8 would make the table smaller. * we use INLINABLE pragma instead of INLINE on `is_ctype`: in my test, the latter *prevents* `is_ctype` to be inlined because `charType` is inlined into `is_ctype` (to call charType`s worker on the unboxed Char directly). >--------------------------------------------------------------- d5a9d9c54bebeda4363d07ba1b2192498182ad76 compiler/parser/Ctype.hs | 273 +++++++++++++++++++++++------------------------ 1 file changed, 135 insertions(+), 138 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 d5a9d9c54bebeda4363d07ba1b2192498182ad76 From git at git.haskell.org Thu Feb 7 17:12:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:13 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Fix optSemi type in Parser.y (879fc87) Message-ID: <20190207171213.1E3473A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/879fc879934a4c97cffa20140c130b67a122414d/ghc >--------------------------------------------------------------- commit 879fc879934a4c97cffa20140c130b67a122414d Author: Vladislav Zavialov Date: Tue Feb 5 20:01:36 2019 -0500 Fix optSemi type in Parser.y The definition of 'optSemi' claimed it had type ([Located a],Bool) Note that its production actually returns ([Located Token],Bool): : ';' { ([$1],True) } -- $1 :: Located Token Due to an infelicity in the implementation of 'happy -c', it effectively resulted in 'unsafeCoerce :: Token -> a'. See https://github.com/simonmar/happy/pull/134 If any consumer of 'optSemi' tried to instantiate 'a' to something not representationally equal to 'Token', they would experience a segfault. In addition to that, this definition made it impossible to compile Parser.y without the -c flag (as it's reliant on this bug to cast 'Token' to 'forall a. a'). >--------------------------------------------------------------- 879fc879934a4c97cffa20140c130b67a122414d compiler/parser/Parser.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index ce5c523..2d1e8f3 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1,4 +1,3 @@ - -- -*-haskell-*- -- --------------------------------------------------------------------------- -- (c) The University of Glasgow 1997-2003 @@ -2580,7 +2579,7 @@ exp10 :: { LHsExpr GhcPs } | scc_annot exp {% ams (sLL $1 $> $ HsSCC noExt (snd $ fst $ unLoc $1) (snd $ unLoc $1) $2) (fst $ fst $ unLoc $1) } -optSemi :: { ([Located a],Bool) } +optSemi :: { ([Located Token],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } From git at git.haskell.org Thu Feb 7 17:12:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:16 +0000 (UTC) Subject: [commit: ghc] wip/marge_bot_batch_merge_job: Remove a few undefined prel names (4f65c42) Message-ID: <20190207171216.2A3ED3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/marge_bot_batch_merge_job Link : http://ghc.haskell.org/trac/ghc/changeset/4f65c42ce3c80eb52528450a11daf499df0599df/ghc >--------------------------------------------------------------- commit 4f65c42ce3c80eb52528450a11daf499df0599df Author: Ömer Sinan Ağacan Date: Wed Feb 6 10:26:00 2019 +0300 Remove a few undefined prel names - breakpointAuto - breakpointJump - breakpointCondJump - breakpointAutoJump These Ids are never defined, but there were definitions about those in PrelNames. Those are now removed. >--------------------------------------------------------------- 4f65c42ce3c80eb52528450a11daf499df0599df compiler/prelude/PrelNames.hs | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 5c86f65..94bb928 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -360,7 +360,7 @@ basicKnownKeyNames -- Others otherwiseIdName, inlineIdName, eqStringName, assertName, breakpointName, breakpointCondName, - breakpointAutoName, opaqueTyConName, + opaqueTyConName, assertErrorName, traceName, printName, fstName, sndName, dollarName, @@ -1081,7 +1081,7 @@ groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey -- Random PrelBase functions fromStringName, otherwiseIdName, foldrName, buildName, augmentName, mapName, appendName, assertName, - breakpointName, breakpointCondName, breakpointAutoName, + breakpointName, breakpointCondName, opaqueTyConName, dollarName :: Name dollarName = varQual gHC_BASE (fsLit "$") dollarIdKey otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey @@ -1093,29 +1093,9 @@ appendName = varQual gHC_BASE (fsLit "++") appendIdKey assertName = varQual gHC_BASE (fsLit "assert") assertIdKey breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey -breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey -breakpointJumpName :: Name -breakpointJumpName - = mkInternalName - breakpointJumpIdKey - (mkOccNameFS varName (fsLit "breakpointJump")) - noSrcSpan -breakpointCondJumpName :: Name -breakpointCondJumpName - = mkInternalName - breakpointCondJumpIdKey - (mkOccNameFS varName (fsLit "breakpointCondJump")) - noSrcSpan -breakpointAutoJumpName :: Name -breakpointAutoJumpName - = mkInternalName - breakpointAutoJumpIdKey - (mkOccNameFS varName (fsLit "breakpointAutoJump")) - noSrcSpan - -- PrelTup fstName, sndName :: Name fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey @@ -2224,15 +2204,9 @@ runRWKey = mkPreludeMiscIdUnique 107 traceKey :: Unique traceKey = mkPreludeMiscIdUnique 108 -breakpointIdKey, breakpointCondIdKey, breakpointAutoIdKey, - breakpointJumpIdKey, breakpointCondJumpIdKey, - breakpointAutoJumpIdKey :: Unique +breakpointIdKey, breakpointCondIdKey :: Unique breakpointIdKey = mkPreludeMiscIdUnique 110 breakpointCondIdKey = mkPreludeMiscIdUnique 111 -breakpointAutoIdKey = mkPreludeMiscIdUnique 112 -breakpointJumpIdKey = mkPreludeMiscIdUnique 113 -breakpointCondJumpIdKey = mkPreludeMiscIdUnique 114 -breakpointAutoJumpIdKey = mkPreludeMiscIdUnique 115 inlineIdKey, noinlineIdKey :: Unique inlineIdKey = mkPreludeMiscIdUnique 120 From git at git.haskell.org Thu Feb 7 17:12:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:19 +0000 (UTC) Subject: [commit: ghc] wip/dmd-arity: Look at idArity in useLetUp (bb61b43) Message-ID: <20190207171219.2F5423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dmd-arity Link : http://ghc.haskell.org/trac/ghc/changeset/bb61b4336e23692580b1ae44de0f216423b85bcf/ghc >--------------------------------------------------------------- commit bb61b4336e23692580b1ae44de0f216423b85bcf Author: Sebastian Graf Date: Thu Feb 7 15:52:31 2019 +0100 Look at idArity in useLetUp >--------------------------------------------------------------- bb61b4336e23692580b1ae44de0f216423b85bcf compiler/stranal/DmdAnal.hs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index 6e10c98..e4230e0 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -286,7 +286,7 @@ dmdAnal' env dmd (Case scrut case_bndr ty alts) -- This is used for a non-recursive local let without manifest lambdas. -- This is the LetUp rule in the paper “Higher-Order Cardinality Analysis”. dmdAnal' env dmd (Let (NonRec id rhs) body) - | useLetUp id rhs + | useLetUp id , Nothing <- unpackTrivial rhs -- dmdAnalRhsLetDown treats trivial right hand sides specially -- so if we have a trival right hand side, fall through to that. @@ -683,19 +683,22 @@ unpackTrivial (Lam v e) | isTyVar v = unpackTrivial e unpackTrivial (App e a) | isTypeArg a = unpackTrivial e unpackTrivial _ = Nothing --- | If given the RHS of a let-binding, this 'useLetUp' determines --- whether we should process the binding up (body before rhs) or --- down (rhs before body). +-- | If given the let-bound 'Id', 'useLetUp' determines whether we should +-- process the binding up (body before rhs) or down (rhs before body). -- -- We use LetDown if there is a chance to get a useful strictness signature. --- This is the case when there are manifest value lambdas or the binding is a --- join point (hence always acts like a function, not a value). -useLetUp :: Var -> CoreExpr -> Bool -useLetUp f _ | isJoinId f = False -useLetUp f (Lam v e) | isTyVar v = useLetUp f e -useLetUp _ (Lam _ _) = False -useLetUp _ _ = True - +-- This is the case when it takes any arguments before performing meaningful +-- work (cf. 'idArity') or the binding is a join point (hence always acts like a +-- function, not a value). +-- +-- Thus, if the binding is not a join point and its arity is 0, we use LetUp. +-- In that case, it's a thunk and we want to unleash its 'DmdEnv' of free vars +-- at most once, regardless of how many times it was forced in the body. This +-- makes a real difference wrt. usage demands. The other reason is being able to +-- unleash a more precise product demand on its RHS once we know how the thunk +-- was used in the let body. +useLetUp :: Var -> Bool +useLetUp f = idArity f == 0 && not (isJoinId f) {- Note [Demand analysis for join points] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Thu Feb 7 17:12:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:22 +0000 (UTC) Subject: [commit: ghc] wip/dmd-arity: IdInfo comments (5c77e57) Message-ID: <20190207171222.3F2B63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dmd-arity Link : http://ghc.haskell.org/trac/ghc/changeset/5c77e573c08e55060319d960ea1784f87c2b92d2/ghc >--------------------------------------------------------------- commit 5c77e573c08e55060319d960ea1784f87c2b92d2 Author: Sebastian Graf Date: Thu Feb 7 15:34:07 2019 +0100 IdInfo comments >--------------------------------------------------------------- 5c77e573c08e55060319d960ea1784f87c2b92d2 compiler/basicTypes/Id.hs | 1 + compiler/basicTypes/IdInfo.hs | 44 +++++++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs index 5e91d26..43872d8 100644 --- a/compiler/basicTypes/Id.hs +++ b/compiler/basicTypes/Id.hs @@ -655,6 +655,7 @@ isBottomingId v | isId v = isBottomingSig (idStrictness v) | otherwise = False +-- | Accesses the 'Id''s 'strictnessInfo'. idStrictness :: Id -> StrictSig idStrictness id = strictnessInfo (idInfo id) diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs index 12ea490..8a59b98 100644 --- a/compiler/basicTypes/IdInfo.hs +++ b/compiler/basicTypes/IdInfo.hs @@ -237,22 +237,34 @@ pprIdDetails other = brackets (pp other) -- too big. data IdInfo = IdInfo { - arityInfo :: !ArityInfo, -- ^ 'Id' arity - ruleInfo :: RuleInfo, -- ^ Specialisations of the 'Id's function which exist - -- See Note [Specialisations and RULES in IdInfo] - unfoldingInfo :: Unfolding, -- ^ The 'Id's unfolding - cafInfo :: CafInfo, -- ^ 'Id' CAF info - oneShotInfo :: OneShotInfo, -- ^ Info about a lambda-bound variable, if the 'Id' is one - inlinePragInfo :: InlinePragma, -- ^ Any inline pragma atached to the 'Id' - occInfo :: OccInfo, -- ^ How the 'Id' occurs in the program - - strictnessInfo :: StrictSig, -- ^ A strictness signature - - demandInfo :: Demand, -- ^ ID demand information - callArityInfo :: !ArityInfo, -- ^ How this is called. - -- n <=> all calls have at least n arguments - - levityInfo :: LevityInfo -- ^ when applied, will this Id ever have a levity-polymorphic type? + arityInfo :: !ArityInfo, + -- ^ 'Id' arity, as computed by 'CoreArity'. Specifies how many + -- arguments this 'Id' has to be applied to before it doesn any + -- meaningful work. + ruleInfo :: RuleInfo, + -- ^ Specialisations of the 'Id's function which exist. + -- See Note [Specialisations and RULES in IdInfo] + unfoldingInfo :: Unfolding, + -- ^ The 'Id's unfolding + cafInfo :: CafInfo, + -- ^ 'Id' CAF info + oneShotInfo :: OneShotInfo, + -- ^ Info about a lambda-bound variable, if the 'Id' is one + inlinePragInfo :: InlinePragma, + -- ^ Any inline pragma atached to the 'Id' + occInfo :: OccInfo, + -- ^ How the 'Id' occurs in the program + strictnessInfo :: StrictSig, + -- ^ A strictness signature. Digests how a function uses its arguments + -- if applied to at least 'arityInfo' arguments. + demandInfo :: Demand, + -- ^ ID demand information + callArityInfo :: !ArityInfo, + -- ^ How this is called. This is the number of arguments to which a + -- binding can be eta-expanded without losing any sharing. + -- n <=> all calls have at least n arguments + levityInfo :: LevityInfo + -- ^ when applied, will this Id ever have a levity-polymorphic type? } -- Setters From git at git.haskell.org Thu Feb 7 17:12:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:25 +0000 (UTC) Subject: [commit: ghc] wip/dmd-arity: Compute strictness signatures assuming idArity (79c909f) Message-ID: <20190207171225.604C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dmd-arity Link : http://ghc.haskell.org/trac/ghc/changeset/79c909f1f0f34a9f541a9228c5d649f6e44ee6a2/ghc >--------------------------------------------------------------- commit 79c909f1f0f34a9f541a9228c5d649f6e44ee6a2 Author: Sebastian Graf Date: Thu Feb 7 16:43:04 2019 +0100 Compute strictness signatures assuming idArity >--------------------------------------------------------------- 79c909f1f0f34a9f541a9228c5d649f6e44ee6a2 compiler/basicTypes/Demand.hs | 6 +----- compiler/stranal/DmdAnal.hs | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 52bdf67..a4ba7c9 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -22,7 +22,7 @@ module Demand ( DmdType(..), dmdTypeDepth, lubDmdType, bothDmdType, nopDmdType, botDmdType, mkDmdType, - addDemand, removeDmdTyArgs, + addDemand, ensureArgs, BothDmdArg, mkBothDmdArg, toBothDmdArg, DmdEnv, emptyDmdEnv, @@ -1207,10 +1207,6 @@ mkDmdType fv ds res = DmdType fv ds res dmdTypeDepth :: DmdType -> Arity dmdTypeDepth (DmdType _ ds _) = length ds --- Remove any demand on arguments. This is used in dmdAnalRhs on the body -removeDmdTyArgs :: DmdType -> DmdType -removeDmdTyArgs = ensureArgs 0 - -- This makes sure we can use the demand type with n arguments, -- It extends the argument list with the correct resTypeArgDmd -- It also adjusts the DmdResult: Divergence survives additional arguments, diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index e4230e0..082a7e7 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -634,13 +634,14 @@ dmdAnalRhsLetDown top_lvl rec_flag env let_dmd id rhs -> (bndrs, body, let_dmd) Nothing | (bndrs, body) <- collectBinders rhs - -> (bndrs, body, mkBodyDmd env body) + , let body_arity = max (idArity id - length bndrs) 0 + -> (bndrs, body, mkBodyDmd env body_arity body) env_body = foldl' extendSigsWithLam env bndrs (body_ty, body') = dmdAnal env_body body_dmd body - body_ty' = removeDmdTyArgs body_ty -- zap possible deep CPR info - (DmdType rhs_fv rhs_dmds rhs_res, bndrs') - = annotateLamBndrs env (isDFunId id) body_ty' bndrs + (rhs_ty, bndrs') = annotateLamBndrs env (isDFunId id) body_ty bndrs + DmdType rhs_fv rhs_dmds rhs_res + = ensureArgs (idArity id) rhs_ty -- zap possible deep CPR info sig_ty = mkStrictSig (mkDmdType sig_fv rhs_dmds rhs_res') id' = set_idStrictness env id sig_ty -- See Note [NOINLINE and strictness] @@ -666,10 +667,14 @@ dmdAnalRhsLetDown top_lvl rec_flag env let_dmd id rhs || not (isStrictDmd (idDemandInfo id) || ae_virgin env) -- See Note [Optimistic CPR in the "virgin" case] -mkBodyDmd :: AnalEnv -> CoreExpr -> CleanDemand +-- | Creates a 'CleanDemand' appropriate for unleashing on the given function +-- body, by wrapping a head demand into @arity@ many calls. -- See Note [Product demands for function body] -mkBodyDmd env body - = case deepSplitProductType_maybe (ae_fam_envs env) (exprType body) of +mkBodyDmd :: AnalEnv -> Arity -> CoreExpr -> CleanDemand +mkBodyDmd env arity body + = iterate mkCallDmd base !! arity + where + base = case deepSplitProductType_maybe (ae_fam_envs env) (exprType body) of Nothing -> cleanEvalDmd Just (dc, _, _, _) -> cleanEvalProdDmd (dataConRepArity dc) From git at git.haskell.org Thu Feb 7 17:12:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Feb 2019 17:12:28 +0000 (UTC) Subject: [commit: ghc] wip/dmd-arity: Don't treat trivial RHS specially (085cd6a) Message-ID: <20190207171228.836C73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dmd-arity Link : http://ghc.haskell.org/trac/ghc/changeset/085cd6af4eca15d544afc4e56f988822dae0b13f/ghc >--------------------------------------------------------------- commit 085cd6af4eca15d544afc4e56f988822dae0b13f Author: Sebastian Graf Date: Thu Feb 7 17:21:43 2019 +0100 Don't treat trivial RHS specially >--------------------------------------------------------------- 085cd6af4eca15d544afc4e56f988822dae0b13f compiler/stranal/DmdAnal.hs | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index 082a7e7..8872a1a 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -287,9 +287,6 @@ dmdAnal' env dmd (Case scrut case_bndr ty alts) -- This is the LetUp rule in the paper “Higher-Order Cardinality Analysis”. dmdAnal' env dmd (Let (NonRec id rhs) body) | useLetUp id - , Nothing <- unpackTrivial rhs - -- dmdAnalRhsLetDown treats trivial right hand sides specially - -- so if we have a trival right hand side, fall through to that. = (final_ty, Let (NonRec id' rhs') body') where (body_ty, body') = dmdAnal env dmd body @@ -582,25 +579,6 @@ environment, which effectively assigns them 'nopSig' (see "getStrictness") -} --- Trivial RHS --- See Note [Demand analysis for trivial right-hand sides] -dmdAnalTrivialRhs :: - AnalEnv -> Id -> CoreExpr -> Var -> - (DmdEnv, Id, CoreExpr) -dmdAnalTrivialRhs env id rhs fn - = (fn_fv, set_idStrictness env id fn_str, rhs) - where - fn_str = getStrictness env fn - fn_fv | isLocalId fn = unitVarEnv fn topDmd - | otherwise = emptyDmdEnv - -- Note [Remember to demand the function itself] - -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- fn_fv: don't forget to produce a demand for fn itself - -- Lacking this caused Trac #9128 - -- The demand is very conservative (topDmd), but that doesn't - -- matter; trivial bindings are usually inlined, so it only - -- kicks in for top-level bindings and NOINLINE bindings - -- Let bindings can be processed in two ways: -- Down (RHS before body) or Up (body before RHS). -- dmdAnalRhsLetDown implements the Down variant: @@ -621,10 +599,6 @@ dmdAnalRhsLetDown :: TopLevelFlag -- Process the RHS of the binding, add the strictness signature -- to the Id, and augment the environment with the signature as well. dmdAnalRhsLetDown top_lvl rec_flag env let_dmd id rhs - | Just fn <- unpackTrivial rhs -- See Note [Demand analysis for trivial right-hand sides] - = dmdAnalTrivialRhs env id rhs fn - - | otherwise = (lazy_fv, id', mkLams bndrs' body') where (bndrs, body, body_dmd) @@ -678,16 +652,6 @@ mkBodyDmd env arity body Nothing -> cleanEvalDmd Just (dc, _, _, _) -> cleanEvalProdDmd (dataConRepArity dc) -unpackTrivial :: CoreExpr -> Maybe Id --- Returns (Just v) if the arg is really equal to v, modulo --- casts, type applications etc --- See Note [Demand analysis for trivial right-hand sides] -unpackTrivial (Var v) = Just v -unpackTrivial (Cast e _) = unpackTrivial e -unpackTrivial (Lam v e) | isTyVar v = unpackTrivial e -unpackTrivial (App e a) | isTypeArg a = unpackTrivial e -unpackTrivial _ = Nothing - -- | If given the let-bound 'Id', 'useLetUp' determines whether we should -- process the binding up (body before rhs) or down (rhs before body). -- @@ -1168,12 +1132,6 @@ extendSigEnv top_lvl sigs var sig = extendVarEnv sigs var (sig, top_lvl) lookupSigEnv :: AnalEnv -> Id -> Maybe (StrictSig, TopLevelFlag) lookupSigEnv env id = lookupVarEnv (ae_sigs env) id -getStrictness :: AnalEnv -> Id -> StrictSig -getStrictness env fn - | isGlobalId fn = idStrictness fn - | Just (sig, _) <- lookupSigEnv env fn = sig - | otherwise = nopSig - nonVirgin :: AnalEnv -> AnalEnv nonVirgin env = env { ae_virgin = False } From git at git.haskell.org Fri Feb 8 17:49:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:26 +0000 (UTC) Subject: [commit: ghc] branch 'wip/andrey/cached-hadrian' created Message-ID: <20190208174926.C97903A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/andrey/cached-hadrian Referencing: 0ba321efc0729018bb4dfcfd5afaa806675ccff1 From git at git.haskell.org Fri Feb 8 17:49:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:28 +0000 (UTC) Subject: [commit: ghc] branch 'wip/cleanup-darwin-deps' created Message-ID: <20190208174928.C9AD03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/cleanup-darwin-deps Referencing: c9d394f98bbc6e06f06bab73cc806eb7a275bda5 From git at git.haskell.org Fri Feb 8 17:49:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:30 +0000 (UTC) Subject: [commit: ghc] branch 'wip/inlining-late' created Message-ID: <20190208174930.CAC5C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/inlining-late Referencing: 55f768ffd40ecebca139849850a04a05420852db From git at git.haskell.org Fri Feb 8 17:49:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:32 +0000 (UTC) Subject: [commit: ghc] branch 'wip/cleanup-tests' created Message-ID: <20190208174932.CBA7C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/cleanup-tests Referencing: de30a9638296b50e721971b0dbe888023ff2e384 From git at git.haskell.org Fri Feb 8 17:49:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:35 +0000 (UTC) Subject: [commit: ghc] wip/andrey/cached-hadrian: Enable cached builds with Hadrian (b468d9d) Message-ID: <20190208174935.E335B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/andrey/cached-hadrian Link : http://ghc.haskell.org/trac/ghc/changeset/b468d9d6f02602d76803bb5e98da9a64b94735fd/ghc >--------------------------------------------------------------- commit b468d9d6f02602d76803bb5e98da9a64b94735fd Author: Andrey Mokhov Date: Fri Feb 8 03:19:44 2019 +0000 Enable cached builds with Hadrian See #16295: https://ghc.haskell.org/trac/ghc/ticket/16295 This commit mostly focuses on getting rid of untracked dependencies, which prevent Shake's new `--shared` feature from appropriately caching build rules. There are three different solutions to untracked dependencies: * Track them! This is the obvious and the best approach, but in some situations we cannot use it, for example, because a build rule creates files whose names are not known statically and hence cannot be specified as the rule's outputs. * Use Shake's `produces` to record outputs dynamically, within the rule. * Use Shake's `historyDisable` to disable caching for a particular build rule. We currently use this approach only for `ghc-pkg` which mutates the package database and the file `package.cache`. >--------------------------------------------------------------- b468d9d6f02602d76803bb5e98da9a64b94735fd hadrian/hadrian.cabal | 2 +- hadrian/src/Base.hs | 22 +++-- hadrian/src/Builder.hs | 4 +- hadrian/src/Context.hs | 16 +--- hadrian/src/Hadrian/Haskell/Cabal.hs | 3 +- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 50 +++++++----- hadrian/src/Hadrian/Haskell/Cabal/Type.hs | 57 ++++++------- hadrian/src/Hadrian/Oracles/Cabal/Rules.hs | 7 +- hadrian/src/Oracles/ModuleFiles.hs | 8 +- hadrian/src/Packages.hs | 23 ++++-- hadrian/src/Rules.hs | 4 +- hadrian/src/Rules/Compile.hs | 125 ++++++++++++----------------- hadrian/src/Rules/Configure.hs | 2 + hadrian/src/Rules/Dependencies.hs | 36 ++++----- hadrian/src/Rules/Documentation.hs | 17 ++-- hadrian/src/Rules/Generate.hs | 65 +++++++-------- hadrian/src/Rules/Gmp.hs | 48 ++++++----- hadrian/src/Rules/Libffi.hs | 59 +++++++------- hadrian/src/Rules/Register.hs | 85 +++++++++++++------- hadrian/src/Settings.hs | 14 +++- hadrian/src/Settings/Builders/Ghc.hs | 4 +- hadrian/src/Settings/Builders/GhcPkg.hs | 2 +- hadrian/src/Settings/Builders/Hsc2Hs.hs | 4 +- hadrian/src/Settings/Default.hs | 9 +-- utils/touchy/touchy.cabal | 2 +- 25 files changed, 349 insertions(+), 319 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 b468d9d6f02602d76803bb5e98da9a64b94735fd From git at git.haskell.org Fri Feb 8 17:49:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:38 +0000 (UTC) Subject: [commit: ghc] wip/cleanup-tests: testsuite: Mark T16212 as fixed (de30a96) Message-ID: <20190208174938.E7CF93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/cleanup-tests Link : http://ghc.haskell.org/trac/ghc/changeset/de30a9638296b50e721971b0dbe888023ff2e384/ghc >--------------------------------------------------------------- commit de30a9638296b50e721971b0dbe888023ff2e384 Author: Ben Gamari Date: Fri Feb 8 01:03:03 2019 -0500 testsuite: Mark T16212 as fixed Trac #16212 was fixed in 4bf35da4fccd2a21153a1c19bfa80006e99e02a1. >--------------------------------------------------------------- de30a9638296b50e721971b0dbe888023ff2e384 testsuite/tests/ghc-api/annotations/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 212e218..09f535d 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -60,5 +60,5 @@ test('T13163', [extra_files(['Test13163.hs']), test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) # Stricter tests from trac #16217 now causes this to fail. Will be fixed for trac #16212 -test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), +test('T16212', [extra_files(['Test16212.hs']), ignore_stderr], makefile_test, ['T16212']) From git at git.haskell.org Fri Feb 8 17:49:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:41 +0000 (UTC) Subject: [commit: ghc] wip/cleanup-tests: testsuite: Always skip T15897 (29aaf8e) Message-ID: <20190208174941.E6E2F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/cleanup-tests Link : http://ghc.haskell.org/trac/ghc/changeset/29aaf8ea9db5618c9685566152b9fd3399daed12/ghc >--------------------------------------------------------------- commit 29aaf8ea9db5618c9685566152b9fd3399daed12 Author: Ben Gamari Date: Mon Feb 4 22:02:52 2019 -0500 testsuite: Always skip T15897 See #16193. >--------------------------------------------------------------- 29aaf8ea9db5618c9685566152b9fd3399daed12 testsuite/tests/profiling/should_run/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index f76b8f9..8baddcb 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -148,6 +148,6 @@ test('T14257', [], makefile_test, ['T14257']) test('T15897', [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2), - # Fragile in unregisterised way (#15467, #16227) - when(unregisterised(), skip)], + # Takes too long and is quite fragile (#15467, #16193) + skip], makefile_test, ['T15897']) From git at git.haskell.org Fri Feb 8 17:49:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:44 +0000 (UTC) Subject: [commit: ghc] wip/andrey/cached-hadrian: Drop GhcPkg Init, which is no longer used. (0ba321e) Message-ID: <20190208174944.F08333A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/andrey/cached-hadrian Link : http://ghc.haskell.org/trac/ghc/changeset/0ba321efc0729018bb4dfcfd5afaa806675ccff1/ghc >--------------------------------------------------------------- commit 0ba321efc0729018bb4dfcfd5afaa806675ccff1 Author: Andrey Mokhov Date: Fri Feb 8 13:15:58 2019 +0000 Drop GhcPkg Init, which is no longer used. Part of https://gitlab.haskell.org/ghc/ghc/merge_requests/317. >--------------------------------------------------------------- 0ba321efc0729018bb4dfcfd5afaa806675ccff1 hadrian/src/Builder.hs | 10 +++++----- hadrian/src/Rules/Gmp.hs | 10 ++++++---- hadrian/src/Settings/Builders/GhcPkg.hs | 3 +-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs index 3d50adc..02edb19 100644 --- a/hadrian/src/Builder.hs +++ b/hadrian/src/Builder.hs @@ -75,13 +75,13 @@ instance Hashable ConfigurationInfo instance NFData ConfigurationInfo -- TODO: Do we really need all these modes? Why do we need 'Dependencies'? We --- can extract dependencies using the Cabal library. +-- can extract dependencies using the Cabal library. Note: we used to also have +-- the @Init@ mode for initialising a new package database but we've deleted it. -- | 'GhcPkg' can initialise a package database and register packages in it. -data GhcPkgMode = Init -- ^ Initialize a new database. - | Update -- ^ Update a package. - | Copy -- ^ Copy a package from one database to another. - | Unregister -- ^ Unregister a package. +data GhcPkgMode = Copy -- ^ Copy a package from one database to another. | Dependencies -- ^ Compute package dependencies. + | Unregister -- ^ Unregister a package. + | Update -- ^ Update a package. deriving (Eq, Generic, Show) instance Binary GhcPkgMode diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs index 93e675b..9b56a3e 100644 --- a/hadrian/src/Rules/Gmp.hs +++ b/hadrian/src/Rules/Gmp.hs @@ -39,7 +39,7 @@ gmpContext = vanillaContext Stage1 integerGmp gmpBuildPath :: Action FilePath gmpBuildPath = buildRoot <&> (-/- stageString (stage gmpContext) -/- "gmp") --- | As 'gmpBuildPath' but in the 'Rules' monad. +-- | Like 'gmpBuildPath' but in the 'Rules' monad. gmpBuildPathRules :: Rules FilePath gmpBuildPathRules = buildRootRules <&> (-/- stageString (stage gmpContext) -/- "gmp") @@ -59,7 +59,6 @@ configureEnvironment = sequence [ builderEnvironment "CC" $ Cc CompileC Stage1 gmpRules :: Rules () gmpRules = do -- Copy appropriate GMP header and object files - root <- buildRootRules gmpPath <- gmpBuildPathRules gmpPath -/- gmpLibraryH %> \header -> do windows <- windowsHost @@ -86,8 +85,11 @@ gmpRules = do build $ target gmpContext (Make gmpPath) [gmpPath -/- "Makefile"] [lib] putSuccess "| Successfully built custom library 'gmp'" - gmpPath -/- gmpLibraryInTreeH %> copyFile (gmpPath -/- gmpLibraryH) - root -/- buildDir gmpContext -/- gmpLibraryH %> copyFile (gmpPath -/- gmpLibraryH) + gmpPath -/- gmpLibraryInTreeH %> copyFile (gmpPath -/- gmpLibraryH) + + root <- buildRootRules + root -/- buildDir gmpContext -/- gmpLibraryH %> + copyFile (gmpPath -/- gmpLibraryH) -- This file is created when 'integerGmp' is configured. gmpPath -/- "config.mk" %> \_ -> do diff --git a/hadrian/src/Settings/Builders/GhcPkg.hs b/hadrian/src/Settings/Builders/GhcPkg.hs index c9a5353..9223a9d 100644 --- a/hadrian/src/Settings/Builders/GhcPkg.hs +++ b/hadrian/src/Settings/Builders/GhcPkg.hs @@ -4,8 +4,7 @@ import Settings.Builders.Common ghcPkgBuilderArgs :: Args ghcPkgBuilderArgs = mconcat - [ builder (GhcPkg Init) ? mconcat [ arg "init", arg =<< getOutput ] -- TODO: unused? - , builder (GhcPkg Copy) ? do + [ builder (GhcPkg Copy) ? do verbosity <- expr getVerbosity stage <- getStage pkgDb <- expr $ packageDbPath stage From git at git.haskell.org Fri Feb 8 17:49:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:47 +0000 (UTC) Subject: [commit: ghc] wip/cleanup-darwin-deps: Add explicit dependencies to cleanup-darwin (c9d394f) Message-ID: <20190208174947.EE9A03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/cleanup-darwin-deps Link : http://ghc.haskell.org/trac/ghc/changeset/c9d394f98bbc6e06f06bab73cc806eb7a275bda5/ghc >--------------------------------------------------------------- commit c9d394f98bbc6e06f06bab73cc806eb7a275bda5 Author: Matthew Pickering Date: Fri Feb 8 10:54:41 2019 -0500 Add explicit dependencies to cleanup-darwin >--------------------------------------------------------------- c9d394f98bbc6e06f06bab73cc806eb7a275bda5 .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9814b1..d11d888 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -428,6 +428,7 @@ cleanup-darwin: tags: - x86_64-darwin when: always + dependencies: [] before_script: - echo "Time to clean up" script: From git at git.haskell.org Fri Feb 8 17:49:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:52 +0000 (UTC) Subject: [commit: ghc] wip/inlining-late: Fix #14729 by making the normaliser homogeneous (2b90356) Message-ID: <20190208174952.ED5D13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/inlining-late Link : http://ghc.haskell.org/trac/ghc/changeset/2b90356d26b4699227816ad9424e766eccdb6c36/ghc >--------------------------------------------------------------- commit 2b90356d26b4699227816ad9424e766eccdb6c36 Author: Richard Eisenberg Date: Thu Jan 24 10:22:58 2019 -0500 Fix #14729 by making the normaliser homogeneous This ports the fix to #12919 to the normaliser. (#12919 was about the flattener.) Because the fix is involved, this is done by moving the critical piece of code to Coercion, and then calling this from both the flattener and the normaliser. The key bit is: simplifying type families in a type is always a *homogeneous* operation. See #12919 for a discussion of why this is the Right Way to simplify type families. Also fixes #15549. test case: dependent/should_compile/T14729{,kind} typecheck/should_compile/T15549[ab] >--------------------------------------------------------------- 2b90356d26b4699227816ad9424e766eccdb6c36 compiler/deSugar/Check.hs | 8 +- compiler/typecheck/TcFlatten.hs | 371 ++----------------- compiler/types/Coercion.hs | 398 ++++++++++++++++++++- compiler/types/FamInstEnv.hs | 133 +++++-- compiler/types/Type.hs | 6 +- testsuite/tests/dependent/should_compile/T14729.hs | 15 + .../tests/dependent/should_compile/T14729.stderr | 15 + .../dependent/should_compile/T14729kind.script | 6 + .../dependent/should_compile/T14729kind.stdout | 2 + testsuite/tests/dependent/should_compile/all.T | 2 + .../tests/typecheck/should_compile/T15549a.hs | 20 ++ .../tests/typecheck/should_compile/T15549b.hs | 29 ++ testsuite/tests/typecheck/should_compile/all.T | 2 + 13 files changed, 636 insertions(+), 371 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 2b90356d26b4699227816ad9424e766eccdb6c36 From git at git.haskell.org Fri Feb 8 17:49:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:49:57 +0000 (UTC) Subject: [commit: ghc] wip/inlining-late: Make constructor wrappers inline only during the final phase (a4fe376) Message-ID: <20190208174957.4F99F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/inlining-late Link : http://ghc.haskell.org/trac/ghc/changeset/a4fe376a5fec9097d72605fd023d9cd822b5d763/ghc >--------------------------------------------------------------- commit a4fe376a5fec9097d72605fd023d9cd822b5d763 Author: Arnaud Spiwack Date: Thu Nov 15 17:14:31 2018 +0100 Make constructor wrappers inline only during the final phase For case-of-known constructor to continue triggering early, exprIsConApp_maybe is now capable of looking through lets and cases. See #15840 >--------------------------------------------------------------- a4fe376a5fec9097d72605fd023d9cd822b5d763 compiler/basicTypes/Id.hs | 8 +- compiler/basicTypes/MkId.hs | 23 +-- compiler/coreSyn/CoreOpt.hs | 164 +++++++++++++++++---- compiler/coreSyn/MkCore.hs | 15 +- compiler/prelude/PrelRules.hs | 4 +- compiler/simplCore/FloatIn.hs | 2 +- compiler/simplCore/Simplify.hs | 70 ++++++--- .../tests/deSugar/should_compile/T2431.stderr | 5 +- .../tests/simplCore/should_compile/T7360.stderr | 2 +- testsuite/tests/simplCore/should_run/T15840.hs | 14 ++ .../tests/simplCore/should_run/T15840.stdout | 0 testsuite/tests/simplCore/should_run/T15840a.hs | 22 +++ .../tests/simplCore/should_run/T15840a.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 2 + 14 files changed, 271 insertions(+), 61 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 a4fe376a5fec9097d72605fd023d9cd822b5d763 From git at git.haskell.org Fri Feb 8 17:50:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:50:01 +0000 (UTC) Subject: [commit: ghc] wip/inlining-late: Disable binder swap in OccurAnal (Trac #16288) (139d4cd) Message-ID: <20190208175001.32DDE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/inlining-late Link : http://ghc.haskell.org/trac/ghc/changeset/139d4cd1815a979fe7b86cc7dd25036cb6787b80/ghc >--------------------------------------------------------------- commit 139d4cd1815a979fe7b86cc7dd25036cb6787b80 Author: Krzysztof Gogolewski Date: Fri Feb 8 17:49:28 2019 +0100 Disable binder swap in OccurAnal (Trac #16288) >--------------------------------------------------------------- 139d4cd1815a979fe7b86cc7dd25036cb6787b80 compiler/coreSyn/CoreUnfold.hs | 10 +++++----- .../tests/dependent/should_compile/dynamic-paper.stderr | 4 ++-- testsuite/tests/simplCore/should_compile/T16288A.hs | 17 +++++++++++++++++ testsuite/tests/simplCore/should_compile/T16288B.hs | 7 +++++++ testsuite/tests/simplCore/should_compile/T16288C.hs | 13 +++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 6 files changed, 45 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 11c2a75..9b97e95 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -47,7 +47,7 @@ import GhcPrelude import DynFlags import CoreSyn import PprCore () -- Instances -import OccurAnal ( occurAnalyseExpr ) +import OccurAnal ( occurAnalyseExpr_NoBinderSwap ) import CoreOpt import CoreArity ( manifestArity ) import CoreUtils @@ -101,7 +101,7 @@ mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding mkDFunUnfolding bndrs con ops = DFunUnfolding { df_bndrs = bndrs , df_con = con - , df_args = map occurAnalyseExpr ops } + , df_args = map occurAnalyseExpr_NoBinderSwap ops } -- see Trac #16288 -- See Note [Occurrence analysis of unfoldings] mkWwInlineRule :: DynFlags -> CoreExpr -> Arity -> Unfolding @@ -311,7 +311,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> UnfoldingGuidance -> Unfolding -- Occurrence-analyses the expression before capturing it mkCoreUnfolding src top_lvl expr guidance - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- see Trac #16288 -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = top_lvl, @@ -330,7 +330,7 @@ mkUnfolding :: DynFlags -> UnfoldingSource -- Calculates unfolding guidance -- Occurrence-analyses the expression before capturing it mkUnfolding dflags src is_top_lvl is_bottoming expr - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- see Trac #16288 -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = is_top_lvl, @@ -342,7 +342,7 @@ mkUnfolding dflags src is_top_lvl is_bottoming expr where is_top_bottoming = is_top_lvl && is_bottoming guidance = calcUnfoldingGuidance dflags is_top_bottoming expr - -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr expr))! + -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr_NoBinderSwap expr))! -- See Note [Calculate unfolding guidance on the non-occ-anal'd expression] {- diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr index 3ba4db2..a170d29 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr @@ -1,5 +1,5 @@ Simplifier ticks exhausted - When trying UnfoldingDone delta1 + When trying UnfoldingDone delta To increase the limit, use -fsimpl-tick-factor=N (default 100). If you need to increase the limit substantially, please file a @@ -12,4 +12,4 @@ Simplifier ticks exhausted simplifier non-termination has been judged acceptable. To see detailed counts use -ddump-simpl-stats - Total ticks: 140004 + Total ticks: 140007 diff --git a/testsuite/tests/simplCore/should_compile/T16288A.hs b/testsuite/tests/simplCore/should_compile/T16288A.hs new file mode 100644 index 0000000..c6a52bf --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288A.hs @@ -0,0 +1,17 @@ +module T16288A where + +import T16288C + +data License + +class Pretty a where + pretty :: a -> Doc + +instance Pretty License where + pretty _ = pretV + +bar :: (Pretty a) => a -> Doc +bar w = foo (pretty (u w w w w)) + +u :: a -> a -> a -> a -> a +u = u diff --git a/testsuite/tests/simplCore/should_compile/T16288B.hs b/testsuite/tests/simplCore/should_compile/T16288B.hs new file mode 100644 index 0000000..c1a98d2 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288B.hs @@ -0,0 +1,7 @@ +module T16288B where + +import T16288A +import T16288C + +bar2 :: License -> Doc +bar2 = bar diff --git a/testsuite/tests/simplCore/should_compile/T16288C.hs b/testsuite/tests/simplCore/should_compile/T16288C.hs new file mode 100644 index 0000000..5efbb2e --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288C.hs @@ -0,0 +1,13 @@ +module T16288C where + +data Doc = Empty | Beside Doc + +hcat :: Doc -> Doc +hcat Empty = Empty +hcat xs = hcat xs + +pretV = hcat Empty + +foo :: Doc -> Doc +foo Empty = hcat Empty +foo val = Beside val diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 06b5e48..779b091 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -299,3 +299,4 @@ test('T15631', normal, makefile_test, ['T15631']) test('T15673', normal, compile, ['-O']) +test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0']) From git at git.haskell.org Fri Feb 8 17:50:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Feb 2019 17:50:05 +0000 (UTC) Subject: [commit: ghc] wip/inlining-late: Look through newtype wrappers (Trac #16254) (55f768f) Message-ID: <20190208175005.0488A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/inlining-late Link : http://ghc.haskell.org/trac/ghc/changeset/55f768ffd40ecebca139849850a04a05420852db/ghc >--------------------------------------------------------------- commit 55f768ffd40ecebca139849850a04a05420852db Author: Krzysztof Gogolewski Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) exprIsConApp_maybe could detect that I# 10 is a constructor application, but not that Size (I# 10) is, because it was an application with a nontrivial argument. >--------------------------------------------------------------- 55f768ffd40ecebca139849850a04a05420852db compiler/basicTypes/Id.hs | 9 +++- compiler/coreSyn/CoreOpt.hs | 51 ++++++++++++++++++++-- compiler/coreSyn/CoreUtils.hs | 1 + testsuite/tests/simplCore/should_compile/Makefile | 5 +++ .../should_compile/{T5327.hs => T16254.hs} | 8 ++-- .../should_compile/T16254.stdout} | 0 testsuite/tests/simplCore/should_compile/all.T | 1 + 7 files changed, 68 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 55f768ffd40ecebca139849850a04a05420852db From git at git.haskell.org Sat Feb 9 18:22:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:18 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ghc-8.6-merge' created Message-ID: <20190209182218.96CAC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ghc-8.6-merge Referencing: 9807e0042f42adc91faea92a002a94e86e461b55 From git at git.haskell.org Sat Feb 9 18:22:21 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:21 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Fix bogus worker for newtypes (ff47e60) Message-ID: <20190209182221.8B3B03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/ff47e60a9d017e5d749ff5e29e61d6f1a558d142/ghc >--------------------------------------------------------------- commit ff47e60a9d017e5d749ff5e29e61d6f1a558d142 Author: Simon Peyton Jones Date: Wed Jan 16 16:34:24 2019 +0000 Fix bogus worker for newtypes The "worker" for a newtype is actually a function with a small (compulsory) unfolding, namely a cast. But the construction of this function was plain wrong for newtype /instances/; it cast the arguemnt to the family type rather than the representation type. This never actually bit us because, in the case of a family instance, we immediately cast the result to the family type. So we get \x. (x |> co1) |> co2 where the compositio of co1 and co2 is ill-kinded. However the optimiser (even the simple optimiser) just collapsed those casts, ignoring the mis-match in the middle, so we never saw the problem. Trac #16191 is indeed a dup of #16141; but the resaon these tickets produce Lint errors is not the unnecessary forcing; it's because of the ill-typed casts. This patch fixes the ill-typed casts, properly. I can't see a way to trigger an actual failure prior to this patch, but it's still wrong wrong wrong to have ill-typed casts, so better to get rid of them. (cherry picked from commit a5373c1fe172dee31e07bcb7c7f6caff1035e6ba) >--------------------------------------------------------------- ff47e60a9d017e5d749ff5e29e61d6f1a558d142 compiler/basicTypes/MkId.hs | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 294a845..777ac77 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -424,26 +424,26 @@ dictSelRule val_index n_ty_args _ id_unf _ args mkDataConWorkId :: Name -> DataCon -> Id mkDataConWorkId wkr_name data_con | isNewTyCon tycon - = mkGlobalId (DataConWrapId data_con) wkr_name nt_wrap_ty nt_work_info + = mkGlobalId (DataConWrapId data_con) wkr_name wkr_ty nt_work_info | otherwise - = mkGlobalId (DataConWorkId data_con) wkr_name alg_wkr_ty wkr_info + = mkGlobalId (DataConWorkId data_con) wkr_name wkr_ty alg_wkr_info where - tycon = dataConTyCon data_con + tycon = dataConTyCon data_con -- The representation TyCon + wkr_ty = dataConRepType data_con ----------- Workers for data types -------------- - alg_wkr_ty = dataConRepType data_con + alg_wkr_info = noCafIdInfo + `setArityInfo` wkr_arity + `setStrictnessInfo` wkr_sig + `setUnfoldingInfo` evaldUnfolding -- Record that it's evaluated, + -- even if arity = 0 + `setLevityInfoWithType` wkr_ty + -- NB: unboxed tuples have workers, so we can't use + -- setNeverLevPoly + wkr_arity = dataConRepArity data_con - wkr_info = noCafIdInfo - `setArityInfo` wkr_arity - `setStrictnessInfo` wkr_sig - `setUnfoldingInfo` evaldUnfolding -- Record that it's evaluated, - -- even if arity = 0 - `setLevityInfoWithType` alg_wkr_ty - -- NB: unboxed tuples have workers, so we can't use - -- setNeverLevPoly - - wkr_sig = mkClosedStrictSig (replicate wkr_arity topDmd) (dataConCPR data_con) + wkr_sig = mkClosedStrictSig (replicate wkr_arity topDmd) (dataConCPR data_con) -- Note [Data-con worker strictness] -- Notice that we do *not* say the worker Id is strict -- even if the data constructor is declared strict @@ -464,20 +464,21 @@ mkDataConWorkId wkr_name data_con -- not from the worker Id. ----------- Workers for newtypes -------------- - (nt_tvs, _, nt_arg_tys, _) = dataConSig data_con - res_ty_args = mkTyVarTys nt_tvs - nt_wrap_ty = dataConUserType data_con + univ_tvs = dataConUnivTyVars data_con + arg_tys = dataConRepArgTys data_con -- Should be same as dataConOrigArgTys nt_work_info = noCafIdInfo -- The NoCaf-ness is set by noCafIdInfo `setArityInfo` 1 -- Arity 1 `setInlinePragInfo` alwaysInlinePragma `setUnfoldingInfo` newtype_unf - `setLevityInfoWithType` nt_wrap_ty - id_arg1 = mkTemplateLocal 1 (head nt_arg_tys) + `setLevityInfoWithType` wkr_ty + id_arg1 = mkTemplateLocal 1 (head arg_tys) + res_ty_args = mkTyVarTys univ_tvs newtype_unf = ASSERT2( isVanillaDataCon data_con && - isSingleton nt_arg_tys, ppr data_con ) + isSingleton arg_tys + , ppr data_con ) -- Note [Newtype datacons] mkCompulsoryUnfolding $ - mkLams nt_tvs $ Lam id_arg1 $ + mkLams univ_tvs $ Lam id_arg1 $ wrapNewTypeBody tycon res_ty_args (Var id_arg1) dataConCPR :: DataCon -> DmdResult From git at git.haskell.org Sat Feb 9 18:22:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:24 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Fix checkPtrInArena (1400129) Message-ID: <20190209182224.8159C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/14001294137e0f86fb7f7be434a1aa8c58454558/ghc >--------------------------------------------------------------- commit 14001294137e0f86fb7f7be434a1aa8c58454558 Author: Ömer Sinan Ağacan Date: Sat Jan 12 16:08:24 2019 +0300 Fix checkPtrInArena (See comments) (cherry picked from commit 448f0e7dd78a8d9404f1aa5e8522cc284360c06d) >--------------------------------------------------------------- 14001294137e0f86fb7f7be434a1aa8c58454558 rts/Arena.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rts/Arena.c b/rts/Arena.c index e0b4ebd..a4ff11b 100644 --- a/rts/Arena.c +++ b/rts/Arena.c @@ -121,8 +121,17 @@ arenaBlocks( void ) #if defined(DEBUG) void checkPtrInArena( StgPtr p, Arena *arena ) { - for (bdescr *bd = arena->current; bd; bd = bd->link) { - if (p >= bd->start && p < bd->free) { + // We don't update free pointers of arena blocks, so we have to check cached + // free pointer for the first block. + if (p >= arena->current->start && p < arena->free) { + return; + } + + // Rest of the blocks should be full (except there may be a little bit of + // slop at the end). Again, free pointers are not updated so we can't use + // those. + for (bdescr *bd = arena->current->link; bd; bd = bd->link) { + if (p >= bd->start && p < bd->start + (bd->blocks*BLOCK_SIZE_W)) { return; } } From git at git.haskell.org Sat Feb 9 18:22:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:27 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: rts: Use always-available locking operations in pthread Itimer implementation (4f18064) Message-ID: <20190209182227.7FC423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/4f180640f3a398bd75e1406111a74eb61a44a529/ghc >--------------------------------------------------------------- commit 4f180640f3a398bd75e1406111a74eb61a44a529 Author: Ben Gamari Date: Wed Jan 9 09:17:05 2019 -0500 rts: Use always-available locking operations in pthread Itimer implementation Previously we ACQUIRE_LOCK and RELEASE_LOCK but these compile to a noop in the non-threaded RTS, as noted in #16150. Use OS_ACQUIRE_LOCK and OS_RELEASE_LOCK instead. (cherry picked from commit ce11f6f25c1160262830d9670c4eaaebac37cbaf) >--------------------------------------------------------------- 4f180640f3a398bd75e1406111a74eb61a44a529 rts/posix/itimer/Pthread.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c index 90923c6..6cc211b 100644 --- a/rts/posix/itimer/Pthread.c +++ b/rts/posix/itimer/Pthread.c @@ -134,12 +134,12 @@ static void *itimer_thread_func(void *_handle_tick) // first try a cheap test if (stopped) { - ACQUIRE_LOCK(&mutex); + OS_ACQUIRE_LOCK(&mutex); // should we really stop? if (stopped) { waitCondition(&start_cond, &mutex); } - RELEASE_LOCK(&mutex); + OS_RELEASE_LOCK(&mutex); } else { handle_tick(0); } @@ -176,19 +176,19 @@ initTicker (Time interval, TickProc handle_tick) void startTicker(void) { - ACQUIRE_LOCK(&mutex); + OS_ACQUIRE_LOCK(&mutex); stopped = 0; signalCondition(&start_cond); - RELEASE_LOCK(&mutex); + OS_RELEASE_LOCK(&mutex); } /* There may be at most one additional tick fired after a call to this */ void stopTicker(void) { - ACQUIRE_LOCK(&mutex); + OS_ACQUIRE_LOCK(&mutex); stopped = 1; - RELEASE_LOCK(&mutex); + OS_RELEASE_LOCK(&mutex); } /* There may be at most one additional tick fired after a call to this */ From git at git.haskell.org Sat Feb 9 18:22:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:30 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Fix raiseAsync() UNDERFLOW_FRAME handling in profiling runtime (cf5b5a7) Message-ID: <20190209182230.6CE8E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/cf5b5a74564a61aeb636a88d68732b913306d101/ghc >--------------------------------------------------------------- commit cf5b5a74564a61aeb636a88d68732b913306d101 Author: Ömer Sinan Ağacan Date: Thu Jan 10 11:55:25 2019 +0300 Fix raiseAsync() UNDERFLOW_FRAME handling in profiling runtime UNDERFLOW_FRAMEs don't have profiling headers so we have to use the AP_STACK's function's CCS as the new frame's CCS. Fixes one of the many bugs caught by concprog001 (#15508). (cherry picked from commit 74cd4ec5d2f9321aad5db3285cb60d78f2562996) >--------------------------------------------------------------- cf5b5a74564a61aeb636a88d68732b913306d101 rts/RaiseAsync.c | 3 +-- testsuite/tests/concurrent/prog001/all.T | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c index b08acc4..ddd6d39 100644 --- a/rts/RaiseAsync.c +++ b/rts/RaiseAsync.c @@ -921,8 +921,7 @@ raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, ap->payload[i] = (StgClosure *)*sp++; } - SET_HDR(ap,&stg_AP_STACK_NOUPD_info, - ((StgClosure *)frame)->header.prof.ccs /* ToDo */); + SET_HDR(ap,&stg_AP_STACK_NOUPD_info,stack->header.prof.ccs); TICK_ALLOC_SE_THK(WDS(words+1),0); stack->sp = sp; diff --git a/testsuite/tests/concurrent/prog001/all.T b/testsuite/tests/concurrent/prog001/all.T index 1476b4f..e319583 100644 --- a/testsuite/tests/concurrent/prog001/all.T +++ b/testsuite/tests/concurrent/prog001/all.T @@ -13,5 +13,6 @@ # right now. --SDM 1/4/2010 test('concprog001', [extra_files(['Arithmetic.hs', 'Converter.hs', 'Mult.hs', 'Stream.hs', 'Thread.hs', 'Trit.hs', 'Utilities.hs']), - when(fast(), skip), only_ways(['threaded2'])], + when(fast(), skip), only_ways(['threaded2']), + run_timeout_multiplier(2)], multimod_compile_and_run, ['Mult', '']) From git at git.haskell.org Sat Feb 9 18:22:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:33 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Implement a sanity check for CCS fields in profiling builds (4f712fb) Message-ID: <20190209182233.8942A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/4f712fb3c88d2586f842202ca3dd921596599777/ghc >--------------------------------------------------------------- commit 4f712fb3c88d2586f842202ca3dd921596599777 Author: Ömer Sinan Ağacan Date: Thu Jan 10 12:42:04 2019 +0300 Implement a sanity check for CCS fields in profiling builds This helped me debug one of the bugs in #15508. I'm not sure if this is a good idea, but it worked for me, so wanted to submit this as a MR. (cherry picked from commit 82d1a88dec216d761b17252ede760da5c566007f) >--------------------------------------------------------------- 4f712fb3c88d2586f842202ca3dd921596599777 rts/Arena.c | 13 +++++++++++++ rts/Arena.h | 4 ++++ rts/Profiling.c | 4 ++++ rts/Profiling.h | 6 ++++++ rts/sm/Sanity.c | 17 +++++++++++++++++ 5 files changed, 44 insertions(+) diff --git a/rts/Arena.c b/rts/Arena.c index cd547e5..e0b4ebd 100644 --- a/rts/Arena.c +++ b/rts/Arena.c @@ -117,3 +117,16 @@ arenaBlocks( void ) { return arena_blocks; } + +#if defined(DEBUG) +void checkPtrInArena( StgPtr p, Arena *arena ) +{ + for (bdescr *bd = arena->current; bd; bd = bd->link) { + if (p >= bd->start && p < bd->free) { + return; + } + } + + barf("Location %p is not in arena %p", (void*)p, (void*)arena); +} +#endif diff --git a/rts/Arena.h b/rts/Arena.h index 8fa8236..4929871 100644 --- a/rts/Arena.h +++ b/rts/Arena.h @@ -20,3 +20,7 @@ RTS_PRIVATE void arenaFree ( Arena * ); // For internal use only: RTS_PRIVATE unsigned long arenaBlocks( void ); + +#if defined(DEBUG) +void checkPtrInArena( StgPtr p, Arena *arena ); +#endif diff --git a/rts/Profiling.c b/rts/Profiling.c index 9f1a442..162651d 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -32,7 +32,11 @@ /* * Profiling allocation arena. */ +#if defined(DEBUG) +Arena *prof_arena; +#else static Arena *prof_arena; +#endif /* * Global variables used to assign unique IDs to cc's, ccs's, and diff --git a/rts/Profiling.h b/rts/Profiling.h index 45725e5..c692c22 100644 --- a/rts/Profiling.h +++ b/rts/Profiling.h @@ -13,6 +13,10 @@ #include "BeginPrivate.h" #include "Rts.h" +#if defined(DEBUG) +#include "Arena.h" +#endif + #if defined(PROFILING) #define PROFILING_ONLY(s) s #else @@ -46,6 +50,8 @@ bool ignoreCCS (CostCentreStack const *ccs); bool ignoreCC (CostCentre const *cc); #if defined(DEBUG) +extern Arena *prof_arena; + void debugCCS( CostCentreStack *ccs ); #endif diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index c6861f4..748f2f4 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -29,6 +29,7 @@ #include "Arena.h" #include "RetainerProfile.h" #include "CNF.h" +#include "Profiling.h" // prof_arena /* ----------------------------------------------------------------------------- Forward decls. @@ -210,6 +211,17 @@ checkPAP (StgClosure *tagged_fun, StgClosure** payload, StgWord n_args) : GET_CLOSURE_TAG(tagged_fun) == fun_info->f.arity); } +#if defined(PROFILING) +static void +checkClosureProfSanity(const StgClosure *p) +{ + StgProfHeader prof_hdr = p->header.prof; + CostCentreStack *ccs = prof_hdr.ccs; + if (HEAP_ALLOCED_GC((void*)ccs)) { + checkPtrInArena((StgPtr)ccs, prof_arena); + } +} +#endif StgOffset checkClosure( const StgClosure* p ) @@ -225,6 +237,11 @@ checkClosure( const StgClosure* p ) if (IS_FORWARDING_PTR(info)) { barf("checkClosure: found EVACUATED closure %d", info->type); } + +#if defined(PROFILING) + checkClosureProfSanity(p); +#endif + info = INFO_PTR_TO_STRUCT(info); switch (info->type) { From git at git.haskell.org Sat Feb 9 18:22:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:36 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Fix a MSG_BLACKHOLE sanity check, add some comments (ee6e4fc) Message-ID: <20190209182236.8380B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/ee6e4fcc9ba9359a1b1b99ac952515649f58c4a9/ghc >--------------------------------------------------------------- commit ee6e4fcc9ba9359a1b1b99ac952515649f58c4a9 Author: Ömer Sinan Ağacan Date: Mon Sep 24 16:21:27 2018 +0300 Fix a MSG_BLACKHOLE sanity check, add some comments Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15508 Differential Revision: https://phabricator.haskell.org/D5178 (cherry picked from commit d90946cea1357d3e99805c27dab1e811785a4088) >--------------------------------------------------------------- ee6e4fcc9ba9359a1b1b99ac952515649f58c4a9 includes/rts/storage/Closures.h | 7 ++++++- rts/sm/Sanity.c | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/rts/storage/Closures.h b/includes/rts/storage/Closures.h index 15231e0..7db67c7 100644 --- a/includes/rts/storage/Closures.h +++ b/includes/rts/storage/Closures.h @@ -130,10 +130,13 @@ typedef struct { typedef struct StgBlockingQueue_ { StgHeader header; - struct StgBlockingQueue_ *link; // here so it looks like an IND + struct StgBlockingQueue_ *link; + // here so it looks like an IND, to be able to skip the queue without + // deleting it (done in wakeBlockingQueue()) StgClosure *bh; // the BLACKHOLE StgTSO *owner; struct MessageBlackHole_ *queue; + // holds TSOs blocked on `bh` } StgBlockingQueue; typedef struct { @@ -400,6 +403,8 @@ typedef struct MessageThrowTo_ { typedef struct MessageBlackHole_ { StgHeader header; struct MessageBlackHole_ *link; + // here so it looks like an IND, to be able to skip the message without + // deleting it (done in throwToMsg()) StgTSO *tso; StgClosure *bh; } MessageBlackHole; diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 8d4171b..c6861f4 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -292,8 +292,12 @@ checkClosure( const StgClosure* p ) ASSERT(LOOKS_LIKE_CLOSURE_PTR(bq->bh)); ASSERT(get_itbl((StgClosure *)(bq->owner))->type == TSO); - ASSERT(bq->queue == (MessageBlackHole*)END_TSO_QUEUE - || bq->queue->header.info == &stg_MSG_BLACKHOLE_info); + ASSERT(// A bq with no other blocked TSOs: + bq->queue == (MessageBlackHole*)END_TSO_QUEUE || + // A bq with blocked TSOs in its queue: + bq->queue->header.info == &stg_MSG_BLACKHOLE_info || + // A bq with a deleted (in throwToMsg()) MSG_BLACKHOLE: + bq->queue->header.info == &stg_IND_info); ASSERT(bq->link == (StgBlockingQueue*)END_TSO_QUEUE || get_itbl((StgClosure *)(bq->link))->type == IND || get_itbl((StgClosure *)(bq->link))->type == BLOCKING_QUEUE); From git at git.haskell.org Sat Feb 9 18:22:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:39 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: itimer: Don't free condvar until we know ticker is stopped (7ec385f) Message-ID: <20190209182239.7B9EB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/7ec385f40406a23da7a52fd5a07131efb8973233/ghc >--------------------------------------------------------------- commit 7ec385f40406a23da7a52fd5a07131efb8973233 Author: Ben Gamari Date: Wed Jan 9 00:20:19 2019 -0500 itimer: Don't free condvar until we know ticker is stopped When we are shutting down the pthread ticker we signal the start_cond condition variable to ensure that the ticker thread wakes up and exits in a reasonable amount of time. Previously, when the ticker thread would shut down it was responsible for freeing the start_cond condition variable. However, this would lead to a race wherein the ticker would free start_cond, then the main thread would try to signal it in an effort to wake the ticker (#16150). Avoid this by moving the mutex destruction to the main thread. (cherry picked from commit 7b12b3f0240321ac1ee43f14eb9c07e015022eeb) >--------------------------------------------------------------- 7ec385f40406a23da7a52fd5a07131efb8973233 rts/posix/itimer/Pthread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c index f591d5e..90923c6 100644 --- a/rts/posix/itimer/Pthread.c +++ b/rts/posix/itimer/Pthread.c @@ -147,8 +147,6 @@ static void *itimer_thread_func(void *_handle_tick) if (USE_TIMERFD_FOR_ITIMER) close(timerfd); - closeMutex(&mutex); - closeCondition(&start_cond); return NULL; } @@ -207,6 +205,8 @@ exitTicker (bool wait) if (pthread_join(thread, NULL)) { sysErrorBelch("Itimer: Failed to join"); } + closeMutex(&mutex); + closeCondition(&start_cond); } else { pthread_detach(thread); } From git at git.haskell.org Sat Feb 9 18:22:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:42 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Bump transformers to 0.5.6.2 (9fbcfb9) Message-ID: <20190209182242.710323A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/9fbcfb97b51550190798aa39c5bb950e25df814f/ghc >--------------------------------------------------------------- commit 9fbcfb97b51550190798aa39c5bb950e25df814f Author: Ben Gamari Date: Thu Jan 17 09:53:23 2019 -0500 Bump transformers to 0.5.6.2 See #16199. >--------------------------------------------------------------- 9fbcfb97b51550190798aa39c5bb950e25df814f libraries/transformers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/transformers b/libraries/transformers index 8055784..def8c55 160000 --- a/libraries/transformers +++ b/libraries/transformers @@ -1 +1 @@ -Subproject commit 80557845cdc0e72bc05cec19cf7a1bf5495e9e69 +Subproject commit def8c55d0c47c1c40de985d83f052f3659b40cfd From git at git.haskell.org Sat Feb 9 18:22:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:45 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: Bump process submodule to 1.6.4.0 (1e4f0a9) Message-ID: <20190209182245.6677B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/1e4f0a9ac358f45821a75cbccf9b3aa1c949f550/ghc >--------------------------------------------------------------- commit 1e4f0a9ac358f45821a75cbccf9b3aa1c949f550 Author: Ben Gamari Date: Thu Jan 17 09:50:47 2019 -0500 Bump process submodule to 1.6.4.0 See #16199 >--------------------------------------------------------------- 1e4f0a9ac358f45821a75cbccf9b3aa1c949f550 libraries/process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/process b/libraries/process index 36a3ad5..7a2dfa0 160000 --- a/libraries/process +++ b/libraries/process @@ -1 +1 @@ -Subproject commit 36a3ad577e31e8c3336c7464b252fc2c9b01a20c +Subproject commit 7a2dfa0b48bbb48a22174cb4c2281d4000191cb0 From git at git.haskell.org Sat Feb 9 18:22:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:48 +0000 (UTC) Subject: [commit: ghc] wip/andrey/cached-hadrian: Make sure autogen files have been generated before scanning sources. (5498f16) Message-ID: <20190209182248.6C4223A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/andrey/cached-hadrian Link : http://ghc.haskell.org/trac/ghc/changeset/5498f16ec5e7cae4c3000a73c7eddf7a85f7c77f/ghc >--------------------------------------------------------------- commit 5498f16ec5e7cae4c3000a73c7eddf7a85f7c77f Author: Andrey Mokhov Date: Sat Feb 9 02:19:46 2019 +0000 Make sure autogen files have been generated before scanning sources. Part of https://gitlab.haskell.org/ghc/ghc/merge_requests/317. >--------------------------------------------------------------- 5498f16ec5e7cae4c3000a73c7eddf7a85f7c77f hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 9 ++++----- hadrian/src/Oracles/ModuleFiles.hs | 1 + hadrian/src/Packages.hs | 12 +++++++++++- hadrian/src/Rules/Gmp.hs | 7 +------ hadrian/src/Rules/Register.hs | 5 +---- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs index fd1cd9c..7e78aa2 100644 --- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs @@ -107,8 +107,7 @@ biModules pd = go [ comp | comp@(bi,_,_) <- -- the package the 'Context' points to. configurePackage :: Context -> Action () configurePackage context at Context {..} = do - putLoud $ "| Configure package " ++ quote (pkgName package) - + putProgressInfo $ "| Configure package " ++ quote (pkgName package) gpd <- pkgGenericDescription package depPkgs <- packageDependencies <$> readPackageData package @@ -155,7 +154,7 @@ configurePackage context at Context {..} = do -- corresponding to the 'Stage' of the 'Context'. copyPackage :: Context -> Action () copyPackage context at Context {..} = do - putLoud $ "| Copy package " ++ quote (pkgName package) + putProgressInfo $ "| Copy package " ++ quote (pkgName package) gpd <- pkgGenericDescription package ctxPath <- Context.contextPath context pkgDbPath <- packageDbPath stage @@ -167,7 +166,7 @@ copyPackage context at Context {..} = do -- | Register the 'Package' of a given 'Context' into the package database. registerPackage :: Context -> Action () registerPackage context at Context {..} = do - putLoud $ "| Register package " ++ quote (pkgName package) + putProgressInfo $ "| Register package " ++ quote (pkgName package) ctxPath <- Context.contextPath context gpd <- pkgGenericDescription package verbosity <- getVerbosity @@ -289,7 +288,7 @@ buildAutogenFiles :: Context -> Action () buildAutogenFiles context = do cPath <- Context.contextPath context setupConfig <- pkgSetupConfigFile context - need [setupConfig] + need [setupConfig] -- This triggers 'configurePackage' pd <- packageDescription <$> readContextData context -- Note: the @cPath@ is ignored. The path that's used is the 'buildDir' path -- from the local build info @lbi at . diff --git a/hadrian/src/Oracles/ModuleFiles.hs b/hadrian/src/Oracles/ModuleFiles.hs index 0ec1573..d2f0299 100644 --- a/hadrian/src/Oracles/ModuleFiles.hs +++ b/hadrian/src/Oracles/ModuleFiles.hs @@ -131,6 +131,7 @@ moduleFilesOracle :: Rules () moduleFilesOracle = void $ do void . addOracleCache $ \(ModuleFiles (stage, package)) -> do let context = vanillaContext stage package + ensureConfigured context srcDirs <- interpretInContext context (getContextData PD.srcDirs) mainIs <- interpretInContext context (getContextData PD.mainIs) let removeMain = case mainIs of diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs index 9a70420..6104148 100644 --- a/hadrian/src/Packages.hs +++ b/hadrian/src/Packages.hs @@ -13,7 +13,7 @@ module Packages ( -- * Package information programName, nonHsMainPackage, autogenPath, programPath, timeoutPath, rtsContext, rtsBuildPath, libffiContext, libffiBuildPath, libffiLibraryName, - generatedGhcDependencies + generatedGhcDependencies, ensureConfigured ) where import Hadrian.Package @@ -184,6 +184,16 @@ autogenPath context at Context {..} where autogen dir = contextPath context <&> (-/- dir -/- "autogen") +-- | Make sure a given context has already been fully configured. The +-- implementation simply calls 'need' on the context's @autogen/cabal_macros.h@ +-- file, which triggers 'configurePackage' and 'buildAutogenFiles'. Why this +-- indirection? Going via @autogen/cabal_macros.h@ allows us to cache the +-- configuration steps, i.e. not to repeat them if they have already been done. +ensureConfigured :: Context -> Action () +ensureConfigured context = do + autogen <- autogenPath context + need [autogen -/- "cabal_macros.h"] + -- | RTS is considered a Stage1 package. This determines RTS build directory. rtsContext :: Stage -> Context rtsContext stage = vanillaContext stage rts diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs index 9b56a3e..a78170c 100644 --- a/hadrian/src/Rules/Gmp.hs +++ b/hadrian/src/Rules/Gmp.hs @@ -92,12 +92,7 @@ gmpRules = do copyFile (gmpPath -/- gmpLibraryH) -- This file is created when 'integerGmp' is configured. - gmpPath -/- "config.mk" %> \_ -> do - -- Calling 'need' on @setup-config@ triggers 'configurePackage'. Why - -- this indirection? Going via @setup-config@ allows us to cache the - -- configuration step, i.e. not to repeat it if it's already been done. - setupConfig <- pkgSetupConfigFile gmpContext - need [setupConfig] + gmpPath -/- "config.mk" %> \_ -> ensureConfigured gmpContext -- Run GMP's configure script gmpPath -/- "Makefile" %> \mk -> do diff --git a/hadrian/src/Rules/Register.hs b/hadrian/src/Rules/Register.hs index 625fca8..d215938 100644 --- a/hadrian/src/Rules/Register.hs +++ b/hadrian/src/Rules/Register.hs @@ -92,10 +92,7 @@ registerPackageRules rs stage = do buildConf :: [(Resource, Int)] -> Context -> FilePath -> Action () buildConf _ context at Context {..} conf = do depPkgIds <- cabalDependencies context - - -- Calling 'need' on @setupConfig@, triggers the package configuration. - setupConfig <- pkgSetupConfigFile context - need [setupConfig] + ensureConfigured context need =<< mapM (\pkgId -> packageDbPath stage <&> (-/- pkgId <.> "conf")) depPkgIds ways <- interpretInContext context (getLibraryWays <> if package == rts then getRtsWays else mempty) From git at git.haskell.org Sat Feb 9 18:22:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:51 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: testsuite: Mark ghci063 as broken on Darwin (18e2de9) Message-ID: <20190209182251.5E2B13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/18e2de9487a8e66c7a5722e40daab1db16d7d685/ghc >--------------------------------------------------------------- commit 18e2de9487a8e66c7a5722e40daab1db16d7d685 Author: Ben Gamari Date: Thu Jan 17 13:55:00 2019 -0500 testsuite: Mark ghci063 as broken on Darwin This is the last failing test on Darwin preventing us from disallowing CI failures. See #16201. (cherry picked from commit 0b705fadf936eaf48aaca26d2f7c8c9ae9158c66) >--------------------------------------------------------------- 18e2de9487a8e66c7a5722e40daab1db16d7d685 testsuite/tests/ghci/scripts/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index c0cceca..baef5f8 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -97,7 +97,7 @@ test('ghci061', normal, ghci_script, ['ghci061.script']) test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']), when(config.have_ext_interp, extra_ways(['ghci-ext']))], ghci_script, ['ghci062.script']) -test('ghci063', normal, ghci_script, ['ghci063.script']) +test('ghci063', when(opsys('darwin'), expect_broken(16201)), ghci_script, ['ghci063.script']) test('T2452', normal, ghci_script, ['T2452.script']) test('T2766', normal, ghci_script, ['T2766.script']) From git at git.haskell.org Sat Feb 9 18:22:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:55 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: testsuite: Add test for #16104 (cdb8def) Message-ID: <20190209182255.2FCCF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/cdb8def0a76072b812cb1a6860a3baa0989f133a/ghc >--------------------------------------------------------------- commit cdb8def0a76072b812cb1a6860a3baa0989f133a Author: Ben Gamari Date: Tue Jan 15 11:48:59 2019 -0500 testsuite: Add test for #16104 (cherry picked from commit 312c957f1cc7ff2ba3bc7eb258c477ed4a7e14c8) >--------------------------------------------------------------- cdb8def0a76072b812cb1a6860a3baa0989f133a testsuite/tests/plugins/T16104.hs | 4 ++++ testsuite/tests/plugins/T16104_Plugin.hs | 20 ++++++++++++++++++++ testsuite/tests/plugins/all.T | 2 ++ 3 files changed, 26 insertions(+) diff --git a/testsuite/tests/plugins/T16104.hs b/testsuite/tests/plugins/T16104.hs new file mode 100644 index 0000000..bfef697 --- /dev/null +++ b/testsuite/tests/plugins/T16104.hs @@ -0,0 +1,4 @@ +{-# OPTIONS_GHC -fplugin T16104_Plugin #-} + +main :: IO () +main = return () diff --git a/testsuite/tests/plugins/T16104_Plugin.hs b/testsuite/tests/plugins/T16104_Plugin.hs new file mode 100644 index 0000000..cad54f6 --- /dev/null +++ b/testsuite/tests/plugins/T16104_Plugin.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TemplateHaskell #-} + +module TestPlugin (plugin) where + +import GhcPlugins +import Data.Bits + +plugin :: Plugin +plugin = defaultPlugin {installCoreToDos = install} + where install _ todos = return (test : todos) + + test = CoreDoPluginPass "Test" check + + check :: ModGuts -> CoreM ModGuts + check m = do mbN <- thNameToGhcName 'complement + case mbN of + Just _ -> liftIO $ putStrLn "Found complement!" + Nothing -> error "Failed to locate complement" + + return m diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index f366d49..2a293b2 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -141,3 +141,5 @@ test('plugin-recomp-change-prof', when(not config.have_profiling,skip) ], run_command, ['$MAKE -s --no-print-directory plugin-recomp-change-prof']) + +test('T16104', normal, compile, ['']) From git at git.haskell.org Sat Feb 9 18:22:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Feb 2019 18:22:58 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.6-merge: GhcPlugins: Fix lookup of TH names (9807e00) Message-ID: <20190209182258.278463A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.6-merge Link : http://ghc.haskell.org/trac/ghc/changeset/9807e0042f42adc91faea92a002a94e86e461b55/ghc >--------------------------------------------------------------- commit 9807e0042f42adc91faea92a002a94e86e461b55 Author: Ben Gamari Date: Sat Jan 19 13:59:18 2019 -0500 GhcPlugins: Fix lookup of TH names Previously `thNameToGhcName` was calling `lookupOrigNameCache` directly, which failed to handle the case that the name wasn't already in the name cache. This happens, for instance, when the name was in scope in a plugin being used during compilation but not in scope in the module being compiled. In this case we the interface file containing the name won't be loaded and `lookupOrigNameCache` fails. This was the cause of #16104. The solution is simple: use the nicely packaged `lookupOrigIO` instead. (cherry picked from commit 0d9f105ba423af4f2ca215a18d04d4c8e2c372a8) >--------------------------------------------------------------- 9807e0042f42adc91faea92a002a94e86e461b55 compiler/simplCore/CoreMonad.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs index 912ff99..683fb04 100644 --- a/compiler/simplCore/CoreMonad.hs +++ b/compiler/simplCore/CoreMonad.hs @@ -67,6 +67,7 @@ import Annotations import IOEnv hiding ( liftIO, failM, failWithM ) import qualified IOEnv ( liftIO ) +import IfaceEnv ( lookupOrigIO ) import TcEnv ( lookupGlobal ) import Var import Outputable @@ -821,6 +822,6 @@ thNameToGhcName th_name | Just n <- isExact_maybe rdr_name -- This happens in derived code = return $ if isExternalName n then Just n else Nothing | Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name - = do { cache <- getOrigNameCache - ; return $ lookupOrigNameCache cache rdr_mod rdr_occ } + = do { hsc_env <- getHscEnv + ; Just <$> liftIO (lookupOrigIO hsc_env rdr_mod rdr_occ) } | otherwise = return Nothing From git at git.haskell.org Sun Feb 10 21:29:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:29:55 +0000 (UTC) Subject: [commit: ghc] branch 'wip/llvm-configure-opts' created Message-ID: <20190210212955.862CB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/llvm-configure-opts Referencing: 980f0dab61b3150403aed21692ffcdfceece97a2 From git at git.haskell.org Sun Feb 10 21:29:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:29:57 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T15449' created Message-ID: <20190210212957.85F583A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T15449 Referencing: 5585c55f8db4b6a0cc36d924dbbe0bd285aac8c0 From git at git.haskell.org Sun Feb 10 21:29:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:29:59 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16188' created Message-ID: <20190210212959.870633A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16188 Referencing: ec0e10ddb93e3c8663ec3ebdd8ded91d87597d05 From git at git.haskell.org Sun Feb 10 21:30:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:02 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Allow resizing the stack for the graph allocator. (03b7abc) Message-ID: <20190210213002.BEE923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/03b7abc19c8b0ec5c606cc2da208d2d004807fe9/ghc >--------------------------------------------------------------- commit 03b7abc19c8b0ec5c606cc2da208d2d004807fe9 Author: klebinger.andreas at gmx.at Date: Sat Jan 26 00:26:02 2019 +0100 Allow resizing the stack for the graph allocator. The graph allocator now dynamically resizes the number of stack slots when running into the limit. This fixes #8657. Also loop membership of basic blocks is now available in the register allocator for cost heuristics. >--------------------------------------------------------------- 03b7abc19c8b0ec5c606cc2da208d2d004807fe9 compiler/nativeGen/AsmCodeGen.hs | 18 +++++++-- compiler/nativeGen/CFG.hs | 18 +++++++++ compiler/nativeGen/RegAlloc/Graph/Main.hs | 38 +++++++++++++------ compiler/nativeGen/RegAlloc/Graph/Spill.hs | 14 +++++-- compiler/nativeGen/RegAlloc/Graph/SpillCost.hs | 51 +++++++++++++++++--------- compiler/nativeGen/X86/Instr.hs | 2 + 6 files changed, 105 insertions(+), 36 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 03b7abc19c8b0ec5c606cc2da208d2d004807fe9 From git at git.haskell.org Sun Feb 10 21:30:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:05 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Update hpc submodule (14eb23c) Message-ID: <20190210213005.D275E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/14eb23c1f123e6b8f69148a01fa8c73aee939cb7/ghc >--------------------------------------------------------------- commit 14eb23c1f123e6b8f69148a01fa8c73aee939cb7 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:35 2019 +0100 Update hpc submodule >--------------------------------------------------------------- 14eb23c1f123e6b8f69148a01fa8c73aee939cb7 libraries/hpc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/hpc b/libraries/hpc index 2678098..75f898b 160000 --- a/libraries/hpc +++ b/libraries/hpc @@ -1 +1 @@ -Subproject commit 26780988735bdb8fdbeffb59c4a8d585b9e46c3e +Subproject commit 75f898badf40cddba7b3bcf149648e49095a52f9 From git at git.haskell.org Sun Feb 10 21:30:08 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:08 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Hadrian: compile libgmp static on Windows (bac64c3) Message-ID: <20190210213008.E5BA23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/bac64c3253c66f9f95a6e5476ccb6a47badc6e1c/ghc >--------------------------------------------------------------- commit bac64c3253c66f9f95a6e5476ccb6a47badc6e1c Author: Tamar Christina Date: Sun Jan 27 21:30:50 2019 +0000 Hadrian: compile libgmp static on Windows >--------------------------------------------------------------- bac64c3253c66f9f95a6e5476ccb6a47badc6e1c hadrian/src/Settings/Packages.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs index 4be0fba..e261dfe 100644 --- a/hadrian/src/Settings/Packages.hs +++ b/hadrian/src/Settings/Packages.hs @@ -137,6 +137,9 @@ packageArgs = do , builder (Cabal Setup) ? mconcat [ flag GmpInTree ? arg "--configure-option=--with-intree-gmp" + -- Windows is always built with inplace GMP until we have dynamic + -- linking working. + , windowsHost ? arg "--configure-option=--with-intree-gmp" , flag GmpFrameworkPref ? arg "--configure-option=--with-gmp-framework-preferred" , arg ("--configure-option=CFLAGS=" ++ includeGmp) From git at git.haskell.org Sun Feb 10 21:30:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:12 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Fix test for T16180 on Darwin (fix #16128) (d97f0db) Message-ID: <20190210213012.15F9D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/d97f0db8fa6c5d9a4c90c6096b01a76da07cfb2b/ghc >--------------------------------------------------------------- commit d97f0db8fa6c5d9a4c90c6096b01a76da07cfb2b Author: Sylvain Henry Date: Tue Jan 29 02:14:12 2019 +0100 Fix test for T16180 on Darwin (fix #16128) >--------------------------------------------------------------- d97f0db8fa6c5d9a4c90c6096b01a76da07cfb2b testsuite/tests/th/T16180.hs | 21 ++++++++++----------- testsuite/tests/th/all.T | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/testsuite/tests/th/T16180.hs b/testsuite/tests/th/T16180.hs index 2a4b80c..073ad7a 100644 --- a/testsuite/tests/th/T16180.hs +++ b/testsuite/tests/th/T16180.hs @@ -4,19 +4,18 @@ module Main where import Language.Haskell.TH.Syntax import Foreign.C.String +import Config -- from "ghc" package $(do - -- some architectures require a "_" symbol prefix... - -- GHC defines a LEADING_UNDERSCORE CPP constant to indicate this. - addForeignSource LangAsm - "#if defined(LEADING_UNDERSCORE)\n\ - \.global \"_mydata\"\n\ - \_mydata:\n\ - \#else\n\ - \.global \"mydata\"\n\ - \mydata:\n\ - \#endif\n\ - \.ascii \"Hello world\\0\"\n" + -- some targets (e.g. Darwin) require a "_" symbol prefix... + addForeignSource LangAsm (if cLeadingUnderscore == "YES" + then ".global \"_mydata\"\n\ + \_mydata:\n\ + \.ascii \"Hello world\\0\"\n" + else ".global \"mydata\"\n\ + \mydata:\n\ + \.ascii \"Hello world\\0\"\n" + ) return []) foreign import ccall "&mydata" mystring :: CString diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 59123fa..0d34c69 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -461,5 +461,5 @@ test('T15437', expect_broken(15437), multimod_compile, test('T15985', normal, compile, ['']) test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) -test('T16180', when(opsys('darwin'), expect_broken(16218)), compile_and_run, ['']) +test('T16180', normal, compile_and_run, ['-package ghc']) test('T16183', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sun Feb 10 21:30:15 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:15 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: TestEquality instance for Compose (ee52298) Message-ID: <20190210213015.559DE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/ee5229834dc5e15cd1eea8427b0e00c50d0fa08b/ghc >--------------------------------------------------------------- commit ee5229834dc5e15cd1eea8427b0e00c50d0fa08b Author: Langston Barrett Date: Fri Feb 1 12:33:38 2019 -0800 TestEquality instance for Compose >--------------------------------------------------------------- ee5229834dc5e15cd1eea8427b0e00c50d0fa08b libraries/base/Data/Functor/Compose.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/base/Data/Functor/Compose.hs b/libraries/base/Data/Functor/Compose.hs index 4ddd12c..97d4a35 100644 --- a/libraries/base/Data/Functor/Compose.hs +++ b/libraries/base/Data/Functor/Compose.hs @@ -1,8 +1,10 @@ -{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Trustworthy #-} +{-# LANGUAGE TypeOperators #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Functor.Compose @@ -27,6 +29,7 @@ import Data.Functor.Classes import Control.Applicative import Data.Coerce (coerce) import Data.Data (Data) +import Data.Type.Equality (TestEquality(..), (:~:)(..)) import GHC.Generics (Generic, Generic1) import Text.Read (Read(..), readListDefault, readListPrecDefault) @@ -118,3 +121,12 @@ instance (Alternative f, Applicative g) => Alternative (Compose f g) where empty = Compose empty (<|>) = coerce ((<|>) :: f (g a) -> f (g a) -> f (g a)) :: forall a . Compose f g a -> Compose f g a -> Compose f g a + +-- | The deduction (via generativity) that if @g x :~: g y@ then @x :~: y at . +-- +-- @since 4.13.0.0 +instance (TestEquality f) => TestEquality (Compose f g) where + testEquality (Compose x) (Compose y) = + case testEquality x y of -- :: Maybe (g x :~: g y) + Just Refl -> Just Refl -- :: Maybe (x :~: y) + Nothing -> Nothing From git at git.haskell.org Sun Feb 10 21:30:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:18 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Add a changelog for base 4.14.0.0 (a9bef62) Message-ID: <20190210213018.5D5C33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/a9bef62ba42056039cc55a68481ed01a5bece445/ghc >--------------------------------------------------------------- commit a9bef62ba42056039cc55a68481ed01a5bece445 Author: Langston Barrett Date: Mon Feb 4 08:59:56 2019 -0800 Add a changelog for base 4.14.0.0 >--------------------------------------------------------------- a9bef62ba42056039cc55a68481ed01a5bece445 libraries/base/Data/Functor/Compose.hs | 2 +- libraries/base/changelog.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/base/Data/Functor/Compose.hs b/libraries/base/Data/Functor/Compose.hs index 97d4a35..44570e1 100644 --- a/libraries/base/Data/Functor/Compose.hs +++ b/libraries/base/Data/Functor/Compose.hs @@ -124,7 +124,7 @@ instance (Alternative f, Applicative g) => Alternative (Compose f g) where -- | The deduction (via generativity) that if @g x :~: g y@ then @x :~: y at . -- --- @since 4.13.0.0 +-- @since 4.14.0.0 instance (TestEquality f) => TestEquality (Compose f g) where testEquality (Compose x) (Compose y) = case testEquality x y of -- :: Maybe (g x :~: g y) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 3d178d3..7992795 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -1,5 +1,10 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) +## 4.14.0.0 *TBA* + * Bundled with GHC *TBA* + + * Add a `TestEquality` instance for the `Compose` newtype. + ## 4.12.0.0 *TBA* * Bundled with GHC *TBA* From git at git.haskell.org Sun Feb 10 21:30:21 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:21 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Update filepath submodule (41df8e3) Message-ID: <20190210213021.7C6663A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/41df8e392ed5f9e02ec460b5037772d8ef46f4d4/ghc >--------------------------------------------------------------- commit 41df8e392ed5f9e02ec460b5037772d8ef46f4d4 Author: Herbert Valerio Riedel Date: Fri Feb 1 22:48:40 2019 +0100 Update filepath submodule >--------------------------------------------------------------- 41df8e392ed5f9e02ec460b5037772d8ef46f4d4 libraries/filepath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/filepath b/libraries/filepath index b10724b..39035d6 160000 --- a/libraries/filepath +++ b/libraries/filepath @@ -1 +1 @@ -Subproject commit b10724be8a907e191d153ad6674415be0c1325fd +Subproject commit 39035d6433fff2356cf65747649666ed9b6e83e1 From git at git.haskell.org Sun Feb 10 21:30:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:24 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Update directory submodule (be8a803) Message-ID: <20190210213024.86FE33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/be8a803f8cd461bbf87df1fc0121fe41fa922e50/ghc >--------------------------------------------------------------- commit be8a803f8cd461bbf87df1fc0121fe41fa922e50 Author: Herbert Valerio Riedel Date: Fri Feb 1 22:48:07 2019 +0100 Update directory submodule >--------------------------------------------------------------- be8a803f8cd461bbf87df1fc0121fe41fa922e50 libraries/directory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/directory b/libraries/directory index 19d6dc0..59883e9 160000 --- a/libraries/directory +++ b/libraries/directory @@ -1 +1 @@ -Subproject commit 19d6dc0d33366a8920bf8acc7a0fd3ef533d39c3 +Subproject commit 59883e953d488492487dcda266901080347bbf1e From git at git.haskell.org Sun Feb 10 21:30:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:28 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: API Annotations: AnnAt disconnected for TYPEAPP (cbfc9fc) Message-ID: <20190210213028.C028D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/cbfc9fcaa33c3b341830962906543dfca1dfedd7/ghc >--------------------------------------------------------------- commit cbfc9fcaa33c3b341830962906543dfca1dfedd7 Author: Alan Zimmerman Date: Wed Jan 30 16:20:52 2019 +0200 API Annotations: AnnAt disconnected for TYPEAPP For the code type family F1 (a :: k) (f :: k -> Type) :: Type where F1 @Peano a f = T @Peano f a the API annotation for the first @ is not attached to a SourceSpan in the ParsedSource Closes #16236 >--------------------------------------------------------------- cbfc9fcaa33c3b341830962906543dfca1dfedd7 compiler/deSugar/DsMeta.hs | 6 +- compiler/hieFile/HieAst.hs | 4 +- compiler/hsSyn/Convert.hs | 9 ++- compiler/hsSyn/HsTypes.hs | 19 ++--- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 69 +++++++++++------- compiler/rename/RnTypes.hs | 10 +-- compiler/typecheck/TcExpr.hs | 24 +++--- compiler/typecheck/TcHsType.hs | 9 ++- testsuite/tests/ghc-api/annotations/Makefile | 4 + testsuite/tests/ghc-api/annotations/T16236.stdout | 85 ++++++++++++++++++++++ .../annotations/Test16236.hs} | 3 +- testsuite/tests/ghc-api/annotations/all.T | 2 + .../parser/should_compile/DumpParsedAst.stderr | 3 +- .../parser/should_compile/DumpRenamedAst.stderr | 3 +- 15 files changed, 181 insertions(+), 71 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 cbfc9fcaa33c3b341830962906543dfca1dfedd7 From git at git.haskell.org Sun Feb 10 21:30:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:33 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Lexer: Alternate Layout Rule injects actual not virtual braces (c1cf269) Message-ID: <20190210213033.353743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/c1cf2693d6efddeeeb813cd8995a1be136800d17/ghc >--------------------------------------------------------------- commit c1cf2693d6efddeeeb813cd8995a1be136800d17 Author: Alan Zimmerman Date: Sun Feb 3 10:27:42 2019 +0200 Lexer: Alternate Layout Rule injects actual not virtual braces When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Likewise, any injected ITsemi should have a zero-width SrcSpan. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279 >--------------------------------------------------------------- c1cf2693d6efddeeeb813cd8995a1be136800d17 compiler/parser/Lexer.x | 32 ++++++++++++---------- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++ .../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 2 ++ 5 files changed, 55 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c1cf2693d6efddeeeb813cd8995a1be136800d17 From git at git.haskell.org Sun Feb 10 21:30:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:37 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: API Annotations: more explicit foralls fixup (be15f74) Message-ID: <20190210213037.15E493A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/be15f7457b98fa0378de7e8146c122757f03c4e9/ghc >--------------------------------------------------------------- commit be15f7457b98fa0378de7e8146c122757f03c4e9 Author: Alan Zimmerman Date: Thu Jan 24 23:22:59 2019 +0200 API Annotations: more explicit foralls fixup The AnnForall annotations introduced via Phab:D4894 are not always attached to the correct SourceSpan. Closes #16230 >--------------------------------------------------------------- be15f7457b98fa0378de7e8146c122757f03c4e9 compiler/parser/Parser.y | 43 +++++++------- compiler/parser/RdrHsSyn.hs | 6 +- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T16230.stdout | 66 ++++++++++++++++++++++ .../hie010.hs => ghc-api/annotations/Test16230.hs} | 0 testsuite/tests/ghc-api/annotations/all.T | 3 +- 6 files changed, 97 insertions(+), 25 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 be15f7457b98fa0378de7e8146c122757f03c4e9 From git at git.haskell.org Sun Feb 10 21:30:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:40 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: ImplicitParams does not imply FlexibleContexts or FlexibleInstances, fixes #16248 (f17a576) Message-ID: <20190210213040.1E5913A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/f17a5765075631b7057aba7c582ea72b28c42d9a/ghc >--------------------------------------------------------------- commit f17a5765075631b7057aba7c582ea72b28c42d9a Author: Neil Mitchell Date: Sun Feb 3 15:45:12 2019 -0500 ImplicitParams does not imply FlexibleContexts or FlexibleInstances, fixes #16248 >--------------------------------------------------------------- f17a5765075631b7057aba7c582ea72b28c42d9a docs/users_guide/glasgow_exts.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index b46196e..c3090b0 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -5879,8 +5879,7 @@ The superclasses of a class declaration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. extension:: FlexibleContexts - :shortdesc: Enable flexible contexts. Implied by - :extension:`ImplicitParams`. + :shortdesc: Enable flexible contexts. :since: 6.8.1 @@ -6464,7 +6463,6 @@ Relaxed rules for the instance head .. extension:: FlexibleInstances :shortdesc: Enable flexible instances. Implies :extension:`TypeSynonymInstances`. - Implied by :extension:`ImplicitParams`. :implies: :extension:`TypeSynonymInstances` :since: 6.8.1 @@ -10882,7 +10880,6 @@ Implicit parameters .. extension:: ImplicitParams :shortdesc: Enable Implicit Parameters. - Implies :extension:`FlexibleContexts` and :extension:`FlexibleInstances`. :since: 6.8.1 From git at git.haskell.org Sun Feb 10 21:30:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:43 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: API Annotations: parens anns discarded for `(*)` operator (5e9888b) Message-ID: <20190210213043.92D053A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/5e9888bd9c22a1315a703f638591b50e657317c4/ghc >--------------------------------------------------------------- commit 5e9888bd9c22a1315a703f638591b50e657317c4 Author: Alan Zimmerman Date: Sat Feb 2 16:29:05 2019 +0200 API Annotations: parens anns discarded for `(*)` operator The patch from https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Updates haddock submodule Closes #16265 >--------------------------------------------------------------- 5e9888bd9c22a1315a703f638591b50e657317c4 compiler/hsSyn/HsUtils.hs | 3 +- compiler/parser/RdrHsSyn.hs | 4 +-- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ .../annotations/StarBinderAnns.hs} | 0 .../ghc-api/annotations/StarBinderAnns.stdout | 36 ++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/all.T | 4 ++- utils/haddock | 2 +- 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index dfb0ebf..23cca4c 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -502,7 +502,8 @@ nlHsTyConApp tycon tys = foldl' nlHsAppTy (nlHsTyVar tycon) tys nlHsAppKindTy :: LHsType (GhcPass p) -> LHsKind (GhcPass p) -> LHsType (GhcPass p) -nlHsAppKindTy f k = noLoc (HsAppKindTy noExt f (parenthesizeHsType appPrec k)) +nlHsAppKindTy f k + = noLoc (HsAppKindTy noSrcSpan f (parenthesizeHsType appPrec k)) {- Tuples. All these functions are *pre-typechecker* because they lack diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index f9b511d..88217c2 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -957,10 +957,10 @@ checkTyClHdr is_cls ty goL (dL->L l ty) acc ann fix = go l ty acc ann fix -- workaround to define '*' despite StarIsType - go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix + go lp (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") - ; return (cL l (Unqual name), acc, fix, ann) } + ; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) } go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix | isRdrTc tc = return (cL l tc, acc, fix, ann) diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index ef2b5ea..da3be43 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -157,3 +157,7 @@ T16230: .PHONY: T16236 T16236: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16236.hs + +.PHONY: StarBinderAnns +StarBinderAnns: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" StarBinderAnns.hs diff --git a/testsuite/tests/warnings/should_compile/StarBinder.hs b/testsuite/tests/ghc-api/annotations/StarBinderAnns.hs similarity index 100% copy from testsuite/tests/warnings/should_compile/StarBinder.hs copy to testsuite/tests/ghc-api/annotations/StarBinderAnns.hs diff --git a/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout new file mode 100644 index 0000000..d75f30a --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout @@ -0,0 +1,36 @@ +---Unattached Annotation Problems (should be empty list)--- +[] +---Ann before enclosing span problem (should be empty list)--- +[ + +] + +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((StarBinderAnns.hs:1:1,AnnModule), [StarBinderAnns.hs:4:1-6]), +((StarBinderAnns.hs:1:1,AnnWhere), [StarBinderAnns.hs:4:23-27]), +((StarBinderAnns.hs:4:10-21,AnnCloseP), [StarBinderAnns.hs:4:21]), +((StarBinderAnns.hs:4:10-21,AnnOpenP), [StarBinderAnns.hs:4:10]), +((StarBinderAnns.hs:4:11-20,AnnType), [StarBinderAnns.hs:4:11-14]), +((StarBinderAnns.hs:4:16-20,AnnCloseP), [StarBinderAnns.hs:4:20]), +((StarBinderAnns.hs:4:16-20,AnnOpenP), [StarBinderAnns.hs:4:16]), +((StarBinderAnns.hs:4:16-20,AnnVal), [StarBinderAnns.hs:4:17-19]), +((StarBinderAnns.hs:6:1-19,AnnCloseC), [StarBinderAnns.hs:6:50]), +((StarBinderAnns.hs:6:1-19,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:1-19,AnnFamily), [StarBinderAnns.hs:6:6-11]), +((StarBinderAnns.hs:6:1-19,AnnOpenC), [StarBinderAnns.hs:6:27]), +((StarBinderAnns.hs:6:1-19,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:1-19,AnnSemi), [StarBinderAnns.hs:7:1]), +((StarBinderAnns.hs:6:1-19,AnnType), [StarBinderAnns.hs:6:1-4]), +((StarBinderAnns.hs:6:1-19,AnnWhere), [StarBinderAnns.hs:6:21-25]), +((StarBinderAnns.hs:6:13-15,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:13-15,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:29-31,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-31,AnnOpenP), [StarBinderAnns.hs:6:29]), +((StarBinderAnns.hs:6:29-48,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-48,AnnEqual), [StarBinderAnns.hs:6:37]), +((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29]), +((,AnnEofPos), [StarBinderAnns.hs:7:1]) +] \ No newline at end of file diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 139c441..8635ba1 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -59,9 +59,11 @@ test('T13163', [extra_files(['Test13163.hs']), ignore_stderr], makefile_test, ['T13163']) test('T15303', [extra_files(['Test15303.hs']), ignore_stderr], makefile_test, ['T15303']) -test('T16212', [expect_broken(16212),extra_files(['Test16212.hs']), +test('T16212', [extra_files(['Test16212.hs']), ignore_stderr], makefile_test, ['T16212']) test('T16230', [extra_files(['Test16230.hs']), ignore_stderr], makefile_test, ['T16230']) test('T16236', [extra_files(['Test16236.hs']), ignore_stderr], makefile_test, ['T16236']) +test('StarBinderAnns', [extra_files(['StarBinderAnns.hs']), + ignore_stderr], makefile_test, ['StarBinderAnns']) diff --git a/utils/haddock b/utils/haddock index cfd682c..3ee6526 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit cfd682c5fd03b099a3d78c44f9279faf56a0ac70 +Subproject commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576 From git at git.haskell.org Sun Feb 10 21:30:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:46 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: rts/ProfilerReportJson: Fix format string (7ff127f) Message-ID: <20190210213046.9794F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/7ff127f9e455402da183d1bb1808db024d1fa944/ghc >--------------------------------------------------------------- commit 7ff127f9e455402da183d1bb1808db024d1fa944 Author: Ben Gamari Date: Mon Feb 4 21:42:41 2019 -0500 rts/ProfilerReportJson: Fix format string This was warning on i386. >--------------------------------------------------------------- 7ff127f9e455402da183d1bb1808db024d1fa944 rts/ProfilerReportJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c index a786921..ea7c852 100644 --- a/rts/ProfilerReportJson.c +++ b/rts/ProfilerReportJson.c @@ -66,7 +66,7 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " - "\"alloc\": %" FMT_Word ", " + "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, From git at git.haskell.org Sun Feb 10 21:30:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:49 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Cleanup in parser/Ctype.hs (ced729f) Message-ID: <20190210213049.B1FC63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/ced729f6f4651b67151015e25a98c93792794aee/ghc >--------------------------------------------------------------- commit ced729f6f4651b67151015e25a98c93792794aee Author: Sylvain Henry Date: Tue Feb 5 15:55:03 2019 +0100 Cleanup in parser/Ctype.hs * GHC now performs constant folding on bit operations like (.|.) so we use them and we remove the misleading comment * we use Word8 instead of Int and we remove the useless conversion to Int32. Hopefully future releases of GHC could transform the big case in `charType` into a value table indexing instead of a jump table. Word8 would make the table smaller. * we use INLINABLE pragma instead of INLINE on `is_ctype`: in my test, the latter *prevents* `is_ctype` to be inlined because `charType` is inlined into `is_ctype` (to call charType`s worker on the unboxed Char directly). >--------------------------------------------------------------- ced729f6f4651b67151015e25a98c93792794aee compiler/parser/Ctype.hs | 273 +++++++++++++++++++++++------------------------ 1 file changed, 135 insertions(+), 138 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 ced729f6f4651b67151015e25a98c93792794aee From git at git.haskell.org Sun Feb 10 21:30:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:52 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Fix optSemi type in Parser.y (071bef1) Message-ID: <20190210213052.BB7EE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/071bef18ccafb134ab886da9e362689b9f092dd3/ghc >--------------------------------------------------------------- commit 071bef18ccafb134ab886da9e362689b9f092dd3 Author: Vladislav Zavialov Date: Tue Feb 5 20:01:36 2019 -0500 Fix optSemi type in Parser.y The definition of 'optSemi' claimed it had type ([Located a],Bool) Note that its production actually returns ([Located Token],Bool): : ';' { ([$1],True) } -- $1 :: Located Token Due to an infelicity in the implementation of 'happy -c', it effectively resulted in 'unsafeCoerce :: Token -> a'. See https://github.com/simonmar/happy/pull/134 If any consumer of 'optSemi' tried to instantiate 'a' to something not representationally equal to 'Token', they would experience a segfault. In addition to that, this definition made it impossible to compile Parser.y without the -c flag (as it's reliant on this bug to cast 'Token' to 'forall a. a'). >--------------------------------------------------------------- 071bef18ccafb134ab886da9e362689b9f092dd3 compiler/parser/Parser.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index c5b5c5f..820144d 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1,4 +1,3 @@ - -- -*-haskell-*- -- --------------------------------------------------------------------------- -- (c) The University of Glasgow 1997-2003 @@ -2581,7 +2580,7 @@ exp10 :: { LHsExpr GhcPs } | scc_annot exp {% ams (sLL $1 $> $ HsSCC noExt (snd $ fst $ unLoc $1) (snd $ unLoc $1) $2) (fst $ fst $ unLoc $1) } -optSemi :: { ([Located a],Bool) } +optSemi :: { ([Located Token],Bool) } : ';' { ([$1],True) } | {- empty -} { ([],False) } From git at git.haskell.org Sun Feb 10 21:30:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:55 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Minor refactor of CUSK handling (9bb23d5) Message-ID: <20190210213055.C968C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/9bb23d5f8bd7a135670864dfa09dd39a60e94d28/ghc >--------------------------------------------------------------- commit 9bb23d5f8bd7a135670864dfa09dd39a60e94d28 Author: Simon Peyton Jones Date: Thu Feb 7 09:51:36 2019 +0000 Minor refactor of CUSK handling Previously, in getFamDeclInitialKind, we were figuring out whether the enclosing class decl had a CUSK very indirectly, via tcTyConIsPoly. This patch just makes the computation much more direct and easy to grok. No change in behaviour. >--------------------------------------------------------------- 9bb23d5f8bd7a135670864dfa09dd39a60e94d28 compiler/hsSyn/HsDecls.hs | 29 +++++++++++++++++++---------- compiler/typecheck/TcTyClsDecls.hs | 28 +++++++++++++++------------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 5b06db8..c18a9ae 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -680,7 +680,9 @@ countTyClDecls decls -- | Does this declaration have a complete, user-supplied kind signature? -- See Note [CUSKs: complete user-supplied kind signatures] hsDeclHasCusk :: TyClDecl GhcRn -> Bool -hsDeclHasCusk (FamDecl { tcdFam = fam_decl }) = famDeclHasCusk Nothing fam_decl +hsDeclHasCusk (FamDecl { tcdFam = fam_decl }) + = famDeclHasCusk False fam_decl + -- False: this is not: an associated type of a class with no cusk hsDeclHasCusk (SynDecl { tcdTyVars = tyvars, tcdRhs = rhs }) -- NB: Keep this synchronized with 'getInitialKind' = hsTvbAllKinded tyvars && rhs_annotated rhs @@ -1078,15 +1080,22 @@ data FamilyInfo pass -- | Does this family declaration have a complete, user-supplied kind signature? -- See Note [CUSKs: complete user-supplied kind signatures] -famDeclHasCusk :: Maybe Bool - -- ^ if associated, does the enclosing class have a CUSK? - -> FamilyDecl pass -> Bool -famDeclHasCusk _ (FamilyDecl { fdInfo = ClosedTypeFamily _ - , fdTyVars = tyvars - , fdResultSig = L _ resultSig }) - = hsTvbAllKinded tyvars && hasReturnKindSignature resultSig -famDeclHasCusk mb_class_cusk _ = mb_class_cusk `orElse` True - -- all un-associated open families have CUSKs +famDeclHasCusk :: Bool -- ^ True <=> this is an associated type family, + -- and the parent class has /no/ CUSK + -> FamilyDecl pass + -> Bool +famDeclHasCusk assoc_with_no_cusk + (FamilyDecl { fdInfo = fam_info + , fdTyVars = tyvars + , fdResultSig = L _ resultSig }) + = case fam_info of + ClosedTypeFamily {} -> hsTvbAllKinded tyvars + && hasReturnKindSignature resultSig + _ -> not assoc_with_no_cusk + -- Un-associated open type/data families have CUSKs + -- Associated type families have CUSKs iff the parent class does + +famDeclHasCusk _ (XFamilyDecl {}) = panic "famDeclHasCusk" -- | Does this family declaration have user-supplied return kind signature? hasReturnKindSignature :: FamilyResultSig a -> Bool diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 7bf5e20..1333489 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -917,7 +917,7 @@ getInitialKind cusk ; let parent_tv_prs = tcTyConScopedTyVars tycon -- See Note [Don't process associated types in kcLHsQTyVars] ; inner_tcs <- tcExtendNameTyVarEnv parent_tv_prs $ - getFamDeclInitialKinds (Just tycon) ats + getFamDeclInitialKinds cusk (Just tycon) ats ; return (tycon : inner_tcs) } getInitialKind cusk @@ -932,8 +932,8 @@ getInitialKind cusk Nothing -> return liftedTypeKind ; return [tc] } -getInitialKind _ (FamDecl { tcdFam = decl }) - = do { tc <- getFamDeclInitialKind Nothing decl +getInitialKind cusk (FamDecl { tcdFam = decl }) + = do { tc <- getFamDeclInitialKind cusk Nothing decl ; return [tc] } getInitialKind cusk (SynDecl { tcdLName = dL->L _ name @@ -956,22 +956,24 @@ getInitialKind _ (XTyClDecl _) = panic "getInitialKind" --------------------------------- getFamDeclInitialKinds - :: Maybe TcTyCon -- ^ Enclosing class TcTyCon, if any + :: Bool -- ^ True <=> cusk + -> Maybe TyCon -- ^ Just cls <=> this is an associated family of class cls -> [LFamilyDecl GhcRn] -> TcM [TcTyCon] -getFamDeclInitialKinds mb_parent_tycon decls - = mapM (addLocM (getFamDeclInitialKind mb_parent_tycon)) decls +getFamDeclInitialKinds cusk mb_parent_tycon decls + = mapM (addLocM (getFamDeclInitialKind cusk mb_parent_tycon)) decls getFamDeclInitialKind - :: Maybe TcTyCon -- ^ Enclosing class TcTyCon, if any + :: Bool -- ^ True <=> cusk + -> Maybe TyCon -- ^ Just cls <=> this is an associated family of class cls -> FamilyDecl GhcRn -> TcM TcTyCon -getFamDeclInitialKind mb_parent_tycon +getFamDeclInitialKind parent_cusk mb_parent_tycon decl@(FamilyDecl { fdLName = (dL->L _ name) , fdTyVars = ktvs , fdResultSig = (dL->L _ resultSig) , fdInfo = info }) - = kcLHsQTyVars name flav cusk ktvs $ + = kcLHsQTyVars name flav fam_cusk ktvs $ case resultSig of KindSig _ ki -> tcLHsKindSig ctxt ki TyVarSig _ (dL->L _ (KindedTyVar _ _ ki)) -> tcLHsKindSig ctxt ki @@ -981,15 +983,15 @@ getFamDeclInitialKind mb_parent_tycon -- by default | otherwise -> newMetaKindVar where - mb_cusk = tcTyConIsPoly <$> mb_parent_tycon - cusk = famDeclHasCusk mb_cusk decl - flav = case info of + assoc_with_no_cusk = isJust mb_parent_tycon && not parent_cusk + fam_cusk = famDeclHasCusk assoc_with_no_cusk decl + flav = case info of DataFamily -> DataFamilyFlavour mb_parent_tycon OpenTypeFamily -> OpenTypeFamilyFlavour mb_parent_tycon ClosedTypeFamily _ -> ASSERT( isNothing mb_parent_tycon ) ClosedTypeFamilyFlavour ctxt = TyFamResKindCtxt name -getFamDeclInitialKind _ (XFamilyDecl _) = panic "getFamDeclInitialKind" +getFamDeclInitialKind _ _ (XFamilyDecl _) = panic "getFamDeclInitialKind" ------------------------------------------------------------------------ kcLTyClDecl :: LTyClDecl GhcRn -> TcM () From git at git.haskell.org Sun Feb 10 21:30:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:30:58 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Comments only about the binder-swap in OccurAnal (cefb780) Message-ID: <20190210213058.D25FC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/cefb780ee7ae3c3be873324423358eafd4ba5a17/ghc >--------------------------------------------------------------- commit cefb780ee7ae3c3be873324423358eafd4ba5a17 Author: Simon Peyton Jones Date: Thu Feb 7 08:46:48 2019 +0000 Comments only about the binder-swap in OccurAnal >--------------------------------------------------------------- cefb780ee7ae3c3be873324423358eafd4ba5a17 compiler/simplCore/OccurAnal.hs | 53 +++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 8b16422..5287817 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2210,17 +2210,45 @@ extendFvs env s Note [Binder swap] ~~~~~~~~~~~~~~~~~~ -We do these two transformations right here: +The "binder swap" tranformation swaps occurence of the +scrutinee of a case for occurrences of the case-binder: - (1) case x of b { pi -> ri } - ==> + (1) case x of b { pi -> ri } + ==> case x of b { pi -> let x=b in ri } (2) case (x |> co) of b { pi -> ri } - ==> + ==> case (x |> co) of b { pi -> let x = b |> sym co in ri } - Why (2)? See Note [Case of cast] +In both cases, the trivial 'let' can be eliminated by the +immediately following simplifier pass. + +There are two reasons for making this swap: + +(A) It reduces the number of occurrences of the scrutinee, x. + That in turn might reduce its occurrences to one, so we + can inline it and save an allocation. E.g. + let x = factorial y in case x of b { I# v -> ...x... } + If we replace 'x' by 'b' in the alternative we get + let x = factorial y in case x of b { I# v -> ...b... } + and now we can inline 'x', thus + case (factorial y) of b { I# v -> ...b... } + +(B) The case-binder b has unfolding information; in the + example above we know that b = I# v. That in turn allows + nested cases to simplify. Consider + case x of b { I# v -> + ...(case x of b2 { I# v2 -> rhs })... + If we replace 'x' by 'b' in the alternative we get + case x of b { I# v -> + ...(case b of b2 { I# v2 -> rhs })... + and now it is trivial to simplify the inner case: + case x of b { I# v -> + ...(let b2 = b in rhs)... + + The same can happen even if the scrutinee is a variable + with a cast: see Note [Case of cast] In both cases, in a particular alternative (pi -> ri), we only add the binding if @@ -2236,18 +2264,19 @@ Notice that * The deliberate shadowing of 'x'. * That (a) rapidly becomes false, so no bindings are injected. -The reason for doing these transformations here is because it allows -us to adjust the OccInfo for 'x' and 'b' as we go. +The reason for doing these transformations /here in the occurrence +analyser/ is because it allows us to adjust the OccInfo for 'x' and +'b' as we go. * Suppose the only occurrences of 'x' are the scrutinee and in the ri; then this transformation makes it occur just once, and hence get inlined right away. - * If we do this in the Simplifier, we don't know whether 'x' is used - in ri, so we are forced to pessimistically zap b's OccInfo even - though it is typically dead (ie neither it nor x appear in the - ri). There's nothing actually wrong with zapping it, except that - it's kind of nice to know which variables are dead. My nose + * If instead we do this in the Simplifier, we don't know whether 'x' + is used in ri, so we are forced to pessimistically zap b's OccInfo + even though it is typically dead (ie neither it nor x appear in + the ri). There's nothing actually wrong with zapping it, except + that it's kind of nice to know which variables are dead. My nose tells me to keep this information as robustly as possible. The Maybe (Id,CoreExpr) passed to occAnalAlt is the extra let-binding From git at git.haskell.org Sun Feb 10 21:31:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:01 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Remove a few undefined prel names (0a4bbb5) Message-ID: <20190210213101.E31643A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/0a4bbb526688a97db0edbd5acc7471e3b139ed7d/ghc >--------------------------------------------------------------- commit 0a4bbb526688a97db0edbd5acc7471e3b139ed7d Author: Ömer Sinan Ağacan Date: Wed Feb 6 10:26:00 2019 +0300 Remove a few undefined prel names - breakpointAuto - breakpointJump - breakpointCondJump - breakpointAutoJump These Ids are never defined, but there were definitions about those in PrelNames. Those are now removed. >--------------------------------------------------------------- 0a4bbb526688a97db0edbd5acc7471e3b139ed7d compiler/prelude/PrelNames.hs | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 5c86f65..94bb928 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -360,7 +360,7 @@ basicKnownKeyNames -- Others otherwiseIdName, inlineIdName, eqStringName, assertName, breakpointName, breakpointCondName, - breakpointAutoName, opaqueTyConName, + opaqueTyConName, assertErrorName, traceName, printName, fstName, sndName, dollarName, @@ -1081,7 +1081,7 @@ groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey -- Random PrelBase functions fromStringName, otherwiseIdName, foldrName, buildName, augmentName, mapName, appendName, assertName, - breakpointName, breakpointCondName, breakpointAutoName, + breakpointName, breakpointCondName, opaqueTyConName, dollarName :: Name dollarName = varQual gHC_BASE (fsLit "$") dollarIdKey otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey @@ -1093,29 +1093,9 @@ appendName = varQual gHC_BASE (fsLit "++") appendIdKey assertName = varQual gHC_BASE (fsLit "assert") assertIdKey breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey -breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey -breakpointJumpName :: Name -breakpointJumpName - = mkInternalName - breakpointJumpIdKey - (mkOccNameFS varName (fsLit "breakpointJump")) - noSrcSpan -breakpointCondJumpName :: Name -breakpointCondJumpName - = mkInternalName - breakpointCondJumpIdKey - (mkOccNameFS varName (fsLit "breakpointCondJump")) - noSrcSpan -breakpointAutoJumpName :: Name -breakpointAutoJumpName - = mkInternalName - breakpointAutoJumpIdKey - (mkOccNameFS varName (fsLit "breakpointAutoJump")) - noSrcSpan - -- PrelTup fstName, sndName :: Name fstName = varQual dATA_TUPLE (fsLit "fst") fstIdKey @@ -2224,15 +2204,9 @@ runRWKey = mkPreludeMiscIdUnique 107 traceKey :: Unique traceKey = mkPreludeMiscIdUnique 108 -breakpointIdKey, breakpointCondIdKey, breakpointAutoIdKey, - breakpointJumpIdKey, breakpointCondJumpIdKey, - breakpointAutoJumpIdKey :: Unique +breakpointIdKey, breakpointCondIdKey :: Unique breakpointIdKey = mkPreludeMiscIdUnique 110 breakpointCondIdKey = mkPreludeMiscIdUnique 111 -breakpointAutoIdKey = mkPreludeMiscIdUnique 112 -breakpointJumpIdKey = mkPreludeMiscIdUnique 113 -breakpointCondJumpIdKey = mkPreludeMiscIdUnique 114 -breakpointAutoJumpIdKey = mkPreludeMiscIdUnique 115 inlineIdKey, noinlineIdKey :: Unique inlineIdKey = mkPreludeMiscIdUnique 120 From git at git.haskell.org Sun Feb 10 21:31:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:04 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Comments only (616b2ef) Message-ID: <20190210213104.F0E743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/616b2ef50d0a4c7cdcda97439936ea31b9a37d09/ghc >--------------------------------------------------------------- commit 616b2ef50d0a4c7cdcda97439936ea31b9a37d09 Author: Simon Peyton Jones Date: Fri Jan 18 17:12:13 2019 +0000 Comments only >--------------------------------------------------------------- 616b2ef50d0a4c7cdcda97439936ea31b9a37d09 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcExpr.hs | 2 +- compiler/typecheck/TcType.hs | 13 +++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index abdce58..05fe393 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -1267,7 +1267,7 @@ tcMonoBinds is_rec sig_fn no_gen do { ((co_fn, matches'), rhs_ty) <- tcInferInst $ \ exp_ty -> -- tcInferInst: see TcUnify, - -- Note [Deep instantiation of InferResult] + -- Note [Deep instantiation of InferResult] in TcUnify tcExtendBinderStack [TcIdBndr_ExpType name exp_ty NotTopLevel] $ -- We extend the error context even for a non-recursive -- function so that in type error messages we show the diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 0e09008..b87f877 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1274,7 +1274,7 @@ tcInferFun (L loc (HsRecFld _ f)) tcInferFun fun = tcInferSigma fun -- NB: tcInferSigma; see TcUnify - -- Note [Deep instantiation of InferResult] + -- Note [Deep instantiation of InferResult] in TcUnify ---------------- diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index b2c9b32..a7ba6b7 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -364,11 +364,16 @@ data ExpType = Check TcType data InferResult = IR { ir_uniq :: Unique -- For debugging only + , ir_lvl :: TcLevel -- See Note [TcLevel of ExpType] in TcMType - , ir_inst :: Bool -- True <=> deeply instantiate before returning - -- i.e. return a RhoType - -- False <=> do not instantiate before returning - -- i.e. return a SigmaType + + , ir_inst :: Bool + -- True <=> deeply instantiate before returning + -- i.e. return a RhoType + -- False <=> do not instantiate before returning + -- i.e. return a SigmaType + -- See Note [Deep instantiation of InferResult] in TcUnify + , ir_ref :: IORef (Maybe TcType) } -- The type that fills in this hole should be a Type, -- that is, its kind should be (TYPE rr) for some rr From git at git.haskell.org Sun Feb 10 21:31:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:09 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Stack: fix name mangling. (fb031b9) Message-ID: <20190210213109.2B0653A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/fb031b9b046e48ffe0d2864ec76bee3bc8ff5625/ghc >--------------------------------------------------------------- commit fb031b9b046e48ffe0d2864ec76bee3bc8ff5625 Author: Tamar Christina Date: Sun Jan 27 15:54:36 2019 +0000 Stack: fix name mangling. >--------------------------------------------------------------- fb031b9b046e48ffe0d2864ec76bee3bc8ff5625 compiler/nativeGen/X86/Instr.hs | 2 +- .../tests/profiling/should_compile/T16166/Main.hs | 11 ++++ .../should_compile/T16166/NetworkRequestHeader.hs | 76 ++++++++++++++++++++++ .../tests/profiling/should_compile/T16166/all.T | 7 ++ 4 files changed, 95 insertions(+), 1 deletion(-) diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/nativeGen/X86/Instr.hs index 4717ec1..beb9a97 100644 --- a/compiler/nativeGen/X86/Instr.hs +++ b/compiler/nativeGen/X86/Instr.hs @@ -946,7 +946,7 @@ x86_mkStackAllocInstr platform amount ] ArchX86_64 | needs_probe_call platform amount -> [ MOV II64 (OpImm (ImmInt amount)) (OpReg rax) - , CALL (Left $ strImmLit "__chkstk_ms") [rax] + , CALL (Left $ strImmLit "___chkstk_ms") [rax] , SUB II64 (OpReg rax) (OpReg rsp) ] | otherwise -> diff --git a/testsuite/tests/profiling/should_compile/T16166/Main.hs b/testsuite/tests/profiling/should_compile/T16166/Main.hs new file mode 100644 index 0000000..09dbb87 --- /dev/null +++ b/testsuite/tests/profiling/should_compile/T16166/Main.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE BangPatterns #-} +-- Main.hs +module Main (main) where + +import NetworkRequestHeader + +import Control.Monad + +main :: IO () +main = void $ parseHeaderLines [] + diff --git a/testsuite/tests/profiling/should_compile/T16166/NetworkRequestHeader.hs b/testsuite/tests/profiling/should_compile/T16166/NetworkRequestHeader.hs new file mode 100644 index 0000000..48a6288 --- /dev/null +++ b/testsuite/tests/profiling/should_compile/T16166/NetworkRequestHeader.hs @@ -0,0 +1,76 @@ +{-# LANGUAGE BangPatterns #-} +-- NetworkRequestHeader.hs +module NetworkRequestHeader (parseHeaderLines, parseRequestLine) where + +import Control.Exception +import Control.Monad +import Data.ByteString.Internal (ByteString(..), memchr) +import Data.Word +import Foreign.ForeignPtr (withForeignPtr) +import Foreign.Ptr (Ptr, plusPtr, minusPtr, nullPtr) +import Foreign.Storable (peek) + +-- | Error types for bad 'Request'. +data InvalidRequest = NonHttp + +instance Show InvalidRequest where show _ = "" +instance Exception InvalidRequest + +parseHeaderLines :: [ByteString] + -> IO (ByteString + ,ByteString -- Path + ,ByteString -- Path, parsed + ) +parseHeaderLines [] = throwIO $ NonHttp +parseHeaderLines (firstLine:_) = do + (method, path') <- parseRequestLine firstLine + let path = path' + return (method, path', path) + +parseRequestLine :: ByteString + -> IO (ByteString + ,ByteString) +parseRequestLine (PS fptr off len) = withForeignPtr fptr $ \ptr -> do + when (len < 14) $ throwIO NonHttp + let methodptr = ptr `plusPtr` off + limptr = methodptr `plusPtr` len + lim0 = fromIntegral len + + pathptr0 <- memchr methodptr 32 lim0 -- ' ' + when (pathptr0 == nullPtr || (limptr `minusPtr` pathptr0) < 11) $ + throwIO NonHttp + let pathptr = pathptr0 `plusPtr` 1 + lim1 = fromIntegral (limptr `minusPtr` pathptr0) + + httpptr0 <- memchr pathptr 32 lim1 -- ' ' + when (httpptr0 == nullPtr || (limptr `minusPtr` httpptr0) < 9) $ + throwIO NonHttp + let httpptr = httpptr0 `plusPtr` 1 + lim2 = fromIntegral (httpptr0 `minusPtr` pathptr) + + checkHTTP httpptr + queryptr <- memchr pathptr 63 lim2 -- '?' + + let !method = bs ptr methodptr pathptr0 + !path + | queryptr == nullPtr = bs ptr pathptr httpptr0 + | otherwise = bs ptr pathptr queryptr + + return (method,path) + where + check :: Ptr Word8 -> Int -> Word8 -> IO () + check p n w = do + w0 <- peek $ p `plusPtr` n + when (w0 /= w) $ throwIO NonHttp + checkHTTP httpptr = do + check httpptr 0 72 -- 'H' + check httpptr 1 84 -- 'T' + check httpptr 2 84 -- 'T' + check httpptr 3 80 -- 'P' + check httpptr 4 47 -- '/' + check httpptr 6 46 -- '.' + bs ptr p0 p1 = PS fptr o l + where + o = p0 `minusPtr` ptr + l = p1 `minusPtr` p0 + diff --git a/testsuite/tests/profiling/should_compile/T16166/all.T b/testsuite/tests/profiling/should_compile/T16166/all.T new file mode 100644 index 0000000..31f129b --- /dev/null +++ b/testsuite/tests/profiling/should_compile/T16166/all.T @@ -0,0 +1,7 @@ +# We need the register allocator to use more than a page worth of stack space +# when spilling in a single function, easiest way to do that is +# using a profiling build +test('T16166', [only_ways(['normal']), req_profiling, + extra_files(['Main.hs', 'NetworkRequestHeader.hs'])], + multimod_compile, + ['Main NetworkRequestHeader', '-O -prof -fprof-auto -v0']) From git at git.haskell.org Sun Feb 10 21:31:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:12 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Improve snocView implementation. (f4d8e90) Message-ID: <20190210213112.7ECE63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/f4d8e907b6b2e4110e1c6a21b34b1b46566ff6d5/ghc >--------------------------------------------------------------- commit f4d8e907b6b2e4110e1c6a21b34b1b46566ff6d5 Author: klebinger.andreas at gmx.at Date: Tue Jan 22 16:17:40 2019 +0100 Improve snocView implementation. The new implementation isn't tailrecursive and instead builds up the initial part of the list as it goes. This improves allocation numbers as we don't build up an intermediate list just to reverse it later. This is slightly slower for lists of size <= 3. But in benchmarks significantly faster for any list above 5 elements, assuming the majority of the resulting list will be evaluated. >--------------------------------------------------------------- f4d8e907b6b2e4110e1c6a21b34b1b46566ff6d5 compiler/utils/Util.hs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index 876cd1e..16864fe 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -783,20 +783,25 @@ lastMaybe :: [a] -> Maybe a lastMaybe [] = Nothing lastMaybe xs = Just $ last xs --- | If there is a good chance that you will only look at the last --- element prefer seperate calls to @last@ + @init at . --- @last@ does not allocate while traversing the list, while this --- will. But if you are guaranteed to use both this will --- usually be more efficient. +-- | Split a list into its last element and the initial part of the list. +-- @snocView xs = Just (init xs, last xs)@ for non-empty lists. +-- @snocView xs = Nothing@ otherwise. +-- Unless both parts of the result are guaranteed to be used +-- prefer separate calls to @last@ + @init at . +-- If you are guaranteed to use both, this will +-- be more efficient. snocView :: [a] -> Maybe ([a],a) - -- Split off the last element snocView [] = Nothing -snocView xs = go [] xs - where - -- Invariant: second arg is non-empty - go acc [x] = Just (reverse acc, x) - go acc (x:xs) = go (x:acc) xs - go _ [] = panic "Util: snocView" +snocView xs + | (xs,x) <- go xs + = Just (xs,x) + where + go :: [a] -> ([a],a) + go [x] = ([],x) + go (x:xs) + | !(xs',x') <- go xs + = (x:xs', x') + go [] = error "impossible" split :: Char -> String -> [String] split c s = case rest of From git at git.haskell.org Sun Feb 10 21:31:15 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:15 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Replace a few uses of snocView with last/lastMaybe. (9170daa) Message-ID: <20190210213115.8A54C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/9170daa859ca5845b95acc88d10c127fb55d66fa/ghc >--------------------------------------------------------------- commit 9170daa859ca5845b95acc88d10c127fb55d66fa Author: klebinger.andreas at gmx.at Date: Mon Jan 21 17:55:22 2019 +0100 Replace a few uses of snocView with last/lastMaybe. These never used the first part of the result from snocView. Hence replacing them with last[Maybe] is both clearer and gives better performance. >--------------------------------------------------------------- 9170daa859ca5845b95acc88d10c127fb55d66fa compiler/typecheck/TcDerivUtils.hs | 2 +- compiler/utils/Outputable.hs | 4 ++-- compiler/utils/Util.hs | 11 ++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcDerivUtils.hs b/compiler/typecheck/TcDerivUtils.hs index 5f48e5f..32a7aca 100644 --- a/compiler/typecheck/TcDerivUtils.hs +++ b/compiler/typecheck/TcDerivUtils.hs @@ -801,7 +801,7 @@ cond_functorOK allowFunctions allowExQuantifiedLastTyVar _ _ rep_tc = allValid (map check_con data_cons) where tc_tvs = tyConTyVars rep_tc - Just (_, last_tv) = snocView tc_tvs + last_tv = last tc_tvs bad_stupid_theta = filter is_bad (tyConStupidTheta rep_tc) is_bad pred = last_tv `elemVarSet` exactTyCoVarsOfType pred -- See Note [Check that the type variable is truly universal] diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index bb3b9d3..b3d77aa 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -609,8 +609,8 @@ quotes d = else SDoc $ \sty -> let pp_d = runSDoc d sty str = show pp_d - in case (str, snocView str) of - (_, Just (_, '\'')) -> pp_d + in case (str, lastMaybe str) of + (_, Just '\'') -> pp_d ('\'' : _, _) -> pp_d _other -> Pretty.quotes pp_d diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index 0c7bb4a..876cd1e 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -28,7 +28,7 @@ module Util ( mapAndUnzip, mapAndUnzip3, mapAccumL2, nOfThem, filterOut, partitionWith, - dropWhileEndLE, spanEnd, last2, + dropWhileEndLE, spanEnd, last2, lastMaybe, foldl1', foldl2, count, countWhile, all2, @@ -779,6 +779,15 @@ last2 = foldl' (\(_,x2) x -> (x2,x)) (partialError,partialError) where partialError = panic "last2 - list length less than two" +lastMaybe :: [a] -> Maybe a +lastMaybe [] = Nothing +lastMaybe xs = Just $ last xs + +-- | If there is a good chance that you will only look at the last +-- element prefer seperate calls to @last@ + @init at . +-- @last@ does not allocate while traversing the list, while this +-- will. But if you are guaranteed to use both this will +-- usually be more efficient. snocView :: [a] -> Maybe ([a],a) -- Split off the last element snocView [] = Nothing From git at git.haskell.org Sun Feb 10 21:31:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:18 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Simplify the build.stack.bat script to use 'stack run' (9adb7f6) Message-ID: <20190210213118.9884D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/9adb7f64b37122d391247aa80227f68b41c11c77/ghc >--------------------------------------------------------------- commit 9adb7f64b37122d391247aa80227f68b41c11c77 Author: Neil Mitchell Date: Thu Feb 7 14:49:33 2019 +0000 Simplify the build.stack.bat script to use 'stack run' >--------------------------------------------------------------- 9adb7f64b37122d391247aa80227f68b41c11c77 hadrian/build.stack.bat | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hadrian/build.stack.bat b/hadrian/build.stack.bat index 642ab06..09bfd95 100644 --- a/hadrian/build.stack.bat +++ b/hadrian/build.stack.bat @@ -3,9 +3,5 @@ setlocal rem Change the current directory to the one containing this script cd %~dp0 -rem Build Hadrian and dependencies and exit the script if the build failed -stack build -if %errorlevel% neq 0 exit /B %errorlevel% - -rem Run Hadrian in GHC top directory forwarding additional user arguments -stack exec hadrian -- --directory ".." %* +rem Build and run Hadrian in GHC top directory forwarding additional user arguments +stack run hadrian --cwd=.. -- %* From git at git.haskell.org Sun Feb 10 21:31:21 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:21 +0000 (UTC) Subject: [commit: ghc] wip/T15449, wip/T16188, wip/llvm-configure-opts: Upgrade to the latest stack resolver (249b0ba) Message-ID: <20190210213121.AB93D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T15449,wip/T16188,wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/249b0babb08409311a56da0ef890445676927fb7/ghc >--------------------------------------------------------------- commit 249b0babb08409311a56da0ef890445676927fb7 Author: Neil Mitchell Date: Thu Feb 7 14:50:47 2019 +0000 Upgrade to the latest stack resolver >--------------------------------------------------------------- 249b0babb08409311a56da0ef890445676927fb7 hadrian/stack.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hadrian/stack.yaml b/hadrian/stack.yaml index d379133..7f06944 100644 --- a/hadrian/stack.yaml +++ b/hadrian/stack.yaml @@ -1,13 +1,12 @@ # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-12.10 +resolver: lts-13.6 # Local packages, usually specified by relative directory name packages: - '.' - '../libraries/Cabal/Cabal' -- '../libraries/text' # This is necessary to build until happy's version bounds are updated to work # with the new Cabal version. Stack's error message explains the issue: @@ -19,6 +18,10 @@ packages: # TODO: Remove this once it's no longer necessary allow-newer: true +# shake-0.17.4 and below depend on heaps, which depends on a specific Cabal +extra-deps: +- shake-0.17.5 + nix: enable: false packages: From git at git.haskell.org Sun Feb 10 21:31:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:24 +0000 (UTC) Subject: [commit: ghc] wip/llvm-configure-opts: configure: Document CLANG, LLC, and OPT variables (980f0da) Message-ID: <20190210213124.BA3713A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/llvm-configure-opts Link : http://ghc.haskell.org/trac/ghc/changeset/980f0dab61b3150403aed21692ffcdfceece97a2/ghc >--------------------------------------------------------------- commit 980f0dab61b3150403aed21692ffcdfceece97a2 Author: Ben Gamari Date: Sat Feb 9 17:34:36 2019 -0500 configure: Document CLANG, LLC, and OPT variables >--------------------------------------------------------------- 980f0dab61b3150403aed21692ffcdfceece97a2 configure.ac | 3 +++ distrib/configure.ac.in | 2 ++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index b75220d..e269b96 100644 --- a/configure.ac +++ b/configure.ac @@ -648,18 +648,21 @@ AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The sup dnl ** Which LLVM clang to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(CLANG,[Use as the path to clang [default=autodetect]]) AC_CHECK_TARGET_TOOL([CLANG], [clang]) ClangCmd="$CLANG" AC_SUBST([ClangCmd]) dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion]) LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion]) OptCmd="$OPT" AC_SUBST([OptCmd]) diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index e064a5d..dd0eb2e 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -128,12 +128,14 @@ LlvmVersion=@LlvmVersion@ dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion]) LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion]) OptCmd="$OPT" AC_SUBST([OptCmd]) From git at git.haskell.org Sun Feb 10 21:31:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:27 +0000 (UTC) Subject: [commit: ghc] wip/T15449: rts: Fix write barrier on thunk updates (5585c55) Message-ID: <20190210213127.D0A2F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15449 Link : http://ghc.haskell.org/trac/ghc/changeset/5585c55f8db4b6a0cc36d924dbbe0bd285aac8c0/ghc >--------------------------------------------------------------- commit 5585c55f8db4b6a0cc36d924dbbe0bd285aac8c0 Author: Ben Gamari Date: Sat Feb 9 17:14:50 2019 -0500 rts: Fix write barrier on thunk updates >--------------------------------------------------------------- 5585c55f8db4b6a0cc36d924dbbe0bd285aac8c0 rts/ThreadPaused.c | 3 ++- rts/Updates.h | 30 ++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index a916891..4feb790 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -331,8 +331,9 @@ threadPaused(Capability *cap, StgTSO *tso) #endif // The payload of the BLACKHOLE points to the TSO - ((StgInd *)bh)->indirectee = (StgClosure *)tso; + // See Note [Write barrier on thunk updates] in rts/Updates.h write_barrier(); + ((StgInd *)bh)->indirectee = (StgClosure *)tso; SET_INFO(bh,&stg_BLACKHOLE_info); // .. and we need a write barrier, since we just mutated the closure: diff --git a/rts/Updates.h b/rts/Updates.h index 1ba398b..2c9be5a 100644 --- a/rts/Updates.h +++ b/rts/Updates.h @@ -23,6 +23,31 @@ * field. So, we call LDV_RECORD_CREATE(). */ +/* Note [Write barrier on thunk updates] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Thunk updates are rather tricky, especially on architectures with weak memory + * ordering guarantees. updateWithIndirection plays a significant role in the + * update process, implementing the logic for turning a thunk or blackhole into + * an indirection. + * + * Before replacing a closure with an indirection we must first ensure that the + * writes that initialize the newly-created indirectee are available to other + * cores. For this reason, we must place a write barrier between the + * construction of the indirectee and the write to the indirectee field of the + * indirection. + * + * However note that we do *not* impose an ordering on the writes to the + * indirection's indirectee and info table pointer fields. It is in principle + * possible for the writes to p1->info to become visible before those to + * p1->indirectee. However, this is okay since we know that this field was + * earlier set to the owning TSO or blocking queue. When the stg_BLACKHOLE entry + * code sees a blackhole whose indirectee is a TSO or blocking queue it will + * retry or block as appropriate. + * + * See #15449. + */ + /* * We have two versions of this macro (sadly), one for use in C-- code, * and the other for C. @@ -40,12 +65,13 @@ p_ updatee +// See Note [Write barrier on thunk update] #define updateWithIndirection(p1, p2, and_then) \ W_ bd; \ \ OVERWRITING_CLOSURE(p1); \ - StgInd_indirectee(p1) = p2; \ prim_write_barrier; \ + StgInd_indirectee(p1) = p2; \ SET_INFO(p1, stg_BLACKHOLE_info); \ LDV_RECORD_CREATE(p1); \ bd = Bdescr(p1); \ @@ -70,8 +96,8 @@ INLINE_HEADER void updateWithIndirection (Capability *cap, /* not necessarily true: ASSERT( !closure_IND(p1) ); */ /* occurs in RaiseAsync.c:raiseAsync() */ OVERWRITING_CLOSURE(p1); + write_barrier(); // See Note [Write barrier on thunk update] ((StgInd *)p1)->indirectee = p2; - write_barrier(); SET_INFO(p1, &stg_BLACKHOLE_info); LDV_RECORD_CREATE(p1); bd = Bdescr((StgPtr)p1); From git at git.haskell.org Sun Feb 10 21:31:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:30 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Make CI via Hadrian build docs (53a870f) Message-ID: <20190210213130.DFA7A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/53a870f4a43591f15694701f2de771773ee8b5eb/ghc >--------------------------------------------------------------- commit 53a870f4a43591f15694701f2de771773ee8b5eb Author: Alec Theriault Date: Tue Jan 29 00:54:10 2019 -0800 Make CI via Hadrian build docs >--------------------------------------------------------------- 53a870f4a43591f15694701f2de771773ee8b5eb .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9814b1..b230331 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,6 +59,7 @@ ghc-linters: - ./boot - ./configure $CONFIGURE_ARGS - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` + - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` docs-haddock cache: key: hadrian paths: From git at git.haskell.org Sun Feb 10 21:31:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:34 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Fix invalid doc comment (e67384f) Message-ID: <20190210213134.032363A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/e67384f43060000f5e9e6b5cb7539bd5042835a9/ghc >--------------------------------------------------------------- commit e67384f43060000f5e9e6b5cb7539bd5042835a9 Author: Alec Theriault Date: Tue Jan 29 00:35:24 2019 -0800 Fix invalid doc comment The invalid doc comments were exposed by 24b39ce53eedad4cefc30f6786542d2072d1f9b0. The fix is to properly escaped the `{-` and `-}` in the doc comments. Some other miscallaneous markup issues are also fixed. >--------------------------------------------------------------- e67384f43060000f5e9e6b5cb7539bd5042835a9 libraries/ghc-prim/GHC/Classes.hs | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/libraries/ghc-prim/GHC/Classes.hs b/libraries/ghc-prim/GHC/Classes.hs index 1143883..14e7ae3 100644 --- a/libraries/ghc-prim/GHC/Classes.hs +++ b/libraries/ghc-prim/GHC/Classes.hs @@ -37,7 +37,7 @@ module GHC.Classes( Eq(..), Ord(..), -- ** Monomorphic equality operators - -- | See GHC.Classes#matching_overloaded_methods_in_rules + -- $matching_overloaded_methods_in_rules eqInt, neInt, eqWord, neWord, eqChar, neChar, @@ -81,9 +81,11 @@ Matching on class methods (e.g. @(==)@) in rewrite rules tends to be a bit fragile. For instance, consider this motivating example from the @bytestring@ library, -> break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) -> breakByte :: Word8 -> ByteString -> (ByteString, ByteString) -> {-# RULES "break -> breakByte" forall a. break (== x) = breakByte x #-} +@ +break :: (Word8 -> Bool) -> ByteString -> (ByteString, ByteString) +breakByte :: Word8 -> ByteString -> (ByteString, ByteString) +\{\-\# RULES "break -> breakByte" forall a. break (== x) = breakByte x \#\-\} +@ Here we have two functions, with @breakByte@ providing an optimized implementation of @break@ where the predicate is merely testing for equality @@ -95,23 +97,27 @@ For this reason, most of the primitive types in @base@ have 'Eq' and 'Ord' instances defined in terms of helper functions with inlinings delayed to phase 1. For instance, @Word8@\'s @Eq@ instance looks like, -> instance Eq Word8 where -> (==) = eqWord8 -> (/=) = neWord8 -> -> eqWord8, neWord8 :: Word8 -> Word8 -> Bool -> eqWord8 (W8# x) (W8# y) = ... -> neWord8 (W8# x) (W8# y) = ... -> {-# INLINE [1] eqWord8 #-} -> {-# INLINE [1] neWord8 #-} +@ +instance Eq Word8 where + (==) = eqWord8 + (/=) = neWord8 + +eqWord8, neWord8 :: Word8 -> Word8 -> Bool +eqWord8 (W8# x) (W8# y) = ... +neWord8 (W8# x) (W8# y) = ... +\{\-\# INLINE [1] eqWord8 \#\-\} +\{\-\# INLINE [1] neWord8 \#\-\} +@ This allows us to save our @break@ rule above by rewriting it to instead match against @eqWord8@, -> {-# RULES "break -> breakByte" forall a. break (`eqWord8` x) = breakByte x #-} +@ +\{\-\# RULES "break -> breakByte" forall a. break (`eqWord8` x) = breakByte x \#\-\} +@ -Currently this is only done for '(==)', '(/=)', '(<)', '(<=)', '(>)', and '(>=)' -for the types in "GHC.Word" and "GHC.Int". +Currently this is only done for @('==')@, @('/=')@, @('<')@, @('<=')@, @('>')@, +and @('>=')@ for the types in "GHC.Word" and "GHC.Int". -} -- | The 'Eq' class defines equality ('==') and inequality ('/='). From git at git.haskell.org Sun Feb 10 21:31:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:37 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Fix inverted position pragma flag in parser API (3fcf79a) Message-ID: <20190210213137.15C2E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/3fcf79a47138661bb01276a94e3b6d934ba92d4d/ghc >--------------------------------------------------------------- commit 3fcf79a47138661bb01276a94e3b6d934ba92d4d Author: Alec Theriault Date: Mon Jan 28 22:11:08 2019 -0800 Fix inverted position pragma flag in parser API The behviour of `lexTokenStream` around position pragma was accidentally inverted in 469fe6133646df5568c9486de2202124cb734242. This fixes that bug. This also unbreaks #16239. >--------------------------------------------------------------- 3fcf79a47138661bb01276a94e3b6d934ba92d4d compiler/parser/Lexer.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 8219390..1e27158 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2900,7 +2900,7 @@ lexTokenStream :: StringBuffer -> RealSrcLoc -> DynFlags -> ParseResult [Located lexTokenStream buf loc dflags = unP go initState{ options = opts' } where dflags' = gopt_set (gopt_unset dflags Opt_Haddock) Opt_KeepRawTokenStream initState at PState{ options = opts } = mkPState dflags' buf loc - opts' = opts{ pExtsBitmap = xbit UsePosPragsBit .|. pExtsBitmap opts } + opts' = opts{ pExtsBitmap = complement (xbit UsePosPragsBit) .&. pExtsBitmap opts } go = do ltok <- lexer False return case ltok of From git at git.haskell.org Sun Feb 10 21:31:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:40 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Remove ghctags (#16274) (027017f) Message-ID: <20190210213140.370993A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/027017fb33923b106765f5a0a6fc000ebe421d40/ghc >--------------------------------------------------------------- commit 027017fb33923b106765f5a0a6fc000ebe421d40 Author: Sylvain Henry Date: Thu Feb 7 01:02:04 2019 +0100 Remove ghctags (#16274) >--------------------------------------------------------------- 027017fb33923b106765f5a0a6fc000ebe421d40 compiler/ghc.mk | 3 - ghc.mk | 21 +-- hadrian/src/Packages.hs | 5 +- hadrian/src/Settings/Default.hs | 2 +- rules/tags-package.mk | 36 ---- utils/ghctags/Main.hs | 364 ---------------------------------------- utils/ghctags/README | 13 -- utils/ghctags/ghc.mk | 18 -- utils/ghctags/ghctags.cabal | 23 --- 9 files changed, 7 insertions(+), 478 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 027017fb33923b106765f5a0a6fc000ebe421d40 From git at git.haskell.org Sun Feb 10 21:31:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:44 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Capture and simplify constraints arising from running typed splices (a48753b) Message-ID: <20190210213144.112533A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/a48753bdbc99cda36890e851950f5b79e1c3b2b2/ghc >--------------------------------------------------------------- commit a48753bdbc99cda36890e851950f5b79e1c3b2b2 Author: Matthew Pickering Date: Sun Feb 3 11:46:28 2019 +0000 Capture and simplify constraints arising from running typed splices This fixes a regression caused by #15471 where splicing in a trivial program such as `[|| return () ||]` would fail as the dictionary for `return` would never get bound in the module containing the splice. Arguably this is symptomatic of a major problem affecting TTH where we serialise renamed asts and then retype check them. The reference to the dictionary should be fully determined at the quote site so that splicing doesn't have to solve any implicits at all. It's a coincidence this works due to coherence but see #15863 and #15865 for examples where things do go very wrong. Fixes #16195 >--------------------------------------------------------------- a48753bdbc99cda36890e851950f5b79e1c3b2b2 compiler/typecheck/TcSplice.hs | 11 ++++++++--- testsuite/tests/th/T16195.hs | 15 +++++++++++++++ testsuite/tests/th/T16195A.hs | 13 +++++++++++++ testsuite/tests/th/all.T | 1 + 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 548dc72..c6e5740 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -524,9 +524,14 @@ runTopSplice (DelayedSplice lcl_env orig_expr res_ty q_expr) -- Rename and typecheck the spliced-in expression, -- making sure it has type res_ty -- These steps should never fail; this is a *typed* splice - ; addErrCtxt (spliceResultDoc zonked_q_expr) $ do - { (exp3, _fvs) <- rnLExpr expr2 - ; unLoc <$> tcMonoExpr exp3 (mkCheckExpType zonked_ty)} } + ; (res, wcs) <- + captureConstraints $ + addErrCtxt (spliceResultDoc zonked_q_expr) $ do + { (exp3, _fvs) <- rnLExpr expr2 + ; tcMonoExpr exp3 (mkCheckExpType zonked_ty)} + ; ev <- simplifyTop wcs + ; return $ unLoc (mkHsDictLet (EvBinds ev) res) + } {- diff --git a/testsuite/tests/th/T16195.hs b/testsuite/tests/th/T16195.hs new file mode 100644 index 0000000..70e9365 --- /dev/null +++ b/testsuite/tests/th/T16195.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TemplateHaskell #-} +module T16195 where + +import T16195A + +main2 :: IO () +main2 = return () + +main :: IO () +main = $$foo + +main3 :: IO () +main3 = putStrLn ($$showC $$unitC) + + diff --git a/testsuite/tests/th/T16195A.hs b/testsuite/tests/th/T16195A.hs new file mode 100644 index 0000000..b79aff7 --- /dev/null +++ b/testsuite/tests/th/T16195A.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE TemplateHaskell #-} +module T16195A where + +import Language.Haskell.TH + +foo :: Q (TExp (IO ())) +foo = [|| return () ||] + +showC :: Q (TExp (() -> String)) +showC = [|| show ||] + +unitC :: Q (TExp ()) +unitC = [|| () ||] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 0d34c69..a92cef4 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -463,3 +463,4 @@ test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) test('T16180', normal, compile_and_run, ['-package ghc']) test('T16183', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T16195', normal, multimod_compile, ['T16195.hs', '-v0']) From git at git.haskell.org Sun Feb 10 21:31:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:47 +0000 (UTC) Subject: [commit: ghc] wip/T16188: testsuite: Report stdout and stderr in JUnit output (224fec6) Message-ID: <20190210213147.2E9DC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/224fec6983e16ecfc44a80d47e591a2425468eaf/ghc >--------------------------------------------------------------- commit 224fec6983e16ecfc44a80d47e591a2425468eaf Author: Ben Gamari Date: Thu Jan 24 14:20:11 2019 -0500 testsuite: Report stdout and stderr in JUnit output This patch makes the JUnit output more useful as now we also report the stdout/stderr in the message which can be used to quickly identify why a test is failing without downloading the log. This also introduces TestResult, previously we were simply passing around tuples, making things the implementation rather difficult to follow and harder to extend. >--------------------------------------------------------------- 224fec6983e16ecfc44a80d47e591a2425468eaf testsuite/driver/junit.py | 23 ++++++++-------- testsuite/driver/testglobals.py | 15 +++++++++++ testsuite/driver/testlib.py | 58 ++++++++++++++++++++++++++--------------- testsuite/driver/testutil.py | 7 +++-- 4 files changed, 69 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 224fec6983e16ecfc44a80d47e591a2425468eaf From git at git.haskell.org Sun Feb 10 21:31:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:50 +0000 (UTC) Subject: [commit: ghc] wip/T16188: testsuite: Always skip T15897 (f53ef1a) Message-ID: <20190210213150.3C2CB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/f53ef1a72fdebeff19d4a4bd5552d25101c85147/ghc >--------------------------------------------------------------- commit f53ef1a72fdebeff19d4a4bd5552d25101c85147 Author: Ben Gamari Date: Mon Feb 4 22:02:52 2019 -0500 testsuite: Always skip T15897 See #16193. >--------------------------------------------------------------- f53ef1a72fdebeff19d4a4bd5552d25101c85147 testsuite/tests/profiling/should_run/all.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index f76b8f9..8baddcb 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -148,6 +148,6 @@ test('T14257', [], makefile_test, ['T14257']) test('T15897', [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2), - # Fragile in unregisterised way (#15467, #16227) - when(unregisterised(), skip)], + # Takes too long and is quite fragile (#15467, #16193) + skip], makefile_test, ['T15897']) From git at git.haskell.org Sun Feb 10 21:31:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:53 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Fix Int overflow on 32 bit platform (07f5cbc) Message-ID: <20190210213153.5A9563A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/07f5cbc8cc61436cd5f3e9280191bad5480203c5/ghc >--------------------------------------------------------------- commit 07f5cbc8cc61436cd5f3e9280191bad5480203c5 Author: Peter Trommler Date: Wed Feb 6 22:31:20 2019 +0100 Fix Int overflow on 32 bit platform >--------------------------------------------------------------- 07f5cbc8cc61436cd5f3e9280191bad5480203c5 compiler/nativeGen/X86/CodeGen.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 9591c42..abd4995 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -2129,7 +2129,7 @@ genCCall dflags is32Bit (PrimTarget (MO_Ctz width)) [dst] [src] bid src_r <- getNewRegNat (intFormat width) return $ appOL (code_src src_r) $ case width of W8 -> toOL - [ OR II32 (OpImm (ImmInt 0xFFFFFF00)) (OpReg src_r) + [ OR II32 (OpImm (ImmInteger 0xFFFFFF00)) (OpReg src_r) , TZCNT II32 (OpReg src_r) dst_r ] W16 -> toOL From git at git.haskell.org Sun Feb 10 21:31:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:31:57 +0000 (UTC) Subject: [commit: ghc] wip/T16188: Fix #16188 (ec0e10d) Message-ID: <20190210213157.B8AE63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16188 Link : http://ghc.haskell.org/trac/ghc/changeset/ec0e10ddb93e3c8663ec3ebdd8ded91d87597d05/ghc >--------------------------------------------------------------- commit ec0e10ddb93e3c8663ec3ebdd8ded91d87597d05 Author: Richard Eisenberg Date: Thu Jan 17 17:17:02 2019 -0700 Fix #16188 There was an awful lot of zipping going on in canDecomposableTyConAppOK, and one of the lists being zipped was too short, causing the result to be too short. Easily fixed. Also fixes #16204 and #16225 test case: typecheck/should_compile/T16188 typecheck/should_compile/T16204[ab] typecheck/should_fail/T16204c typecheck/should_compile/T16225 >--------------------------------------------------------------- ec0e10ddb93e3c8663ec3ebdd8ded91d87597d05 compiler/typecheck/TcCanonical.hs | 40 +++++++++------ compiler/types/Coercion.hs | 3 ++ .../tests/indexed-types/should_fail/T2544.stderr | 12 ----- testsuite/tests/polykinds/T14172.stderr | 15 ------ testsuite/tests/typecheck/should_compile/T16188.hs | 48 ++++++++++++++++++ .../tests/typecheck/should_compile/T16204a.hs | 58 ++++++++++++++++++++++ .../tests/typecheck/should_compile/T16204b.hs | 58 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/T16225.hs | 25 ++++++++++ testsuite/tests/typecheck/should_compile/all.T | 4 ++ testsuite/tests/typecheck/should_fail/T16204c.hs | 16 ++++++ .../tests/typecheck/should_fail/T16204c.stderr | 12 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 12 files changed, 251 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 ec0e10ddb93e3c8663ec3ebdd8ded91d87597d05 From git at git.haskell.org Sun Feb 10 21:32:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Feb 2019 21:32:00 +0000 (UTC) Subject: [commit: ghc] wip/andrey/cached-hadrian: Record contents of the build/lib directory after package configuration (8033e92) Message-ID: <20190210213200.C82BF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/andrey/cached-hadrian Link : http://ghc.haskell.org/trac/ghc/changeset/8033e9293011a69c9d22da02228baa7f3db6df9b/ghc >--------------------------------------------------------------- commit 8033e9293011a69c9d22da02228baa7f3db6df9b Author: Andrey Mokhov Date: Sun Feb 10 15:26:02 2019 +0000 Record contents of the build/lib directory after package configuration Part of https://gitlab.haskell.org/ghc/ghc/merge_requests/317. >--------------------------------------------------------------- 8033e9293011a69c9d22da02228baa7f3db6df9b hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs index 7e78aa2..d53aabd 100644 --- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs @@ -147,6 +147,7 @@ configurePackage context at Context {..} = do dir <- Context.buildPath context files <- liftIO $ getDirectoryFilesIO "." [ dir -/- "include" "*" , dir -/- "*.buildinfo" + , dir -/- "lib" "*" , dir -/- "config.*" ] produces files From git at git.haskell.org Tue Feb 12 07:00:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Feb 2019 07:00:52 +0000 (UTC) Subject: [commit: ghc] branch 'wip/wildcards-warn' created Message-ID: <20190212070052.9AD4B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/wildcards-warn Referencing: db47e6320b585adb5100c773105c9e861eebab21 From git at git.haskell.org Tue Feb 12 07:00:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Feb 2019 07:00:56 +0000 (UTC) Subject: [commit: ghc] wip/wildcards-warn: Hadrian: add LLVM flavours (b1662e8) Message-ID: <20190212070056.30E3A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/wildcards-warn Link : http://ghc.haskell.org/trac/ghc/changeset/b1662e812c09b8b7c41b90415eecb0c7f215a09b/ghc >--------------------------------------------------------------- commit b1662e812c09b8b7c41b90415eecb0c7f215a09b Author: Alec Theriault Date: Tue Jan 29 18:33:20 2019 -0800 Hadrian: add LLVM flavours This adds a handful of LLVM flavours and the accompanying documentation. These flavours are mostly uninteresting, but exist in the Make system. >--------------------------------------------------------------- b1662e812c09b8b7c41b90415eecb0c7f215a09b hadrian/doc/flavours.md | 37 +++++++++++++++++++++++++++++++++-- hadrian/hadrian.cabal | 1 + hadrian/src/Settings.hs | 4 +++- hadrian/src/Settings/Flavours/Llvm.hs | 26 ++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/hadrian/doc/flavours.md b/hadrian/doc/flavours.md index cb864a0..7b89637 100644 --- a/hadrian/doc/flavours.md +++ b/hadrian/doc/flavours.md @@ -109,6 +109,39 @@ when compiling the `compiler` library, and `hsGhc` when compiling/linking the GH -O0
-DDEBUG + + quick-llvm + -O0
-H64m
-fllvm + -O0
-H64m
-fllvm + + -O + -O + + -O + + + + perf-llvm + -O
-H64m
-fllvm + -O
-H64m
-fllvm + + -O2 + -O + -O2 + -O + -O2 + + + prof-llvm + -O0
-H64m
-fllvm + -O0
-H64m
-fllvm + + -O + -O + -O + -O + -O + ## Ways @@ -132,7 +165,7 @@ information. The following table lists ways that are built in different flavours stage1+ - default
perf
prof
devel1
devel2 + default
perf
prof
devel1
devel2
perf-llvm
prof-llvm vanilla vanilla
profiling
dynamic logging
debug
threaded
threadedDebug
threadedLogging @@ -149,7 +182,7 @@ information. The following table lists ways that are built in different flavours Only in
prof
flavour - quick + quick
quick-llvm vanilla vanilla
dynamic logging
debug
threaded
threadedDebug
threadedLogging diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index 669d16c..6a4fff1 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -91,6 +91,7 @@ executable hadrian , Settings.Default , Settings.Flavours.Common , Settings.Flavours.Development + , Settings.Flavours.Llvm , Settings.Flavours.Performance , Settings.Flavours.Profiled , Settings.Flavours.Quick diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs index 99a58db..519d1fc 100755 --- a/hadrian/src/Settings.hs +++ b/hadrian/src/Settings.hs @@ -12,6 +12,7 @@ import UserSettings (userFlavours, userPackages, userDefaultFlavour) import {-# SOURCE #-} Settings.Default import Settings.Flavours.Development +import Settings.Flavours.Llvm import Settings.Flavours.Performance import Settings.Flavours.Profiled import Settings.Flavours.Quick @@ -36,7 +37,8 @@ hadrianFlavours :: [Flavour] hadrianFlavours = [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2 , performanceFlavour, profiledFlavour, quickFlavour, quickestFlavour - , quickCrossFlavour ] + , quickCrossFlavour + , performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour ] flavour :: Action Flavour flavour = do diff --git a/hadrian/src/Settings/Flavours/Llvm.hs b/hadrian/src/Settings/Flavours/Llvm.hs new file mode 100644 index 0000000..2752c9e --- /dev/null +++ b/hadrian/src/Settings/Flavours/Llvm.hs @@ -0,0 +1,26 @@ +module Settings.Flavours.Llvm ( + performanceLlvmFlavour, + profiledLlvmFlavour, + quickLlvmFlavour, +) where + +import Expression +import Flavour + +import Settings.Flavours.Performance +import Settings.Flavours.Profiled +import Settings.Flavours.Quick + +-- Please update doc/flavours.md when changing this file. +performanceLlvmFlavour, profiledLlvmFlavour, quickLlvmFlavour :: Flavour +performanceLlvmFlavour = mkLlvmFlavour performanceFlavour +profiledLlvmFlavour = mkLlvmFlavour profiledFlavour +quickLlvmFlavour = mkLlvmFlavour quickFlavour + +-- | Turn a flavour into an LLVM flavour +mkLlvmFlavour :: Flavour -> Flavour +mkLlvmFlavour flav = flav + { name = name flav ++ "-llvm" + , args = mconcat [ args flav + , builder Ghc ? arg "-fllvm" ] + } From git at git.haskell.org Tue Feb 12 07:00:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Feb 2019 07:00:59 +0000 (UTC) Subject: [commit: ghc] wip/T15449: rts: Ensure thunk updates are safe on non-TSO platforms (df9aa86) Message-ID: <20190212070059.3F8D23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T15449 Link : http://ghc.haskell.org/trac/ghc/changeset/df9aa8651b054bcf869fd7d7d5dfe76c5c5b031f/ghc >--------------------------------------------------------------- commit df9aa8651b054bcf869fd7d7d5dfe76c5c5b031f Author: Ben Gamari Date: Sun Feb 10 12:49:51 2019 -0500 rts: Ensure thunk updates are safe on non-TSO platforms Previously we wouldn't bother to initialize the `indirectee` field of a thunk during construction. However, on architectures with weak memory ordering this can result in unsoundness with an expensive dual write barrier in `updateWithIndirection`. To see how this happens, consider a thunk X and two threads. Say thread 1 evaluates X. When thread 1 finishes evaluation it will call `updateWithIndirection` to replace X with an indirection to the result, Y. To first order `updateWithIndirection` does the following, void updateWithIndirection (Capability *cap, StgClosure *p1, StgClosure *p2) { write_barrier(); ((StgInd *)p1)->indirectee = p2; SET_INFO(p1, &stg_BLACKHOLE_info); } The write barrier ensures that the writes constructing the result Y are made visible to other cores before it is introduced as the indirectee. We then set the `indirectee` and then the info table pointer. However, we don't impose any ordering relationship on these two writes. This means on a weak memory model machine we could observe an indirection such that `p->info == stg_BLACKHOLE_info` yet without a valid value in `indirectee`. One solution to this would be to add another `write_barrier` between these two writes. However, write barriers are expensive. Instead of adding more write barriers we instead take care to initialize the `indirectee` field with a known value (a non-enterable closure, `stg_NO_INDIRECTEE_closure`) on architecture that don't have total store ordering. The indirection entry code can then check for this value and loop as necessary. This incurs two costs: * an additional write during thunk allocation. However, given that we have to touch the cache line anyways this should have negligible performance impact since the write goes straight to the store buffer. * an additional branch in the indirection closures' entry code. However, indirections are eventually short-cutting out of existence anyways, so we should be able to avoid this cost much of the time. >--------------------------------------------------------------- df9aa8651b054bcf869fd7d7d5dfe76c5c5b031f compiler/cmm/CLabel.hs | 2 ++ compiler/codeGen/StgCmmHeap.hs | 7 +++++-- includes/stg/SMP.h | 7 +++++++ rts/StgMiscClosures.cmm | 43 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index 40b4e70..ef3a567 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -54,6 +54,7 @@ module CLabel ( mkBadAlignmentLabel, mkArrWords_infoLabel, mkSRTInfoLabel, + mkNO_INDIRECTEELabel, mkTopTickyCtrLabel, mkCAFBlackHoleInfoTableLabel, @@ -511,6 +512,7 @@ mkSMAP_FROZEN_CLEAN_infoLabel = CmmLabel rtsUnitId (fsLit "stg_SMALL_MUT_ARR_P mkSMAP_FROZEN_DIRTY_infoLabel = CmmLabel rtsUnitId (fsLit "stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY") CmmInfo mkSMAP_DIRTY_infoLabel = CmmLabel rtsUnitId (fsLit "stg_SMALL_MUT_ARR_PTRS_DIRTY") CmmInfo mkBadAlignmentLabel = CmmLabel rtsUnitId (fsLit "stg_badAlignment") CmmEntry +mkNO_INDIRECTEELabel = CmmLabel rtsUnitId (fsLit "stg_NO_INDIRECTEE") CmmEntry mkSRTInfoLabel :: Int -> CLabel mkSRTInfoLabel n = CmmLabel rtsUnitId lbl CmmInfo diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs index 3b170eb..2ea0831 100644 --- a/compiler/codeGen/StgCmmHeap.hs +++ b/compiler/codeGen/StgCmmHeap.hs @@ -144,9 +144,12 @@ emitSetDynHdr base info_ptr ccs hpStore base (zip (header dflags) [0, wORD_SIZE dflags ..]) where header :: DynFlags -> [CmmExpr] - header dflags = [info_ptr] ++ dynProfHdr dflags ccs - -- ToDo: Parallel stuff + header dflags = [info_ptr] ++ dynProfHdr dflags ccs ++ indirectee -- No ticky header + indirectee + -- TODO: Make this dependent upon TSO + | True = [CmmLit (CmmLabel mkNO_INDIRECTEELabel)] + | otherwise = [] -- Store the item (expr,off) in base[off] hpStore :: CmmExpr -> [(CmmExpr, ByteOff)] -> FCode () diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index 4020aef..9fc5389 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -18,6 +18,13 @@ void arm_atomic_spin_lock(void); void arm_atomic_spin_unlock(void); #endif +/* Does the platform maintain ordering of stores by a single core? */ +#if !defined(THREADED_RTS) || defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH) +#define ARCH_TOTAL_STORE_ORDER 1 +#else +#define ARCH_TOTAL_STORE_ORDER 0 +#endif + #if defined(THREADED_RTS) /* ---------------------------------------------------------------------------- diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index fdd9f15..44746c5 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -242,7 +242,14 @@ INFO_TABLE(stg_IND,1,0,IND,"IND","IND") (P_ node) { TICK_ENT_DYN_IND(); /* tick */ +retry: node = UNTAG(StgInd_indirectee(node)); +#if !ARCH_TOTAL_STORE_ORDER + if (node == stg_NO_INDIRECTEE_info) { + // See Note [Write barrier on thunk updates] + goto retry; + } +#endif TICK_ENT_VIA_NODE(); jump %GET_ENTRY(node) (node); } @@ -250,7 +257,14 @@ INFO_TABLE(stg_IND,1,0,IND,"IND","IND") /* explicit stack */ { TICK_ENT_DYN_IND(); /* tick */ +retry: R1 = UNTAG(StgInd_indirectee(R1)); +#if !ARCH_TOTAL_STORE_ORDER + if (R1 == stg_NO_INDIRECTEE_info) { + // See Note [Write barrier on thunk updates] + goto retry; + } +#endif TICK_ENT_VIA_NODE(); jump %GET_ENTRY(R1) [R1]; } @@ -260,7 +274,14 @@ INFO_TABLE(stg_IND_direct,1,0,IND,"IND","IND") (P_ node) { TICK_ENT_DYN_IND(); /* tick */ +retry: node = StgInd_indirectee(node); +#if !ARCH_TOTAL_STORE_ORDER + if (node == stg_NO_INDIRECTEE_info) { + // See Note [Write barrier on thunk updates] + goto retry; + } +#endif TICK_ENT_VIA_NODE(); jump %ENTRY_CODE(Sp(0)) (node); } @@ -269,7 +290,14 @@ INFO_TABLE(stg_IND_STATIC,1,0,IND_STATIC,"IND_STATIC","IND_STATIC") /* explicit stack */ { TICK_ENT_STATIC_IND(); /* tick */ +retry: R1 = UNTAG(StgInd_indirectee(R1)); +#if !ARCH_TOTAL_STORE_ORDER + if (node == stg_NO_INDIRECTEE_info) { + // See Note [Write barrier on thunk updates] + goto retry; + } +#endif TICK_ENT_VIA_NODE(); jump %GET_ENTRY(R1) [R1]; } @@ -297,7 +325,15 @@ retry: return (p); } +#if !ARCH_TOTAL_STORE_ORDER + if (p == stg_NO_INDIRECTEE) { + // See Note [Write barrier on thunk updates] + goto retry; + } +#endif + info = StgHeader_info(p); + if (info == stg_IND_info) { // This could happen, if e.g. we got a BLOCKING_QUEUE that has // just been replaced with an IND by another thread in @@ -360,6 +396,13 @@ INFO_TABLE(stg_BLOCKING_QUEUE_CLEAN,4,0,BLOCKING_QUEUE,"BLOCKING_QUEUE","BLOCKIN INFO_TABLE(stg_BLOCKING_QUEUE_DIRTY,4,0,BLOCKING_QUEUE,"BLOCKING_QUEUE","BLOCKING_QUEUE") { foreign "C" barf("BLOCKING_QUEUE_DIRTY object (%p) entered!", R1) never returns; } +// We initialize the SMP header indirectee field to this value to avoid needing +// two write barriers during thunk updates. +INFO_TABLE_CONSTR(stg_NO_INDIRECTEE,0,0,0,CONSTR_NOCAF,"NO_INDIRECTEE","NO_INDIRECTEE") +{ foreign "C" barf("NO_INDIRECTEE object (%p) entered!", R1) never returns; } + +CLOSURE(stg_NO_INDIRECTEE_closure,stg_NO_INDIRECTEE); + /* ---------------------------------------------------------------------------- Whiteholes are used for the "locked" state of a closure (see lockClosure()) From git at git.haskell.org Tue Feb 12 07:01:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Feb 2019 07:01:02 +0000 (UTC) Subject: [commit: ghc] wip/wildcards-warn: testsuite: Report unexpected passes in junit output (180c976) Message-ID: <20190212070102.566643A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/wildcards-warn Link : http://ghc.haskell.org/trac/ghc/changeset/180c9762d4565f0e8b192abf95d2bed57765e0c5/ghc >--------------------------------------------------------------- commit 180c9762d4565f0e8b192abf95d2bed57765e0c5 Author: Matthew Pickering Date: Sun Feb 10 21:59:38 2019 +0000 testsuite: Report unexpected passes in junit output >--------------------------------------------------------------- 180c9762d4565f0e8b192abf95d2bed57765e0c5 testsuite/driver/junit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testsuite/driver/junit.py b/testsuite/driver/junit.py index ec84018..d376a06 100644 --- a/testsuite/driver/junit.py +++ b/testsuite/driver/junit.py @@ -7,12 +7,15 @@ def junit(t): id = "0", package = 'ghc', tests = str(t.total_tests), - failures = str(len(t.unexpected_failures) + len(t.unexpected_stat_failures)), + failures = str(len(t.unexpected_failures) + + len(t.unexpected_stat_failures) + + len(t.unexpected_passes)), errors = str(len(t.framework_failures)), timestamp = datetime.now().isoformat()) for res_type, group in [('stat failure', t.unexpected_stat_failures), - ('unexpected failure', t.unexpected_failures)]: + ('unexpected failure', t.unexpected_failures), + ('unexpected_passes', t.unexpected_passes)]: for tr in group: testcase = ET.SubElement(testsuite, 'testcase', classname = tr.way, From git at git.haskell.org Tue Feb 12 07:01:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Feb 2019 07:01:06 +0000 (UTC) Subject: [commit: ghc] wip/wildcards-warn: Implement -Wredundant-record-wildcards and -Wunused-record-wildcards (db47e63) Message-ID: <20190212070106.9259F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/wildcards-warn Link : http://ghc.haskell.org/trac/ghc/changeset/db47e6320b585adb5100c773105c9e861eebab21/ghc >--------------------------------------------------------------- commit db47e6320b585adb5100c773105c9e861eebab21 Author: Matthew Pickering Date: Mon Feb 11 09:24:04 2019 +0000 Implement -Wredundant-record-wildcards and -Wunused-record-wildcards -Wredundant-record-wildcards warns when a .. pattern binds no variables. -Wunused-record-wildcards warns when none of the variables bound by a .. pattern are used. These flags are not enabled by `-Wall` currently. If people think it is appropuiate to add them then that is an easy change. >--------------------------------------------------------------- db47e6320b585adb5100c773105c9e861eebab21 compiler/main/DynFlags.hs | 4 + compiler/rename/RnExpr.hs | 2 +- compiler/rename/RnPat.hs | 113 ++++++++++++++++----- compiler/rename/RnUtils.hs | 15 +++ docs/users_guide/using-warnings.rst | 42 ++++++++ testsuite/tests/rename/should_compile/T15957.hs | 8 ++ testsuite/tests/rename/should_compile/all.T | 1 + testsuite/tests/rename/should_fail/T15957_Fail.hs | 11 ++ .../tests/rename/should_fail/T15957_Fail.stderr | 9 ++ testsuite/tests/rename/should_fail/all.T | 1 + 10 files changed, 182 insertions(+), 24 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc db47e6320b585adb5100c773105c9e861eebab21 From git at git.haskell.org Wed Feb 13 08:49:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:35 +0000 (UTC) Subject: [commit: ghc] branch 'wip/exp-pat-frame' created Message-ID: <20190213084935.3962B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/exp-pat-frame Referencing: b71734ef7a8de2596fddc1efb785e7a42864dfc1 From git at git.haskell.org Wed Feb 13 08:49:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:38 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Update array submodule (093fa2f) Message-ID: <20190213084938.42E213A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/093fa2ff74579bf25375526ca54471d69f615004/ghc >--------------------------------------------------------------- commit 093fa2ff74579bf25375526ca54471d69f615004 Author: Herbert Valerio Riedel Date: Sun Jan 27 22:35:36 2019 +0100 Update array submodule >--------------------------------------------------------------- 093fa2ff74579bf25375526ca54471d69f615004 libraries/array | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/array b/libraries/array index 82a29b1..8593a10 160000 --- a/libraries/array +++ b/libraries/array @@ -1 +1 @@ -Subproject commit 82a29b198a67f54de2f72d96ca077800afbfbe4f +Subproject commit 8593a10f65020da3854b1c8478082d454b416118 From git at git.haskell.org Wed Feb 13 08:49:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:41 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Add explicit dependencies to cleanup-darwin (6399965) Message-ID: <20190213084941.561BA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/6399965d7f1636db6c777f597192467f93d800b1/ghc >--------------------------------------------------------------- commit 6399965d7f1636db6c777f597192467f93d800b1 Author: Matthew Pickering Date: Fri Feb 8 10:54:41 2019 -0500 Add explicit dependencies to cleanup-darwin >--------------------------------------------------------------- 6399965d7f1636db6c777f597192467f93d800b1 .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b230331..068b3e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -429,6 +429,7 @@ cleanup-darwin: tags: - x86_64-darwin when: always + dependencies: [] before_script: - echo "Time to clean up" script: From git at git.haskell.org Wed Feb 13 08:49:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:45 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Fix #16293 by cleaning up Proxy# infelicities (012257c) Message-ID: <20190213084945.5E1103A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/012257c15f584069500af2953ab70856f9a1470e/ghc >--------------------------------------------------------------- commit 012257c15f584069500af2953ab70856f9a1470e Author: Ryan Scott Date: Sat Feb 9 09:50:42 2019 -0500 Fix #16293 by cleaning up Proxy# infelicities This bug fixes three problems related to `Proxy#`/`proxy#`: 1. Reifying it with TH claims that the `Proxy#` type constructor has two arguments, but that ought to be one for consistency with TH's treatment for other primitive type constructors like `(->)`. This was fixed by just returning the number of `tyConVisibleTyVars` instead of using `tyConArity` (which includes invisible arguments). 2. The role of `Proxy#`'s visible argument was hard-coded as nominal. Easily fixed by changing it to phantom. 3. The visibility of `proxy#`'s kind argument was specified, which is different from the `Proxy` constructor (which treats it as inferred). Some minor refactoring in `proxyHashId` fixed ths up. Along the way, I had to introduce a `mkSpecForAllTy` function, so I did some related Haddock cleanup in `Type`, where that function lives. >--------------------------------------------------------------- 012257c15f584069500af2953ab70856f9a1470e compiler/basicTypes/MkId.hs | 12 ++++++++---- compiler/prelude/TysPrim.hs | 10 +++++----- compiler/typecheck/TcSplice.hs | 3 ++- compiler/types/Type.hs | 24 ++++++++++++++--------- testsuite/tests/primops/should_compile/T16293a.hs | 19 ++++++++++++++++++ testsuite/tests/primops/should_compile/all.T | 1 + testsuite/tests/th/T16293b.hs | 13 ++++++++++++ testsuite/tests/th/all.T | 1 + 8 files changed, 64 insertions(+), 19 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 012257c15f584069500af2953ab70856f9a1470e From git at git.haskell.org Wed Feb 13 08:49:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:49 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Fix #16188 (4a4ae70) Message-ID: <20190213084949.BC0093A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/4a4ae70f09009c5d32696445a06eacb273f364b5/ghc >--------------------------------------------------------------- commit 4a4ae70f09009c5d32696445a06eacb273f364b5 Author: Richard Eisenberg Date: Thu Jan 17 17:17:02 2019 -0700 Fix #16188 There was an awful lot of zipping going on in canDecomposableTyConAppOK, and one of the lists being zipped was too short, causing the result to be too short. Easily fixed. Also fixes #16204 and #16225 test case: typecheck/should_compile/T16188 typecheck/should_compile/T16204[ab] typecheck/should_fail/T16204c typecheck/should_compile/T16225 >--------------------------------------------------------------- 4a4ae70f09009c5d32696445a06eacb273f364b5 compiler/typecheck/TcCanonical.hs | 40 +++++++++------ compiler/types/Coercion.hs | 3 ++ .../tests/indexed-types/should_fail/T2544.stderr | 12 ----- testsuite/tests/polykinds/T14172.stderr | 15 ------ testsuite/tests/typecheck/should_compile/T16188.hs | 48 ++++++++++++++++++ .../tests/typecheck/should_compile/T16204a.hs | 58 ++++++++++++++++++++++ .../tests/typecheck/should_compile/T16204b.hs | 58 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/T16225.hs | 25 ++++++++++ testsuite/tests/typecheck/should_compile/all.T | 4 ++ testsuite/tests/typecheck/should_fail/T16204c.hs | 16 ++++++ .../tests/typecheck/should_fail/T16204c.stderr | 12 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 12 files changed, 251 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 4a4ae70f09009c5d32696445a06eacb273f364b5 From git at git.haskell.org Wed Feb 13 08:49:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:52 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Fix #16299 by deleting incorrect code from IfaceSyn (8b476d8) Message-ID: <20190213084952.C35273A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/8b476d822e97cfe4cebe6e74924d9a79148d608c/ghc >--------------------------------------------------------------- commit 8b476d822e97cfe4cebe6e74924d9a79148d608c Author: Ryan Scott Date: Sun Feb 10 11:21:12 2019 -0500 Fix #16299 by deleting incorrect code from IfaceSyn GHCi's `:info` command was pretty-printing Haskell98-style data types with explicit return kinds if the return kind wasn't `Type`. This leads to bizarre output like this: ``` λ> :i (##) data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##) -- Defined in ‘GHC.Prim’ ``` Or, with unlifted newtypes: ``` λ> newtype T = MkT Int# λ> :i T newtype T :: TYPE 'IntRep = MkT Int# -- Defined at :5:1 ``` The solution is simple: just delete one part from `IfaceSyn` where GHC mistakenly pretty-prints the return kinds for non-GADTs. >--------------------------------------------------------------- 8b476d822e97cfe4cebe6e74924d9a79148d608c compiler/iface/IfaceSyn.hs | 2 +- testsuite/tests/ghci/scripts/T7627.stdout | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs index 5478c94..3dd8a21 100644 --- a/compiler/iface/IfaceSyn.hs +++ b/compiler/iface/IfaceSyn.hs @@ -713,7 +713,7 @@ pprIfaceDecl ss (IfaceData { ifName = tycon, ifCType = ctype, , nest 2 (vcat pp_cons) , nest 2 $ ppShowIface ss pp_extra ] | otherwise = vcat [ pp_roles - , hang (pp_nd <+> pp_lhs <+> pp_kind) 2 (add_bars pp_cons) + , hang (pp_nd <+> pp_lhs) 2 (add_bars pp_cons) , nest 2 $ ppShowIface ss pp_extra ] where is_data_instance = isIfaceDataInstance parent diff --git a/testsuite/tests/ghci/scripts/T7627.stdout b/testsuite/tests/ghci/scripts/T7627.stdout index 8bf93a0..ff4e670 100644 --- a/testsuite/tests/ghci/scripts/T7627.stdout +++ b/testsuite/tests/ghci/scripts/T7627.stdout @@ -7,8 +7,7 @@ instance Show () -- Defined in ‘GHC.Show’ instance Read () -- Defined in ‘GHC.Read’ instance Enum () -- Defined in ‘GHC.Enum’ instance Bounded () -- Defined in ‘GHC.Enum’ -data (##) :: TYPE ('GHC.Types.TupleRep '[]) = (##) - -- Defined in ‘GHC.Prim’ +data (##) = (##) -- Defined in ‘GHC.Prim’ () :: () (##) :: (# #) ( ) :: () @@ -29,9 +28,7 @@ instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ instance Traversable ((,) a) -- Defined in ‘Data.Traversable’ instance (Bounded a, Bounded b) => Bounded (a, b) -- Defined in ‘GHC.Enum’ -data (#,#) (a :: TYPE k0) (b :: TYPE k1) :: TYPE - ('GHC.Types.TupleRep '[k0, k1]) - = (#,#) a b +data (#,#) (a :: TYPE k0) (b :: TYPE k1) = (#,#) a b -- Defined in ‘GHC.Prim’ (,) :: a -> b -> (a, b) (#,#) :: a -> b -> (# a, b #) From git at git.haskell.org Wed Feb 13 08:49:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 08:49:56 +0000 (UTC) Subject: [commit: ghc] wip/exp-pat-frame: Introduce ExpPatFrame (b71734e) Message-ID: <20190213084956.763E63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-pat-frame Link : http://ghc.haskell.org/trac/ghc/changeset/b71734ef7a8de2596fddc1efb785e7a42864dfc1/ghc >--------------------------------------------------------------- commit b71734ef7a8de2596fddc1efb785e7a42864dfc1 Author: Vladislav Zavialov Date: Tue Feb 12 13:22:35 2019 +0300 Introduce ExpPatFrame >--------------------------------------------------------------- b71734ef7a8de2596fddc1efb785e7a42864dfc1 compiler/ghc.cabal.in | 1 + compiler/hsSyn/HsUtils.hs | 5 +- compiler/parser/ExpPatFrame.hs | 340 +++++++++++++++++++++++++++++++++++++++++ compiler/parser/Parser.y | 311 ++++++++++++++++++------------------- compiler/parser/RdrHsSyn.hs | 307 +++++++++++++++++++------------------ 5 files changed, 646 insertions(+), 318 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 b71734ef7a8de2596fddc1efb785e7a42864dfc1 From git at git.haskell.org Wed Feb 13 17:43:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Feb 2019 17:43:34 +0000 (UTC) Subject: [commit: ghc] wip/andrey/cached-hadrian: Switch to `shake-0.17.5` to avoid dependency on `heaps` (91ff9ca) Message-ID: <20190213174334.30D303A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/andrey/cached-hadrian Link : http://ghc.haskell.org/trac/ghc/changeset/91ff9ca992cdc09b7c6afed85beeb767a852c767/ghc >--------------------------------------------------------------- commit 91ff9ca992cdc09b7c6afed85beeb767a852c767 Author: Andrey Mokhov Date: Wed Feb 13 17:42:33 2019 +0000 Switch to `shake-0.17.5` to avoid dependency on `heaps` Part of https://gitlab.haskell.org/ghc/ghc/merge_requests/317. >--------------------------------------------------------------- 91ff9ca992cdc09b7c6afed85beeb767a852c767 hadrian/hadrian.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal index eceede2..f7c3687 100644 --- a/hadrian/hadrian.cabal +++ b/hadrian/hadrian.cabal @@ -123,7 +123,7 @@ executable hadrian , mtl == 2.2.* , parsec >= 3.1 && < 3.2 , QuickCheck >= 2.6 && < 2.13 - , shake >= 0.17.4 + , shake >= 0.17.5 , transformers >= 0.4 && < 0.6 , unordered-containers >= 0.2.1 && < 0.3 build-tools: alex >= 3.1 From git at git.haskell.org Thu Feb 14 09:12:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:32 +0000 (UTC) Subject: [commit: ghc] branch 'wip/no-kind-vars' created Message-ID: <20190214091232.729CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/no-kind-vars Referencing: 0b7f6a6c0aa9d145a244d95b417b41e006eac154 From git at git.haskell.org Thu Feb 14 09:12:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:34 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hadrian-wcompat' created Message-ID: <20190214091234.7260B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hadrian-wcompat Referencing: 709db55ed13ef2c98d50a7c45e329279d13f8e73 From git at git.haskell.org Thu Feb 14 09:12:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:36 +0000 (UTC) Subject: [commit: ghc] branch 'wip/forall-keyword' created Message-ID: <20190214091236.735483A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/forall-keyword Referencing: 2fce98a06ac84f1cf9e14b51ae9d160531623769 From git at git.haskell.org Thu Feb 14 09:12:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:39 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword, wip/hadrian-wcompat, wip/no-kind-vars: Fix #15849 by checking whether there's a do block (a08f463) Message-ID: <20190214091239.CB8573A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/forall-keyword,wip/hadrian-wcompat,wip/no-kind-vars Link : http://ghc.haskell.org/trac/ghc/changeset/a08f463bcc9727d91cec4c6e952ad0f5bbc3fbf9/ghc >--------------------------------------------------------------- commit a08f463bcc9727d91cec4c6e952ad0f5bbc3fbf9 Author: nineonine Date: Sat Feb 9 00:20:19 2019 -0800 Fix #15849 by checking whether there's a do block >--------------------------------------------------------------- a08f463bcc9727d91cec4c6e952ad0f5bbc3fbf9 compiler/parser/Lexer.x | 3 ++- testsuite/tests/parser/should_fail/T15849.hs | 4 ++++ testsuite/tests/parser/should_fail/T15849.stderr | 3 +++ testsuite/tests/parser/should_fail/all.T | 1 + testsuite/tests/parser/should_fail/readFail011.stderr | 2 -- testsuite/tests/parser/should_fail/readFail034.stderr | 2 -- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 1e27158..929a6a6 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2585,7 +2585,7 @@ srcParseErr options buf len (if mdoInLast100 then text "Perhaps you intended to use RecursiveDo" else text "Perhaps this statement should be within a 'do' block?") - $$ ppWhen (token == "=") + $$ ppWhen (token == "=" && doInLast100) -- #15849 (text "Perhaps you need a 'let' in a 'do' block?" $$ text "e.g. 'let x = 5' instead of 'x = 5'") $$ ppWhen (not ps_enabled && pattern == "pattern ") -- #12429 @@ -2593,6 +2593,7 @@ srcParseErr options buf len where token = lexemeToString (offsetBytes (-len) buf) len pattern = decodePrevNChars 8 buf last100 = decodePrevNChars 100 buf + doInLast100 = "do" `isInfixOf` last100 mdoInLast100 = "mdo" `isInfixOf` last100 th_enabled = ThBit `xtest` pExtsBitmap options ps_enabled = PatternSynonymsBit `xtest` pExtsBitmap options diff --git a/testsuite/tests/parser/should_fail/T15849.hs b/testsuite/tests/parser/should_fail/T15849.hs new file mode 100644 index 0000000..eea8e4f --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15849.hs @@ -0,0 +1,4 @@ +module T15849 where + +main = return () + foo = return () diff --git a/testsuite/tests/parser/should_fail/T15849.stderr b/testsuite/tests/parser/should_fail/T15849.stderr new file mode 100644 index 0000000..e974dbd --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15849.stderr @@ -0,0 +1,3 @@ + +T15849.hs:4:6: error: + parse error on input ‘=’ diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index ad23574..7976c17 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -133,6 +133,7 @@ test('typeops_C', normal, compile_fail, ['']) test('typeops_D', normal, compile_fail, ['']) test('T15053', normal, compile_fail, ['']) test('T15233', normal, compile_fail, ['']) +test('T15849', normal, compile_fail, ['']) test('typeopsDataCon_A', normal, compile_fail, ['']) test('typeopsDataCon_B', normal, compile_fail, ['']) test('strictnessDataCon_A', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/readFail011.stderr b/testsuite/tests/parser/should_fail/readFail011.stderr index 25accd2..08388e5 100644 --- a/testsuite/tests/parser/should_fail/readFail011.stderr +++ b/testsuite/tests/parser/should_fail/readFail011.stderr @@ -1,5 +1,3 @@ readFail011.hs:7:10: error: parse error on input ‘=’ - Perhaps you need a 'let' in a 'do' block? - e.g. 'let x = 5' instead of 'x = 5' diff --git a/testsuite/tests/parser/should_fail/readFail034.stderr b/testsuite/tests/parser/should_fail/readFail034.stderr index 75156c9..ad2fb00 100644 --- a/testsuite/tests/parser/should_fail/readFail034.stderr +++ b/testsuite/tests/parser/should_fail/readFail034.stderr @@ -1,5 +1,3 @@ readFail034.hs:4:6: error: parse error on input ‘=’ - Perhaps you need a 'let' in a 'do' block? - e.g. 'let x = 5' instead of 'x = 5' From git at git.haskell.org Thu Feb 14 09:12:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:42 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword, wip/hadrian-wcompat, wip/no-kind-vars: configure: Document CLANG, LLC, and OPT variables (2868313) Message-ID: <20190214091242.D06273A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/forall-keyword,wip/hadrian-wcompat,wip/no-kind-vars Link : http://ghc.haskell.org/trac/ghc/changeset/28683137a59607dfdac6add35aefc8676b7fa864/ghc >--------------------------------------------------------------- commit 28683137a59607dfdac6add35aefc8676b7fa864 Author: Ben Gamari Date: Sat Feb 9 17:34:36 2019 -0500 configure: Document CLANG, LLC, and OPT variables >--------------------------------------------------------------- 28683137a59607dfdac6add35aefc8676b7fa864 configure.ac | 3 +++ distrib/configure.ac.in | 2 ++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index b75220d..e269b96 100644 --- a/configure.ac +++ b/configure.ac @@ -648,18 +648,21 @@ AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The sup dnl ** Which LLVM clang to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(CLANG,[Use as the path to clang [default=autodetect]]) AC_CHECK_TARGET_TOOL([CLANG], [clang]) ClangCmd="$CLANG" AC_SUBST([ClangCmd]) dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion]) LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion]) OptCmd="$OPT" AC_SUBST([OptCmd]) diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index e064a5d..dd0eb2e 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -128,12 +128,14 @@ LlvmVersion=@LlvmVersion@ dnl ** Which LLVM llc to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]]) FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion]) LlcCmd="$LLC" AC_SUBST([LlcCmd]) dnl ** Which LLVM opt to use? dnl -------------------------------------------------------------- +AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]]) FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion]) OptCmd="$OPT" AC_SUBST([OptCmd]) From git at git.haskell.org Thu Feb 14 09:12:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:45 +0000 (UTC) Subject: [commit: ghc] wip/hadrian-wcompat: Hadrian: enable -Wcompat=error in the testsuite (709db55) Message-ID: <20190214091245.D9C083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hadrian-wcompat Link : http://ghc.haskell.org/trac/ghc/changeset/709db55ed13ef2c98d50a7c45e329279d13f8e73/ghc >--------------------------------------------------------------- commit 709db55ed13ef2c98d50a7c45e329279d13f8e73 Author: Vladislav Zavialov Date: Wed Feb 13 15:22:59 2019 +0300 Hadrian: enable -Wcompat=error in the testsuite >--------------------------------------------------------------- 709db55ed13ef2c98d50a7c45e329279d13f8e73 hadrian/src/Settings/Builders/RunTest.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 55a5e58..834cacf 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -46,6 +46,7 @@ runTestGhcFlags = do , ifMinGhcVer "711" "-fshow-warning-groups" , ifMinGhcVer "801" "-fdiagnostics-color=never" , ifMinGhcVer "801" "-fno-diagnostics-show-caret" + , pure "-Werror=compat" -- See Trac #15278 , pure "-dno-debug-output" ] From git at git.haskell.org Thu Feb 14 09:12:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:48 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword, wip/no-kind-vars: Fix checkStackChunk() call in Interepter.c, enable an assertion (6b890d7) Message-ID: <20190214091248.F11E33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/forall-keyword,wip/no-kind-vars Link : http://ghc.haskell.org/trac/ghc/changeset/6b890d76a252259843a6e87043f8f12e6a8a0aae/ghc >--------------------------------------------------------------- commit 6b890d76a252259843a6e87043f8f12e6a8a0aae Author: Ömer Sinan Ağacan Date: Mon Feb 11 18:17:43 2019 +0300 Fix checkStackChunk() call in Interepter.c, enable an assertion Fixes #16303 >--------------------------------------------------------------- 6b890d76a252259843a6e87043f8f12e6a8a0aae rts/Interpreter.c | 2 +- rts/sm/Sanity.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rts/Interpreter.c b/rts/Interpreter.c index a3b179a..3450780 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -938,7 +938,7 @@ run_BCO_fun: Sp_subW(2); SpW(1) = (W_)obj; SpW(0) = (W_)&stg_apply_interp_info; - checkStackChunk(Sp,SpLim); + checkStackChunk(Sp, cap->r.rCurrentTSO->stackobj->stack+cap->r.rCurrentTSO->stackobj->stack_size); Sp_addW(2); ); diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 28c9b43..8082b7e 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -172,7 +172,7 @@ checkStackChunk( StgPtr sp, StgPtr stack_end ) while (p < stack_end) { p += checkStackFrame( p ); } - // ASSERT( p == stack_end ); -- HWL + ASSERT( p == stack_end ); } static void From git at git.haskell.org Thu Feb 14 09:12:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:52 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword, wip/no-kind-vars: Update parallel submodule (4af0a2d) Message-ID: <20190214091252.150653A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/forall-keyword,wip/no-kind-vars Link : http://ghc.haskell.org/trac/ghc/changeset/4af0a2d609651c4bae45d84d2bf7ce9fe8cca350/ghc >--------------------------------------------------------------- commit 4af0a2d609651c4bae45d84d2bf7ce9fe8cca350 Author: Herbert Valerio Riedel Date: Mon Feb 11 23:32:38 2019 +0100 Update parallel submodule >--------------------------------------------------------------- 4af0a2d609651c4bae45d84d2bf7ce9fe8cca350 libraries/parallel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/parallel b/libraries/parallel index 5015bc7..4a04f41 160000 --- a/libraries/parallel +++ b/libraries/parallel @@ -1 +1 @@ -Subproject commit 5015bc74127beac29b4d08dcb3beb230149fed25 +Subproject commit 4a04f41b7e2857ab8a09bcb8ed0b346516b0c817 From git at git.haskell.org Thu Feb 14 09:12:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:56 +0000 (UTC) Subject: [commit: ghc] wip/no-kind-vars: Treat kind/type variables identically in 'forall' (0b7f6a6) Message-ID: <20190214091256.299883A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/no-kind-vars Link : http://ghc.haskell.org/trac/ghc/changeset/0b7f6a6c0aa9d145a244d95b417b41e006eac154/ghc >--------------------------------------------------------------- commit 0b7f6a6c0aa9d145a244d95b417b41e006eac154 Author: Vladislav Zavialov Date: Wed Feb 13 17:15:49 2019 +0300 Treat kind/type variables identically in 'forall' >--------------------------------------------------------------- 0b7f6a6c0aa9d145a244d95b417b41e006eac154 compiler/main/DynFlags.hs | 4 +- compiler/rename/RnSource.hs | 14 +++--- compiler/rename/RnTypes.hs | 51 ++++----------------- docs/users_guide/using-warnings.rst | 53 ---------------------- testsuite/tests/codeGen/should_fail/T13233.hs | 4 +- .../tests/dependent/should_compile/T15264.stderr | 10 ---- testsuite/tests/dependent/should_compile/all.T | 1 - .../tests/dependent/should_fail/BadTelescope2.hs | 2 +- .../dependent/should_fail/BadTelescope2.stderr | 6 +-- .../{should_compile => should_fail}/T15264.hs | 1 - .../tests/dependent/should_fail/T15264.stderr | 6 +++ testsuite/tests/dependent/should_fail/T15825.hs | 4 +- .../tests/dependent/should_fail/T15825.stderr | 2 +- testsuite/tests/dependent/should_fail/all.T | 1 + testsuite/tests/ghci/scripts/T9293.stdout | 4 -- testsuite/tests/ghci/scripts/ghci024.stdout | 1 - testsuite/tests/ghci/scripts/ghci057.stdout | 4 -- .../should_compile/ExplicitForAllFams1.hs | 2 +- testsuite/tests/patsyn/should_fail/T14498.hs | 4 +- testsuite/tests/patsyn/should_fail/T14507.hs | 2 +- testsuite/tests/patsyn/should_fail/all.T | 2 +- testsuite/tests/polykinds/BadKindVar.hs | 2 +- testsuite/tests/polykinds/BadKindVar.stderr | 2 +- testsuite/tests/polykinds/T10503.hs | 2 +- testsuite/tests/polykinds/T10503.stderr | 6 +-- testsuite/tests/polykinds/T14561.hs | 2 +- testsuite/tests/polykinds/T14563.hs | 2 +- testsuite/tests/polykinds/T14887a.hs | 8 +--- testsuite/tests/polykinds/T8616.hs | 4 +- testsuite/tests/polykinds/T8616.stderr | 2 +- testsuite/tests/polykinds/T9144.hs | 2 +- testsuite/tests/typecheck/should_fail/T12973.hs | 2 +- testsuite/tests/typecheck/should_fail/T15629.hs | 2 +- .../tests/typecheck/should_fail/T15629.stderr | 10 ++-- 34 files changed, 59 insertions(+), 165 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 0b7f6a6c0aa9d145a244d95b417b41e006eac154 From git at git.haskell.org Thu Feb 14 09:12:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:12:59 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword: 'forall' always a keyword, plus the dot type operator (d06449f) Message-ID: <20190214091259.3CF743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/forall-keyword Link : http://ghc.haskell.org/trac/ghc/changeset/d06449ff21512aa69be61581a6ae95dc33e00b3a/ghc >--------------------------------------------------------------- commit d06449ff21512aa69be61581a6ae95dc33e00b3a Author: Vladislav Zavialov Date: Thu Feb 14 00:36:00 2019 +0300 'forall' always a keyword, plus the dot type operator >--------------------------------------------------------------- d06449ff21512aa69be61581a6ae95dc33e00b3a compiler/parser/Lexer.x | 6 +-- compiler/parser/Parser.y | 47 ++++++++-------------- compiler/parser/RdrHsSyn.hs | 25 ++++++++---- compiler/prelude/PrelNames.hs | 4 -- compiler/rename/RnTypes.hs | 7 +--- compiler/rename/RnUnbound.hs | 9 ++--- testsuite/tests/ghci/prog006/prog006.stderr | 10 +++-- .../should_fail/ParserNoForallUnicode.stderr | 4 +- testsuite/tests/parser/should_fail/T12811.stderr | 6 ++- testsuite/tests/parser/should_fail/T3095.stderr | 4 +- .../tests/rename/should_fail/rnfail052.stderr | 4 +- .../tests/rename/should_fail/rnfail053.stderr | 10 +++-- testsuite/tests/typecheck/should_fail/T3155.stderr | 4 +- .../tests/typecheck/should_fail/tcfail166.stderr | 4 +- .../tests/typecheck/should_fail/tcfail183.stderr | 4 +- 15 files changed, 69 insertions(+), 79 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 d06449ff21512aa69be61581a6ae95dc33e00b3a From git at git.haskell.org Thu Feb 14 09:13:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:13:02 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword: Dot/forall in 8.8.1 release notes (647894e) Message-ID: <20190214091302.3FAD03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/forall-keyword Link : http://ghc.haskell.org/trac/ghc/changeset/647894e5450d354e0255b705b8fdbe3264514ecb/ghc >--------------------------------------------------------------- commit 647894e5450d354e0255b705b8fdbe3264514ecb Author: Vladislav Zavialov Date: Thu Feb 14 00:59:23 2019 +0300 Dot/forall in 8.8.1 release notes >--------------------------------------------------------------- 647894e5450d354e0255b705b8fdbe3264514ecb docs/users_guide/8.8.1-notes.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index 33b7f48..0f97ff7 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -41,9 +41,13 @@ Language terminating value of type ``Void``. Accordingly, GHC will not warn about ``K2`` (whereas previous versions of GHC would). -- ``(!)`` is now a valid type operator: :: +- ``(!)`` and ``(.)`` are now a valid type operators: :: type family a ! b + type family a . b + +- ``forall`` is now always a keyword in types to provide more helpful + error messages when ``-XExplicitForall`` is off. - An existential context no longer requires parenthesization: :: From git at git.haskell.org Thu Feb 14 09:13:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Feb 2019 09:13:05 +0000 (UTC) Subject: [commit: ghc] wip/forall-keyword: Remove 'perhapsForallMsg' (2fce98a) Message-ID: <20190214091305.484BF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/forall-keyword Link : http://ghc.haskell.org/trac/ghc/changeset/2fce98a06ac84f1cf9e14b51ae9d160531623769/ghc >--------------------------------------------------------------- commit 2fce98a06ac84f1cf9e14b51ae9d160531623769 Author: Vladislav Zavialov Date: Thu Feb 14 01:08:42 2019 +0300 Remove 'perhapsForallMsg' >--------------------------------------------------------------- 2fce98a06ac84f1cf9e14b51ae9d160531623769 compiler/rename/RnTypes.hs | 1 - compiler/rename/RnUnbound.hs | 6 ------ 2 files changed, 7 deletions(-) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index d36bee5..8e390f0 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -44,7 +44,6 @@ import DynFlags import HsSyn import RnHsDoc ( rnLHsDoc, rnMbLHsDoc ) import RnEnv -import RnUnbound ( perhapsForallMsg ) import RnUtils ( HsDocContext(..), withHsDocContext, mapFvRn , pprHsDocContext, bindLocalNamesFV, typeAppErr , newLocalBndrRn, checkDupRdrNames, checkShadowedRdrNames ) diff --git a/compiler/rename/RnUnbound.hs b/compiler/rename/RnUnbound.hs index a0fe729..2de2fc1 100644 --- a/compiler/rename/RnUnbound.hs +++ b/compiler/rename/RnUnbound.hs @@ -12,7 +12,6 @@ module RnUnbound ( mkUnboundName , WhereLooking(..) , unboundName , unboundNameX - , perhapsForallMsg , notInScopeErr ) where import GhcPrelude @@ -349,11 +348,6 @@ extensionSuggestions rdrName = text "Perhaps you meant to use RecursiveDo" | otherwise = Outputable.empty -perhapsForallMsg :: SDoc -perhapsForallMsg - = vcat [ text "Perhaps you intended to use ExplicitForAll or similar flag" - , text "to enable explicit-forall syntax: forall . "] - qualsInScope :: GlobalRdrElt -> [(ModuleName, HowInScope)] -- Ones for which the qualified version is in scope qualsInScope GRE { gre_name = n, gre_lcl = lcl, gre_imp = is } From git at git.haskell.org Fri Feb 15 10:15:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:34 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hie-module' created Message-ID: <20190215101534.82C573A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hie-module Referencing: e8d8c738e75dc9d23a287a8fab2392333c5cc6a5 From git at git.haskell.org Fri Feb 15 10:15:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:37 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Fix typos [skip ci] (e40f00d) Message-ID: <20190215101537.915C83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/e40f00dcf96ba9009801dd1ca37b4abf12951b6e/ghc >--------------------------------------------------------------- commit e40f00dcf96ba9009801dd1ca37b4abf12951b6e Author: Alexandre Esteves Date: Tue Feb 12 17:17:21 2019 +0000 Fix typos [skip ci] >--------------------------------------------------------------- e40f00dcf96ba9009801dd1ca37b4abf12951b6e libraries/base/GHC/Natural.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/base/GHC/Natural.hs b/libraries/base/GHC/Natural.hs index fef76df..b452d51 100644 --- a/libraries/base/GHC/Natural.hs +++ b/libraries/base/GHC/Natural.hs @@ -98,7 +98,7 @@ default () -- TODO: Note that some functions have commented CONSTANT_FOLDED annotations, -- that's because the Integer counter-parts of these functions do actually have -- a builtinRule in PrelRules, where the Natural functions do not. The plan is --- to eventually also add builtin rules for those function on Natural. +-- to eventually also add builtin rules for those functions on Natural. #define CONSTANT_FOLDED NOINLINE ------------------------------------------------------------------------------- @@ -188,7 +188,7 @@ gcdNatural (NatJ# x) (NatS# y) = NatS# (gcdBigNatWord x y) gcdNatural (NatS# x) (NatJ# y) = NatS# (gcdBigNatWord y x) gcdNatural (NatS# x) (NatS# y) = NatS# (gcdWord x y) --- | compute least common multiplier. +-- | Compute least common multiple. lcmNatural :: Natural -> Natural -> Natural lcmNatural (NatS# 0##) _ = NatS# 0## lcmNatural _ (NatS# 0##) = NatS# 0## From git at git.haskell.org Fri Feb 15 10:15:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:40 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Add `liftedTyped` to `Lift` class (7f26b74) Message-ID: <20190215101540.A05F33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/7f26b74e409d058005909fc2b2ed2e6027d49365/ghc >--------------------------------------------------------------- commit 7f26b74e409d058005909fc2b2ed2e6027d49365 Author: Alec Theriault Date: Mon Feb 11 09:31:40 2019 -0800 Add `liftedTyped` to `Lift` class Implements GHC proposal 43, adding a `liftTyped` method to the `Lift` typeclass. This also adds some documentation to `TExp`, describing typed splices and their advantages over their untyped counterparts. Resolves #14671. >--------------------------------------------------------------- 7f26b74e409d058005909fc2b2ed2e6027d49365 .../template-haskell/Language/Haskell/TH/Syntax.hs | 58 ++++++++++++++++++++-- libraries/template-haskell/changelog.md | 5 ++ .../tests/deriving/should_compile/T14682.stderr | 7 +++ 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index 3ff6393..7bff489 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -200,12 +200,53 @@ instance Applicative Q where ----------------------------------------------------- type role TExp nominal -- See Note [Role of TExp] -newtype TExp a = TExp { unType :: Exp } - +newtype TExp a = TExp + { unType :: Exp -- ^ Underlying untyped Template Haskell expression + } +-- ^ Represents an expression which has type @a at . Built on top of 'Exp', typed +-- expressions allow for type-safe splicing via: +-- +-- - typed quotes, written as @[|| ... ||]@ where @...@ is an expression; if +-- that expression has type @a@, then the quotation has type +-- @'Q' ('TExp' a)@ +-- +-- - typed splices inside of typed quotes, written as @$$(...)@ where @...@ +-- is an arbitrary expression of type @'Q' ('TExp' a)@ +-- +-- Traditional expression quotes and splices let us construct ill-typed +-- expressions: +-- +-- >>> fmap ppr $ runQ [| True == $( [| "foo" |] ) |] +-- GHC.Types.True GHC.Classes.== "foo" +-- >>> GHC.Types.True GHC.Classes.== "foo" +-- error: +-- • Couldn't match expected type ‘Bool’ with actual type ‘[Char]’ +-- • In the second argument of ‘(==)’, namely ‘"foo"’ +-- In the expression: True == "foo" +-- In an equation for ‘it’: it = True == "foo" +-- +-- With typed expressions, the type error occurs when /constructing/ the +-- Template Haskell expression: +-- +-- >>> fmap ppr $ runQ [|| True == $$( [|| "foo" ||] ) ||] +-- error: +-- • Couldn't match type ‘[Char]’ with ‘Bool’ +-- Expected type: Q (TExp Bool) +-- Actual type: Q (TExp [Char]) +-- • In the Template Haskell quotation [|| "foo" ||] +-- In the expression: [|| "foo" ||] +-- In the Template Haskell splice $$([|| "foo" ||]) + +-- | Discard the type annotation and produce a plain Template Haskell +-- expression unTypeQ :: Q (TExp a) -> Q Exp unTypeQ m = do { TExp e <- m ; return e } +-- | Annotate the Template Haskell expression with a type +-- +-- This is unsafe because GHC cannot check for you that the expression +-- really does have the type you claim it has. unsafeTExpCoerce :: Q Exp -> Q (TExp a) unsafeTExpCoerce m = do { e <- m ; return (TExp e) } @@ -635,8 +676,17 @@ class Lift t where -- | Turn a value into a Template Haskell expression, suitable for use in -- a splice. lift :: t -> Q Exp - default lift :: Data t => t -> Q Exp - lift = liftData + lift = unTypeQ . liftTyped + + -- | Turn a value into a Template Haskell typed expression, suitable for use + -- in a typed splice. + -- + -- @since 2.16.0.0 + liftTyped :: t -> Q (TExp t) + liftTyped = unsafeTExpCoerce . lift + + {-# MINIMAL lift | liftTyped #-} + -- If you add any instances here, consider updating test th/TH_Lift instance Lift Integer where diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md index b144434..cfed120 100644 --- a/libraries/template-haskell/changelog.md +++ b/libraries/template-haskell/changelog.md @@ -1,5 +1,10 @@ # Changelog for [`template-haskell` package](http://hackage.haskell.org/package/template-haskell) +## 2.16.0.0 *TBA* + + * Introduce a `liftTyped` method to the `Lift` class and set the default + implementations of `lift`/`liftTyped` to be in terms of each other. + ## 2.15.0.0 *TBA* * In `Language.Haskell.TH.Syntax`, `DataInstD`, `NewTypeInstD`, `TySynEqn`, diff --git a/testsuite/tests/deriving/should_compile/T14682.stderr b/testsuite/tests/deriving/should_compile/T14682.stderr index ed44b3c..75e9030 100644 --- a/testsuite/tests/deriving/should_compile/T14682.stderr +++ b/testsuite/tests/deriving/should_compile/T14682.stderr @@ -98,6 +98,13 @@ GHC.Show.Show [T14682.Foo] ==================== Filling in method body ==================== +Language.Haskell.TH.Syntax.Lift [T14682.Foo] + Language.Haskell.TH.Syntax.liftTyped = Language.Haskell.TH.Syntax.$dmliftTyped + @(T14682.Foo) + + + +==================== Filling in method body ==================== Data.Data.Data [T14682.Foo] Data.Data.dataCast1 = Data.Data.$dmdataCast1 @(T14682.Foo) From git at git.haskell.org Fri Feb 15 10:15:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:43 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: NCG: fast compilation of very large strings (#16190) (1d9a1d9) Message-ID: <20190215101543.AE8403A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3/ghc >--------------------------------------------------------------- commit 1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 Author: Sylvain Henry Date: Mon Feb 11 17:40:00 2019 +0100 NCG: fast compilation of very large strings (#16190) This patch adds an optimization into the NCG: for large strings (threshold configurable via -fbinary-blob-threshold=NNN flag), instead of printing `.asciz "..."` in the generated ASM source, we print `.incbin "tmpXXX.dat"` and we dump the contents of the string into a temporary "tmpXXX.dat" file. See the note for more details. >--------------------------------------------------------------- 1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 compiler/main/DynFlags.hs | 6 +++++ compiler/nativeGen/PPC/Ppr.hs | 3 +-- compiler/nativeGen/PprBase.hs | 48 +++++++++++++++++++++++++++++++++ compiler/nativeGen/SPARC/Ppr.hs | 8 +----- compiler/nativeGen/X86/Ppr.hs | 4 +-- docs/users_guide/using-optimisation.rst | 16 +++++++++++ 6 files changed, 73 insertions(+), 12 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 1d9a1d9fb8fe0a1fea2c44c4246f102ff3e1f3a3 From git at git.haskell.org Fri Feb 15 10:15:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:47 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Add perf test for #16190 (0f1eb88) Message-ID: <20190215101547.922733A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/0f1eb88c93143359fa671bb72aceebc299c87a95/ghc >--------------------------------------------------------------- commit 0f1eb88c93143359fa671bb72aceebc299c87a95 Author: Sylvain Henry Date: Mon Feb 11 17:39:02 2019 +0100 Add perf test for #16190 >--------------------------------------------------------------- 0f1eb88c93143359fa671bb72aceebc299c87a95 testsuite/tests/perf/compiler/T16190.hs | 17 +++++++++++++++++ testsuite/tests/perf/compiler/T16190_Embed.hs | 7 +++++++ testsuite/tests/perf/compiler/all.T | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/testsuite/tests/perf/compiler/T16190.hs b/testsuite/tests/perf/compiler/T16190.hs new file mode 100644 index 0000000..79479f0 --- /dev/null +++ b/testsuite/tests/perf/compiler/T16190.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Main where + +import T16190_Embed +import Foreign.Ptr +import Foreign.Storable +import Data.Word +import GHC.Ptr + +ptr :: Ptr Word32 +ptr = Ptr $(embedBytes (replicate (3 * 1000 * 1000) 0x37)) + +main :: IO () +main = do + w <- peek (ptr `plusPtr` 12) + print (w == (0x37373737 :: Word32)) diff --git a/testsuite/tests/perf/compiler/T16190_Embed.hs b/testsuite/tests/perf/compiler/T16190_Embed.hs new file mode 100644 index 0000000..f7e50d6 --- /dev/null +++ b/testsuite/tests/perf/compiler/T16190_Embed.hs @@ -0,0 +1,7 @@ +module T16190_Embed where + +import Data.Word +import Language.Haskell.TH + +embedBytes :: [Word8] -> Q Exp +embedBytes bs = return (LitE (StringPrimL bs)) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 9103719..82847c2 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -390,3 +390,9 @@ test ('T15164', ], compile, ['-v0 -O']) + +test('T16190', + [ collect_stats() + ], + multimod_compile, + ['T16190.hs', '-v0']) From git at git.haskell.org Fri Feb 15 10:15:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:51 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Implement -Wredundant-record-wildcards and -Wunused-record-wildcards (1962621) Message-ID: <20190215101551.C22453A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/19626218566ea709b5f6f287d3c296b0c4021de2/ghc >--------------------------------------------------------------- commit 19626218566ea709b5f6f287d3c296b0c4021de2 Author: Matthew Pickering Date: Mon Feb 11 09:24:04 2019 +0000 Implement -Wredundant-record-wildcards and -Wunused-record-wildcards -Wredundant-record-wildcards warns when a .. pattern binds no variables. -Wunused-record-wildcards warns when none of the variables bound by a .. pattern are used. These flags are enabled by `-Wall`. >--------------------------------------------------------------- 19626218566ea709b5f6f287d3c296b0c4021de2 compiler/hsSyn/HsPat.hs | 4 +- compiler/hsSyn/HsUtils.hs | 73 ++++++++++++++-------- compiler/main/DynFlags.hs | 8 ++- compiler/parser/Parser.y | 10 +-- compiler/parser/RdrHsSyn.hs | 14 ++--- compiler/rename/RnBinds.hs | 10 ++- compiler/rename/RnExpr.hs | 8 ++- compiler/rename/RnPat.hs | 32 ++++++++-- compiler/rename/RnUtils.hs | 66 +++++++++++++++++++ compiler/typecheck/TcTypeable.hs | 4 +- docs/users_guide/8.10.1-notes.rst | 45 +++++++++++++ docs/users_guide/using-warnings.rst | 44 +++++++++++++ libraries/base/GHC/IO/Handle.hs | 4 +- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs | 2 +- libraries/ghci/GHCi/TH.hs | 2 +- libraries/libiserv/src/Lib.hs | 2 +- testsuite/tests/rename/should_compile/T15957.hs | 21 +++++++ testsuite/tests/rename/should_compile/all.T | 1 + testsuite/tests/rename/should_fail/T15957_Fail.hs | 32 ++++++++++ .../tests/rename/should_fail/T15957_Fail.stderr | 36 +++++++++++ testsuite/tests/rename/should_fail/T9437.stderr | 2 +- testsuite/tests/rename/should_fail/all.T | 1 + testsuite/tests/typecheck/should_compile/T4404.hs | 1 + 23 files changed, 362 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 19626218566ea709b5f6f287d3c296b0c4021de2 From git at git.haskell.org Fri Feb 15 10:15:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:54 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Fail fast in solveLocalEqualities (5c1f268) Message-ID: <20190215101554.CED183A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/5c1f268e2744fab2d36e64c163858995451d7095/ghc >--------------------------------------------------------------- commit 5c1f268e2744fab2d36e64c163858995451d7095 Author: Simon Peyton Jones Date: Thu Feb 14 08:28:43 2019 +0000 Fail fast in solveLocalEqualities This patch makes us fail fast in TcSimplify.solveLocalEqualities, and in TcHsType.tc_hs_sig_type, if there are insoluble constraints. Previously we ploughed on even if there were insoluble constraints, leading to a cascade of hard-to-understand type errors. Failing eagerly is much better; hence a lot of testsuite error message changes. Eg if we have f :: [Maybe] -> blah f xs = e then trying typecheck 'f x = e' with an utterly bogus type is just asking for trouble. I can't quite remember what provoked me to make this change, but I think the error messages are notably improved, by removing confusing clutter and focusing on the real error. >--------------------------------------------------------------- 5c1f268e2744fab2d36e64c163858995451d7095 compiler/typecheck/TcHsType.hs | 4 + compiler/typecheck/TcSimplify.hs | 19 +++- .../tests/dependent/should_fail/DepFail1.stderr | 16 --- testsuite/tests/ghci/scripts/T15898.stderr | 28 ------ .../tests/indexed-types/should_fail/T13877.stderr | 22 +---- .../tests/partial-sigs/should_fail/T11976.stderr | 11 --- .../tests/partial-sigs/should_fail/T12634.stderr | 23 +---- testsuite/tests/patsyn/should_fail/T15289.stderr | 6 -- testsuite/tests/polykinds/T12593.stderr | 107 +-------------------- testsuite/tests/polykinds/T15577.stderr | 62 ------------ .../tests/typecheck/should_fail/T11112.stderr | 9 -- .../tests/typecheck/should_fail/T13819.stderr | 11 --- .../tests/typecheck/should_fail/T14232.stderr | 13 --- testsuite/tests/typecheck/should_fail/T3540.stderr | 10 -- testsuite/tests/typecheck/should_fail/T7778.stderr | 6 -- testsuite/tests/typecheck/should_fail/T8806.stderr | 6 +- .../tests/typecheck/should_fail/VtaFail.stderr | 22 ----- .../tests/typecheck/should_fail/tcfail057.stderr | 9 -- .../tests/typecheck/should_fail/tcfail058.stderr | 20 ---- .../tests/typecheck/should_fail/tcfail063.stderr | 17 ---- .../tests/typecheck/should_fail/tcfail113.stderr | 21 ---- .../tests/typecheck/should_fail/tcfail160.stderr | 6 -- .../tests/typecheck/should_fail/tcfail161.stderr | 8 -- .../tests/typecheck/should_fail/tcfail212.stderr | 36 ++++--- 24 files changed, 50 insertions(+), 442 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 5c1f268e2744fab2d36e64c163858995451d7095 From git at git.haskell.org Fri Feb 15 10:15:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:15:58 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: Make a smart mkAppTyM (6827838) Message-ID: <20190215101558.087113A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/682783828275cca5fd8bf5be5b52054c75e0e22c/ghc >--------------------------------------------------------------- commit 682783828275cca5fd8bf5be5b52054c75e0e22c Author: Simon Peyton Jones Date: Thu Jan 24 11:53:03 2019 +0000 Make a smart mkAppTyM This patch finally delivers on Trac #15952. Specifically * Completely remove Note [The tcType invariant], along with its complicated consequences (IT1-IT6). * Replace Note [The well-kinded type invariant] with: Note [The Purely Kinded Type Invariant (PKTI)] * Instead, establish the (PKTI) in TcHsType.tcInferApps, by using a new function mkAppTyM when building a type application. See Note [mkAppTyM]. * As a result we can remove the delicate mkNakedXX functions entirely. Specifically, mkNakedCastTy retained lots of extremly delicate Refl coercions which just cluttered everything up, and(worse) were very vulnerable to being silently eliminated by (say) substTy. This led to a succession of bug reports. The result is noticeably simpler to explain, simpler to code, and Richard and I are much more confident that it is correct. It does not actually fix any bugs, but it brings us closer. E.g. I hoped it'd fix #15918 and #15799, but it doesn't quite do so. However, it makes it much easier to fix. I also did a raft of other minor refactorings: * Use tcTypeKind consistently in the type checker * Rename tcInstTyBinders to tcInvisibleTyBinders, and refactor it a bit * Refactor tcEqType, pickyEqType, tcEqTypeVis Simpler, probably more efficient. * Make zonkTcType zonk TcTyCons, at least if they have any free unification variables -- see zonk_tc_tycon in TcMType.zonkTcTypeMapper. Not zonking these TcTyCons was actually a bug before. * Simplify try_to_reduce_no_cache in TcFlatten (a lot) * Combine checkExpectedKind and checkExpectedKindX. And then combine the invisible-binder instantation code Much simpler now. * Fix a little bug in TcMType.skolemiseQuantifiedTyVar. I'm not sure how I came across this originally. * Fix a little bug in TyCoRep.isUnliftedRuntimeRep (the ASSERT was over-zealous). Again I'm not certain how I encountered this. * Add a missing solveLocalEqualities in TcHsType.tcHsPartialSigType. I came across this when trying to get level numbers right. >--------------------------------------------------------------- 682783828275cca5fd8bf5be5b52054c75e0e22c compiler/hsSyn/HsTypes.hs | 12 +- compiler/hsSyn/HsUtils.hs | 2 +- compiler/main/GHC.hs | 2 +- compiler/main/InteractiveEval.hs | 2 +- compiler/typecheck/Inst.hs | 59 +- compiler/typecheck/TcCanonical.hs | 21 +- compiler/typecheck/TcErrors.hs | 11 +- compiler/typecheck/TcFlatten.hs | 23 +- compiler/typecheck/TcHsSyn.hs | 1 + compiler/typecheck/TcHsType.hs | 853 +++++++++++++++---------- compiler/typecheck/TcInstDcls.hs | 13 +- compiler/typecheck/TcMType.hs | 41 +- compiler/typecheck/TcSMonad.hs | 4 +- compiler/typecheck/TcTyClsDecls.hs | 53 +- compiler/typecheck/TcType.hs | 297 +++------ compiler/typecheck/TcUnify.hs | 50 +- compiler/types/Coercion.hs | 2 +- compiler/types/OptCoercion.hs | 2 +- compiler/types/TyCoRep.hs | 7 +- compiler/types/TyCon.hs | 47 +- compiler/types/Type.hs | 73 ++- compiler/types/Type.hs-boot | 2 +- compiler/utils/Outputable.hs | 6 +- compiler/utils/Outputable.hs-boot | 3 +- testsuite/tests/ghci/should_fail/T16287.stderr | 13 +- 25 files changed, 839 insertions(+), 760 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 682783828275cca5fd8bf5be5b52054c75e0e22c From git at git.haskell.org Fri Feb 15 10:16:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Feb 2019 10:16:01 +0000 (UTC) Subject: [commit: ghc] wip/hie-module: HIE: Save module name and module exports (e8d8c73) Message-ID: <20190215101601.30A463A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-module Link : http://ghc.haskell.org/trac/ghc/changeset/e8d8c738e75dc9d23a287a8fab2392333c5cc6a5/ghc >--------------------------------------------------------------- commit e8d8c738e75dc9d23a287a8fab2392333c5cc6a5 Author: Matthew Pickering Date: Fri Feb 15 10:14:29 2019 +0000 HIE: Save module name and module exports >--------------------------------------------------------------- e8d8c738e75dc9d23a287a8fab2392333c5cc6a5 compiler/hieFile/HieAst.hs | 12 ++++++++++-- compiler/hieFile/HieTypes.hs | 15 ++++++++++++++- compiler/main/HscMain.hs | 5 +++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 0040b30..7fd217c 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -34,6 +34,8 @@ import TcHsSyn ( hsLitType, hsPatType ) import Type ( mkFunTys, Type ) import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) +import TcRnTypes +import MkIface ( mkIfaceExports ) import HieTypes import HieUtils @@ -87,17 +89,23 @@ modifyState = foldr go id type HieM = ReaderT HieState Hsc -- | Construct an 'HieFile' from the outputs of the typechecker. -mkHieFile :: ModSummary -> TypecheckedSource -> RenamedSource -> Hsc HieFile +mkHieFile :: ModSummary + -> TcGblEnv + -> RenamedSource -> Hsc HieFile mkHieFile ms ts rs = do - (asts', arr) <- getCompressedAsts ts rs + let tc_binds = tcg_binds ts + (asts', arr) <- getCompressedAsts tc_binds rs let Just src_file = ml_hs_file $ ms_location ms src <- liftIO $ BS.readFile src_file return $ HieFile { hie_version = curHieVersion , hie_ghc_version = BSC.pack cProjectVersion , hie_hs_file = src_file + , hie_module = ms_mod ms , hie_types = arr , hie_asts = asts' + -- mkIfaceExports sorts the AvailInfos for stability + , hie_exports = mkIfaceExports (tcg_exports ts) , hie_hs_src = src } diff --git a/compiler/hieFile/HieTypes.hs b/compiler/hieFile/HieTypes.hs index c20887f..b22ee19 100644 --- a/compiler/hieFile/HieTypes.hs +++ b/compiler/hieFile/HieTypes.hs @@ -10,10 +10,11 @@ import GhcPrelude import Binary import FastString ( FastString ) import IfaceType -import Module ( ModuleName ) +import Module ( ModuleName, Module ) import Name ( Name ) import Outputable hiding ( (<>) ) import SrcLoc ( RealSrcSpan ) +import Avail import qualified Data.Array as A import qualified Data.Map as M @@ -56,6 +57,9 @@ data HieFile = HieFile , hie_hs_file :: FilePath -- ^ Initial Haskell source file path + , hie_module :: Module + -- ^ The module this HIE file is for + , hie_types :: A.Array TypeIndex HieTypeFlat -- ^ Types referenced in the 'hie_asts'. -- @@ -64,17 +68,24 @@ data HieFile = HieFile , hie_asts :: HieASTs TypeIndex -- ^ Type-annotated abstract syntax trees + , hie_exports :: [AvailInfo] + -- ^ The names that this module exports + , hie_hs_src :: ByteString -- ^ Raw bytes of the initial Haskell source } +type HieExports = [(HieASTs TypeIndex, Avails)] + instance Binary HieFile where put_ bh hf = do put_ bh $ hie_version hf put_ bh $ hie_ghc_version hf put_ bh $ hie_hs_file hf + put_ bh $ hie_module hf put_ bh $ hie_types hf put_ bh $ hie_asts hf + put_ bh $ hie_exports hf put_ bh $ hie_hs_src hf get bh = HieFile @@ -84,6 +95,8 @@ instance Binary HieFile where <*> get bh <*> get bh <*> get bh + <*> get bh + <*> get bh {- diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 9a4dd4a..674afc9 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -408,8 +408,9 @@ extract_renamed_stuff mod_summary tc_result = do -- Create HIE files when (gopt Opt_WriteHie dflags) $ do - hieFile <- mkHieFile mod_summary (tcg_binds tc_result) - (fromJust rn_info) + -- I assume this fromJust is safe because `-fwrite-hie-file` + -- enables the option which keeps the renamed source. + hieFile <- mkHieFile mod_summary tc_result (fromJust rn_info) let out_file = ml_hie_file $ ms_location mod_summary liftIO $ writeHieFile out_file hieFile From git at git.haskell.org Sat Feb 16 10:32:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:40 +0000 (UTC) Subject: [commit: ghc] branch 'wip/parse-errors' created Message-ID: <20190216103240.2E6A33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/parse-errors Referencing: 60eb2fba1d31ca3bb1dea34c019c42db5340cb44 From git at git.haskell.org Sat Feb 16 10:32:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:42 +0000 (UTC) Subject: [commit: ghc] branch 'wip/junit-fix' created Message-ID: <20190216103242.2D1A53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/junit-fix Referencing: 19ae47a4c715c406f8082b14cebc5bbc41734e6d From git at git.haskell.org Sat Feb 16 10:32:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:44 +0000 (UTC) Subject: [commit: ghc] branch 'wip/unexpected-test' created Message-ID: <20190216103244.2DFBE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/unexpected-test Referencing: 5544f6082d6e15d305b83f27f4daa29576d3666e From git at git.haskell.org Sat Feb 16 10:32:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:46 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ghc-8.8-cherries' created Message-ID: <20190216103246.2F2613A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ghc-8.8-cherries Referencing: 4ac472b2b67d6bcb8b39f78b030940e6c464d9c8 From git at git.haskell.org Sat Feb 16 10:32:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:48 +0000 (UTC) Subject: [commit: ghc] branch 'wip/map-coerce-wrappers' created Message-ID: <20190216103248.301AD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/map-coerce-wrappers Referencing: 44bbf4f4fac5f53ebb5c167f80c75c5fa420fcb1 From git at git.haskell.org Sat Feb 16 10:32:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:51 +0000 (UTC) Subject: [commit: ghc] wip/junit-fix: try removing the underscore (19ae47a) Message-ID: <20190216103251.3D2C83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/junit-fix Link : http://ghc.haskell.org/trac/ghc/changeset/19ae47a4c715c406f8082b14cebc5bbc41734e6d/ghc >--------------------------------------------------------------- commit 19ae47a4c715c406f8082b14cebc5bbc41734e6d Author: Matthew Pickering Date: Fri Feb 15 10:37:07 2019 +0000 try removing the underscore >--------------------------------------------------------------- 19ae47a4c715c406f8082b14cebc5bbc41734e6d testsuite/driver/junit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/driver/junit.py b/testsuite/driver/junit.py index d376a06..824b64c 100644 --- a/testsuite/driver/junit.py +++ b/testsuite/driver/junit.py @@ -15,7 +15,7 @@ def junit(t): for res_type, group in [('stat failure', t.unexpected_stat_failures), ('unexpected failure', t.unexpected_failures), - ('unexpected_passes', t.unexpected_passes)]: + ('unexpected passes', t.unexpected_passes)]: for tr in group: testcase = ET.SubElement(testsuite, 'testcase', classname = tr.way, From git at git.haskell.org Sat Feb 16 10:32:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:54 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers, wip/parse-errors, wip/unexpected-test: Hadrian: enable -Wcompat=error in the testsuite (b31df5c) Message-ID: <20190216103254.45CB23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/map-coerce-wrappers,wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/b31df5caaebb1c4f72a3c70a9cdb7893af4c3309/ghc >--------------------------------------------------------------- commit b31df5caaebb1c4f72a3c70a9cdb7893af4c3309 Author: Vladislav Zavialov Date: Wed Feb 13 15:22:59 2019 +0300 Hadrian: enable -Wcompat=error in the testsuite >--------------------------------------------------------------- b31df5caaebb1c4f72a3c70a9cdb7893af4c3309 hadrian/src/Settings/Builders/RunTest.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs index 55a5e58..834cacf 100644 --- a/hadrian/src/Settings/Builders/RunTest.hs +++ b/hadrian/src/Settings/Builders/RunTest.hs @@ -46,6 +46,7 @@ runTestGhcFlags = do , ifMinGhcVer "711" "-fshow-warning-groups" , ifMinGhcVer "801" "-fdiagnostics-color=never" , ifMinGhcVer "801" "-fno-diagnostics-show-caret" + , pure "-Werror=compat" -- See Trac #15278 , pure "-dno-debug-output" ] From git at git.haskell.org Sat Feb 16 10:32:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:32:57 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers, wip/parse-errors, wip/unexpected-test: 'forall' always a keyword, plus the dot type operator (887454d) Message-ID: <20190216103257.59F593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/map-coerce-wrappers,wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/887454d8889ca5dbba70425de41d97939cb9ac60/ghc >--------------------------------------------------------------- commit 887454d8889ca5dbba70425de41d97939cb9ac60 Author: Vladislav Zavialov Date: Thu Feb 14 00:36:00 2019 +0300 'forall' always a keyword, plus the dot type operator >--------------------------------------------------------------- 887454d8889ca5dbba70425de41d97939cb9ac60 compiler/parser/Lexer.x | 6 +-- compiler/parser/Parser.y | 47 ++++++++-------------- compiler/parser/RdrHsSyn.hs | 25 ++++++++---- compiler/prelude/PrelNames.hs | 4 -- compiler/rename/RnTypes.hs | 8 +--- compiler/rename/RnUnbound.hs | 15 ++----- docs/users_guide/8.8.1-notes.rst | 6 ++- testsuite/tests/ghci/prog006/prog006.stderr | 10 +++-- .../should_fail/ParserNoForallUnicode.stderr | 4 +- testsuite/tests/parser/should_fail/T12811.stderr | 6 ++- testsuite/tests/parser/should_fail/T3095.stderr | 4 +- .../tests/rename/should_fail/rnfail052.stderr | 4 +- .../tests/rename/should_fail/rnfail053.stderr | 10 +++-- testsuite/tests/typecheck/should_fail/T3155.stderr | 4 +- .../tests/typecheck/should_fail/tcfail166.stderr | 4 +- .../tests/typecheck/should_fail/tcfail183.stderr | 4 +- 16 files changed, 74 insertions(+), 87 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 887454d8889ca5dbba70425de41d97939cb9ac60 From git at git.haskell.org Sat Feb 16 10:33:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:00 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-cherries: 'forall' always a keyword, plus the dot type operator (4ac472b) Message-ID: <20190216103300.71F9A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-cherries Link : http://ghc.haskell.org/trac/ghc/changeset/4ac472b2b67d6bcb8b39f78b030940e6c464d9c8/ghc >--------------------------------------------------------------- commit 4ac472b2b67d6bcb8b39f78b030940e6c464d9c8 Author: Vladislav Zavialov Date: Thu Feb 14 00:36:00 2019 +0300 'forall' always a keyword, plus the dot type operator >--------------------------------------------------------------- 4ac472b2b67d6bcb8b39f78b030940e6c464d9c8 compiler/parser/Lexer.x | 6 +-- compiler/parser/Parser.y | 47 ++++++++-------------- compiler/parser/RdrHsSyn.hs | 25 ++++++++---- compiler/prelude/PrelNames.hs | 4 -- compiler/rename/RnTypes.hs | 8 +--- compiler/rename/RnUnbound.hs | 15 ++----- docs/users_guide/8.8.1-notes.rst | 6 ++- testsuite/tests/ghci/prog006/prog006.stderr | 10 +++-- .../should_fail/ParserNoForallUnicode.stderr | 4 +- testsuite/tests/parser/should_fail/T12811.stderr | 6 ++- testsuite/tests/parser/should_fail/T3095.stderr | 4 +- .../tests/rename/should_fail/rnfail052.stderr | 4 +- .../tests/rename/should_fail/rnfail053.stderr | 10 +++-- testsuite/tests/typecheck/should_fail/T3155.stderr | 4 +- .../tests/typecheck/should_fail/tcfail166.stderr | 4 +- .../tests/typecheck/should_fail/tcfail183.stderr | 4 +- 16 files changed, 74 insertions(+), 87 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 4ac472b2b67d6bcb8b39f78b030940e6c464d9c8 From git at git.haskell.org Sat Feb 16 10:33:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:04 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers: Disable binder swap in OccurAnal (Trac #16288) (d8a4d82) Message-ID: <20190216103304.571823A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/map-coerce-wrappers Link : http://ghc.haskell.org/trac/ghc/changeset/d8a4d8230a4e67bce679d3f73586012c05061c70/ghc >--------------------------------------------------------------- commit d8a4d8230a4e67bce679d3f73586012c05061c70 Author: Krzysztof Gogolewski Date: Fri Feb 8 17:49:28 2019 +0100 Disable binder swap in OccurAnal (Trac #16288) >--------------------------------------------------------------- d8a4d8230a4e67bce679d3f73586012c05061c70 compiler/coreSyn/CoreUnfold.hs | 39 +++++++++++++++++++--- .../dependent/should_compile/dynamic-paper.stderr | 4 +-- .../tests/simplCore/should_compile/T16288A.hs | 17 ++++++++++ .../tests/simplCore/should_compile/T16288B.hs | 7 ++++ .../tests/simplCore/should_compile/T16288C.hs | 13 ++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 6 files changed, 74 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 11c2a75..adfd8ac 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -47,7 +47,7 @@ import GhcPrelude import DynFlags import CoreSyn import PprCore () -- Instances -import OccurAnal ( occurAnalyseExpr ) +import OccurAnal ( occurAnalyseExpr_NoBinderSwap ) import CoreOpt import CoreArity ( manifestArity ) import CoreUtils @@ -101,7 +101,7 @@ mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding mkDFunUnfolding bndrs con ops = DFunUnfolding { df_bndrs = bndrs , df_con = con - , df_args = map occurAnalyseExpr ops } + , df_args = map occurAnalyseExpr_NoBinderSwap ops } -- See Note [Occurrence analysis of unfoldings] mkWwInlineRule :: DynFlags -> CoreExpr -> Arity -> Unfolding @@ -311,7 +311,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> UnfoldingGuidance -> Unfolding -- Occurrence-analyses the expression before capturing it mkCoreUnfolding src top_lvl expr guidance - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = top_lvl, @@ -330,7 +330,7 @@ mkUnfolding :: DynFlags -> UnfoldingSource -- Calculates unfolding guidance -- Occurrence-analyses the expression before capturing it mkUnfolding dflags src is_top_lvl is_bottoming expr - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = is_top_lvl, @@ -342,7 +342,7 @@ mkUnfolding dflags src is_top_lvl is_bottoming expr where is_top_bottoming = is_top_lvl && is_bottoming guidance = calcUnfoldingGuidance dflags is_top_bottoming expr - -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr expr))! + -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr_NoBinderSwap expr))! -- See Note [Calculate unfolding guidance on the non-occ-anal'd expression] {- @@ -364,6 +364,35 @@ But more generally, the simplifier is designed on the basis that it is looking at occurrence-analysed expressions, so better ensure that they acutally are. +We use occurAnalyseExpr_NoBinderSwap instead of occurAnalyseExpr; +see Note [No binder swap]. + +Note [No binder swap] +~~~~~~~~~~~~~~~~~~~~~ +The binder swap can temporarily violate Core Lint, by assinging +a LocalId binding to a GlobalId. For example, if A.foo{r872} +is a GlobalId with unique r872, then + + case A.foo{r872} of bar { + K x -> ...(A.foo{r872})... + } + +gets transformed to + + case A.foo{r872} of bar { + K x -> let foo{r872} = bar + in ...(A.foo{r872})... + +This is usually not a problem, because the simplifier will transform +this to: + + case A.foo{r872} of bar { + K x -> ...(bar)... + +However, during occurrence analysis of unfoldings this can show up +as a Core Lint error. As a quick workaround, we disable binder swap +in this module. See Trac #16288 and #16296 for further plans. + Note [Calculate unfolding guidance on the non-occ-anal'd expression] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Notice that we give the non-occur-analysed expression to diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr index 3ba4db2..a170d29 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr @@ -1,5 +1,5 @@ Simplifier ticks exhausted - When trying UnfoldingDone delta1 + When trying UnfoldingDone delta To increase the limit, use -fsimpl-tick-factor=N (default 100). If you need to increase the limit substantially, please file a @@ -12,4 +12,4 @@ Simplifier ticks exhausted simplifier non-termination has been judged acceptable. To see detailed counts use -ddump-simpl-stats - Total ticks: 140004 + Total ticks: 140007 diff --git a/testsuite/tests/simplCore/should_compile/T16288A.hs b/testsuite/tests/simplCore/should_compile/T16288A.hs new file mode 100644 index 0000000..c6a52bf --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288A.hs @@ -0,0 +1,17 @@ +module T16288A where + +import T16288C + +data License + +class Pretty a where + pretty :: a -> Doc + +instance Pretty License where + pretty _ = pretV + +bar :: (Pretty a) => a -> Doc +bar w = foo (pretty (u w w w w)) + +u :: a -> a -> a -> a -> a +u = u diff --git a/testsuite/tests/simplCore/should_compile/T16288B.hs b/testsuite/tests/simplCore/should_compile/T16288B.hs new file mode 100644 index 0000000..c1a98d2 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288B.hs @@ -0,0 +1,7 @@ +module T16288B where + +import T16288A +import T16288C + +bar2 :: License -> Doc +bar2 = bar diff --git a/testsuite/tests/simplCore/should_compile/T16288C.hs b/testsuite/tests/simplCore/should_compile/T16288C.hs new file mode 100644 index 0000000..5efbb2e --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288C.hs @@ -0,0 +1,13 @@ +module T16288C where + +data Doc = Empty | Beside Doc + +hcat :: Doc -> Doc +hcat Empty = Empty +hcat xs = hcat xs + +pretV = hcat Empty + +foo :: Doc -> Doc +foo Empty = hcat Empty +foo val = Beside val diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 06b5e48..779b091 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -299,3 +299,4 @@ test('T15631', normal, makefile_test, ['T15631']) test('T15673', normal, compile, ['-O']) +test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0']) From git at git.haskell.org Sat Feb 16 10:33:08 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:08 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers: Look through newtype wrappers (Trac #16254) (0b5aff8) Message-ID: <20190216103308.500E13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/map-coerce-wrappers Link : http://ghc.haskell.org/trac/ghc/changeset/0b5aff8e9ec711e2bdcd476577ce209fa17c8512/ghc >--------------------------------------------------------------- commit 0b5aff8e9ec711e2bdcd476577ce209fa17c8512 Author: Krzysztof Gogolewski Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) exprIsConApp_maybe could detect that I# 10 is a constructor application, but not that Size (I# 10) is, because it was an application with a nontrivial argument. >--------------------------------------------------------------- 0b5aff8e9ec711e2bdcd476577ce209fa17c8512 compiler/basicTypes/Id.hs | 9 +++- compiler/coreSyn/CoreOpt.hs | 51 ++++++++++++++++++++-- compiler/coreSyn/CoreUtils.hs | 1 + testsuite/tests/simplCore/should_compile/Makefile | 5 +++ .../should_compile/{T5327.hs => T16254.hs} | 8 ++-- .../should_compile/T16254.stdout} | 0 testsuite/tests/simplCore/should_compile/all.T | 1 + 7 files changed, 68 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 0b5aff8e9ec711e2bdcd476577ce209fa17c8512 From git at git.haskell.org Sat Feb 16 10:33:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:12 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers: Make constructor wrappers inline only during the final phase (9db7a8b) Message-ID: <20190216103312.995C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/map-coerce-wrappers Link : http://ghc.haskell.org/trac/ghc/changeset/9db7a8b20f616b6a3ea4cbc04b6f38feda84fd87/ghc >--------------------------------------------------------------- commit 9db7a8b20f616b6a3ea4cbc04b6f38feda84fd87 Author: Arnaud Spiwack Date: Thu Nov 15 17:14:31 2018 +0100 Make constructor wrappers inline only during the final phase For case-of-known constructor to continue triggering early, exprIsConApp_maybe is now capable of looking through lets and cases. See #15840 >--------------------------------------------------------------- 9db7a8b20f616b6a3ea4cbc04b6f38feda84fd87 compiler/basicTypes/Id.hs | 8 +- compiler/basicTypes/MkId.hs | 23 +-- compiler/coreSyn/CoreOpt.hs | 164 +++++++++++++++++---- compiler/coreSyn/MkCore.hs | 15 +- compiler/prelude/PrelRules.hs | 4 +- compiler/simplCore/FloatIn.hs | 2 +- compiler/simplCore/Simplify.hs | 70 ++++++--- .../tests/deSugar/should_compile/T2431.stderr | 5 +- .../tests/simplCore/should_compile/T7360.stderr | 2 +- testsuite/tests/simplCore/should_run/T15840.hs | 14 ++ .../tests/simplCore/should_run/T15840.stdout | 0 testsuite/tests/simplCore/should_run/T15840a.hs | 22 +++ .../tests/simplCore/should_run/T15840a.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 2 + 14 files changed, 271 insertions(+), 61 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 9db7a8b20f616b6a3ea4cbc04b6f38feda84fd87 From git at git.haskell.org Sat Feb 16 10:33:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:16 +0000 (UTC) Subject: [commit: ghc] wip/map-coerce-wrappers: Fix map/coerce for newtypes with wrappers (Trac #16208) (44bbf4f) Message-ID: <20190216103316.23D753A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/map-coerce-wrappers Link : http://ghc.haskell.org/trac/ghc/changeset/44bbf4f4fac5f53ebb5c167f80c75c5fa420fcb1/ghc >--------------------------------------------------------------- commit 44bbf4f4fac5f53ebb5c167f80c75c5fa420fcb1 Author: Krzysztof Gogolewski Date: Fri Feb 15 15:58:15 2019 +0100 Fix map/coerce for newtypes with wrappers (Trac #16208) >--------------------------------------------------------------- 44bbf4f4fac5f53ebb5c167f80c75c5fa420fcb1 compiler/coreSyn/CoreOpt.hs | 19 +++++++++++++++++++ .../simplCore/should_run/{T2110.hs => T16208.hs} | 11 +++++++---- .../should_run/{T2110.stdout => T16208.stdout} | 0 testsuite/tests/simplCore/should_run/all.T | 1 + 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs index 29f8ab2..8ffc58c 100644 --- a/compiler/coreSyn/CoreOpt.hs +++ b/compiler/coreSyn/CoreOpt.hs @@ -291,6 +291,12 @@ simple_app env (Var v) as -- See Note [Unfold compulsory unfoldings in LHSs] = simple_app (soeZapSubst env) (unfoldingTemplate unf) as + | let unf = idUnfolding v + , Just a <- isDataConWrapId_maybe v + , isNewTyCon (dataConTyCon a) + -- See note [Unfold newtype wrappers in LHSs] + = simple_app (soeZapSubst env) (unfoldingTemplate unf) as + | otherwise , let out_fn = lookupIdSubst (text "simple_app") (soe_subst env) v = finish_app env out_fn as @@ -582,6 +588,19 @@ However, we don't want to inline 'seq', which happens to also have a compulsory unfolding, so we only do this unfolding only for things that are always-active. See Note [User-defined RULES for seq] in MkId. +Note [Unfold newtype wrappers in LHSs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Newtypes may have wrappers, e.g. + +newtype Age a b where + MkAge :: forall b a. Int -> Age a b + +(the wrapper reorders the type arguments) + +In order for the `map coerce = coerce` rule to match `map MkAge` (as +it should!), we need to unfold newtype wrappers in simple_app. See also Note +[Unfold compulsory unfoldings in LHSs] and Trac #16208. + Note [Getting the map/coerce RULE to work] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We wish to allow the "map/coerce" RULE to fire: diff --git a/testsuite/tests/simplCore/should_run/T2110.hs b/testsuite/tests/simplCore/should_run/T16208.hs similarity index 68% copy from testsuite/tests/simplCore/should_run/T2110.hs copy to testsuite/tests/simplCore/should_run/T16208.hs index d945fac..60c3af7 100644 --- a/testsuite/tests/simplCore/should_run/T2110.hs +++ b/testsuite/tests/simplCore/should_run/T16208.hs @@ -1,17 +1,20 @@ +{-# LANGUAGE GADTs #-} {-# LANGUAGE MagicHash #-} +{-# LANGUAGE RankNTypes #-} import GHC.Exts import Unsafe.Coerce -newtype Age = Age Int +newtype Age a b where + Age :: forall b a. Int -> Age a b foo :: [Int] -> [Int] foo = map id -fooAge :: [Int] -> [Age] +fooAge :: [Int] -> [Age a b] fooAge = map Age -fooCoerce :: [Int] -> [Age] +fooCoerce :: [Int] -> [Age a b] fooCoerce = map coerce -fooUnsafeCoerce :: [Int] -> [Age] +fooUnsafeCoerce :: [Int] -> [Age a b] fooUnsafeCoerce = map unsafeCoerce same :: a -> b -> IO () diff --git a/testsuite/tests/simplCore/should_run/T2110.stdout b/testsuite/tests/simplCore/should_run/T16208.stdout similarity index 100% copy from testsuite/tests/simplCore/should_run/T2110.stdout copy to testsuite/tests/simplCore/should_run/T16208.stdout diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index f808943..646929f 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -50,6 +50,7 @@ test('T5441', [], multimod_compile_and_run, ['T5441', '']) test('T5603', reqlib('integer-gmp'), compile_and_run, ['']) test('T2110', normal, compile_and_run, ['']) test('AmapCoerce', normal, compile_and_run, ['']) +test('T16208', normal, compile_and_run, ['']) # Run these tests *without* optimisation too test('T5625', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, ['']) From git at git.haskell.org Sat Feb 16 10:33:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:19 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors, wip/unexpected-test: Properly escape character literals in Haddocks (173d0ce) Message-ID: <20190216103319.33D763A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/173d0cee84ef944059a473b1425e48062739988f/ghc >--------------------------------------------------------------- commit 173d0cee84ef944059a473b1425e48062739988f Author: Alec Theriault Date: Wed Feb 13 08:43:35 2019 -0500 Properly escape character literals in Haddocks Character literals in Haddock should not be written as plain `'\n'` since single quotes are for linking identifiers. Besides, since we want the character literal to be monospaced, we really should use `@\'\\n\'@`. [skip ci] >--------------------------------------------------------------- 173d0cee84ef944059a473b1425e48062739988f compiler/basicTypes/Literal.hs | 2 +- compiler/utils/StringBuffer.hs | 8 ++++---- libraries/base/GHC/IO/Device.hs | 2 +- libraries/base/GHC/IO/Encoding.hs | 2 +- libraries/base/GHC/IO/Handle/Types.hs | 12 ++++++------ libraries/base/GHC/ResponseFile.hs | 2 +- libraries/base/System/IO.hs | 10 +++++----- 7 files changed, 19 insertions(+), 19 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 173d0cee84ef944059a473b1425e48062739988f From git at git.haskell.org Sat Feb 16 10:33:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:22 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors, wip/unexpected-test: Don't wrap the entry map for LiveInfo in Maybe. (bcaba30) Message-ID: <20190216103322.403403A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/bcaba30a9602d7c5899c9754096a4460191dc667/ghc >--------------------------------------------------------------- commit bcaba30a9602d7c5899c9754096a4460191dc667 Author: klebinger.andreas at gmx.at Date: Thu Feb 14 19:23:19 2019 +0100 Don't wrap the entry map for LiveInfo in Maybe. It never really encoded a invariant. * The linear register allocator just did partial pattern matches * The graph allocator just set it to (Just mapEmpty) for Nothing So I changed LiveInfo to directly contain the map. Further natCmmTopToLive which filled in Nothing is no longer exported. Instead we know call cmmTopLiveness which changes the type AND fills in the map. >--------------------------------------------------------------- bcaba30a9602d7c5899c9754096a4460191dc667 compiler/nativeGen/AsmCodeGen.hs | 4 +--- compiler/nativeGen/RegAlloc/Graph/Main.hs | 5 ++-- compiler/nativeGen/RegAlloc/Graph/Spill.hs | 8 ++----- compiler/nativeGen/RegAlloc/Graph/SpillCost.hs | 2 +- compiler/nativeGen/RegAlloc/Linear/Main.hs | 2 +- compiler/nativeGen/RegAlloc/Liveness.hs | 32 +++++++++++++++----------- 6 files changed, 27 insertions(+), 26 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 bcaba30a9602d7c5899c9754096a4460191dc667 From git at git.haskell.org Sat Feb 16 10:33:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:25 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors, wip/unexpected-test: Fix and Reapply "Performance tests: recover a baseline from ancestor commits and CI results." (0b92bdc) Message-ID: <20190216103325.B43793A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/0b92bdc79ddd38ceb69820dbc27ed36d7e5d7a57/ghc >--------------------------------------------------------------- commit 0b92bdc79ddd38ceb69820dbc27ed36d7e5d7a57 Author: David Eichmann Date: Mon Feb 4 16:51:58 2019 +0000 Fix and Reapply "Performance tests: recover a baseline from ancestor commits and CI results." >--------------------------------------------------------------- 0b92bdc79ddd38ceb69820dbc27ed36d7e5d7a57 .gitlab-ci.yml | 31 +++++- .gitlab/push-test-metrics.sh | 67 +++++++++++++ testsuite/driver/perf_notes.py | 217 ++++++++++++++++++++++++++++++++++++++-- testsuite/driver/runtests.py | 35 +++++-- testsuite/driver/testglobals.py | 16 ++- testsuite/driver/testlib.py | 70 +++++-------- testsuite/driver/testutil.py | 2 +- 7 files changed, 373 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 0b92bdc79ddd38ceb69820dbc27ed36d7e5d7a57 From git at git.haskell.org Sat Feb 16 10:33:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:28 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors, wip/unexpected-test: Remove Simon's special number from typecheck/should_fail/all.t (5544f60) Message-ID: <20190216103328.BB20C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/5544f6082d6e15d305b83f27f4daa29576d3666e/ghc >--------------------------------------------------------------- commit 5544f6082d6e15d305b83f27f4daa29576d3666e Author: Matthew Pickering Date: Fri Feb 15 10:30:14 2019 +0000 Remove Simon's special number from typecheck/should_fail/all.t >--------------------------------------------------------------- 5544f6082d6e15d305b83f27f4daa29576d3666e testsuite/tests/typecheck/should_fail/all.T | 1 - 1 file changed, 1 deletion(-) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 2488551..bb7ed96 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -1,4 +1,3 @@ -4607 test('tcfail001', normal, compile_fail, ['']) test('tcfail002', normal, compile_fail, ['']) test('tcfail003', normal, compile_fail, ['']) From git at git.haskell.org Sat Feb 16 10:33:31 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:31 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors, wip/unexpected-test: Fix tests which were made to pass by "Make a smart mkAppTyM" (9b39597) Message-ID: <20190216103331.C152B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/parse-errors,wip/unexpected-test Link : http://ghc.haskell.org/trac/ghc/changeset/9b39597b66b6a46c1af2bb939dd77d01544ab7be/ghc >--------------------------------------------------------------- commit 9b39597b66b6a46c1af2bb939dd77d01544ab7be Author: Matthew Pickering Date: Fri Feb 15 10:26:41 2019 +0000 Fix tests which were made to pass by "Make a smart mkAppTyM" For some reason gitlab is not reporting these as failures in CI. It's not clear to me why as the junit output looks fine. Fixes #16112 and #16113 They were fixed by 682783828275cca5fd8bf5be5b52054c75e0e22c >--------------------------------------------------------------- 9b39597b66b6a46c1af2bb939dd77d01544ab7be testsuite/tests/dependent/should_fail/all.T | 2 +- testsuite/tests/parser/should_fail/all.T | 2 +- testsuite/tests/typecheck/should_fail/all.T | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T index a75886e..f127220 100644 --- a/testsuite/tests/dependent/should_fail/all.T +++ b/testsuite/tests/dependent/should_fail/all.T @@ -9,7 +9,7 @@ test('SelfDep', normal, compile_fail, ['']) test('BadTelescope4', normal, compile_fail, ['']) test('RenamingStar', normal, compile_fail, ['']) test('T11407', normal, compile_fail, ['']) -test('T11334b', when(compiler_debugged(), expect_broken(16112)), compile_fail, ['']) +test('T11334b', normal, compile_fail, ['']) test('T11473', normal, compile_fail, ['']) test('T11471', normal, compile_fail, ['']) test('T12174', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 7976c17..1a049bb 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -115,7 +115,7 @@ test('T12610', normal, compile_fail, ['']) test('T13450', normal, compile_fail, ['']) test('T13450TH', normal, compile_fail, ['']) test('T14588', normal, compile_fail, ['']) -test('T14740', when(compiler_debugged(), expect_broken(16113)), compile_fail, ['']) +test('T14740', normal, compile_fail, ['']) test('T15209', normal, compile_fail, ['']) test('NoNumericUnderscores0', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 3f7e820..2488551 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -143,7 +143,7 @@ test('tcfail156', normal, compile_fail, ['']) test('tcfail157', normal, compile_fail, ['']) # Skip tcfail158 until Trac ticket #15899 fixes the broken test test('tcfail158', skip, compile_fail, ['']) -test('tcfail159', when(compiler_debugged(), expect_broken(16113)), compile_fail, ['']) +test('tcfail159', normal, compile_fail, ['']) test('tcfail160', normal, compile_fail, ['']) test('tcfail161', normal, compile_fail, ['']) test('tcfail162', normal, compile_fail, ['']) From git at git.haskell.org Sat Feb 16 10:33:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Feb 2019 10:33:35 +0000 (UTC) Subject: [commit: ghc] wip/parse-errors: Fix warnings and fatal parsing errors (60eb2fb) Message-ID: <20190216103335.A93083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/parse-errors Link : http://ghc.haskell.org/trac/ghc/changeset/60eb2fba1d31ca3bb1dea34c019c42db5340cb44/ghc >--------------------------------------------------------------- commit 60eb2fba1d31ca3bb1dea34c019c42db5340cb44 Author: Vladislav Zavialov Date: Sat Feb 16 03:38:21 2019 +0300 Fix warnings and fatal parsing errors >--------------------------------------------------------------- 60eb2fba1d31ca3bb1dea34c019c42db5340cb44 compiler/backpack/DriverBkp.hs | 3 +- compiler/cmm/CmmMonad.hs | 2 +- compiler/cmm/CmmParse.y | 7 +-- compiler/main/ErrUtils.hs | 10 ++++ compiler/main/GHC.hs | 16 +++--- compiler/main/HeaderInfo.hs | 7 +-- compiler/main/HscMain.hs | 36 ++++++------- compiler/main/HscTypes.hs | 9 ++-- compiler/main/InteractiveEval.hs | 8 +-- compiler/parser/Lexer.x | 55 +++++++++----------- compiler/parser/Parser.y | 30 ++++------- compiler/parser/RdrHsSyn.hs | 61 +++++++++++------------ testsuite/tests/parser/should_fail/T16270.hs | 37 ++++++++------ testsuite/tests/parser/should_fail/T16270.stderr | 39 ++++++++++++--- testsuite/tests/parser/should_fail/T16270h.hs | 13 +++++ testsuite/tests/parser/should_fail/T16270h.stderr | 11 ++++ testsuite/tests/parser/should_fail/all.T | 1 + utils/haddock | 2 +- 18 files changed, 195 insertions(+), 152 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 60eb2fba1d31ca3bb1dea34c019c42db5340cb44 From git at git.haskell.org Sun Feb 17 13:32:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Feb 2019 13:32:25 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hie-8.8' created Message-ID: <20190217133225.7E1DC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hie-8.8 Referencing: b0f82e589465479157cfbdcff2fe516294fd8d39 From git at git.haskell.org Sun Feb 17 13:32:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Feb 2019 13:32:28 +0000 (UTC) Subject: [commit: ghc] wip/hie-8.8: HIE: Save module name and module exports (b0f82e5) Message-ID: <20190217133228.8C2813A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie-8.8 Link : http://ghc.haskell.org/trac/ghc/changeset/b0f82e589465479157cfbdcff2fe516294fd8d39/ghc >--------------------------------------------------------------- commit b0f82e589465479157cfbdcff2fe516294fd8d39 Author: Matthew Pickering Date: Fri Feb 15 10:14:29 2019 +0000 HIE: Save module name and module exports >--------------------------------------------------------------- b0f82e589465479157cfbdcff2fe516294fd8d39 compiler/hieFile/HieAst.hs | 12 ++++++++++-- compiler/hieFile/HieTypes.hs | 13 ++++++++++++- compiler/main/HscMain.hs | 5 +++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 432dc36..6dee180 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -32,6 +32,8 @@ import SrcLoc import TcHsSyn ( hsPatType ) import Type ( Type ) import Var ( Id, Var, setVarName, varName, varType ) +import TcRnTypes +import MkIface ( mkIfaceExports ) import HieTypes import HieUtils @@ -85,17 +87,23 @@ modifyState = foldr go id type HieM = ReaderT HieState Hsc -- | Construct an 'HieFile' from the outputs of the typechecker. -mkHieFile :: ModSummary -> TypecheckedSource -> RenamedSource -> Hsc HieFile +mkHieFile :: ModSummary + -> TcGblEnv + -> RenamedSource -> Hsc HieFile mkHieFile ms ts rs = do - (asts', arr) <- getCompressedAsts ts rs + let tc_binds = tcg_binds ts + (asts', arr) <- getCompressedAsts tc_binds rs let Just src_file = ml_hs_file $ ms_location ms src <- liftIO $ BS.readFile src_file return $ HieFile { hie_version = curHieVersion , hie_ghc_version = BSC.pack cProjectVersion , hie_hs_file = src_file + , hie_module = ms_mod ms , hie_types = arr , hie_asts = asts' + -- mkIfaceExports sorts the AvailInfos for stability + , hie_exports = mkIfaceExports (tcg_exports ts) , hie_hs_src = src } diff --git a/compiler/hieFile/HieTypes.hs b/compiler/hieFile/HieTypes.hs index c20887f..1b1d8c5 100644 --- a/compiler/hieFile/HieTypes.hs +++ b/compiler/hieFile/HieTypes.hs @@ -10,10 +10,11 @@ import GhcPrelude import Binary import FastString ( FastString ) import IfaceType -import Module ( ModuleName ) +import Module ( ModuleName, Module ) import Name ( Name ) import Outputable hiding ( (<>) ) import SrcLoc ( RealSrcSpan ) +import Avail import qualified Data.Array as A import qualified Data.Map as M @@ -56,6 +57,9 @@ data HieFile = HieFile , hie_hs_file :: FilePath -- ^ Initial Haskell source file path + , hie_module :: Module + -- ^ The module this HIE file is for + , hie_types :: A.Array TypeIndex HieTypeFlat -- ^ Types referenced in the 'hie_asts'. -- @@ -64,6 +68,9 @@ data HieFile = HieFile , hie_asts :: HieASTs TypeIndex -- ^ Type-annotated abstract syntax trees + , hie_exports :: [AvailInfo] + -- ^ The names that this module exports + , hie_hs_src :: ByteString -- ^ Raw bytes of the initial Haskell source } @@ -73,8 +80,10 @@ instance Binary HieFile where put_ bh $ hie_version hf put_ bh $ hie_ghc_version hf put_ bh $ hie_hs_file hf + put_ bh $ hie_module hf put_ bh $ hie_types hf put_ bh $ hie_asts hf + put_ bh $ hie_exports hf put_ bh $ hie_hs_src hf get bh = HieFile @@ -84,6 +93,8 @@ instance Binary HieFile where <*> get bh <*> get bh <*> get bh + <*> get bh + <*> get bh {- diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 9a4dd4a..674afc9 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -408,8 +408,9 @@ extract_renamed_stuff mod_summary tc_result = do -- Create HIE files when (gopt Opt_WriteHie dflags) $ do - hieFile <- mkHieFile mod_summary (tcg_binds tc_result) - (fromJust rn_info) + -- I assume this fromJust is safe because `-fwrite-hie-file` + -- enables the option which keeps the renamed source. + hieFile <- mkHieFile mod_summary tc_result (fromJust rn_info) let out_file = ml_hie_file $ ms_location mod_summary liftIO $ writeHieFile out_file hieFile From git at git.haskell.org Tue Feb 19 14:12:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:12:54 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ww-noinline' created Message-ID: <20190219141254.BD0A33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ww-noinline Referencing: 70ebc57eddc0951128184482aabe30fb84aada70 From git at git.haskell.org Tue Feb 19 14:12:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:12:56 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ci-i386' created Message-ID: <20190219141256.BC0783A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ci-i386 Referencing: e7aec9c9226ab684dd072dadeb3c7fa87f439e43 From git at git.haskell.org Tue Feb 19 14:12:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:12:58 +0000 (UTC) Subject: [commit: ghc] branch 'wip/linters' created Message-ID: <20190219141258.BD2E83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/linters Referencing: 24c040202a3c948631625b73e3edcb5adac66004 From git at git.haskell.org Tue Feb 19 14:13:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:01 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Minor documentation fix in GHC.ForeignPtr (7752fa5) Message-ID: <20190219141301.CBF7F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/7752fa54909a10b565a80a5ca8b751e174b14282/ghc >--------------------------------------------------------------- commit 7752fa54909a10b565a80a5ca8b751e174b14282 Author: Ömer Sinan Ağacan Date: Wed Feb 13 13:52:17 2019 +0300 Minor documentation fix in GHC.ForeignPtr >--------------------------------------------------------------- 7752fa54909a10b565a80a5ca8b751e174b14282 libraries/base/GHC/ForeignPtr.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libraries/base/GHC/ForeignPtr.hs b/libraries/base/GHC/ForeignPtr.hs index dc3b88a..965ebb0 100644 --- a/libraries/base/GHC/ForeignPtr.hs +++ b/libraries/base/GHC/ForeignPtr.hs @@ -250,7 +250,7 @@ mallocPlainForeignPtrAlignedBytes (I# size) (I# align) = IO $ \s -> } addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO () --- ^This function adds a finalizer to the given foreign object. The +-- ^ This function adds a finalizer to the given foreign object. The -- finalizer will run /before/ all other finalizers for the same -- object which have already been registered. addForeignPtrFinalizer (FunPtr fp) (ForeignPtr p c) = case c of @@ -269,10 +269,8 @@ addForeignPtrFinalizer (FunPtr fp) (ForeignPtr p c) = case c of addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO () --- ^ Like 'addForeignPtrFinalizerEnv' but allows the finalizer to be --- passed an additional environment parameter to be passed to the --- finalizer. The environment passed to the finalizer is fixed by the --- second argument to 'addForeignPtrFinalizerEnv' +-- ^ Like 'addForeignPtrFinalizer' but the finalizer is passed an additional +-- environment parameter. addForeignPtrFinalizerEnv (FunPtr fp) (Ptr ep) (ForeignPtr p c) = case c of PlainForeignPtr r -> insertCFinalizer r fp 1# ep p () MallocPtr _ r -> insertCFinalizer r fp 1# ep p c From git at git.haskell.org Tue Feb 19 14:13:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:04 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Remove `parallel` as a submodule (3cb063c) Message-ID: <20190219141304.D50563A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/3cb063c805ec841ca33b8371ef8aba9329221b6c/ghc >--------------------------------------------------------------- commit 3cb063c805ec841ca33b8371ef8aba9329221b6c Author: Alec Theriault Date: Wed Feb 13 07:44:58 2019 -0800 Remove `parallel` as a submodule `parallel` is used in exactly one place in the GHC tree: the T2317 test. It seems almost by accident that it is a submodule; libraries needed only for tests should net be included as submodules (see `QuickCheck`, `async`, `haskell98`, `regex-compat`, `utf8-string`, `vector` and more for examples). T2317 will now get run only when `parallel` is installed instead of `parallel` being required for the testsuite to run. >--------------------------------------------------------------- 3cb063c805ec841ca33b8371ef8aba9329221b6c .gitmodules | 4 ---- ghc.mk | 4 ---- hadrian/src/Base.hs | 2 +- hadrian/src/Packages.hs | 5 ++--- hadrian/src/Rules/SourceDist.hs | 1 - hadrian/src/Settings/Default.hs | 1 - libraries/parallel | 1 - packages | 1 - 8 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.gitmodules b/.gitmodules index d2ab9ed..5700a96 100644 --- a/.gitmodules +++ b/.gitmodules @@ -83,10 +83,6 @@ url = ../packages/unix.git ignore = untracked branch = 2.7 -[submodule "libraries/parallel"] - path = libraries/parallel - url = ../packages/parallel.git - ignore = untracked [submodule "libraries/stm"] path = libraries/stm url = ../packages/stm.git diff --git a/ghc.mk b/ghc.mk index 143afb9..47d260d 100644 --- a/ghc.mk +++ b/ghc.mk @@ -1206,9 +1206,6 @@ GIT_COMMIT_ID: sdist-ghc-prep-tree : VERSION GIT_COMMIT_ID -# Extra packages which shouldn't be in the source distribution: see #8801 -EXTRA_PACKAGES=parallel - .PHONY: sdist-ghc-prep-tree sdist-ghc-prep-tree : $(call removeTrees,$(SRC_DIST_GHC_ROOT)) @@ -1223,7 +1220,6 @@ sdist-ghc-prep-tree : $(call removeTrees,$(SRC_DIST_GHC_DIR)/libraries/stamp/) $(call removeTrees,$(SRC_DIST_GHC_DIR)/compiler/stage[123]) $(call removeFiles,$(SRC_DIST_GHC_DIR)/mk/build.mk) - for i in $(EXTRA_PACKAGES); do $(RM) $(RM_OPTS_REC) $(SRC_DIST_GHC_DIR)/libraries/$$i/; done cd $(SRC_DIST_GHC_DIR) && "$(FIND)" $(SRC_DIST_GHC_DIRS) \( -name .git -o -name "autom4te*" -o -name "*~" -o -name "\#*" -o -name ".\#*" -o -name "log" -o -name "*-SAVE" -o -name "*.orig" -o -name "*.rej" \) -print | "$(XARGS)" $(XARGS_OPTS) "$(RM)" $(RM_OPTS_REC) # Add files generated by alex and happy. diff --git a/hadrian/src/Base.hs b/hadrian/src/Base.hs index 277d614..77eec0a 100644 --- a/hadrian/src/Base.hs +++ b/hadrian/src/Base.hs @@ -34,7 +34,7 @@ import Control.Monad.Reader import Data.List.Extra import Data.Maybe import Data.Semigroup -import Development.Shake hiding (parallel, unit, (*>), Normal) +import Development.Shake hiding (unit, (*>), Normal) import Development.Shake.Classes import Development.Shake.FilePath import Development.Shake.Util diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs index f32661e..02dc134 100644 --- a/hadrian/src/Packages.hs +++ b/hadrian/src/Packages.hs @@ -6,7 +6,7 @@ module Packages ( filepath, genapply, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact, ghcHeap, ghci, ghcPkg, ghcPrim, ghcSplit, haddock, haskeline, hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, - libiserv, mtl, parsec, parallel, pretty, primitive, process, rts, runGhc, + libiserv, mtl, parsec, pretty, primitive, process, rts, runGhc, stm, templateHaskell, terminfo, text, time, timeout, touchy, transformers, unlit, unix, win32, xhtml, ghcPackages, isGhcPackage, @@ -35,7 +35,7 @@ ghcPackages = , filepath, genapply, genprimopcode, ghc, ghcBoot, ghcBootTh, ghcCompact , ghcHeap, ghci, ghcPkg, ghcPrim, haddock, haskeline, hsc2hs, hp2ps , hpc, hpcBin, integerGmp, integerSimple, iserv, libffi, libiserv, mtl - , parsec, parallel, pretty, process, rts, runGhc, stm, templateHaskell + , parsec, pretty, process, rts, runGhc, stm, templateHaskell , terminfo, text, time, touchy, transformers, unlit, unix, win32, xhtml , timeout ] @@ -82,7 +82,6 @@ libffi = top "libffi" libiserv = lib "libiserv" mtl = lib "mtl" parsec = lib "parsec" -parallel = lib "parallel" pretty = lib "pretty" primitive = lib "primitive" process = lib "process" diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs index 8bec3f3..6e56c66 100644 --- a/hadrian/src/Rules/SourceDist.hs +++ b/hadrian/src/Rules/SourceDist.hs @@ -68,7 +68,6 @@ prepareTree dest = do , Test "libraries//ghc.mk" , Test "libraries//include/Hs*Config.h" , Test "libraries/dph" - , Test "libraries/parallel" , Test "libraries/primitive" , Test "libraries/random" , Test "libraries/stm" diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs index 01fc014..cec1d66 100644 --- a/hadrian/src/Settings/Default.hs +++ b/hadrian/src/Settings/Default.hs @@ -135,7 +135,6 @@ testsuitePackages = do , hp2ps , hsc2hs , iserv - , parallel , runGhc , unlit ] ++ [ timeout | win ] diff --git a/libraries/parallel b/libraries/parallel deleted file mode 160000 index 4a04f41..0000000 --- a/libraries/parallel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a04f41b7e2857ab8a09bcb8ed0b346516b0c817 diff --git a/packages b/packages index 2f4dfd1..40141ac 100644 --- a/packages +++ b/packages @@ -65,6 +65,5 @@ libraries/unix - - ssh://g libraries/Win32 - - https://github.com/haskell/win32.git libraries/xhtml - - https://github.com/haskell/xhtml.git nofib nofib - - -libraries/parallel extra - ssh://git at github.com/haskell/parallel.git libraries/stm - - ssh://git at github.com/haskell/stm.git . - ghc.git - From git at git.haskell.org Tue Feb 19 14:13:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:07 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: HIE: Save module name and module exports (69ebf5c) Message-ID: <20190219141307.DC0C83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/69ebf5cb4592b4c89e268937ef7eb96f7c9d4532/ghc >--------------------------------------------------------------- commit 69ebf5cb4592b4c89e268937ef7eb96f7c9d4532 Author: Matthew Pickering Date: Fri Feb 15 10:14:29 2019 +0000 HIE: Save module name and module exports >--------------------------------------------------------------- 69ebf5cb4592b4c89e268937ef7eb96f7c9d4532 compiler/hieFile/HieAst.hs | 12 ++++++++++-- compiler/hieFile/HieTypes.hs | 13 ++++++++++++- compiler/main/HscMain.hs | 5 +++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 0040b30..7fd217c 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -34,6 +34,8 @@ import TcHsSyn ( hsLitType, hsPatType ) import Type ( mkFunTys, Type ) import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) +import TcRnTypes +import MkIface ( mkIfaceExports ) import HieTypes import HieUtils @@ -87,17 +89,23 @@ modifyState = foldr go id type HieM = ReaderT HieState Hsc -- | Construct an 'HieFile' from the outputs of the typechecker. -mkHieFile :: ModSummary -> TypecheckedSource -> RenamedSource -> Hsc HieFile +mkHieFile :: ModSummary + -> TcGblEnv + -> RenamedSource -> Hsc HieFile mkHieFile ms ts rs = do - (asts', arr) <- getCompressedAsts ts rs + let tc_binds = tcg_binds ts + (asts', arr) <- getCompressedAsts tc_binds rs let Just src_file = ml_hs_file $ ms_location ms src <- liftIO $ BS.readFile src_file return $ HieFile { hie_version = curHieVersion , hie_ghc_version = BSC.pack cProjectVersion , hie_hs_file = src_file + , hie_module = ms_mod ms , hie_types = arr , hie_asts = asts' + -- mkIfaceExports sorts the AvailInfos for stability + , hie_exports = mkIfaceExports (tcg_exports ts) , hie_hs_src = src } diff --git a/compiler/hieFile/HieTypes.hs b/compiler/hieFile/HieTypes.hs index c20887f..1b1d8c5 100644 --- a/compiler/hieFile/HieTypes.hs +++ b/compiler/hieFile/HieTypes.hs @@ -10,10 +10,11 @@ import GhcPrelude import Binary import FastString ( FastString ) import IfaceType -import Module ( ModuleName ) +import Module ( ModuleName, Module ) import Name ( Name ) import Outputable hiding ( (<>) ) import SrcLoc ( RealSrcSpan ) +import Avail import qualified Data.Array as A import qualified Data.Map as M @@ -56,6 +57,9 @@ data HieFile = HieFile , hie_hs_file :: FilePath -- ^ Initial Haskell source file path + , hie_module :: Module + -- ^ The module this HIE file is for + , hie_types :: A.Array TypeIndex HieTypeFlat -- ^ Types referenced in the 'hie_asts'. -- @@ -64,6 +68,9 @@ data HieFile = HieFile , hie_asts :: HieASTs TypeIndex -- ^ Type-annotated abstract syntax trees + , hie_exports :: [AvailInfo] + -- ^ The names that this module exports + , hie_hs_src :: ByteString -- ^ Raw bytes of the initial Haskell source } @@ -73,8 +80,10 @@ instance Binary HieFile where put_ bh $ hie_version hf put_ bh $ hie_ghc_version hf put_ bh $ hie_hs_file hf + put_ bh $ hie_module hf put_ bh $ hie_types hf put_ bh $ hie_asts hf + put_ bh $ hie_exports hf put_ bh $ hie_hs_src hf get bh = HieFile @@ -84,6 +93,8 @@ instance Binary HieFile where <*> get bh <*> get bh <*> get bh + <*> get bh + <*> get bh {- diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 9a4dd4a..674afc9 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -408,8 +408,9 @@ extract_renamed_stuff mod_summary tc_result = do -- Create HIE files when (gopt Opt_WriteHie dflags) $ do - hieFile <- mkHieFile mod_summary (tcg_binds tc_result) - (fromJust rn_info) + -- I assume this fromJust is safe because `-fwrite-hie-file` + -- enables the option which keeps the renamed source. + hieFile <- mkHieFile mod_summary tc_result (fromJust rn_info) let out_file = ml_hie_file $ ms_location mod_summary liftIO $ writeHieFile out_file hieFile From git at git.haskell.org Tue Feb 19 14:13:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:10 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Cmm: Promote stack arguments to word size (af7b0fd) Message-ID: <20190219141310.E85053A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2/ghc >--------------------------------------------------------------- commit af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2 Author: Peter Trommler Date: Thu Jan 31 09:43:08 2019 +0100 Cmm: Promote stack arguments to word size Smaller than word size integers must be promoted to word size when passed on the stack. While on little endian systems we can get away with writing a small integer to a word size stack slot and read it as a word ignoring the upper bits, on big endian systems a small integer write ends up in the most significant bits and a word size read that ignores the upper bits delivers a random value. On little endian systems a smaller than word size write to the stack might be more efficient but that decision is system specific and should be done as an optimization in the respective backends. Fixes #16258 >--------------------------------------------------------------- af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2 compiler/cmm/MkGraph.hs | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs index bcd03bf..41526c7 100644 --- a/compiler/cmm/MkGraph.hs +++ b/compiler/cmm/MkGraph.hs @@ -327,7 +327,17 @@ copyIn dflags conv area formals extra_stk ci (reg, RegisterParam r) = CmmAssign (CmmLocal reg) (CmmReg (CmmGlobal r)) - ci (reg, StackParam off) = + ci (reg, StackParam off) + | isBitsType $ localRegType reg + , typeWidth (localRegType reg) < wordWidth dflags = + let + stack_slot = (CmmLoad (CmmStackSlot area off) (cmmBits $ wordWidth dflags)) + local = CmmLocal reg + width = cmmRegWidth dflags local + expr = CmmMachOp (MO_XX_Conv (wordWidth dflags) width) [stack_slot] + in CmmAssign local expr + + | otherwise = CmmAssign (CmmLocal reg) (CmmLoad (CmmStackSlot area off) ty) where ty = localRegType reg @@ -377,8 +387,16 @@ copyOutOflow dflags conv transfer area actuals updfr_off extra_stack_stuff co (v, RegisterParam r) (rs, ms) = (r:rs, mkAssign (CmmGlobal r) v <*> ms) + -- See Note [Width of parameters] co (v, StackParam off) (rs, ms) - = (rs, mkStore (CmmStackSlot area off) v <*> ms) + = (rs, mkStore (CmmStackSlot area off) (value v) <*> ms) + + width v = cmmExprWidth dflags v + value v + | isBitsType $ cmmExprType dflags v + , width v < wordWidth dflags = + CmmMachOp (MO_XX_Conv (width v) (wordWidth dflags)) [v] + | otherwise = v (setRA, init_offset) = case area of @@ -405,22 +423,26 @@ copyOutOflow dflags conv transfer area actuals updfr_off extra_stack_stuff -- Note [Width of parameters] -- --- Consider passing a small (< word width) primitive like Int8# to a function --- through a register. It's actually non-trivial to do this without --- extending/narrowing: +-- Consider passing a small (< word width) primitive like Int8# to a function. +-- It's actually non-trivial to do this without extending/narrowing: -- * Global registers are considered to have native word width (i.e., 64-bits on --- x86-64), so CmmLint would complain if we assigne an 8-bit parameter to a +-- x86-64), so CmmLint would complain if we assigned an 8-bit parameter to a -- global register. -- * Same problem exists with LLVM IR. -- * Lowering gets harder since on x86-32 not every register exposes its lower -- 8 bits (e.g., for %eax we can use %al, but there isn't a corresponding -- 8-bit register for %edi). So we would either need to extend/narrow anyway, -- or complicate the calling convention. +-- * Passing a small integer in a stack slot, which has native word width, +-- requires extending to word width when writing to the stack and narrowing +-- when reading off the stack (see #16258). -- So instead, we always extend every parameter smaller than native word width -- in copyOutOflow and then truncate it back to the expected width in copyIn. -- Note that we do this in cmm using MO_XX_Conv to avoid requiring -- zero-/sign-extending - it's up to a backend to handle this in a most --- efficient way (e.g., a simple register move) +-- efficient way (e.g., a simple register move or a smaller size store). +-- This convention (of ignoring the upper bits) is different from some C ABIs, +-- e.g. all PowerPC ELF ABIs, that require sign or zero extending parameters. -- -- There was some discussion about this on this PR: -- https://github.com/ghc-proposals/ghc-proposals/pull/74 From git at git.haskell.org Tue Feb 19 14:13:14 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:14 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Run some of Haddock's tests in the testsuite (4a09d30) Message-ID: <20190219141314.B04E43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/4a09d30bffa0c9df10ab5e7d22293c1f39c75728/ghc >--------------------------------------------------------------- commit 4a09d30bffa0c9df10ab5e7d22293c1f39c75728 Author: Alec Theriault Date: Mon Feb 4 22:06:07 2019 -0800 Run some of Haddock's tests in the testsuite The 4 main testsuites in Haddock don't have many dependencies, but are regularly broken in small ways by changes to the GHC AST or the GHC API. The main gotcha is that we'll have to make sure that `haddock-test` and the test suite don't add modules without modifying this test. Then again, if that happens, the test will fail and someone will noticed. >--------------------------------------------------------------- 4a09d30bffa0c9df10ab5e7d22293c1f39c75728 testsuite/tests/haddock/haddock_testsuite/Makefile | 70 ++++++++++++++++++++++ testsuite/tests/haddock/haddock_testsuite/all.T | 19 ++++++ utils/haddock | 2 +- 3 files changed, 90 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/haddock/haddock_testsuite/Makefile b/testsuite/tests/haddock/haddock_testsuite/Makefile new file mode 100644 index 0000000..59a4a17 --- /dev/null +++ b/testsuite/tests/haddock/haddock_testsuite/Makefile @@ -0,0 +1,70 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Remark: these should be synced up with the testsuites listed in `utils/haddock/haddock.cabal` +# See #16206 + + +# Corresponds to files in the `haddock-test` package +haddockTest=$(TOP)/../utils/haddock/haddock-test/src/Test/Haddock.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Config.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Utils.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Process.hs + +# Corresponds to the `html-test` testsuite +.PHONY: htmlTest +htmlTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o html-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/html-test/Main.hs + ./html-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `latex-test` testsuite +.PHONY: latexTest +latexTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o latex-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/latex-test/Main.hs + ./latex-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `hoogle-test` testsuite +.PHONY: hoogleTest +hoogleTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o hoogle-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/hoogle-test/Main.hs + ./hoogle-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `hypsrc-test` testsuite +.PHONY: hypsrcTest +hypsrcTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o hypsrc-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/hypsrc-test/Main.hs + ./hypsrc-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log diff --git a/testsuite/tests/haddock/haddock_testsuite/all.T b/testsuite/tests/haddock/haddock_testsuite/all.T new file mode 100644 index 0000000..1aa387b --- /dev/null +++ b/testsuite/tests/haddock/haddock_testsuite/all.T @@ -0,0 +1,19 @@ +test('haddockHtmlTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['htmlTest']) + +test('haddockLatexTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['latexTest']) + +test('haddockHoogleTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['hoogleTest']) + +test('haddockHypsrcTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['hypsrcTest']) diff --git a/utils/haddock b/utils/haddock index 3ee6526..33cdd81 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 3ee6526d4ae7bf4deb7cd1caf24b3d7355573576 +Subproject commit 33cdd810e4222b92bc22f7f5b7196fc97fd3cea6 From git at git.haskell.org Tue Feb 19 14:13:17 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:17 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Testsuite: implement use_specs. (0fff3ae) Message-ID: <20190219141317.D030C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/0fff3ae6d2b821cacf33193b85307588402f1748/ghc >--------------------------------------------------------------- commit 0fff3ae6d2b821cacf33193b85307588402f1748 Author: Tamar Christina Date: Sun Jan 27 20:18:24 2019 +0000 Testsuite: implement use_specs. >--------------------------------------------------------------- 0fff3ae6d2b821cacf33193b85307588402f1748 testsuite/driver/testglobals.py | 3 +++ testsuite/driver/testlib.py | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index b3c9a55..054fd71 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -223,6 +223,9 @@ class TestOptions: # the stdin file that this test will use (empty for .stdin) self.stdin = '' + # Set the expected stderr/stdout. '' means infer from test name. + self.use_specs = {} + # don't compare output self.ignore_stdout = False self.ignore_stderr = False diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index dd66340..e800772 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -189,6 +189,28 @@ def ignore_stderr(name, opts): def combined_output( name, opts ): opts.combined_output = True +def use_specs( specs ): + """ + use_specs allows one to override files based on suffixes. e.g. 'stdout', + 'stderr', 'asm', 'prof.sample', etc. + + Example use_specs({'stdout' : 'prof002.stdout'}) to make the test re-use + prof002.stdout. + + Full Example: + test('T5889', [only_ways(['normal']), req_profiling, + extra_files(['T5889/A.hs', 'T5889/B.hs']), + use_specs({'stdout' : 'prof002.stdout'})], + multimod_compile, + ['A B', '-O -prof -fno-prof-count-entries -v0']) + + """ + return lambda name, opts, s=specs: _use_specs( name, opts, s ) + +def _use_specs( name, opts, specs ): + opts.extra_files.extend(specs.values ()) + opts.use_specs = specs + # ----- def expect_fail_for( ways ): @@ -2001,6 +2023,10 @@ def in_srcdir(name, suffix=''): # def find_expected_file(name, suff): basename = add_suffix(name, suff) + # Override the basename if the user has specified one, this will then be + # subjected to the same name mangling scheme as normal to allow platform + # specific overrides to work. + basename = getTestOpts().use_specs.get (suff, basename) files = [basename + ws + plat for plat in ['-' + config.platform, '-' + config.os, ''] From git at git.haskell.org Tue Feb 19 14:13:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:20 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Get rid of tcm_smart from TyCoMapper (1f1b9e3) Message-ID: <20190219141320.E0EA53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/1f1b9e356a873ec7da84cdac2a7850ecb2b32ea9/ghc >--------------------------------------------------------------- commit 1f1b9e356a873ec7da84cdac2a7850ecb2b32ea9 Author: Simon Peyton Jones Date: Fri Feb 15 09:56:06 2019 +0000 Get rid of tcm_smart from TyCoMapper Following a succession of refactorings of the type checker, culminating in the patch Make a smart mkAppTyM we have got rid of mkNakedAppTy etc. And that in turn meant that the tcm_smart field of the generic TyCoMapper (in Type.hs) was entirely unused. It was always set to True. So this patch just gets rid of it completely. Less code, less complexity, and more efficient because fewer higher-order function calls. Everyone wins. No change in behaviour; this does not cure any bugs! >--------------------------------------------------------------- 1f1b9e356a873ec7da84cdac2a7850ecb2b32ea9 compiler/typecheck/TcHsSyn.hs | 9 +++--- compiler/typecheck/TcHsType.hs | 3 +- compiler/typecheck/TcMType.hs | 18 ++++++------ compiler/types/Type.hs | 64 ++++++++++++++++-------------------------- 4 files changed, 39 insertions(+), 55 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 1f1b9e356a873ec7da84cdac2a7850ecb2b32ea9 From git at git.haskell.org Tue Feb 19 14:13:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:24 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/linters, wip/ww-noinline: Fix warnings and fatal parsing errors (1ffee94) Message-ID: <20190219141324.DA0A03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/linters,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/1ffee940a011fc75f40514696a747dd1f3d4f342/ghc >--------------------------------------------------------------- commit 1ffee940a011fc75f40514696a747dd1f3d4f342 Author: Vladislav Zavialov Date: Sat Feb 16 03:38:21 2019 +0300 Fix warnings and fatal parsing errors >--------------------------------------------------------------- 1ffee940a011fc75f40514696a747dd1f3d4f342 compiler/backpack/DriverBkp.hs | 3 +- compiler/cmm/CmmMonad.hs | 2 +- compiler/cmm/CmmParse.y | 7 +- compiler/main/ErrUtils.hs | 10 +++ compiler/main/GHC.hs | 16 ++-- compiler/main/HeaderInfo.hs | 7 +- compiler/main/HscMain.hs | 36 ++++----- compiler/main/HscTypes.hs | 9 ++- compiler/main/InteractiveEval.hs | 8 +- compiler/parser/Lexer.x | 85 +++++++++++++--------- compiler/parser/Parser.y | 30 +++----- compiler/parser/RdrHsSyn.hs | 61 ++++++++-------- testsuite/tests/parser/should_fail/T16270.hs | 37 ++++++---- testsuite/tests/parser/should_fail/T16270.stderr | 39 ++++++++-- testsuite/tests/parser/should_fail/T16270h.hs | 13 ++++ testsuite/tests/parser/should_fail/T16270h.stderr | 11 +++ testsuite/tests/parser/should_fail/T3095.hs | 4 +- testsuite/tests/parser/should_fail/T3095.stderr | 8 +- testsuite/tests/parser/should_fail/T9225.stderr | 4 +- testsuite/tests/parser/should_fail/all.T | 1 + .../tests/rename/should_fail/rnfail052.stderr | 10 +++ utils/haddock | 2 +- 22 files changed, 246 insertions(+), 157 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 1ffee940a011fc75f40514696a747dd1f3d4f342 From git at git.haskell.org Tue Feb 19 14:13:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:27 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/ww-noinline: Uphold AvailTC Invariant for associated data fams (2a43164) Message-ID: <20190219141327.DDDBE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/2a431640d199b164ca5d233684d4f4bdaf5ca021/ghc >--------------------------------------------------------------- commit 2a431640d199b164ca5d233684d4f4bdaf5ca021 Author: Alec Theriault Date: Fri Feb 1 16:26:43 2019 -0800 Uphold AvailTC Invariant for associated data fams The AvailTC was not be upheld for explicit export module export lists when the module contains associated data families. module A (module A) where class C a where { data T a } instance C () where { data T () = D } Used to (incorrectly) report avails as `[C{C, T;}, T{D;}]`. Note that although `T` is exported, the avail where it is the parent does _not_ list it as its first element. This avail is now correctly listed as `[C{C, T;}, T{T, D;}]`. This was induces a [crash in Haddock][0]. See #16077. [0]: https://github.com/haskell/haddock/issues/979 >--------------------------------------------------------------- 2a431640d199b164ca5d233684d4f4bdaf5ca021 compiler/basicTypes/Avail.hs | 42 +++++++++++++++---------------- compiler/typecheck/TcRnExports.hs | 52 +++++++++++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/compiler/basicTypes/Avail.hs b/compiler/basicTypes/Avail.hs index cefa934..291c95a 100644 --- a/compiler/basicTypes/Avail.hs +++ b/compiler/basicTypes/Avail.hs @@ -47,27 +47,27 @@ import Data.Function -- ----------------------------------------------------------------------------- -- The AvailInfo type --- | Records what things are "available", i.e. in scope -data AvailInfo = Avail Name -- ^ An ordinary identifier in scope - | AvailTC Name - [Name] - [FieldLabel] - -- ^ A type or class in scope. Parameters: - -- - -- 1) The name of the type or class - -- 2) The available pieces of type or class, - -- excluding field selectors. - -- 3) The record fields of the type - -- (see Note [Representing fields in AvailInfo]). - -- - -- The AvailTC Invariant: - -- * If the type or class is itself - -- to be in scope, it must be - -- *first* in this list. Thus, - -- typically: @AvailTC Eq [Eq, ==, \/=]@ - deriving( Eq, Data ) - -- Equality used when deciding if the - -- interface has changed +-- | Records what things are \"available\", i.e. in scope +data AvailInfo + + -- | An ordinary identifier in scope + = Avail Name + + -- | A type or class in scope + -- + -- The __AvailTC Invariant__: If the type or class is itself to be in scope, + -- it must be /first/ in this list. Thus, typically: + -- + -- > AvailTC Eq [Eq, ==, \/=] [] + | AvailTC + Name -- ^ The name of the type or class + [Name] -- ^ The available pieces of type or class, + -- excluding field selectors. + [FieldLabel] -- ^ The record fields of the type + -- (see Note [Representing fields in AvailInfo]). + + deriving ( Eq -- ^ Used when deciding if the interface has changed + , Data ) -- | A collection of 'AvailInfo' - several things that are \"available\" type Avails = [AvailInfo] diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs index 28c1773..b3baf6c 100644 --- a/compiler/typecheck/TcRnExports.hs +++ b/compiler/typecheck/TcRnExports.hs @@ -89,6 +89,41 @@ At one point I implemented a compromise: But the compromise seemed too much of a hack, so we backed it out. You just have to use an explicit export list: module M( F(..) ) where ... + +Note [Avails of associated data families] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Suppose you have (Trac #16077) + + {-# LANGUAGE TypeFamilies #-} + module A (module A) where + + class C a where { data T a } + instance C () where { data T () = D } + +Because @A@ is exported explicitly, GHC tries to produce an export list +from the @GlobalRdrEnv at . In this case, it pulls out the following: + + [ C defined at A.hs:4:1 + , T parent:C defined at A.hs:4:23 + , D parent:T defined at A.hs:5:35 ] + +If map these directly into avails, (via 'availFromGRE'), we get +@[C{C;}, C{T;}, T{D;}]@, which eventually gets merged into @[C{C, T;}, T{D;}]@. +That's not right, because @T{D;}@ violates the AvailTC invariant: @T@ is +exported, but it isn't the first entry in the avail! + +We work around this issue by expanding GREs where the parent and child +are both type constructors into two GRES. + + T parent:C defined at A.hs:4:23 + + => + + [ T parent:C defined at A.hs:4:23 + , T defined at A.hs:4:23 ] + +Then, we get @[C{C;}, C{T;}, T{T;}, T{D;}]@, which eventually gets merged +into @[C{C, T;}, T{T, D;}]@ (which satsifies the AvailTC invariant). -} data ExportAccum -- The type of the accumulating parameter of @@ -175,12 +210,12 @@ tcRnExports explicit_mod exports ; return new_tcg_env } exports_from_avail :: Maybe (Located [LIE GhcPs]) - -- Nothing => no explicit export list + -- ^ 'Nothing' means no explicit export list -> GlobalRdrEnv -> ImportAvails - -- Imported modules; this is used to test if a - -- 'module Foo' export is valid (it's not valid - -- if we didn't import Foo!) + -- ^ Imported modules; this is used to test if a + -- @module Foo@ export is valid (it's not valid + -- if we didn't import @Foo@!) -> Module -> RnM (Maybe [(LIE GhcRn, Avails)], Avails) -- (Nothing, _) <=> no explicit export list @@ -230,6 +265,11 @@ exports_from_avail (Just (dL->L _ rdr_items)) rdr_env imports this_mod kids_env :: NameEnv [GlobalRdrElt] kids_env = mkChildEnv (globalRdrEnvElts rdr_env) + -- See Note [Avails of associated data families] + expand_tyty_gre :: GlobalRdrElt -> [GlobalRdrElt] + expand_tyty_gre (gre @ GRE { gre_name = me, gre_par = ParentIs p }) + | isTyConName p, isTyConName me = [gre, gre{ gre_par = NoParent }] + expand_tyty_gre gre = [gre] imported_modules = [ imv_name imv | xs <- moduleEnvElts $ imp_mods imports @@ -248,7 +288,9 @@ exports_from_avail (Just (dL->L _ rdr_items)) rdr_env imports this_mod = do { let { exportValid = (mod `elem` imported_modules) || (moduleName this_mod == mod) ; gre_prs = pickGREsModExp mod (globalRdrEnvElts rdr_env) - ; new_exports = map (availFromGRE . fst) gre_prs + ; new_exports = [ availFromGRE gre' + | (gre, _) <- gre_prs + , gre' <- expand_tyty_gre gre ] ; all_gres = foldr (\(gre1,gre2) gres -> gre1 : gre2 : gres) [] gre_prs ; mods = addOneToUniqSet earlier_mods mod } From git at git.haskell.org Tue Feb 19 14:13:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:30 +0000 (UTC) Subject: [commit: ghc] wip/linters: Run linters on merge requests (24c0402) Message-ID: <20190219141330.DE2C43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/linters Link : http://ghc.haskell.org/trac/ghc/changeset/24c040202a3c948631625b73e3edcb5adac66004/ghc >--------------------------------------------------------------- commit 24c040202a3c948631625b73e3edcb5adac66004 Author: Matthew Pickering Date: Mon Feb 18 17:28:39 2019 +0000 Run linters on merge requests It seems that it has failed to execute at all since it was implemented. We now run the linters on merge requests. >--------------------------------------------------------------- 24c040202a3c948631625b73e3edcb5adac66004 .gitlab-ci.yml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b630d9f..de7e733 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,11 +9,17 @@ before_script: - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true" stages: - - lint - build - full-build - cleanup # See Note [Cleanup on Windows] +.only-default: &only-default + only: + - master + - merge_requests + - tags + - branches + ############################################################ # Runner Tags ############################################################ @@ -31,27 +37,34 @@ stages: ############################################################ ghc-linters: - stage: lint + stage: build image: ghcci/linters:0.1 script: - - | - if [ -n "$CI_MERGE_REQUEST_ID" ]; then - base="$(git merge-base $CI_MERGE_REQUEST_BRANCH_NAME HEAD)" - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA) - submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA) - validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA) - .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA - .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA - fi + - git fetch origin + - git checkout "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" + - git reset --hard "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" + - echo "$CI_MERGE_REQUEST_ID" + - echo "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" + - echo "$CI_COMMIT_SHA" + - base="$(git merge-base $CI_MERGE_REQUEST_TARGET_BRANCH_NAME $CI_COMMIT_SHA)" + - echo $base + # - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA) + - validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA) + - .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA + - .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA + - submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA) dependencies: [] tags: - lint + only: + - merge_requests ############################################################ # Validation via Pipelines (hadrian) ############################################################ .validate-hadrian: + <<: *only-default allow_failure: true script: - git clean -xdf && git submodule foreach git clean -xdf @@ -86,6 +99,7 @@ validate-x86_64-linux-deb8-hadrian: ############################################################ .validate: + <<: *only-default variables: TEST_TYPE: test before_script: @@ -336,6 +350,7 @@ validate-x86_64-linux-deb9-unreg: ############################################################ .validate-windows: + <<: *only-default before_script: - git clean -xdf - git submodule foreach git clean -xdf @@ -432,6 +447,7 @@ validate-x86_64-windows: # See Note [Cleanup after shell executor] cleanup-windows: + <<: *only-default stage: cleanup tags: - x86_64-windows @@ -454,6 +470,7 @@ cleanup-windows: # See Note [Cleanup after shell executor] cleanup-darwin: + <<: *only-default stage: cleanup tags: - x86_64-darwin From git at git.haskell.org Tue Feb 19 14:13:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:33 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386, wip/ww-noinline: Fix Haddock comment for Integer datatype (129a800) Message-ID: <20190219141333.E83A33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/ci-i386,wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/129a800dd01bff93f64c21bc22a4609cb26fc571/ghc >--------------------------------------------------------------- commit 129a800dd01bff93f64c21bc22a4609cb26fc571 Author: Alexandre Baldé Date: Thu Feb 7 12:31:44 2019 +0000 Fix Haddock comment for Integer datatype Move implementation notes for Integer to Haddock named section Revert documentation named chunk change [skip ci] Haddock's named chunk feature was not used correctly in this case, as it cannot export only parts of a Haddock top level comment. As such, it was removed and replaced by a message informing the end- user to browse the source code for detailed information. >--------------------------------------------------------------- 129a800dd01bff93f64c21bc22a4609cb26fc571 libraries/integer-gmp/src/GHC/Integer/Type.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs index 3434df2..8a1a574 100644 --- a/libraries/integer-gmp/src/GHC/Integer/Type.hs +++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs @@ -136,13 +136,17 @@ instance Eq BigNat where instance Ord BigNat where compare = compareBigNat --- | Invariant: 'Jn#' and 'Jp#' are used iff value doesn't fit in 'S#' +-- [Implementation notes] +-- +-- Invariant: 'Jn#' and 'Jp#' are used iff value doesn't fit in 'S#' -- -- Useful properties resulting from the invariants: -- -- - @abs ('S#' _) <= abs ('Jp#' _)@ -- - @abs ('S#' _) < abs ('Jn#' _)@ --- + +-- | Arbitrary precision integers. For more information about this datatype, +-- see the comments in its implementation. data Integer = S# !Int# -- ^ iff value in @[minBound::'Int', maxBound::'Int']@ range | Jp# {-# UNPACK #-} !BigNat From git at git.haskell.org Tue Feb 19 14:13:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:37 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: Look through newtype wrappers (Trac #16254) (7833cf4) Message-ID: <20190219141337.BB7F63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/7833cf407d1f608bebb1d38bb99d3035d8d735e6/ghc >--------------------------------------------------------------- commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6 Author: Krzysztof Gogolewski Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) exprIsConApp_maybe could detect that I# 10 is a constructor application, but not that Size (I# 10) is, because it was an application with a nontrivial argument. >--------------------------------------------------------------- 7833cf407d1f608bebb1d38bb99d3035d8d735e6 compiler/basicTypes/Id.hs | 9 +++- compiler/coreSyn/CoreOpt.hs | 58 +++++++++++++++++++--- compiler/coreSyn/CoreUtils.hs | 1 + testsuite/tests/simplCore/should_compile/Makefile | 5 ++ .../should_compile/{T5327.hs => T16254.hs} | 8 +-- .../should_compile/T16254.stdout} | 0 testsuite/tests/simplCore/should_compile/all.T | 1 + 7 files changed, 71 insertions(+), 11 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 7833cf407d1f608bebb1d38bb99d3035d8d735e6 From git at git.haskell.org Tue Feb 19 14:13:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:42 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: Make constructor wrappers inline only during the final phase (b78cc64) Message-ID: <20190219141342.1AB323A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/b78cc64e923716ac0512c299f42d4d0012306c05/ghc >--------------------------------------------------------------- commit b78cc64e923716ac0512c299f42d4d0012306c05 Author: Arnaud Spiwack Date: Thu Nov 15 17:14:31 2018 +0100 Make constructor wrappers inline only during the final phase For case-of-known constructor to continue triggering early, exprIsConApp_maybe is now capable of looking through lets and cases. See #15840 >--------------------------------------------------------------- b78cc64e923716ac0512c299f42d4d0012306c05 compiler/basicTypes/Id.hs | 8 +- compiler/basicTypes/MkId.hs | 26 +-- compiler/coreSyn/CoreOpt.hs | 174 ++++++++++++++++++--- compiler/coreSyn/MkCore.hs | 15 +- compiler/prelude/PrelRules.hs | 4 +- compiler/simplCore/FloatIn.hs | 2 +- compiler/simplCore/Simplify.hs | 74 +++++++-- .../tests/deSugar/should_compile/T2431.stderr | 5 +- .../tests/simplCore/should_compile/T7360.stderr | 2 +- testsuite/tests/simplCore/should_run/T15840.hs | 14 ++ .../tests/simplCore/should_run/T15840.stdout | 0 testsuite/tests/simplCore/should_run/T15840a.hs | 22 +++ .../tests/simplCore/should_run/T15840a.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 2 + 14 files changed, 288 insertions(+), 61 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 b78cc64e923716ac0512c299f42d4d0012306c05 From git at git.haskell.org Tue Feb 19 14:13:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:45 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: Disable binder swap in OccurAnal (Trac #16288) (9049bfb) Message-ID: <20190219141345.F02A03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/9049bfb1773cf114fd4e2d2d6daed46af2b73093/ghc >--------------------------------------------------------------- commit 9049bfb1773cf114fd4e2d2d6daed46af2b73093 Author: Krzysztof Gogolewski Date: Fri Feb 8 17:49:28 2019 +0100 Disable binder swap in OccurAnal (Trac #16288) >--------------------------------------------------------------- 9049bfb1773cf114fd4e2d2d6daed46af2b73093 compiler/coreSyn/CoreUnfold.hs | 43 +++++++++++++++++++--- .../dependent/should_compile/dynamic-paper.stderr | 4 +- .../tests/simplCore/should_compile/T16288A.hs | 17 +++++++++ .../tests/simplCore/should_compile/T16288B.hs | 7 ++++ .../tests/simplCore/should_compile/T16288C.hs | 13 +++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 6 files changed, 78 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 11c2a75..3ac35c9 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -47,7 +47,7 @@ import GhcPrelude import DynFlags import CoreSyn import PprCore () -- Instances -import OccurAnal ( occurAnalyseExpr ) +import OccurAnal ( occurAnalyseExpr_NoBinderSwap ) import CoreOpt import CoreArity ( manifestArity ) import CoreUtils @@ -101,7 +101,7 @@ mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding mkDFunUnfolding bndrs con ops = DFunUnfolding { df_bndrs = bndrs , df_con = con - , df_args = map occurAnalyseExpr ops } + , df_args = map occurAnalyseExpr_NoBinderSwap ops } -- See Note [Occurrence analysis of unfoldings] mkWwInlineRule :: DynFlags -> CoreExpr -> Arity -> Unfolding @@ -311,7 +311,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> UnfoldingGuidance -> Unfolding -- Occurrence-analyses the expression before capturing it mkCoreUnfolding src top_lvl expr guidance - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = top_lvl, @@ -330,7 +330,7 @@ mkUnfolding :: DynFlags -> UnfoldingSource -- Calculates unfolding guidance -- Occurrence-analyses the expression before capturing it mkUnfolding dflags src is_top_lvl is_bottoming expr - = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = is_top_lvl, @@ -342,7 +342,7 @@ mkUnfolding dflags src is_top_lvl is_bottoming expr where is_top_bottoming = is_top_lvl && is_bottoming guidance = calcUnfoldingGuidance dflags is_top_bottoming expr - -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr expr))! + -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr_NoBinderSwap expr))! -- See Note [Calculate unfolding guidance on the non-occ-anal'd expression] {- @@ -364,6 +364,39 @@ But more generally, the simplifier is designed on the basis that it is looking at occurrence-analysed expressions, so better ensure that they acutally are. +We use occurAnalyseExpr_NoBinderSwap instead of occurAnalyseExpr; +see Note [No binder swap in unfoldings]. + +Note [No binder swap in unfoldings] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The binder swap can temporarily violate Core Lint, by assinging +a LocalId binding to a GlobalId. For example, if A.foo{r872} +is a GlobalId with unique r872, then + + case A.foo{r872} of bar { + K x -> ...(A.foo{r872})... + } + +gets transformed to + + case A.foo{r872} of bar { + K x -> let foo{r872} = bar + in ...(A.foo{r872})... + +This is usually not a problem, because the simplifier will transform +this to: + + case A.foo{r872} of bar { + K x -> ...(bar)... + +However, after occurrence analysis but before simplification, this extra 'let' +violates the Core Lint invariant that we do not have local 'let' bindings for +GlobalIds. That seems (just) tolerable for the occurrence analysis that happens +just before the Simplifier, but not for unfoldings, which are Linted +independently. +As a quick workaround, we disable binder swap in this module. +See Trac #16288 and #16296 for further plans. + Note [Calculate unfolding guidance on the non-occ-anal'd expression] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Notice that we give the non-occur-analysed expression to diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr index 3ba4db2..a170d29 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr @@ -1,5 +1,5 @@ Simplifier ticks exhausted - When trying UnfoldingDone delta1 + When trying UnfoldingDone delta To increase the limit, use -fsimpl-tick-factor=N (default 100). If you need to increase the limit substantially, please file a @@ -12,4 +12,4 @@ Simplifier ticks exhausted simplifier non-termination has been judged acceptable. To see detailed counts use -ddump-simpl-stats - Total ticks: 140004 + Total ticks: 140007 diff --git a/testsuite/tests/simplCore/should_compile/T16288A.hs b/testsuite/tests/simplCore/should_compile/T16288A.hs new file mode 100644 index 0000000..c6a52bf --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288A.hs @@ -0,0 +1,17 @@ +module T16288A where + +import T16288C + +data License + +class Pretty a where + pretty :: a -> Doc + +instance Pretty License where + pretty _ = pretV + +bar :: (Pretty a) => a -> Doc +bar w = foo (pretty (u w w w w)) + +u :: a -> a -> a -> a -> a +u = u diff --git a/testsuite/tests/simplCore/should_compile/T16288B.hs b/testsuite/tests/simplCore/should_compile/T16288B.hs new file mode 100644 index 0000000..c1a98d2 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288B.hs @@ -0,0 +1,7 @@ +module T16288B where + +import T16288A +import T16288C + +bar2 :: License -> Doc +bar2 = bar diff --git a/testsuite/tests/simplCore/should_compile/T16288C.hs b/testsuite/tests/simplCore/should_compile/T16288C.hs new file mode 100644 index 0000000..5efbb2e --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T16288C.hs @@ -0,0 +1,13 @@ +module T16288C where + +data Doc = Empty | Beside Doc + +hcat :: Doc -> Doc +hcat Empty = Empty +hcat xs = hcat xs + +pretV = hcat Empty + +foo :: Doc -> Doc +foo Empty = hcat Empty +foo val = Beside val diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 06b5e48..779b091 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -299,3 +299,4 @@ test('T15631', normal, makefile_test, ['T15631']) test('T15673', normal, compile, ['-O']) +test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0']) From git at git.haskell.org Tue Feb 19 14:13:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:48 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: base: Document errno behaviour in haddocks. (76ac103) Message-ID: <20190219141348.F0AC13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/76ac103f5021cba5cd000293c7cb8c2bd3148e7a/ghc >--------------------------------------------------------------- commit 76ac103f5021cba5cd000293c7cb8c2bd3148e7a Author: Niklas Hambüchen Date: Thu Feb 14 16:52:17 2019 -0500 base: Document errno behaviour in haddocks. Also add an implementation comment for details. >--------------------------------------------------------------- 76ac103f5021cba5cd000293c7cb8c2bd3148e7a libraries/base/Foreign/C/Error.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/base/Foreign/C/Error.hs b/libraries/base/Foreign/C/Error.hs index 90b949b..6d6c0cc 100644 --- a/libraries/base/Foreign/C/Error.hs +++ b/libraries/base/Foreign/C/Error.hs @@ -255,11 +255,15 @@ isValidErrno (Errno errno) = errno /= -1 -- | Get the current value of @errno@ in the current thread. -- +-- On GHC, the runtime will ensure that any Haskell thread will only see "its own" +-- @errno@, by saving and restoring the value when Haskell threads are scheduled +-- across OS threads. getErrno :: IO Errno -- We must call a C function to get the value of errno in general. On -- threaded systems, errno is hidden behind a C macro so that each OS --- thread gets its own copy. +-- thread gets its own copy (`saved_errno`, which `rts/Schedule.c` restores +-- back into the thread-local `errno` when a Haskell thread is rescheduled). getErrno = do e <- get_errno; return (Errno e) foreign import ccall unsafe "HsBase.h __hscore_get_errno" get_errno :: IO CInt From git at git.haskell.org Tue Feb 19 14:13:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:52 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: Remove arc scripts (9f5b11f) Message-ID: <20190219141352.23B123A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/9f5b11fa6a0bc32888fa88b6c3d57baa2e734c64/ghc >--------------------------------------------------------------- commit 9f5b11fa6a0bc32888fa88b6c3d57baa2e734c64 Author: Ömer Sinan Ağacan Date: Sun Feb 17 08:04:17 2019 +0300 Remove arc scripts >--------------------------------------------------------------- 9f5b11fa6a0bc32888fa88b6c3d57baa2e734c64 .arc-linters/arcanist-external-json-linter | 1 - .arc-linters/check-binaries.py | 20 ----- .arc-linters/check-cpp.py | 91 --------------------- .arc-linters/check-makefiles.py | 27 ------- .arcconfig | 10 --- .arclint | 125 ----------------------------- .gitmodules | 3 - 7 files changed, 277 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 9f5b11fa6a0bc32888fa88b6c3d57baa2e734c64 From git at git.haskell.org Tue Feb 19 14:13:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:55 +0000 (UTC) Subject: [commit: ghc] wip/ci-i386: CI: Do not allow i386 to fail anymore (e7aec9c) Message-ID: <20190219141355.2E3F73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ci-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/e7aec9c9226ab684dd072dadeb3c7fa87f439e43/ghc >--------------------------------------------------------------- commit e7aec9c9226ab684dd072dadeb3c7fa87f439e43 Author: Peter Trommler Date: Mon Feb 18 15:43:00 2019 +0100 CI: Do not allow i386 to fail anymore Metric Decrease: haddock.Cabal >--------------------------------------------------------------- e7aec9c9226ab684dd072dadeb3c7fa87f439e43 .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b630d9f..51a74aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -206,7 +206,6 @@ validate-i386-linux-deb9: extends: .validate-linux stage: full-build image: ghcci/i386-linux-deb9:0.1 - allow_failure: true variables: TEST_ENV: "i386-linux-deb9" artifacts: From git at git.haskell.org Tue Feb 19 14:13:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Feb 2019 14:13:59 +0000 (UTC) Subject: [commit: ghc] wip/ww-noinline: Always do the worker/wrapper split for NOINLINEs (70ebc57) Message-ID: <20190219141359.0C8703A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ww-noinline Link : http://ghc.haskell.org/trac/ghc/changeset/70ebc57eddc0951128184482aabe30fb84aada70/ghc >--------------------------------------------------------------- commit 70ebc57eddc0951128184482aabe30fb84aada70 Author: Sebastian Graf Date: Tue Feb 19 13:52:11 2019 +0100 Always do the worker/wrapper split for NOINLINEs Trac #10069 revealed that small NOINLINE functions didn't get split into worker and wrapper. This was due to `certainlyWillInline` saying that any unfoldings with a guidance of `UnfWhen` inline unconditionally. That isn't the case for NOINLINE functions, so we catch this case earlier now. Fixes #10069. >--------------------------------------------------------------- 70ebc57eddc0951128184482aabe30fb84aada70 compiler/coreSyn/CoreUnfold.hs | 13 ++++++------- testsuite/tests/stranal/should_compile/T10069.hs | 11 +++++++++++ testsuite/tests/stranal/should_compile/T10069.stderr | 1 + testsuite/tests/stranal/should_compile/all.T | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 3ac35c9..9bb6231 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -1118,13 +1118,14 @@ smallEnoughToInline _ _ ---------------- certainlyWillInline :: DynFlags -> IdInfo -> Maybe Unfolding --- Sees if the unfolding is pretty certain to inline --- If so, return a *stable* unfolding for it, that will always inline +-- ^ Sees if the unfolding is pretty certain to inline. +-- If so, return a *stable* unfolding for it, that will always inline. certainlyWillInline dflags fn_info = case unfoldingInfo fn_info of CoreUnfolding { uf_tmpl = e, uf_guidance = g } - | loop_breaker -> Nothing -- Won't inline, so try w/w - | otherwise -> do_cunf e g -- Depends on size, so look at that + | loop_breaker -- Loop breakers and NOINLINEs + || noinline -> Nothing -- won't inline, so try w/w + | otherwise -> do_cunf e g -- Depends on size, so look at that DFunUnfolding {} -> Just fn_unf -- Don't w/w DFuns; it never makes sense -- to do so, and even if it is currently a @@ -1134,6 +1135,7 @@ certainlyWillInline dflags fn_info where loop_breaker = isStrongLoopBreaker (occInfo fn_info) + noinline = inlinePragmaSpec (inlinePragInfo fn_info) == NoInline fn_unf = unfoldingInfo fn_info do_cunf :: CoreExpr -> UnfoldingGuidance -> Maybe Unfolding @@ -1148,9 +1150,6 @@ certainlyWillInline dflags fn_info -- See Note [certainlyWillInline: INLINABLE] do_cunf expr (UnfIfGoodArgs { ug_size = size, ug_args = args }) | not (null args) -- See Note [certainlyWillInline: be careful of thunks] - , case inlinePragmaSpec (inlinePragInfo fn_info) of - NoInline -> False -- NOINLINE; do not say certainlyWillInline! - _ -> True -- INLINE, INLINABLE, or nothing , not (isBottomingSig (strictnessInfo fn_info)) -- Do not unconditionally inline a bottoming functions even if -- it seems smallish. We've carefully lifted it out to top level, diff --git a/testsuite/tests/stranal/should_compile/T10069.hs b/testsuite/tests/stranal/should_compile/T10069.hs new file mode 100644 index 0000000..f93eaf5 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T10069.hs @@ -0,0 +1,11 @@ +module T10069 where + +data C = C !Int !Int + +{-# NOINLINE c1 #-} +c1 :: C -> Int +c1 (C _ c) = c + +{-# NOINLINE fc #-} +fc :: C -> Int +fc c = c1 c + c1 c diff --git a/testsuite/tests/stranal/should_compile/T10069.stderr b/testsuite/tests/stranal/should_compile/T10069.stderr new file mode 100644 index 0000000..97c255a --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T10069.stderr @@ -0,0 +1 @@ +T10069.$wc1 [InlPrag=NOINLINE] :: GHC.Prim.Int# -> GHC.Prim.Int# diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index c94065b..3cff3c7 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -48,3 +48,4 @@ test('T13077a', normal, compile, ['']) test('T15627', [ grep_errmsg(r'(wmutVar|warray).*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl']) test('T16029', normal, makefile_test, []) +test('T10069', [ grep_errmsg(r'(wc1).*Int#$') ], compile, ['-dppr-cols=200 -ddump-simpl']) From git at git.haskell.org Wed Feb 20 14:59:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:35 +0000 (UTC) Subject: [commit: ghc] branch 'wip/unexpected-pass-exit-code' created Message-ID: <20190220145935.127213A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/unexpected-pass-exit-code Referencing: 1232d544904a902d77623ca933bebee1273caaed From git at git.haskell.org Wed Feb 20 14:59:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:37 +0000 (UTC) Subject: [commit: ghc] branch 'wip/export-bang-dot' created Message-ID: <20190220145937.12AAC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/export-bang-dot Referencing: 6b4d731bdcb02189461b5fc22011386bed9e44a2 From git at git.haskell.org Wed Feb 20 14:59:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:39 +0000 (UTC) Subject: [commit: ghc] branch 'wip/absolute-submodules' created Message-ID: <20190220145939.138043A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/absolute-submodules Referencing: 290470ff8c814484cb07d155c3311add05c1ece4 From git at git.haskell.org Wed Feb 20 14:59:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:41 +0000 (UTC) Subject: [commit: ghc] branch 'wip/dwarf-release' created Message-ID: <20190220145941.14D443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/dwarf-release Referencing: 3889e2f6d2b04fa866bba1165f5c413fd96c54b4 From git at git.haskell.org Wed Feb 20 14:59:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:44 +0000 (UTC) Subject: [commit: ghc] wip/absolute-submodules: gitmodules: Make git submodule paths absolute (290470f) Message-ID: <20190220145944.1EC313A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/absolute-submodules Link : http://ghc.haskell.org/trac/ghc/changeset/290470ff8c814484cb07d155c3311add05c1ece4/ghc >--------------------------------------------------------------- commit 290470ff8c814484cb07d155c3311add05c1ece4 Author: Ben Gamari Date: Tue Feb 19 02:02:09 2019 -0500 gitmodules: Make git submodule paths absolute Several people have requested this change. I was weakly on the side of keeping them relative but ultimately it just doesn't matter much one way or the other. >--------------------------------------------------------------- 290470ff8c814484cb07d155c3311add05c1ece4 .gitmodules | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitmodules b/.gitmodules index 5700a96..2fe354e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,112 +1,112 @@ [submodule "libraries/binary"] path = libraries/binary - url = ../packages/binary.git + url = https://gitlab.haskell.org/ghc/packages/binary.git ignore = untracked [submodule "libraries/bytestring"] path = libraries/bytestring - url = ../packages/bytestring.git + url = https://gitlab.haskell.org/ghc/packages/bytestring.git ignore = untracked [submodule "libraries/Cabal"] path = libraries/Cabal - url = ../packages/Cabal.git + url = https://gitlab.haskell.org/ghc/packages/Cabal.git ignore = untracked [submodule "libraries/containers"] path = libraries/containers - url = ../packages/containers.git + url = https://gitlab.haskell.org/ghc/packages/containers.git ignore = untracked [submodule "libraries/haskeline"] path = libraries/haskeline - url = ../packages/haskeline.git + url = https://gitlab.haskell.org/ghc/packages/haskeline.git ignore = untracked [submodule "libraries/pretty"] path = libraries/pretty - url = ../packages/pretty.git + url = https://gitlab.haskell.org/ghc/packages/pretty.git ignore = untracked [submodule "libraries/terminfo"] path = libraries/terminfo - url = ../packages/terminfo.git + url = https://gitlab.haskell.org/ghc/packages/terminfo.git ignore = untracked [submodule "libraries/transformers"] path = libraries/transformers - url = ../packages/transformers.git + url = https://gitlab.haskell.org/ghc/packages/transformers.git ignore = untracked [submodule "libraries/xhtml"] path = libraries/xhtml - url = ../packages/xhtml.git + url = https://gitlab.haskell.org/ghc/packages/xhtml.git ignore = untracked [submodule "libraries/Win32"] path = libraries/Win32 - url = ../packages/Win32.git + url = https://gitlab.haskell.org/ghc/packages/Win32.git ignore = untracked [submodule "libraries/time"] path = libraries/time - url = ../packages/time.git + url = https://gitlab.haskell.org/ghc/packages/time.git ignore = untracked [submodule "libraries/array"] path = libraries/array - url = ../packages/array.git + url = https://gitlab.haskell.org/ghc/packages/array.git ignore = untracked [submodule "libraries/deepseq"] path = libraries/deepseq - url = ../packages/deepseq.git + url = https://gitlab.haskell.org/ghc/packages/deepseq.git ignore = untracked [submodule "libraries/directory"] path = libraries/directory - url = ../packages/directory.git + url = https://gitlab.haskell.org/ghc/packages/directory.git ignore = untracked [submodule "libraries/filepath"] path = libraries/filepath - url = ../packages/filepath.git + url = https://gitlab.haskell.org/ghc/packages/filepath.git ignore = untracked [submodule "libraries/hpc"] path = libraries/hpc - url = ../packages/hpc.git + url = https://gitlab.haskell.org/ghc/packages/hpc.git ignore = untracked [submodule "libraries/parsec"] path = libraries/parsec - url = ../packages/parsec.git + url = https://gitlab.haskell.org/ghc/packages/parsec.git ignore = untracked [submodule "libraries/text"] path = libraries/text - url = ../packages/text.git + url = https://gitlab.haskell.org/ghc/packages/text.git ignore = untracked [submodule "libraries/mtl"] path = libraries/mtl - url = ../packages/mtl.git + url = https://gitlab.haskell.org/ghc/packages/mtl.git ignore = untracked [submodule "libraries/process"] path = libraries/process - url = ../packages/process.git + url = https://gitlab.haskell.org/ghc/packages/process.git ignore = untracked [submodule "libraries/unix"] path = libraries/unix - url = ../packages/unix.git + url = https://gitlab.haskell.org/ghc/packages/unix.git ignore = untracked branch = 2.7 [submodule "libraries/stm"] path = libraries/stm - url = ../packages/stm.git + url = https://gitlab.haskell.org/ghc/packages/stm.git ignore = untracked [submodule "utils/haddock"] path = utils/haddock - url = ../haddock.git + url = https://gitlab.haskell.org/ghc/haddock.git ignore = untracked branch = ghc-head [submodule "nofib"] path = nofib - url = ../nofib.git + url = https://gitlab.haskell.org/ghc/nofib.git ignore = untracked [submodule "utils/hsc2hs"] path = utils/hsc2hs - url = ../hsc2hs.git + url = https://gitlab.haskell.org/ghc/hsc2hs.git ignore = untracked [submodule "libffi-tarballs"] path = libffi-tarballs - url = ../libffi-tarballs.git + url = https://gitlab.haskell.org/ghc/libffi-tarballs.git ignore = untracked [submodule "gmp-tarballs"] path = libraries/integer-gmp/gmp/gmp-tarballs - url = ../gmp-tarballs.git + url = https://gitlab.haskell.org/ghc/gmp-tarballs.git [submodule ".arc-linters/arcanist-external-json-linter"] path = .arc-linters/arcanist-external-json-linter - url = ../arcanist-external-json-linter.git + url = https://gitlab.haskell.org/ghc/arcanist-external-json-linter.git From git at git.haskell.org Wed Feb 20 14:59:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:47 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-release: gitlab-ci: Generate documentation tarball (0de86f7) Message-ID: <20190220145947.205E13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dwarf-release Link : http://ghc.haskell.org/trac/ghc/changeset/0de86f700d97b2f7b812681ca10ea974ae8a6889/ghc >--------------------------------------------------------------- commit 0de86f700d97b2f7b812681ca10ea974ae8a6889 Author: Ben Gamari Date: Sat Jan 5 17:25:23 2019 -0500 gitlab-ci: Generate documentation tarball >--------------------------------------------------------------- 0de86f700d97b2f7b812681ca10ea974ae8a6889 .gitlab-ci.yml | 39 ++++++++++++++++++++++++++++++++------- mk/config.mk.in | 10 +++++----- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b630d9f..52ef0c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ stages: - lint - build - full-build + - packaging - cleanup # See Note [Cleanup on Windows] ############################################################ @@ -97,8 +98,7 @@ validate-x86_64-linux-deb8-hadrian: THREADS=`mk/detect-cpu-count.sh` make V=0 -j$THREADS WERROR=-Werror - | - make binary-dist TAR_COMP_OPTS="-1" - mv ghc-*.tar.xz ghc.tar.xz + make binary-dist TAR_COMP_OPTS="-1" BIN_DIST_NAME=ghc-bindist - | # Prepare to push git notes. METRICS_FILE=$(mktemp) @@ -116,7 +116,7 @@ validate-x86_64-linux-deb8-hadrian: junit: junit.xml expire_in: 2 week paths: - - ghc.tar.xz + - ghc-bindist-*.tar.xz - junit.xml validate-x86_64-darwin: @@ -359,6 +359,9 @@ validate-x86_64-linux-deb9-unreg: - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache - bash -c 'make clean || true' dependencies: [] + artifacts: + paths: + - ghc-bindist-*.tar.xz cache: paths: - cabal-cache @@ -384,7 +387,7 @@ validate-x86_64-windows-hadrian: # FIXME: Testsuite disabled due to #16156. #- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' cache: - key: x86_64-windows + key: x86_64-windows-hadrian tags: - x86_64-windows @@ -403,9 +406,7 @@ validate-x86_64-windows: bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex' - bash -c "echo include mk/flavours/quick.mk > mk/build.mk" - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`" - - | - bash -c "make binary-dist TAR_COMP_OPTS=-1" - mv ghc-*.tar.xz ghc.tar.xz + - bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist TAR_COMP_OPTS=-1 BIN_DIST_NAME=ghc-bindist" - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' cache: key: x86_64-windows @@ -419,6 +420,30 @@ validate-x86_64-windows: - ghc.tar.xz - junit.xml +############################################################ +# Packaging +############################################################ + +doc-tarball: + stage: packaging + tags: + - x86_64-linux + image: ghcci/x86_64-linux-deb9:0.2 + dependencies: + - validate-x86_64-linux-deb9 + - validate-x86_64-windows + artifacts: + paths: + - haddock.html.tar.xz + - libraries.html.tar.xz + - users_guide.html.tar.xz + - index.html + - "*.pdf" + script: + - ls -lh + - rm -Rf docs + - distrib/mkDocs/mkDocs ghc-bindist-x86_64-unknown-linux.tar.xz ghc-bindist-x86_64-unknown-mingw32.tar.xz + # Note [Cleaning up after shell executor] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # diff --git a/mk/config.mk.in b/mk/config.mk.in index 0119e9a..47580c6 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -414,12 +414,12 @@ GhcRtsWithLibdw=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64), at UseLibdw@, # ################################################################################ -BINDIST = NO -BIN_DIST_NAME = ghc-$(ProjectVersion) -BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME) -BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar +BINDIST = NO +BIN_DIST_NAME ?= ghc-$(ProjectVersion) +BIN_DIST_PREP_DIR = bindistprep/$(BIN_DIST_NAME) +BIN_DIST_PREP_TAR = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar BIN_DIST_PREP_TAR_COMP = $(BIN_DIST_PREP_TAR).$(TAR_COMP_EXT) -BIN_DIST_TAR_COMP = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.$(TAR_COMP_EXT) +BIN_DIST_TAR_COMP = $(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.$(TAR_COMP_EXT) # ----------------------------------------------------------------------------- # Utilities programs: flags From git at git.haskell.org Wed Feb 20 14:59:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:50 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-release: gitlab-ci: Always generate Windows bindist tarball (67f015e) Message-ID: <20190220145950.2F55E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dwarf-release Link : http://ghc.haskell.org/trac/ghc/changeset/67f015ecef18979504d790419c2564a48057064b/ghc >--------------------------------------------------------------- commit 67f015ecef18979504d790419c2564a48057064b Author: Ben Gamari Date: Wed Jan 9 13:38:30 2019 -0500 gitlab-ci: Always generate Windows bindist tarball Currently there are many testsuite failures (#16156). It will take a while to sort these out so let's just always generate a bindist. >--------------------------------------------------------------- 67f015ecef18979504d790419c2564a48057064b .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52ef0c7..78ba746 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -360,6 +360,7 @@ validate-x86_64-linux-deb9-unreg: - bash -c 'make clean || true' dependencies: [] artifacts: + when: always # remove when #16156 is sorted paths: - ghc-bindist-*.tar.xz cache: From git at git.haskell.org Wed Feb 20 14:59:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:53 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-release: gitlab-ci: Generate source tarballs (15ca587) Message-ID: <20190220145953.342343A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dwarf-release Link : http://ghc.haskell.org/trac/ghc/changeset/15ca587e716f5b8a89a471fb0708d86c7024f71e/ghc >--------------------------------------------------------------- commit 15ca587e716f5b8a89a471fb0708d86c7024f71e Author: Ben Gamari Date: Tue Feb 19 10:00:02 2019 -0500 gitlab-ci: Generate source tarballs >--------------------------------------------------------------- 15ca587e716f5b8a89a471fb0708d86c7024f71e .gitlab-ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78ba746..ff03933 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -445,6 +445,22 @@ doc-tarball: - rm -Rf docs - distrib/mkDocs/mkDocs ghc-bindist-x86_64-unknown-linux.tar.xz ghc-bindist-x86_64-unknown-mingw32.tar.xz +source-tarball: + stage: packaging + tags: + - x86_64-linux + image: ghcci/x86_64-linux-deb9:0.2 + only: tags + artifacts: + paths: + - ghc-*.tar.xz + script: + - mk/get-win32-tarballs.sh download all + - ./boot + - ./configure + - make sdist + - mv sdistprep/*.xz . + # Note [Cleaning up after shell executor] # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # From git at git.haskell.org Wed Feb 20 14:59:56 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:56 +0000 (UTC) Subject: [commit: ghc] wip/export-bang-dot: Dot/bang operators in export lists (Trac #16339) (f7c2525) Message-ID: <20190220145956.CA9943A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/export-bang-dot Link : http://ghc.haskell.org/trac/ghc/changeset/f7c2525b9c8735ffdad0beb7dcdeff897ca63e7a/ghc >--------------------------------------------------------------- commit f7c2525b9c8735ffdad0beb7dcdeff897ca63e7a Author: Vladislav Zavialov Date: Tue Feb 19 18:27:09 2019 +0300 Dot/bang operators in export lists (Trac #16339) The dot type operator was handled in the 'tyvarop' parser production, and the bang type operator in 'tyapp'. However, export lists and role annotations use 'oqtycon', so these type operators could not be exported or assigned roles. The fix is to handle them in a lower level production, 'tyconsym'. >--------------------------------------------------------------- f7c2525b9c8735ffdad0beb7dcdeff897ca63e7a compiler/parser/Parser.y | 10 +++++----- compiler/parser/RdrHsSyn.hs | 5 +++++ testsuite/tests/parser/should_compile/T16339.hs | 18 ++++++++++++++++++ testsuite/tests/parser/should_compile/all.T | 1 + 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 78f1013..544d9d7 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1989,14 +1989,15 @@ tyapps :: { [Located TyEl] } -- NB: This list is reversed tyapp :: { Located TyEl } : atype { sL1 $1 $ TyElOpd (unLoc $1) } | TYPEAPP atype { sLL $1 $> $ (TyElKindApp (comb2 $1 $2) $2) } - | qtyconop { sL1 $1 $ TyElOpr (unLoc $1) } + | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) + then TyElBang + else TyElOpr (unLoc $1) } | tyvarop { sL1 $1 $ TyElOpr (unLoc $1) } | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | '~' { sL1 $1 TyElTilde } - | '!' { sL1 $1 TyElBang } | unpackedness { sL1 $1 $ TyElUnpackedness (unLoc $1) } atype :: { LHsType GhcPs } @@ -3310,13 +3311,13 @@ qtyconsym :: { Located RdrName } | QVARSYM { sL1 $1 $! mkQual tcClsName (getQVARSYM $1) } | tyconsym { $1 } --- Does not include "!", because that is used for strictness marks --- or ".", because that separates the quantified type vars from the rest tyconsym :: { Located RdrName } : CONSYM { sL1 $1 $! mkUnqual tcClsName (getCONSYM $1) } | VARSYM { sL1 $1 $! mkUnqual tcClsName (getVARSYM $1) } | ':' { sL1 $1 $! consDataCon_RDR } | '-' { sL1 $1 $! mkUnqual tcClsName (fsLit "-") } + | '!' { sL1 $1 $! mkUnqual tcClsName (fsLit "!") } + | '.' { sL1 $1 $! mkUnqual tcClsName (fsLit ".") } ----------------------------------------------------------------------------- @@ -3371,7 +3372,6 @@ tyvarop :: { Located RdrName } tyvarop : '`' tyvarid '`' {% ams (sLL $1 $> (unLoc $2)) [mj AnnBackquote $1,mj AnnVal $2 ,mj AnnBackquote $3] } - | '.' { sL1 $1 $ mkUnqual tcClsName (fsLit ".") } tyvarid :: { Located RdrName } : VARID { sL1 $1 $! mkUnqual tvName (getVARID $1) } diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 606e2e7..c65b814 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -49,6 +49,7 @@ module RdrHsSyn ( checkContext, -- HsType -> P HsContext checkPattern, -- HsExp -> P HsPat bang_RDR, + isBangRdr, checkPatterns, -- SrcLoc -> [HsExp] -> P [HsPat] checkMonadComp, -- P (HsStmtContext RdrName) checkCommand, -- LHsExpr RdrName -> P (LHsCmd RdrName) @@ -1162,6 +1163,10 @@ plus_RDR = mkUnqual varName (fsLit "+") -- Hack bang_RDR = mkUnqual varName (fsLit "!") -- Hack pun_RDR = mkUnqual varName (fsLit "pun-right-hand-side") +isBangRdr :: RdrName -> Bool +isBangRdr (Unqual occ) = occNameFS occ == fsLit "!" +isBangRdr _ = False + checkPatField :: SDoc -> LHsRecField GhcPs (LHsExpr GhcPs) -> P (LHsRecField GhcPs (LPat GhcPs)) checkPatField msg (dL->L l fld) = do p <- checkLPat msg (hsRecFieldArg fld) diff --git a/testsuite/tests/parser/should_compile/T16339.hs b/testsuite/tests/parser/should_compile/T16339.hs new file mode 100644 index 0000000..9bb8349 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T16339.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE ExplicitNamespaces, TypeOperators, RoleAnnotations #-} +{-# OPTIONS -Wno-duplicate-exports #-} + +module T16339 + ( + type (!), + type (!)(Bang), + type (!)(..), + type (.), + type (.)(Dot), + type (.)(..), + ) where + +data a ! b = Bang +data f . g = Dot + +type role (!) phantom phantom +type role (.) phantom phantom diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index b3f693d..1c5c225 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -141,3 +141,4 @@ test('T15279', normalise_errmsg_fun(only_MG_loc), compile, ['']) test('T15457', normal, compile, ['']) test('T15675', normal, compile, ['']) test('T15781', normal, compile, ['']) +test('T16339', normal, compile, ['']) From git at git.haskell.org Wed Feb 20 14:59:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 14:59:59 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-release: gitlab-ci: Produce DWARF-enabled binary distribution (3889e2f) Message-ID: <20190220145959.CC24A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dwarf-release Link : http://ghc.haskell.org/trac/ghc/changeset/3889e2f6d2b04fa866bba1165f5c413fd96c54b4/ghc >--------------------------------------------------------------- commit 3889e2f6d2b04fa866bba1165f5c413fd96c54b4 Author: Ben Gamari Date: Tue Feb 19 11:40:40 2019 -0500 gitlab-ci: Produce DWARF-enabled binary distribution >--------------------------------------------------------------- 3889e2f6d2b04fa866bba1165f5c413fd96c54b4 .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff03933..7750567 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -255,6 +255,19 @@ validate-x86_64-linux-deb9: cache: key: linux-x86_64-deb9 +release-x86_64-linux-deb9-dwarf: + extends: .validate-linux + stage: build + image: ghcci/x86_64-linux-deb9:0.2 + variables: + BUILD_FLAVOUR: dwarf + TEST_ENV: "x86_64-linux-deb9" + artifacts: + when: always + expire_in: 2 week + cache: + key: linux-x86_64-deb9 + nightly-x86_64-linux-deb9: extends: validate-x86_64-linux-deb9 stage: build From git at git.haskell.org Wed Feb 20 15:00:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 15:00:02 +0000 (UTC) Subject: [commit: ghc] wip/export-bang-dot: Handle the (~) type operator in 'tyconsym' (6b4d731) Message-ID: <20190220150002.D47AD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/export-bang-dot Link : http://ghc.haskell.org/trac/ghc/changeset/6b4d731bdcb02189461b5fc22011386bed9e44a2/ghc >--------------------------------------------------------------- commit 6b4d731bdcb02189461b5fc22011386bed9e44a2 Author: Vladislav Zavialov Date: Tue Feb 19 19:44:13 2019 +0300 Handle the (~) type operator in 'tyconsym' By parsing '~' in 'tyconsym' instead of 'oqtycon', we get one less shift/reduce conflict. >--------------------------------------------------------------- 6b4d731bdcb02189461b5fc22011386bed9e44a2 compiler/parser/Parser.y | 12 +++++------- compiler/parser/RdrHsSyn.hs | 4 +++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 544d9d7..05bf674 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -88,7 +88,7 @@ import Util ( looksLikePackageName, fstOf3, sndOf3, thdOf3 ) import GhcPrelude } -%expect 237 -- shift/reduce conflicts +%expect 236 -- shift/reduce conflicts {- Last updated: 04 June 2018 @@ -1989,15 +1989,14 @@ tyapps :: { [Located TyEl] } -- NB: This list is reversed tyapp :: { Located TyEl } : atype { sL1 $1 $ TyElOpd (unLoc $1) } | TYPEAPP atype { sLL $1 $> $ (TyElKindApp (comb2 $1 $2) $2) } - | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) - then TyElBang - else TyElOpr (unLoc $1) } + | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) then TyElBang else + if isTildeRdr (unLoc $1) then TyElTilde else + TyElOpr (unLoc $1) } | tyvarop { sL1 $1 $ TyElOpr (unLoc $1) } | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } - | '~' { sL1 $1 TyElTilde } | unpackedness { sL1 $1 $ TyElUnpackedness (unLoc $1) } atype :: { LHsType GhcPs } @@ -3251,8 +3250,6 @@ oqtycon :: { Located RdrName } -- An "ordinary" qualified tycon; : qtycon { $1 } | '(' qtyconsym ')' {% ams (sLL $1 $> (unLoc $2)) [mop $1,mj AnnVal $2,mcp $3] } - | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) - [mop $1,mj AnnVal $2,mcp $3] } oqtycon_no_varcon :: { Located RdrName } -- Type constructor which cannot be mistaken -- for variable constructor in export lists @@ -3318,6 +3315,7 @@ tyconsym :: { Located RdrName } | '-' { sL1 $1 $! mkUnqual tcClsName (fsLit "-") } | '!' { sL1 $1 $! mkUnqual tcClsName (fsLit "!") } | '.' { sL1 $1 $! mkUnqual tcClsName (fsLit ".") } + | '~' { sL1 $1 $ eqTyCon_RDR } ----------------------------------------------------------------------------- diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index c65b814..12a9c05 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -50,6 +50,7 @@ module RdrHsSyn ( checkPattern, -- HsExp -> P HsPat bang_RDR, isBangRdr, + isTildeRdr, checkPatterns, -- SrcLoc -> [HsExp] -> P [HsPat] checkMonadComp, -- P (HsStmtContext RdrName) checkCommand, -- LHsExpr RdrName -> P (LHsCmd RdrName) @@ -1163,9 +1164,10 @@ plus_RDR = mkUnqual varName (fsLit "+") -- Hack bang_RDR = mkUnqual varName (fsLit "!") -- Hack pun_RDR = mkUnqual varName (fsLit "pun-right-hand-side") -isBangRdr :: RdrName -> Bool +isBangRdr, isTildeRdr :: RdrName -> Bool isBangRdr (Unqual occ) = occNameFS occ == fsLit "!" isBangRdr _ = False +isTildeRdr = (==eqTyCon_RDR) checkPatField :: SDoc -> LHsRecField GhcPs (LHsExpr GhcPs) -> P (LHsRecField GhcPs (LPat GhcPs)) From git at git.haskell.org Wed Feb 20 15:00:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 15:00:05 +0000 (UTC) Subject: [commit: ghc] wip/junit-fix: exitcode 1 on unexpected passes (0dfc23c) Message-ID: <20190220150005.DB0E83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/junit-fix Link : http://ghc.haskell.org/trac/ghc/changeset/0dfc23cedb615c2581d4332115ac7e9600036828/ghc >--------------------------------------------------------------- commit 0dfc23cedb615c2581d4332115ac7e9600036828 Author: Matthew Pickering Date: Tue Feb 19 20:23:48 2019 +0000 exitcode 1 on unexpected passes >--------------------------------------------------------------- 0dfc23cedb615c2581d4332115ac7e9600036828 testsuite/driver/runtests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 247a5cc..cb00b7c 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -421,6 +421,7 @@ else: if len(t.unexpected_failures) > 0 or \ len(t.unexpected_stat_failures) > 0 or \ + len(t.unexpected_passes) > 0 or \ len(t.framework_failures) > 0: exitcode = 1 else: From git at git.haskell.org Wed Feb 20 15:00:08 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 15:00:08 +0000 (UTC) Subject: [commit: ghc] wip/unexpected-pass-exit-code: Exit with exit code 1 when tests unexpectedly pass (2181b91) Message-ID: <20190220150008.DBA843A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/unexpected-pass-exit-code Link : http://ghc.haskell.org/trac/ghc/changeset/2181b9135b656e43c374dc2a800a8809ef0b49b1/ghc >--------------------------------------------------------------- commit 2181b9135b656e43c374dc2a800a8809ef0b49b1 Author: Matthew Pickering Date: Tue Feb 19 20:23:48 2019 +0000 Exit with exit code 1 when tests unexpectedly pass >--------------------------------------------------------------- 2181b9135b656e43c374dc2a800a8809ef0b49b1 testsuite/driver/runtests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index f61ebbc..d86a638 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -440,6 +440,7 @@ else: if len(t.unexpected_failures) > 0 or \ len(t.unexpected_stat_failures) > 0 or \ + len(t.unexpected_passes) > 0 or \ len(t.framework_failures) > 0: exitcode = 1 else: From git at git.haskell.org Wed Feb 20 15:00:11 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Feb 2019 15:00:11 +0000 (UTC) Subject: [commit: ghc] wip/unexpected-pass-exit-code: LLVM ext-interp tests seem to be passing now (1232d54) Message-ID: <20190220150011.E3FC13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/unexpected-pass-exit-code Link : http://ghc.haskell.org/trac/ghc/changeset/1232d544904a902d77623ca933bebee1273caaed/ghc >--------------------------------------------------------------- commit 1232d544904a902d77623ca933bebee1273caaed Author: Matthew Pickering Date: Wed Feb 20 12:58:25 2019 +0000 LLVM ext-interp tests seem to be passing now >--------------------------------------------------------------- 1232d544904a902d77623ca933bebee1273caaed testsuite/tests/th/all.T | 2 -- 1 file changed, 2 deletions(-) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 2aaa48c..56e4ac9 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -12,8 +12,6 @@ setTestOpts(req_interp) if config.have_ext_interp : setTestOpts(extra_ways(['ext-interp'])) setTestOpts(only_ways(['normal','ghci','ext-interp'])) - if config.ghc_built_by_llvm: - setTestOpts(expect_broken_for(16087, ['ext-interp'])) test('TH_mkName', normal, compile, ['-v0']) test('TH_overloadedlabels', normal, compile, ['-v0']) From git at git.haskell.org Thu Feb 21 15:07:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:33 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/nonmoving-nonconcurrent' created Message-ID: <20190221150733.70AE43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/nonmoving-nonconcurrent Referencing: f50b734a9386438a560047b87671fbb2352ff2f3 From git at git.haskell.org Thu Feb 21 15:07:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:35 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/aligned-block-allocation' created Message-ID: <20190221150735.7101A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/aligned-block-allocation Referencing: fee8f29373213f9425d1144440a7b6b6354adee5 From git at git.haskell.org Thu Feb 21 15:07:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:37 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/preparation' created Message-ID: <20190221150737.719953A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/preparation Referencing: 412abe8b6eb1b17af9c0db503ab7a4ed74064faa From git at git.haskell.org Thu Feb 21 15:07:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:39 +0000 (UTC) Subject: [commit: ghc] branch 'wip/std-hdr-llf' created Message-ID: <20190221150739.7280B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/std-hdr-llf Referencing: 07bba23dccc51c9d7f286005495f596ce1554471 From git at git.haskell.org Thu Feb 21 15:07:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:41 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/misc-rts' created Message-ID: <20190221150741.73E173A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/misc-rts Referencing: 7d7b866c63b04dc2e2fcf655c043160acbb8f6b4 From git at git.haskell.org Thu Feb 21 15:07:43 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:43 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/factor-out-bitmap-walking' created Message-ID: <20190221150743.747A73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/factor-out-bitmap-walking Referencing: b1d37721abdc083fd5e28cb5dfac9f437c986d16 From git at git.haskell.org Thu Feb 21 15:07:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:45 +0000 (UTC) Subject: [commit: ghc] branch 'wip/test-hadrian-caching' created Message-ID: <20190221150745.757C13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/test-hadrian-caching Referencing: eb9944b8b4136096f284bfd6b1192c114e129e17 From git at git.haskell.org Thu Feb 21 15:07:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:47 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/unglobalize-gc-state' created Message-ID: <20190221150747.7647A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/unglobalize-gc-state Referencing: 39d7a76cac5269c389abc60a9559b30578062fad From git at git.haskell.org Thu Feb 21 15:07:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:49 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/sync-without-capability' created Message-ID: <20190221150749.77A133A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/sync-without-capability Referencing: 3ce969bb518ad5f056be18756d93d1472f372b61 From git at git.haskell.org Thu Feb 21 15:07:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:51 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ghc-8.8-merges' created Message-ID: <20190221150751.78AEA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ghc-8.8-merges Referencing: 52a5400baefb6425438356e3c74856352324f01b From git at git.haskell.org Thu Feb 21 15:07:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:53 +0000 (UTC) Subject: [commit: ghc] branch 'wip/validate-ci' created Message-ID: <20190221150753.795BC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/validate-ci Referencing: f903a5b5ba6ef9de569a814c8d6e351ab99c336c From git at git.haskell.org Thu Feb 21 15:07:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:55 +0000 (UTC) Subject: [commit: ghc] branch 'wip/dwarf-bindists' created Message-ID: <20190221150755.7AA1E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/dwarf-bindists Referencing: 138af8785ff441273c13115b794837353cf93d28 From git at git.haskell.org Thu Feb 21 15:07:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:57 +0000 (UTC) Subject: [commit: ghc] branch 'wip/zip7-fusion' created Message-ID: <20190221150757.7B7833A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/zip7-fusion Referencing: de521be79f20d36d9b0d9792d8e3c44b7a584ecb From git at git.haskell.org Thu Feb 21 15:07:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:07:59 +0000 (UTC) Subject: [commit: ghc] branch 'wip/pare-down-ci' created Message-ID: <20190221150759.7C5C33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/pare-down-ci Referencing: 6c074dd4b719701d8298ad0a8032700485a8f347 From git at git.haskell.org Thu Feb 21 15:08:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:01 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gc/printer-improvements' created Message-ID: <20190221150801.7D8E33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gc/printer-improvements Referencing: ad8da7093ab48089b2509cd87319940ffcfa08ab From git at git.haskell.org Thu Feb 21 15:08:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:04 +0000 (UTC) Subject: [commit: ghc] wip/pdf-docs-on-darwin: make: Silence some xelatex output (c3a265a) Message-ID: <20190221150804.9A9643A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pdf-docs-on-darwin Link : http://ghc.haskell.org/trac/ghc/changeset/c3a265a2d47305be412f62b93fe9d5ce9fb29693/ghc >--------------------------------------------------------------- commit c3a265a2d47305be412f62b93fe9d5ce9fb29693 Author: Ben Gamari Date: Sun Dec 30 16:36:21 2018 -0500 make: Silence some xelatex output Currently build logs from GitLab CI around around 7 megabytes each. Of this, around 2 megabytes is latex output. This is quite silly as essentially all of this output is unresolved references in the early latex iterations. Here we silence this output. However, to make sure that we don't silence errors we allow each xelatex invocation besides the last to fail. >--------------------------------------------------------------- c3a265a2d47305be412f62b93fe9d5ce9fb29693 rules/sphinx.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rules/sphinx.mk b/rules/sphinx.mk index 4929f3c..32ef3e4 100644 --- a/rules/sphinx.mk +++ b/rules/sphinx.mk @@ -56,13 +56,18 @@ pdf_$1 : $1/$2.pdf pdf : pdf_$1 ifneq "$$(BINDIST)" "YES" +# N.B. If we don't redirect latex output to /dev/null then we end up with literally +# 30% of the build output being warnings, even in a successful build. However, +# to make sure that we don't silence errors we allow each xelatex invocation +# besides the last to fail. + $1/$2.pdf: $1/conf.py $$($1_RST_SOURCES) $(SPHINXBUILD) -b latex -d $1/.doctrees-pdf $(SPHINXOPTS) $1 $1/build-pdf/$2 - cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex - cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex - cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex + cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true + cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true + cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true cd $1/build-pdf/$2 ; makeindex $2.idx - cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex + cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex cp $1/build-pdf/$2/$2.pdf $1/$2.pdf endif From git at git.haskell.org Thu Feb 21 15:08:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:07 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Uphold AvailTC Invariant for associated data fams (a0cd486) Message-ID: <20190221150807.9A25B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/a0cd486ebb1ba14392c0ab60b0ef377ec767703c/ghc >--------------------------------------------------------------- commit a0cd486ebb1ba14392c0ab60b0ef377ec767703c Author: Alec Theriault Date: Fri Feb 1 16:26:43 2019 -0800 Uphold AvailTC Invariant for associated data fams The AvailTC was not be upheld for explicit export module export lists when the module contains associated data families. module A (module A) where class C a where { data T a } instance C () where { data T () = D } Used to (incorrectly) report avails as `[C{C, T;}, T{D;}]`. Note that although `T` is exported, the avail where it is the parent does _not_ list it as its first element. This avail is now correctly listed as `[C{C, T;}, T{T, D;}]`. This was induces a [crash in Haddock][0]. See #16077. [0]: https://github.com/haskell/haddock/issues/979 >--------------------------------------------------------------- a0cd486ebb1ba14392c0ab60b0ef377ec767703c compiler/basicTypes/Avail.hs | 42 +++++++++++++++---------------- compiler/typecheck/TcRnExports.hs | 52 +++++++++++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 26 deletions(-) diff --git a/compiler/basicTypes/Avail.hs b/compiler/basicTypes/Avail.hs index cefa934..291c95a 100644 --- a/compiler/basicTypes/Avail.hs +++ b/compiler/basicTypes/Avail.hs @@ -47,27 +47,27 @@ import Data.Function -- ----------------------------------------------------------------------------- -- The AvailInfo type --- | Records what things are "available", i.e. in scope -data AvailInfo = Avail Name -- ^ An ordinary identifier in scope - | AvailTC Name - [Name] - [FieldLabel] - -- ^ A type or class in scope. Parameters: - -- - -- 1) The name of the type or class - -- 2) The available pieces of type or class, - -- excluding field selectors. - -- 3) The record fields of the type - -- (see Note [Representing fields in AvailInfo]). - -- - -- The AvailTC Invariant: - -- * If the type or class is itself - -- to be in scope, it must be - -- *first* in this list. Thus, - -- typically: @AvailTC Eq [Eq, ==, \/=]@ - deriving( Eq, Data ) - -- Equality used when deciding if the - -- interface has changed +-- | Records what things are \"available\", i.e. in scope +data AvailInfo + + -- | An ordinary identifier in scope + = Avail Name + + -- | A type or class in scope + -- + -- The __AvailTC Invariant__: If the type or class is itself to be in scope, + -- it must be /first/ in this list. Thus, typically: + -- + -- > AvailTC Eq [Eq, ==, \/=] [] + | AvailTC + Name -- ^ The name of the type or class + [Name] -- ^ The available pieces of type or class, + -- excluding field selectors. + [FieldLabel] -- ^ The record fields of the type + -- (see Note [Representing fields in AvailInfo]). + + deriving ( Eq -- ^ Used when deciding if the interface has changed + , Data ) -- | A collection of 'AvailInfo' - several things that are \"available\" type Avails = [AvailInfo] diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs index 28c1773..b3baf6c 100644 --- a/compiler/typecheck/TcRnExports.hs +++ b/compiler/typecheck/TcRnExports.hs @@ -89,6 +89,41 @@ At one point I implemented a compromise: But the compromise seemed too much of a hack, so we backed it out. You just have to use an explicit export list: module M( F(..) ) where ... + +Note [Avails of associated data families] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Suppose you have (Trac #16077) + + {-# LANGUAGE TypeFamilies #-} + module A (module A) where + + class C a where { data T a } + instance C () where { data T () = D } + +Because @A@ is exported explicitly, GHC tries to produce an export list +from the @GlobalRdrEnv at . In this case, it pulls out the following: + + [ C defined at A.hs:4:1 + , T parent:C defined at A.hs:4:23 + , D parent:T defined at A.hs:5:35 ] + +If map these directly into avails, (via 'availFromGRE'), we get +@[C{C;}, C{T;}, T{D;}]@, which eventually gets merged into @[C{C, T;}, T{D;}]@. +That's not right, because @T{D;}@ violates the AvailTC invariant: @T@ is +exported, but it isn't the first entry in the avail! + +We work around this issue by expanding GREs where the parent and child +are both type constructors into two GRES. + + T parent:C defined at A.hs:4:23 + + => + + [ T parent:C defined at A.hs:4:23 + , T defined at A.hs:4:23 ] + +Then, we get @[C{C;}, C{T;}, T{T;}, T{D;}]@, which eventually gets merged +into @[C{C, T;}, T{T, D;}]@ (which satsifies the AvailTC invariant). -} data ExportAccum -- The type of the accumulating parameter of @@ -175,12 +210,12 @@ tcRnExports explicit_mod exports ; return new_tcg_env } exports_from_avail :: Maybe (Located [LIE GhcPs]) - -- Nothing => no explicit export list + -- ^ 'Nothing' means no explicit export list -> GlobalRdrEnv -> ImportAvails - -- Imported modules; this is used to test if a - -- 'module Foo' export is valid (it's not valid - -- if we didn't import Foo!) + -- ^ Imported modules; this is used to test if a + -- @module Foo@ export is valid (it's not valid + -- if we didn't import @Foo@!) -> Module -> RnM (Maybe [(LIE GhcRn, Avails)], Avails) -- (Nothing, _) <=> no explicit export list @@ -230,6 +265,11 @@ exports_from_avail (Just (dL->L _ rdr_items)) rdr_env imports this_mod kids_env :: NameEnv [GlobalRdrElt] kids_env = mkChildEnv (globalRdrEnvElts rdr_env) + -- See Note [Avails of associated data families] + expand_tyty_gre :: GlobalRdrElt -> [GlobalRdrElt] + expand_tyty_gre (gre @ GRE { gre_name = me, gre_par = ParentIs p }) + | isTyConName p, isTyConName me = [gre, gre{ gre_par = NoParent }] + expand_tyty_gre gre = [gre] imported_modules = [ imv_name imv | xs <- moduleEnvElts $ imp_mods imports @@ -248,7 +288,9 @@ exports_from_avail (Just (dL->L _ rdr_items)) rdr_env imports this_mod = do { let { exportValid = (mod `elem` imported_modules) || (moduleName this_mod == mod) ; gre_prs = pickGREsModExp mod (globalRdrEnvElts rdr_env) - ; new_exports = map (availFromGRE . fst) gre_prs + ; new_exports = [ availFromGRE gre' + | (gre, _) <- gre_prs + , gre' <- expand_tyty_gre gre ] ; all_gres = foldr (\(gre1,gre2) gres -> gre1 : gre2 : gres) [] gre_prs ; mods = addOneToUniqSet earlier_mods mod } From git at git.haskell.org Thu Feb 21 15:08:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:10 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Fix two bugs in stg_ap_0_fast in profiling runtime (908b4b8) Message-ID: <20190221150810.A5B863A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/908b4b8659713f0b7a1704ce33c7fa30e3e0ffc3/ghc >--------------------------------------------------------------- commit 908b4b8659713f0b7a1704ce33c7fa30e3e0ffc3 Author: Ömer Sinan Ağacan Date: Fri Jan 18 22:35:37 2019 +0300 Fix two bugs in stg_ap_0_fast in profiling runtime This includes two bug fixes in profiling version of stg_ap_0_fast: - PAPs allocated by stg_ap_0_fast are now correctly tagged. This invariant is checked in Sanity.c:checkPAP. (This was originally implemented in 2693eb11f5, later reverted with ab55b4ddb7 because it revealed the bug below, but it wasn't clear at the time whether the bug was the one below or something in the commit) - The local variable `untaggedfun` is now marked as a pointer so it survives GC. With this we finally fix all known bugs caught in #15508. `concprog001` now works reliably with prof+threaded and prof runtimes (with and without -debug). >--------------------------------------------------------------- 908b4b8659713f0b7a1704ce33c7fa30e3e0ffc3 rts/Apply.cmm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rts/Apply.cmm b/rts/Apply.cmm index 40f890d..0454fd6 100644 --- a/rts/Apply.cmm +++ b/rts/Apply.cmm @@ -60,7 +60,7 @@ stg_ap_0_fast ( P_ fun ) again: W_ info; - W_ untaggedfun; + P_ untaggedfun; W_ arity; untaggedfun = UNTAG(fun); info = %INFO_PTR(untaggedfun); @@ -106,6 +106,11 @@ again: pap = Hp - SIZEOF_StgPAP + WDS(1); SET_HDR(pap, stg_PAP_info, CCCS); StgPAP_arity(pap) = arity; + if (arity <= TAG_MASK) { + // TODO: Shouldn't this already be tagged? If not why did we + // untag it at the beginning of this function? + fun = untaggedfun + arity; + } StgPAP_fun(pap) = fun; StgPAP_n_args(pap) = 0; return (pap); @@ -117,9 +122,8 @@ again: return (fun); } else { // We're going to copy this PAP, and put the new CCS in it - fun = untaggedfun; W_ size; - size = SIZEOF_StgPAP + WDS(TO_W_(StgPAP_n_args(fun))); + size = SIZEOF_StgPAP + WDS(TO_W_(StgPAP_n_args(untaggedfun))); HP_CHK_GEN(size); TICK_ALLOC_PAP(size, 0); // attribute this allocation to the "overhead of profiling" @@ -127,13 +131,13 @@ again: P_ pap; pap = Hp - size + WDS(1); // We'll lose the original PAP, so we should enter its CCS - ccall enterFunCCS(BaseReg "ptr", StgHeader_ccs(fun) "ptr"); + ccall enterFunCCS(BaseReg "ptr", StgHeader_ccs(untaggedfun) "ptr"); SET_HDR(pap, stg_PAP_info, CCCS); - StgPAP_arity(pap) = StgPAP_arity(fun); - StgPAP_n_args(pap) = StgPAP_n_args(fun); + StgPAP_arity(pap) = StgPAP_arity(untaggedfun); + StgPAP_n_args(pap) = StgPAP_n_args(untaggedfun); StgPAP_fun(pap) = StgPAP_fun(fun); W_ i; - i = TO_W_(StgPAP_n_args(fun)); + i = TO_W_(StgPAP_n_args(untaggedfun)); loop: if (i == 0) { return (pap); From git at git.haskell.org Thu Feb 21 15:08:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:13 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: CI: Run `cabal update` before trying to build Hadrian (eda456f) Message-ID: <20190221150813.A93AE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/eda456f6f7ff53d0237531bc7f60ea42a648b6f3/ghc >--------------------------------------------------------------- commit eda456f6f7ff53d0237531bc7f60ea42a648b6f3 Author: Matthew Pickering Date: Mon Feb 18 19:42:35 2019 +0000 CI: Run `cabal update` before trying to build Hadrian >--------------------------------------------------------------- eda456f6f7ff53d0237531bc7f60ea42a648b6f3 .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b630d9f..33d96d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,6 +54,7 @@ ghc-linters: .validate-hadrian: allow_failure: true script: + - cabal update - git clean -xdf && git submodule foreach git clean -xdf - bash .circleci/prepare-system.sh - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi From git at git.haskell.org Thu Feb 21 15:08:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:16 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Hadrian: Fix untracked dependencies (1dad4fc) Message-ID: <20190221150816.C21143A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/1dad4fc27ea128a11ba0077f459494c2a1ca0d5c/ghc >--------------------------------------------------------------- commit 1dad4fc27ea128a11ba0077f459494c2a1ca0d5c Author: Andrey Mokhov Date: Thu Feb 14 14:29:50 2019 +0000 Hadrian: Fix untracked dependencies This is a preparation for #16295: https://ghc.haskell.org/trac/ghc/ticket/16295 This commit mostly focuses on getting rid of untracked dependencies, which prevent Shake's new `--shared` feature from appropriately caching build rules. There are three different solutions to untracked dependencies: * Track them! This is the obvious and the best approach, but in some situations we cannot use it, for example, because a build rule creates files whose names are not known statically and hence cannot be specified as the rule's outputs. * Use Shake's `produces` to record outputs dynamically, within the rule. * Use Shake's `historyDisable` to disable caching for a particular build rule. We currently use this approach only for `ghc-pkg` which mutates the package database and the file `package.cache`. These two tickets are fixed as the result: Ticket #16271: ​https://ghc.haskell.org/trac/ghc/ticket/16271 Ticket #16272: ​https://ghc.haskell.org/trac/ghc/ticket/16272 (this one is fixed only partially: we correctly record the dependency, but we still copy files into the RTS build tree). >--------------------------------------------------------------- 1dad4fc27ea128a11ba0077f459494c2a1ca0d5c hadrian/hadrian.cabal | 2 +- hadrian/src/Base.hs | 22 +++-- hadrian/src/Builder.hs | 14 ++-- hadrian/src/Context.hs | 16 +--- hadrian/src/Hadrian/Haskell/Cabal.hs | 3 +- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 58 ++++++++----- hadrian/src/Hadrian/Haskell/Cabal/Type.hs | 57 ++++++------- hadrian/src/Hadrian/Oracles/Cabal/Rules.hs | 7 +- hadrian/src/Oracles/ModuleFiles.hs | 9 ++- hadrian/src/Packages.hs | 33 ++++++-- hadrian/src/Rules.hs | 4 +- hadrian/src/Rules/Compile.hs | 125 ++++++++++++----------------- hadrian/src/Rules/Configure.hs | 2 + hadrian/src/Rules/Dependencies.hs | 36 ++++----- hadrian/src/Rules/Documentation.hs | 17 ++-- hadrian/src/Rules/Generate.hs | 65 +++++++-------- hadrian/src/Rules/Gmp.hs | 49 +++++------ hadrian/src/Rules/Libffi.hs | 59 +++++++------- hadrian/src/Rules/Register.hs | 90 +++++++++++++-------- hadrian/src/Settings.hs | 14 +++- hadrian/src/Settings/Builders/Ghc.hs | 4 +- hadrian/src/Settings/Builders/GhcPkg.hs | 3 +- hadrian/src/Settings/Builders/Hsc2Hs.hs | 4 +- hadrian/src/Settings/Default.hs | 9 +-- utils/touchy/touchy.cabal | 2 +- 25 files changed, 369 insertions(+), 335 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 1dad4fc27ea128a11ba0077f459494c2a1ca0d5c From git at git.haskell.org Thu Feb 21 15:08:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:20 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Bump ghc version to 8.9 (aa79f65) Message-ID: <20190221150820.33FD93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/aa79f65c06fbe2bbca08de1d02b30ee4fa53d1b4/ghc >--------------------------------------------------------------- commit aa79f65c06fbe2bbca08de1d02b30ee4fa53d1b4 Author: Ryan Scott Date: Thu Feb 14 09:12:20 2019 -0500 Bump ghc version to 8.9 Along the way, I discovered that `template-haskell.cabal` was hard-coding the GHC version (in the form of its `ghc-boot-th` version bounds), so I decided to make life a little simpler in the future by generating `template-haskell.cabal` with autoconf. >--------------------------------------------------------------- aa79f65c06fbe2bbca08de1d02b30ee4fa53d1b4 .gitignore | 1 + configure.ac | 4 ++-- .../{template-haskell.cabal => template-haskell.cabal.in} | 6 +++++- testsuite/tests/haddock/haddock_testsuite/all.T | 8 ++++---- utils/haddock | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b205b24..f56f6ca 100644 --- a/.gitignore +++ b/.gitignore @@ -159,6 +159,7 @@ _darcs/ /libraries/plus.gif /libraries/synopsis.png /libraries/stamp/ +/libraries/template-haskell/template-haskell.cabal /linter.log /mk/are-validating.mk /mk/build.mk diff --git a/configure.ac b/configure.ac index e269b96..a0b3d89 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], [8.7], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.9], [glasgow-haskell-bugs at haskell.org], [ghc-AC_PACKAGE_VERSION]) # Set this to YES for a released version, otherwise NO : ${RELEASE=NO} @@ -1332,7 +1332,7 @@ checkMake380() { checkMake380 make checkMake380 gmake -AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) +AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk rts/rts.cabal compiler/ghc.cabal ghc/ghc-bin.cabal utils/iserv/iserv.cabal utils/iserv-proxy/iserv-proxy.cabal utils/runghc/runghc.cabal utils/gen-dll/gen-dll.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghc-boot-th/ghc-boot-th.cabal libraries/ghci/ghci.cabal libraries/ghc-heap/ghc-heap.cabal libraries/libiserv/libiserv.cabal libraries/template-haskell/template-haskell.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) AC_OUTPUT [ if test "$print_make_warning" = "true"; then diff --git a/libraries/template-haskell/template-haskell.cabal b/libraries/template-haskell/template-haskell.cabal.in similarity index 88% rename from libraries/template-haskell/template-haskell.cabal rename to libraries/template-haskell/template-haskell.cabal.in index cdb60c4..d689af1 100644 --- a/libraries/template-haskell/template-haskell.cabal +++ b/libraries/template-haskell/template-haskell.cabal.in @@ -1,3 +1,7 @@ +-- WARNING: template-haskell.cabal is automatically generated from template-haskell.cabal.in by +-- ../../configure. Make sure you are editing template-haskell.cabal.in, not +-- template-haskell.cabal. + name: template-haskell version: 2.15.0.0 -- NOTE: Don't forget to update ./changelog.md @@ -52,7 +56,7 @@ Library build-depends: base >= 4.11 && < 4.14, - ghc-boot-th == 8.7.*, + ghc-boot-th == @ProjectVersionMunged@, pretty == 1.1.* ghc-options: -Wall diff --git a/testsuite/tests/haddock/haddock_testsuite/all.T b/testsuite/tests/haddock/haddock_testsuite/all.T index 1aa387b..df7dc74 100644 --- a/testsuite/tests/haddock/haddock_testsuite/all.T +++ b/testsuite/tests/haddock/haddock_testsuite/all.T @@ -1,19 +1,19 @@ test('haddockHtmlTest', - [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + [ignore_stdout, ignore_stderr, unless(in_tree_compiler(), skip), req_haddock], makefile_test, ['htmlTest']) test('haddockLatexTest', - [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + [ignore_stdout, ignore_stderr, unless(in_tree_compiler(), skip), req_haddock], makefile_test, ['latexTest']) test('haddockHoogleTest', - [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + [ignore_stdout, ignore_stderr, unless(in_tree_compiler(), skip), req_haddock], makefile_test, ['hoogleTest']) test('haddockHypsrcTest', - [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + [ignore_stdout, ignore_stderr, unless(in_tree_compiler(), skip), req_haddock], makefile_test, ['hypsrcTest']) diff --git a/utils/haddock b/utils/haddock index edd500d..1a4715b 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit edd500da16e44e3b211cbf3cb354db99a61f021c +Subproject commit 1a4715b2c14d6387da91e74560845fb6cbe6808b From git at git.haskell.org Thu Feb 21 15:08:23 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:23 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Test bit-manipulating primops under respective arch flags like -msse4.2 (2e96ce1) Message-ID: <20190221150823.A0A2B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/2e96ce1fced5ea4f005edea2eeab50f67acb9114/ghc >--------------------------------------------------------------- commit 2e96ce1fced5ea4f005edea2eeab50f67acb9114 Author: Dmitry Ivanov Date: Sun Feb 17 16:40:19 2019 +0100 Test bit-manipulating primops under respective arch flags like -msse4.2 >--------------------------------------------------------------- 2e96ce1fced5ea4f005edea2eeab50f67acb9114 testsuite/driver/cpu_features.py | 4 +- testsuite/tests/codeGen/should_run/all.T | 3 +- testsuite/tests/codeGen/should_run/cgrun077.hs | 107 +++++++++++++++++++++ .../{cgrun072.stdout => cgrun077.stdout} | 3 + 4 files changed, 113 insertions(+), 4 deletions(-) diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py index 7716306..7b4340b 100644 --- a/testsuite/driver/cpu_features.py +++ b/testsuite/driver/cpu_features.py @@ -54,12 +54,10 @@ def have_cpu_feature(feature): A testsuite predicate for testing the availability of CPU features. """ assert feature in SUPPORTED_CPU_FEATURES + global cpu_feature_cache if cpu_feature_cache is None: cpu_feature_cache = get_cpu_features() print('Found CPU features:', ' '.join(cpu_feature_cache)) - # Sanity checking - assert all(feat in SUPPORTED_CPU_FEATURES - for feat in cpu_feature_cache) return feature in cpu_feature_cache diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 7f976b8..c6a6b27 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -78,10 +78,11 @@ test('cgrun069', multi_compile_and_run, ['cgrun069', [('cgrun069_cmm.cmm', '')], '']) test('cgrun070', normal, compile_and_run, ['']) -test('cgrun071', normal, compile_and_run, ['']) +test('cgrun071', [when(have_cpu_feature('sse4_2'), extra_hc_opts('-msse4.2'))], compile_and_run, ['']) test('cgrun072', normal, compile_and_run, ['']) test('cgrun075', normal, compile_and_run, ['']) test('cgrun076', normal, compile_and_run, ['']) +test('cgrun077', [when(have_cpu_feature('bmi2'), extra_hc_opts('-mbmi2'))], compile_and_run, ['']) test('T1852', normal, compile_and_run, ['']) test('T1861', extra_run_opts('0'), compile_and_run, ['']) diff --git a/testsuite/tests/codeGen/should_run/cgrun077.hs b/testsuite/tests/codeGen/should_run/cgrun077.hs new file mode 100644 index 0000000..2058ad7 --- /dev/null +++ b/testsuite/tests/codeGen/should_run/cgrun077.hs @@ -0,0 +1,107 @@ +{-# LANGUAGE BangPatterns, CPP, MagicHash #-} + +module Main ( main ) where + +import Data.Bits +import GHC.Prim +import GHC.Word + +#include "MachDeps.h" + +main = putStr + (test_lzCnt ++ "\n" + ++ test_lzCnt8 ++ "\n" + ++ test_lzCnt16 ++ "\n" + ++ test_lzCnt32 ++ "\n" + ++ test_lzCnt64 ++ "\n" + ++ "\n" + ++ test_tzCnt ++ "\n" + ++ test_tzCnt8 ++ "\n" + ++ test_tzCnt16 ++ "\n" + ++ test_tzCnt32 ++ "\n" + ++ test_tzCnt64 ++ "\n" + ++ "\n" + ) + +lzcnt :: Word -> Word +lzcnt (W# w#) = W# (clz# w#) + +lzcnt8 :: Word -> Word +lzcnt8 (W# w#) = W# (clz8# w#) + +lzcnt16 :: Word -> Word +lzcnt16 (W# w#) = W# (clz16# w#) + +lzcnt32 :: Word -> Word +lzcnt32 (W# w#) = W# (clz32# w#) + +lzcnt64 :: Word64 -> Word +lzcnt64 (W64# w#) = +#if SIZEOF_HSWORD == 4 + W# (clz64# w#) +#else + W# (clz# w#) +#endif + +lzcnt_slow :: Int -> Word -> Word +lzcnt_slow size x = fromIntegral $ min size $ length $ takeWhile (== False) $ reverse $ map (testBit x) [0 .. size - 1] + +tzcnt :: Word -> Word +tzcnt (W# w#) = W# (ctz# w#) + +tzcnt8 :: Word -> Word +tzcnt8 (W# w#) = W# (ctz8# w#) + +tzcnt16 :: Word -> Word +tzcnt16 (W# w#) = W# (ctz16# w#) + +tzcnt32 :: Word -> Word +tzcnt32 (W# w#) = W# (ctz32# w#) + +tzcnt64 :: Word64 -> Word +tzcnt64 (W64# w#) = +#if SIZEOF_HSWORD == 4 + W# (ctz64# w#) +#else + W# (ctz# w#) +#endif + +tzcnt_slow :: Int -> Word -> Word +tzcnt_slow size x = fromIntegral $ min size $ length $ takeWhile (== False) $ map (testBit x) [0 .. size - 1] + +test_lzCnt = test "lzcnt" lzcnt (lzcnt_slow (8 * SIZEOF_HSWORD)) +test_lzCnt8 = test "lzcnt8" lzcnt8 (lzcnt_slow 8 . fromIntegral . (mask 8 .&.)) +test_lzCnt16 = test "lzcnt16" lzcnt16 (lzcnt_slow 16 . fromIntegral . (mask 16 .&.)) +test_lzCnt32 = test "lzcnt32" lzcnt32 (lzcnt_slow 32 . fromIntegral . (mask 32 .&.)) +test_lzCnt64 = test "lzcnt64" lzcnt64 (lzcnt_slow 64 . fromIntegral . (mask 64 .&.)) + +test_tzCnt = test "tzcnt" tzcnt (tzcnt_slow (8 * SIZEOF_HSWORD)) +test_tzCnt8 = test "tzcnt8" tzcnt8 (tzcnt_slow 8 . fromIntegral . (mask 8 .&.)) +test_tzCnt16 = test "tzcnt16" tzcnt16 (tzcnt_slow 16 . fromIntegral . (mask 16 .&.)) +test_tzCnt32 = test "tzcnt32" tzcnt32 (tzcnt_slow 32 . fromIntegral . (mask 32 .&.)) +test_tzCnt64 = test "tzcnt64" tzcnt64 (tzcnt_slow 64 . fromIntegral . (mask 64 .&.)) + +mask n = (2 ^ n) - 1 + +test :: (Show a, Num a) => String -> (a -> Word) -> (a -> Word) -> String +test name fast slow = case failing of + [] -> "OK" + ((_, e, a, i):xs) -> + "FAIL " ++ name ++ "\n" ++ " Input: " ++ show i ++ "\nExpected: " ++ show e ++ + "\n Actual: " ++ show a + where + failing = dropWhile ( \(b,_,_,_) -> b) + . map (\ x -> (slow x == fast x, slow x, fast x, x)) $ cases + expected = map slow cases + actual = map fast cases +#if SIZEOF_HSWORD == 4 + cases = [0, 1, 2, 1480294021,1626858410,2316287658,1246556957,3806579062,65945563, + 1521588071,791321966,1355466914,2284998160] +#elif SIZEOF_HSWORD == 8 + cases = [0, 1, 2, 11004539497957619752,5625461252166958202,1799960778872209546, + 16979826074020750638,12789915432197771481,11680809699809094550, + 13208678822802632247,13794454868797172383,13364728999716654549, + 17516539991479925226] +#else +# error Unexpected word size +#endif diff --git a/testsuite/tests/codeGen/should_run/cgrun072.stdout b/testsuite/tests/codeGen/should_run/cgrun077.stdout similarity index 84% copy from testsuite/tests/codeGen/should_run/cgrun072.stdout copy to testsuite/tests/codeGen/should_run/cgrun077.stdout index 6bf2504..7faabe0 100644 --- a/testsuite/tests/codeGen/should_run/cgrun072.stdout +++ b/testsuite/tests/codeGen/should_run/cgrun077.stdout @@ -3,7 +3,10 @@ OK OK OK OK + OK OK OK OK +OK + From git at git.haskell.org Thu Feb 21 15:08:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:26 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Tiny refactor in isUnliftedRuntimeRep (e86606f) Message-ID: <20190221150826.9FC7C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/e86606f2dd25a6ea55ed29a0434b82cf862c2544/ghc >--------------------------------------------------------------- commit e86606f2dd25a6ea55ed29a0434b82cf862c2544 Author: Simon Peyton Jones Date: Mon Feb 18 09:04:44 2019 +0000 Tiny refactor in isUnliftedRuntimeRep No change in behaviour, slightly more efficient >--------------------------------------------------------------- e86606f2dd25a6ea55ed29a0434b82cf862c2544 compiler/types/TyCoRep.hs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 8dead30..9c50d2e 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -906,30 +906,36 @@ isUnliftedTypeKind kind Just rep -> isUnliftedRuntimeRep rep Nothing -> False -isLiftedRuntimeRep, isUnliftedRuntimeRep :: Type -> Bool +isLiftedRuntimeRep :: Type -> Bool -- isLiftedRuntimeRep is true of LiftedRep :: RuntimeRep --- Similarly isUnliftedRuntimeRep +-- False of type variables (a :: RuntimeRep) +-- and of other reps e.g. (IntRep :: RuntimeRep) isLiftedRuntimeRep rep | Just rep' <- coreView rep = isLiftedRuntimeRep rep' | TyConApp rr_tc args <- rep , rr_tc `hasKey` liftedRepDataConKey = ASSERT( null args ) True | otherwise = False +isUnliftedRuntimeRep :: Type -> Bool +-- True of definitely-unlifted RuntimeReps +-- False of (LiftedRep :: RuntimeRep) +-- and of variables (a :: RuntimeRep) isUnliftedRuntimeRep rep - | Just rep' <- coreView rep = isUnliftedRuntimeRep rep' + | Just rep' <- coreView rep = isUnliftedRuntimeRep rep' | TyConApp rr_tc _ <- rep -- NB: args might be non-empty - -- e.g. TupleRep - , isUnliftedRuntimeRepTyCon rr_tc = True - | otherwise = False - -isUnliftedRuntimeRepTyCon :: TyCon -> Bool -isUnliftedRuntimeRepTyCon rr_tc - = elem (getUnique rr_tc) unliftedRepDataConKeys + -- e.g. TupleRep [r1, .., rn] + = isPromotedDataCon rr_tc && not (rr_tc `hasKey` liftedRepDataConKey) + -- Avoid searching all the unlifted RuntimeRep type cons + -- In the RuntimeRep data type, only LiftedRep is lifted + -- But be careful of type families (F tys) :: RuntimeRep + | otherwise {- Variables, applications -} + = False -- | Is this the type 'RuntimeRep'? isRuntimeRepTy :: Type -> Bool isRuntimeRepTy ty | Just ty' <- coreView ty = isRuntimeRepTy ty' -isRuntimeRepTy (TyConApp tc []) = tc `hasKey` runtimeRepTyConKey +isRuntimeRepTy (TyConApp tc args) + | tc `hasKey` runtimeRepTyConKey = ASSERT( null args ) True isRuntimeRepTy _ = False -- | Is a tyvar of type 'RuntimeRep'? From git at git.haskell.org Thu Feb 21 15:08:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:29 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Comments only, in GhcPrelude (3f73f08) Message-ID: <20190221150829.BECEE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/3f73f081d675fd35ee0af0facc05a046d379ef26/ghc >--------------------------------------------------------------- commit 3f73f081d675fd35ee0af0facc05a046d379ef26 Author: Simon Peyton Jones Date: Tue Feb 19 08:46:34 2019 +0000 Comments only, in GhcPrelude >--------------------------------------------------------------- 3f73f081d675fd35ee0af0facc05a046d379ef26 compiler/utils/GhcPrelude.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/utils/GhcPrelude.hs b/compiler/utils/GhcPrelude.hs index 3437e65..dd78f15 100644 --- a/compiler/utils/GhcPrelude.hs +++ b/compiler/utils/GhcPrelude.hs @@ -5,7 +5,11 @@ -- This module serves as a replacement for the "Prelude" module -- and abstracts over differences between the bootstrapping -- GHC version, and may also provide a common default vocabulary. --- + +-- Every module in GHC +-- * Is compiled with -XNoImplicitPrelude +-- * Explicitly imports GhcPrelude + module GhcPrelude (module X) where -- We export the 'Semigroup' class but w/o the (<>) operator to avoid From git at git.haskell.org Thu Feb 21 15:08:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:33 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Improve the very simple optimiser slightly (5eeefe4) Message-ID: <20190221150833.32D103A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/5eeefe4c1e007ea2098f241634b48a4dada785a5/ghc >--------------------------------------------------------------- commit 5eeefe4c1e007ea2098f241634b48a4dada785a5 Author: Simon Peyton Jones Date: Mon Feb 18 13:46:35 2019 +0000 Improve the very simple optimiser slightly There was a missing case in the very simple optimiser, CoreOpt.simpleOptExpr, which led to Trac #13208 comment:2. In particular, in simple_app, if we find a Let, we should just float it outwards. Otherwise we leave behind some easy-to-reduce beta-redexes. >--------------------------------------------------------------- 5eeefe4c1e007ea2098f241634b48a4dada785a5 compiler/coreSyn/CoreOpt.hs | 10 ++++++++++ testsuite/tests/deSugar/should_compile/Makefile | 6 ++++++ testsuite/tests/deSugar/should_compile/T13208.hs | 3 +++ testsuite/tests/deSugar/should_compile/T13208.stdout | 1 + testsuite/tests/deSugar/should_compile/all.T | 1 + 5 files changed, 21 insertions(+) diff --git a/compiler/coreSyn/CoreOpt.hs b/compiler/coreSyn/CoreOpt.hs index 548b5de..a2ac7b5 100644 --- a/compiler/coreSyn/CoreOpt.hs +++ b/compiler/coreSyn/CoreOpt.hs @@ -308,6 +308,16 @@ simple_app env (Tick t e) as | t `tickishScopesLike` SoftScope = mkTick t $ simple_app env e as +-- (let x = e in b) a1 .. an => let x = e in (b a1 .. an) +-- The let might appear there as a result of inlining +-- e.g. let f = let x = e in b +-- in f a1 a2 +-- (Trac #13208) +simple_app env (Let bind body) as + = case simple_opt_bind env bind of + (env', Nothing) -> simple_app env' body as + (env', Just bind) -> Let bind (simple_app env' body as) + simple_app env e as = finish_app env (simple_opt_expr env e) as diff --git a/testsuite/tests/deSugar/should_compile/Makefile b/testsuite/tests/deSugar/should_compile/Makefile index 4600070..98e9213 100644 --- a/testsuite/tests/deSugar/should_compile/Makefile +++ b/testsuite/tests/deSugar/should_compile/Makefile @@ -2,6 +2,12 @@ TOP=../../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk +# Should show that function f has been optimised by +# the simple CoreOpt optimiser run by the desugarer +T13208: + $(RM) -f T13028.hi T13208.o + '$(TEST_HC)' $(TEST_HC_OPTS) -c T13208.hs -ddump-ds -dsuppress-uniques | grep True + T5252: $(RM) -f T5252.hi T5252.o $(RM) -f T5252a.hi T5252a.o diff --git a/testsuite/tests/deSugar/should_compile/T13208.hs b/testsuite/tests/deSugar/should_compile/T13208.hs new file mode 100644 index 0000000..30af974 --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/T13208.hs @@ -0,0 +1,3 @@ +module T13208 where + +f x = let g = \x -> x in g True diff --git a/testsuite/tests/deSugar/should_compile/T13208.stdout b/testsuite/tests/deSugar/should_compile/T13208.stdout new file mode 100644 index 0000000..2917ddd --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/T13208.stdout @@ -0,0 +1 @@ +f = \ (@ p) _ [Occ=Dead] -> GHC.Types.True diff --git a/testsuite/tests/deSugar/should_compile/all.T b/testsuite/tests/deSugar/should_compile/all.T index 6186df0..3879341 100644 --- a/testsuite/tests/deSugar/should_compile/all.T +++ b/testsuite/tests/deSugar/should_compile/all.T @@ -106,3 +106,4 @@ test('T14547', normal, compile, ['-Wincomplete-patterns']) test('T14773a', normal, compile, ['-Wincomplete-patterns']) test('T14773b', normal, compile, ['-Wincomplete-patterns']) test('T14815', [], makefile_test, ['T14815']) +test('T13208', [], makefile_test, ['T13208']) From git at git.haskell.org Thu Feb 21 15:08:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:36 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists, wip/pare-down-ci, wip/std-hdr-llf, wip/test-hadrian-caching, wip/validate-ci, wip/zip7-fusion: Add comments about how zip fusion (2209ea8) Message-ID: <20190221150836.4185F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/dwarf-bindists,wip/pare-down-ci,wip/std-hdr-llf,wip/test-hadrian-caching,wip/validate-ci,wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/2209ea86cbdfb1e08772a41f74b28563119b4385/ghc >--------------------------------------------------------------- commit 2209ea86cbdfb1e08772a41f74b28563119b4385 Author: Simon Peyton Jones Date: Mon Feb 18 09:03:01 2019 +0000 Add comments about how zip fusion Alexandre Balde (rockbmb) points out that the fusion technology for foldr2, zip, zipWith, etc is undocumented. This patch adds comments to explain. >--------------------------------------------------------------- 2209ea86cbdfb1e08772a41f74b28563119b4385 libraries/base/Control/Monad.hs | 4 ++ libraries/base/GHC/List.hs | 87 +++++++++++++++++++++++++++++------------ 2 files changed, 65 insertions(+), 26 deletions(-) diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 96d8938..75bc2b2 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -196,11 +196,15 @@ mapAndUnzipM f xs = unzip <$> traverse f xs -- | The 'zipWithM' function generalizes 'zipWith' to arbitrary applicative functors. zipWithM :: (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m [c] {-# INLINE zipWithM #-} +-- Inline so that fusion with zipWith and sequenceA have a chance to fire +-- See Note [Fusion for zipN/zipWithN] in List.hs] zipWithM f xs ys = sequenceA (zipWith f xs ys) -- | 'zipWithM_' is the extension of 'zipWithM' which ignores the final result. zipWithM_ :: (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m () {-# INLINE zipWithM_ #-} +-- Inline so that fusion with zipWith and sequenceA have a chance to fire +-- See Note [Fusion for zipN/zipWithN] in List.hs] zipWithM_ f xs ys = sequenceA_ (zipWith f xs ys) {- | The 'foldM' function is analogous to 'Data.Foldable.foldl', except that its result is diff --git a/libraries/base/GHC/List.hs b/libraries/base/GHC/List.hs index df2c19a..8f03ce3 100644 --- a/libraries/base/GHC/List.hs +++ b/libraries/base/GHC/List.hs @@ -925,14 +925,14 @@ foldr2 k z = go go [] _ys = z go _xs [] = z go (x:xs) (y:ys) = k x y (go xs ys) -{-# INLINE [0] foldr2 #-} +{-# INLINE [0] foldr2 #-} -- See Note [Fusion for foldrN] foldr2_left :: (a -> b -> c -> d) -> d -> a -> ([b] -> c) -> [b] -> d foldr2_left _k z _x _r [] = z foldr2_left k _z x r (y:ys) = k x y (r ys) -- foldr2 k z xs ys = foldr (foldr2_left k z) (\_ -> z) xs ys -{-# RULES +{-# RULES -- See Note [Fusion for foldrN] "foldr2/left" forall k z ys (g::forall b.(a->b->b)->b->b) . foldr2 k z (build g) ys = g (foldr2_left k z) (\_ -> z) ys #-} @@ -944,7 +944,7 @@ foldr3 k z = go go _ [] _ = z go _ _ [] = z go (a:as) (b:bs) (c:cs) = k a b c (go as bs cs) -{-# INLINE [0] foldr3 #-} +{-# INLINE [0] foldr3 #-} -- See Note [Fusion for foldrN] foldr3_left :: (a -> b -> c -> d -> e) -> e -> a -> @@ -953,28 +953,63 @@ foldr3_left k _z a r (b:bs) (c:cs) = k a b c (r bs cs) foldr3_left _ z _ _ _ _ = z -- foldr3 k n xs ys zs = foldr (foldr3_left k n) (\_ _ -> n) xs ys zs -{-# RULES +{-# RULES -- See Note [Fusion for foldrN] "foldr3/left" forall k z (g::forall b.(a->b->b)->b->b). foldr3 k z (build g) = g (foldr3_left k z) (\_ _ -> z) #-} --- There used to be a foldr2/right rule, allowing foldr2 to fuse with a build --- form on the right. However, this causes trouble if the right list ends in --- a bottom that is only avoided by the left list ending at that spot. That is, --- foldr2 f z [a,b,c] (d:e:f:_|_), where the right list is produced by a build --- form, would cause the foldr2/right rule to introduce bottom. Example: --- --- zip [1,2,3,4] (unfoldr (\s -> if s > 4 then undefined else Just (s,s+1)) 1) --- --- should produce --- --- [(1,1),(2,2),(3,3),(4,4)] --- --- but with the foldr2/right rule it would instead produce --- --- (1,1):(2,2):(3,3):(4,4):_|_ - --- Zips for larger tuples are in the List module. +{- Note [Fusion for foldrN] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We arrange that foldr2, foldr3, etc is a good consumer for its first +(left) list argument. Here's how. See below for the second, third +etc list arguments + +* The rule "foldr2/left" (active only before phase 1) does this: + foldr2 k z (build g) ys = g (foldr2_left k z) (\_ -> z) ys + thereby fusing away the 'build' on the left argument + +* To ensure this rule has a chance to fire, foldr2 has a NOINLINE[1] pragma + +There used to be a "foldr2/right" rule, allowing foldr2 to fuse with a build +form on the right. However, this causes trouble if the right list ends in +a bottom that is only avoided by the left list ending at that spot. That is, +foldr2 f z [a,b,c] (d:e:f:_|_), where the right list is produced by a build +form, would cause the foldr2/right rule to introduce bottom. Example: + zip [1,2,3,4] (unfoldr (\s -> if s > 4 then undefined else Just (s,s+1)) 1) +should produce + [(1,1),(2,2),(3,3),(4,4)] +but with the foldr2/right rule it would instead produce + (1,1):(2,2):(3,3):(4,4):_|_ + +Note [Fusion for zipN/zipWithN] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We arrange that zip, zip3, etc, and zipWith, zipWit3 etc, are all +good consumers for their first (left) argument, and good producers. +Here's how. See Note [Fusion for foldr2] for why it can't fuse its +second (right) list argument. + +NB: Zips for larger tuples are in the List module. + +* Rule "zip" (active only before phase 1) rewrites + zip xs ys = build (\c n -> foldr2 (zipFB c) n xs ys) + See also Note [Inline FB functions] + + Ditto rule "zipWith". + +* To give this rule a chance to fire, we give zip a NOLINLINE[1] + pragma (although since zip is recursive it might not need it) + +* Now the rules for foldr2 (see Note [Fusion for foldr2]) may fire, + or rules that fuse the build-produced output of zip. + +* If none of these fire, rule "zipList" (active only in phase 1) + rewrites the foldr2 call back to zip + foldr2 (zipFB (:)) [] = zip + This rule will only fire when build has inlined, which also + happens in phase 1. + + Ditto rule "zipWithList". +-} ---------------------------------------------- -- | /O(min(m,n))/. 'zip' takes two lists and returns a list of corresponding @@ -995,7 +1030,7 @@ foldr3_left _ z _ _ _ _ = z -- -- 'zip' is capable of list fusion, but it is restricted to its -- first list argument and its resulting list. -{-# NOINLINE [1] zip #-} +{-# NOINLINE [1] zip #-} -- See Note [Fusion for zipN/zipWithN] zip :: [a] -> [b] -> [(a,b)] zip [] _bs = [] zip _as [] = [] @@ -1005,7 +1040,7 @@ zip (a:as) (b:bs) = (a,b) : zip as bs zipFB :: ((a, b) -> c -> d) -> a -> b -> c -> d zipFB c = \x y r -> (x,y) `c` r -{-# RULES +{-# RULES -- See Note [Fusion for zipN/zipWithN] "zip" [~1] forall xs ys. zip xs ys = build (\c n -> foldr2 (zipFB c) n xs ys) "zipList" [1] foldr2 (zipFB (:)) [] = zip #-} @@ -1026,7 +1061,7 @@ zip3 _ _ _ = [] zip3FB :: ((a,b,c) -> xs -> xs') -> a -> b -> c -> xs -> xs' zip3FB cons = \a b c r -> (a,b,c) `cons` r -{-# RULES +{-# RULES -- See Note [Fusion for zipN/zipWithN] "zip3" [~1] forall as bs cs. zip3 as bs cs = build (\c n -> foldr3 (zip3FB c) n as bs cs) "zip3List" [1] foldr3 (zip3FB (:)) [] = zip3 #-} @@ -1049,7 +1084,7 @@ zip3FB cons = \a b c r -> (a,b,c) `cons` r -- -- 'zipWith' is capable of list fusion, but it is restricted to its -- first list argument and its resulting list. -{-# NOINLINE [1] zipWith #-} +{-# NOINLINE [1] zipWith #-} -- See Note [Fusion for zipN/zipWithN] zipWith :: (a->b->c) -> [a]->[b]->[c] zipWith f = go where @@ -1063,7 +1098,7 @@ zipWith f = go zipWithFB :: (a -> b -> c) -> (d -> e -> a) -> d -> e -> b -> c zipWithFB c f = \x y r -> (x `f` y) `c` r -{-# RULES +{-# RULES -- See Note [Fusion for zipN/zipWithN] "zipWith" [~1] forall f xs ys. zipWith f xs ys = build (\c n -> foldr2 (zipWithFB c f) n xs ys) "zipWithList" [1] forall f. foldr2 (zipWithFB (:) f) [] = zipWith f #-} From git at git.haskell.org Thu Feb 21 15:08:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:39 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Mark ghci063 as broken on Darwin (0b09188) Message-ID: <20190221150839.44B923A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/0b09188cdff87762094b22d7c740f8795e847330/ghc >--------------------------------------------------------------- commit 0b09188cdff87762094b22d7c740f8795e847330 Author: Ben Gamari Date: Thu Jan 17 13:55:00 2019 -0500 testsuite: Mark ghci063 as broken on Darwin This is the last failing test on Darwin preventing us from disallowing CI failures. See #16201. >--------------------------------------------------------------- 0b09188cdff87762094b22d7c740f8795e847330 testsuite/tests/ghci/scripts/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index a27ab32..1394a9a 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -106,7 +106,7 @@ test('ghci061', normal, ghci_script, ['ghci061.script']) test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']), when(config.have_ext_interp, extra_ways(['ghci-ext']))], ghci_script, ['ghci062.script']) -test('ghci063', normal, ghci_script, ['ghci063.script']) +test('ghci063', when(opsys('darwin'), expect_broken(16201)), ghci_script, ['ghci063.script']) test('T2452', [extra_hc_opts("-fno-implicit-import-qualified")], ghci_script, ['T2452.script']) From git at git.haskell.org Thu Feb 21 15:08:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:42 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Add CODEOWNERS (24148b2) Message-ID: <20190221150842.B6CAC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/24148b2a507b2b337b4a6667998721dc41acabbb/ghc >--------------------------------------------------------------- commit 24148b2a507b2b337b4a6667998721dc41acabbb Author: Ben Gamari Date: Mon Jan 21 14:42:13 2019 -0500 Add CODEOWNERS GitLab uses this file to suggest reviewers based upon the files that a Merge Request touches. [skip-ci] >--------------------------------------------------------------- 24148b2a507b2b337b4a6667998721dc41acabbb CODEOWNERS | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..6ad914b --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,22 @@ +# Confused about what this is? See +# https://gitlab.haskell.org/help/user/project/code_owners + +# Catch-all +* @bgamari + +# Build system +/hadrian @snowleopard @alp @DavidEichmann + +# RTS-like things +/rts @bgamari @simonmar @osa1 @Phyx +/includes @bgamari @simonmar @osa1 + +# The compiler +/compiler/typecheck @simonpj @goldfire +/compiler/rename @simonpj @goldfire +/compiler/typecheck/TcDeriv* @RyanGlScott +/compiler/nativeGen @simonmar @bgamari @AndreasK + +# Core libraries +/libraries/base @hvr +/libraries/template-haskell @goldfire From git at git.haskell.org Thu Feb 21 15:08:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:46 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Test that hsc2hs works with promoted data constructors (805681e) Message-ID: <20190221150846.61ACF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/805681e816a8677e341144d596d65edd29866246/ghc >--------------------------------------------------------------- commit 805681e816a8677e341144d596d65edd29866246 Author: Andrew Martin Date: Mon Jan 21 16:04:30 2019 -0500 Test that hsc2hs works with promoted data constructors (cherry picked from commit 79a5afb613235e93bc2c580987595b9c1324db15) >--------------------------------------------------------------- 805681e816a8677e341144d596d65edd29866246 testsuite/tests/hsc2hs/Makefile | 5 +++++ testsuite/tests/hsc2hs/T11004.hsc | 13 +++++++++++++ testsuite/tests/hsc2hs/all.T | 2 ++ utils/hsc2hs | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/hsc2hs/Makefile b/testsuite/tests/hsc2hs/Makefile index b0751f1..9291e4b 100644 --- a/testsuite/tests/hsc2hs/Makefile +++ b/testsuite/tests/hsc2hs/Makefile @@ -41,6 +41,11 @@ T10272: '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make $@ ./$@ +.PHONY: T11004 +T11004: + LANG=C '$(HSC2HS)' $@.hsc + '$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs + .PHONY: T12504 T12504: '$(HSC2HS)' T12504/path/to/$@.hsc diff --git a/testsuite/tests/hsc2hs/T11004.hsc b/testsuite/tests/hsc2hs/T11004.hsc new file mode 100644 index 0000000..796d35a --- /dev/null +++ b/testsuite/tests/hsc2hs/T11004.hsc @@ -0,0 +1,13 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} + +module T11004 where + +import Data.Kind (Type) + +data Foo = Foo' | Bar + +data Indexed :: Foo -> Type where + IndexedA :: Indexed ' Foo' + IndexedB :: Indexed 'Bar diff --git a/testsuite/tests/hsc2hs/all.T b/testsuite/tests/hsc2hs/all.T index f237d9a..d42f385 100644 --- a/testsuite/tests/hsc2hs/all.T +++ b/testsuite/tests/hsc2hs/all.T @@ -14,6 +14,8 @@ test('T4340', [], run_command, ['$MAKE -s --no-print-directory T4340']) test('T10272', [], run_command, ['$MAKE -s --no-print-directory T10272']) +test('T11004', [], run_command, ['$MAKE -s --no-print-directory T11004']) + test('T12504', [extra_files(['T12504']), ignore_stdout], run_command, ['$MAKE -s --no-print-directory T12504']) diff --git a/utils/hsc2hs b/utils/hsc2hs index a816333..fac8b62 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit a816333ae67c54b98cce4ed22621242714967b3e +Subproject commit fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d6 From git at git.haskell.org Thu Feb 21 15:08:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:49 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix typo in TcRnTypes.hs [skip ci] (2c9d37b) Message-ID: <20190221150849.6818E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/2c9d37ba26c390bca2cb2f7835571b7cc4fa17e8/ghc >--------------------------------------------------------------- commit 2c9d37ba26c390bca2cb2f7835571b7cc4fa17e8 Author: Matthew Pickering Date: Mon Jan 21 12:17:20 2019 -0500 Fix typo in TcRnTypes.hs [skip ci] >--------------------------------------------------------------- 2c9d37ba26c390bca2cb2f7835571b7cc4fa17e8 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 b9e5b6c..7c9d70e 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1020,8 +1020,8 @@ splice. In particular it is not set when the splice is renamed or typechecked. 'RunSplice' is needed to provide a reference where 'addModFinalizer' can insert the finalizer (see Note [Delaying modFinalizers in untyped splices]), and 'addModFinalizer' runs when doing Q things. Therefore, It doesn't make sense to -set 'RunSplice' when renaming or typechecking the splice, where 'Splice', 'Brak' -or 'Comp' are used instead. +set 'RunSplice' when renaming or typechecking the splice, where 'Splice', +'Brack' or 'Comp' are used instead. -} From git at git.haskell.org Thu Feb 21 15:08:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:52 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Fix Windows cleanup command line (31a3dc4) Message-ID: <20190221150852.675D63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/31a3dc43f9c6278210964988f09601f625af738a/ghc >--------------------------------------------------------------- commit 31a3dc43f9c6278210964988f09601f625af738a Author: Ben Gamari Date: Wed Jan 23 10:09:49 2019 -0500 gitlab-ci: Fix Windows cleanup command line Why is it so hard to delete a directory's contents without deleting the directory itself in Windows? This will forever remain a mystery. (cherry picked from commit 6da9f4c8df7a216234ef50104e400cdcbfbc1bd4) >--------------------------------------------------------------- 31a3dc43f9c6278210964988f09601f625af738a .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d739eff..2478d0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -407,5 +407,8 @@ cleanup-windows: - set "BUILD_DIR=%BUILD_DIR:/=\%" - echo "Cleaning %BUILD_DIR%" - cd \GitLabRunner - - rmdir /S /Q %BUILD_DIR%/* + # This is way more complicated than it should be: + # See https://stackoverflow.com/questions/1965787 + - del %BUILD_DIR%\* /F /Q + - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p" - exit /b 0 From git at git.haskell.org Thu Feb 21 15:08:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:55 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Hadrian: install patches 'haddock-{html, interface}' (59a8d47) Message-ID: <20190221150855.699423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/59a8d4752d4af6b03faaa68d5aae214726a3cbb0/ghc >--------------------------------------------------------------- commit 59a8d4752d4af6b03faaa68d5aae214726a3cbb0 Author: Alec Theriault Date: Sat Jan 19 01:06:00 2019 -0800 Hadrian: install patches 'haddock-{html,interface}' Since the `$(docdir)` can be picked independently from the `$(libdir)`, we need to make sure that that the `haddock-html` and `haddock-interface` fields in the package DB (which is in the `$(libdir)`) get updated to point to the appropriate places in the `$(docdir)`. NB: in the make system, `ghc-cabal` would cover this sort of thing by re-running `configure` on installation, but here we get away with a couple lines of `sed` and a call to `ghc-pkg recache`. Fixes #16202. >--------------------------------------------------------------- 59a8d4752d4af6b03faaa68d5aae214726a3cbb0 hadrian/src/Rules/BinaryDist.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index f847af9..03740cd 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -239,12 +239,25 @@ bindistMakefile = unlines , "\t$(EXECUTABLE_FILE) $2 ;" , "endef" , "" + , "# Hacky function to patch up the 'haddock-interfaces' and 'haddock-html'" + , "# fields in the package .conf files" + , "define patchpackageconf" + , "# $1 = package name (ex: 'bytestring')" + , "# $2 = path to .conf file" + , "# $3 = Docs Directory" + , "\tcat $2 | sed 's|haddock-interfaces.*|haddock-interfaces: $3/html/libraries/$1/$1.haddock|' \\" + , "\t | sed 's|haddock-html.*|haddock-html: $3/html/libraries/$1|' \\" + , "\t > $2.copy" + , "\tmv $2.copy $2" + , "endef" + , "" , "# QUESTION : should we use shell commands?" , "" , "" , ".PHONY: install" , "install: install_lib install_bin install_includes" , "install: install_docs install_wrappers install_ghci" + , "install: update_package_db" , "" , "ActualBinsDir=${ghclibdir}/bin" , "WrapperBinsDir=${bindir}" @@ -298,6 +311,15 @@ bindistMakefile = unlines "$(WrapperBinsDir),$(ActualBinsDir),$(ActualBinsDir)/$p," ++ "$(libdir),$(docdir),$(includedir)))" , "" + , "PKG_CONFS = $(wildcard $(libdir)/package.conf.d/*)" + , "update_package_db:" + , "\t at echo \"Updating the package DB\"" + , "\t$(foreach p, $(PKG_CONFS),\\" + , "\t\t$(call patchpackageconf," ++ + "$(shell echo $(notdir $p) | sed 's/-\\([0-9]*[0-9]\\.\\)*conf//g')," ++ + "$p,$(docdir)))" + , "\t$(WrapperBinsDir)/ghc-pkg recache" + , "" , "# END INSTALL" , "# ----------------------------------------------------------------------" ] From git at git.haskell.org Thu Feb 21 15:08:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:08:58 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Add Simon and Richard as more CODEOWNERS (13e4ab2) Message-ID: <20190221150858.716463A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/13e4ab290ca680f58fd58d49d22eedc9290a4ee3/ghc >--------------------------------------------------------------- commit 13e4ab290ca680f58fd58d49d22eedc9290a4ee3 Author: Richard Eisenberg Date: Thu Jan 24 22:27:00 2019 -0500 Add Simon and Richard as more CODEOWNERS [skip ci] >--------------------------------------------------------------- 13e4ab290ca680f58fd58d49d22eedc9290a4ee3 CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 2a6f508..30d05f5 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -21,6 +21,9 @@ /compiler/simplCore/Exitify.hs @nomeata /compiler/simplStg/StgCse.hs @nomeata /compiler/cmm/CmmSwitch.hs @nomeata +/compiler/types @simonpj @goldfire +/compiler/deSugar @simonpj @goldfire +/compiler/hsSyn/Convert.hs @goldfire # Core libraries /libraries/base @hvr From git at git.haskell.org Thu Feb 21 15:09:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:01 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Drop CircleCI jobs (d89c187) Message-ID: <20190221150901.77D943A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/d89c1879520232bc9164e3955f560dc9b3df069e/ghc >--------------------------------------------------------------- commit d89c1879520232bc9164e3955f560dc9b3df069e Author: Ben Gamari Date: Tue Jan 22 14:25:05 2019 -0500 gitlab-ci: Drop CircleCI jobs It's pretty unlikely we will be going back to circleci at this point [skip-ci] >--------------------------------------------------------------- d89c1879520232bc9164e3955f560dc9b3df069e .gitlab-ci.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9512380..218bd78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -405,33 +405,3 @@ cleanup-windows: - cd \GitLabRunner - rmdir /S /Q %BUILD_DIR%/* - exit /b 0 - -############################################################ -# Validation via CircleCI -############################################################ - -.circleci: - stage: build - image: ghcci/x86_64-linux-deb8:0.1 - artifacts: - when: always - expire_in: 2 week - reports: - junit: junit.xml - paths: - - ghc.tar.xz - - junit.xml - tags: - - circleci - -# All validation jobs keep the bindists and test results are artifacts, -# when we get far enough to generate them. -# -# This requires updating the maximum artifacts size limit in Gitlab to -# something like 200MB. - -.circleci-validate-x86_64-darwin: - extends: .circleci - stage: full-build - allow_failure: true - script: ".gitlab/circle-ci-job.sh validate-x86_64-darwin" From git at git.haskell.org Thu Feb 21 15:09:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:04 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix hadrian prof flavour so that it builds a profiled version of GHC (49c1f88) Message-ID: <20190221150904.8559F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/49c1f88c850ef0bc2ed8e8eff08e29abd9e73908/ghc >--------------------------------------------------------------- commit 49c1f88c850ef0bc2ed8e8eff08e29abd9e73908 Author: Matthew Pickering Date: Tue Jan 22 11:33:18 2019 +0000 Fix hadrian prof flavour so that it builds a profiled version of GHC In Alp's refactoring of `getProgramContexts` he removed a call to `getProgramContext` which was where the logic for this used to be implemented. Fixes #16214 >--------------------------------------------------------------- 49c1f88c850ef0bc2ed8e8eff08e29abd9e73908 hadrian/src/Rules/Program.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hadrian/src/Rules/Program.hs b/hadrian/src/Rules/Program.hs index c9df6f5..d7bcb48 100644 --- a/hadrian/src/Rules/Program.hs +++ b/hadrian/src/Rules/Program.hs @@ -13,6 +13,7 @@ import Settings import Settings.Default import Target import Utilities +import Flavour -- | TODO: Drop code duplication buildProgramRules :: [(Resource, Int)] -> Rules () @@ -44,12 +45,18 @@ getProgramContexts stage = do -- make sure that we cover these -- "prof-build-under-other-name" cases. -- iserv gets its names from Packages.hs:programName - let allCtxs = [ vanillaContext stage pkg + -- + profiled <- ghcProfiled <$> flavour + let allCtxs = + if pkg == ghc && profiled && stage > Stage0 + then [ Context stage pkg profiling ] + else [ vanillaContext stage pkg , Context stage pkg profiling -- TODO Dynamic way has been reverted as the dynamic build is -- broken. See #15837. -- , Context stage pkg dynamic - ] + ] + forM allCtxs $ \ctx -> do name <- programName ctx return (name <.> exe, ctx) From git at git.haskell.org Thu Feb 21 15:09:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:07 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Ensure that config.{msys, cygwin} are initialized (c460b88) Message-ID: <20190221150907.869B63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/c460b88e23e7000d921b867dfcd9c6ec0c331381/ghc >--------------------------------------------------------------- commit c460b88e23e7000d921b867dfcd9c6ec0c331381 Author: Ben Gamari Date: Sun Jan 20 20:45:34 2019 -0500 testsuite: Ensure that config.{msys,cygwin} are initialized Reviewers: monoidal Reviewed By: monoidal Subscribers: monoidal, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5056 >--------------------------------------------------------------- c460b88e23e7000d921b867dfcd9c6ec0c331381 testsuite/driver/testglobals.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 03a6250..0e0240d 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -50,6 +50,8 @@ class TestConfig: self.platform = '' self.os = '' self.arch = '' + self.msys = False + self.cygwin = False # What is the wordsize (in bits) of this platform? self.wordsize = '' From git at git.haskell.org Thu Feb 21 15:09:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:10 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: GhcPlugins: Fix lookup of TH names (0113490) Message-ID: <20190221150910.8A2FB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/0113490e4b01b6be06d290ad464119c8b3a9492e/ghc >--------------------------------------------------------------- commit 0113490e4b01b6be06d290ad464119c8b3a9492e Author: Ben Gamari Date: Sat Jan 19 13:59:18 2019 -0500 GhcPlugins: Fix lookup of TH names Previously `thNameToGhcName` was calling `lookupOrigNameCache` directly, which failed to handle the case that the name wasn't already in the name cache. This happens, for instance, when the name was in scope in a plugin being used during compilation but not in scope in the module being compiled. In this case we the interface file containing the name won't be loaded and `lookupOrigNameCache` fails. This was the cause of #16104. The solution is simple: use the nicely packaged `lookupOrigIO` instead. >--------------------------------------------------------------- 0113490e4b01b6be06d290ad464119c8b3a9492e compiler/main/GhcPlugins.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/main/GhcPlugins.hs b/compiler/main/GhcPlugins.hs index 3e0facf..5649237 100644 --- a/compiler/main/GhcPlugins.hs +++ b/compiler/main/GhcPlugins.hs @@ -87,7 +87,7 @@ import Unique ( Unique, Uniquable(..) ) import FastString import Data.Maybe -import NameCache (lookupOrigNameCache) +import IfaceEnv ( lookupOrigIO ) import GhcPrelude import MonadUtils ( mapMaybeM ) import Convert ( thRdrNameGuesses ) @@ -127,6 +127,6 @@ thNameToGhcName th_name | Just n <- isExact_maybe rdr_name -- This happens in derived code = return $ if isExternalName n then Just n else Nothing | Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name - = do { cache <- getOrigNameCache - ; return $ lookupOrigNameCache cache rdr_mod rdr_occ } + = do { hsc_env <- getHscEnv + ; Just <$> liftIO (lookupOrigIO hsc_env rdr_mod rdr_occ) } | otherwise = return Nothing From git at git.haskell.org Thu Feb 21 15:09:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:13 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: users guide: consistent spelling of inlinable (0807c9b) Message-ID: <20190221150913.99C913A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/0807c9bb70a28f57a9740ab879a8769f9c07809d/ghc >--------------------------------------------------------------- commit 0807c9bb70a28f57a9740ab879a8769f9c07809d Author: Ben Price Date: Tue Jan 22 00:15:05 2019 +0000 users guide: consistent spelling of inlinable >--------------------------------------------------------------- 0807c9bb70a28f57a9740ab879a8769f9c07809d docs/users_guide/glasgow_exts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index b1e9bc6..b46196e 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -14638,7 +14638,7 @@ See also the ``NOINLINE`` (:ref:`noinline-pragma`) and ``INLINABLE`` ``INLINABLE`` pragma ~~~~~~~~~~~~~~~~~~~~ -.. pragma:: INLINEABLE ⟨name⟩ +.. pragma:: INLINABLE ⟨name⟩ :where: top-level From git at git.haskell.org Thu Feb 21 15:09:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:16 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Remove directories that already exist when seeding extra_files (b9b02b7) Message-ID: <20190221150916.9AE083A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/b9b02b70a4abad29646490c79db141434f757256/ghc >--------------------------------------------------------------- commit b9b02b70a4abad29646490c79db141434f757256 Author: Ben Gamari Date: Sun Jan 20 22:36:22 2019 -0500 testsuite: Remove directories that already exist when seeding extra_files Otherwise the testsuite driver crashes when run multiple times with CLEANUP=NO on a test containing such extra_files. >--------------------------------------------------------------- b9b02b70a4abad29646490c79db141434f757256 testsuite/driver/testlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index ba4f6a5..4a87f0a 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -882,6 +882,8 @@ def do_test(name, way, func, args, files): if os.path.isfile(src): link_or_copy_file(src, dst) elif os.path.isdir(src): + if os.path.exists(dst): + shutil.rmtree(dst) os.mkdir(dst) lndir(src, dst) else: From git at git.haskell.org Thu Feb 21 15:09:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:19 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Mark hWaitForInput-accurate-socket as requiring unix (8a567a0) Message-ID: <20190221150919.9C9433A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/8a567a0e8b873fe30165cf7f3f928cf4e35f5bad/ghc >--------------------------------------------------------------- commit 8a567a0e8b873fe30165cf7f3f928cf4e35f5bad Author: Ben Gamari Date: Wed Jan 23 13:06:45 2019 -0500 testsuite: Mark hWaitForInput-accurate-socket as requiring unix It imports System.Posix.IO. >--------------------------------------------------------------- 8a567a0e8b873fe30165cf7f3f928cf4e35f5bad libraries/base/tests/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 457d9f4..a6cb96d 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -200,7 +200,7 @@ test('T9681', normal, compile_fail, ['']) test('T8089', [exit_code(99), run_timeout_multiplier(0.01)], compile_and_run, ['']) -test('hWaitForInput-accurate-socket', normal, compile_and_run, ['']) +test('hWaitForInput-accurate-socket', reqlib('unix'), compile_and_run, ['']) test('T8684', expect_broken(8684), compile_and_run, ['']) test('T9826',normal, compile_and_run,['']) test('T9848', From git at git.haskell.org Thu Feb 21 15:09:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:22 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Remove TODO in HsExpr (f9bd1cf) Message-ID: <20190221150922.9E7553A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/f9bd1cfe10fd14a2718dde2e06e1836f95d55e4b/ghc >--------------------------------------------------------------- commit f9bd1cfe10fd14a2718dde2e06e1836f95d55e4b Author: Matthew Pickering Date: Fri Jan 18 11:36:12 2019 -0500 Remove TODO in HsExpr It is correct to be `GhcTc` as the data type is for expressions which are inside splices so they can be delayed until desugaring. >--------------------------------------------------------------- f9bd1cfe10fd14a2718dde2e06e1836f95d55e4b compiler/hsSyn/HsExpr.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 41bbdb2..bae29b0 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -2486,7 +2486,6 @@ data UntypedSpliceFlavour -- | Pending Type-checker Splice data PendingTcSplice - -- AZ:TODO: The hard-coded GhcTc feels wrong. = PendingTcSplice SplicePointName (LHsExpr GhcTc) {- From git at git.haskell.org Thu Feb 21 15:09:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:25 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Minor refactor [ci skip] (327a48b) Message-ID: <20190221150925.9F6953A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/327a48ba0d3c205a8421a73696d19c6cd93364b5/ghc >--------------------------------------------------------------- commit 327a48ba0d3c205a8421a73696d19c6cd93364b5 Author: Gabor Greif Date: Tue Jan 22 12:13:28 2019 +0100 Minor refactor [ci skip] >--------------------------------------------------------------- 327a48ba0d3c205a8421a73696d19c6cd93364b5 compiler/basicTypes/MkId.hs | 2 +- compiler/prelude/TysPrim.hs | 8 ++++---- compiler/prelude/TysWiredIn.hs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 3e70fdb..38af092 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1265,7 +1265,7 @@ proxyHashId `setNeverLevPoly` ty ) where -- proxy# :: forall k (a:k). Proxy# k a - bndrs = mkTemplateKiTyVars [liftedTypeKind] (\ks -> ks) + bndrs = mkTemplateKiTyVars [liftedTypeKind] id [k,t] = mkTyVarTys bndrs ty = mkSpecForAllTys bndrs (mkProxyPrimTy k t) diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs index 77ea80e..2a604cc 100644 --- a/compiler/prelude/TysPrim.hs +++ b/compiler/prelude/TysPrim.hs @@ -858,7 +858,7 @@ proxyPrimTyCon :: TyCon proxyPrimTyCon = mkPrimTyCon proxyPrimTyConName binders res_kind [Nominal,Nominal] where -- Kind: forall k. k -> Void# - binders = mkTemplateTyConBinders [liftedTypeKind] (\ks-> ks) + binders = mkTemplateTyConBinders [liftedTypeKind] id res_kind = unboxedTupleKind [] @@ -874,7 +874,7 @@ eqPrimTyCon :: TyCon -- The representation type for equality predicates eqPrimTyCon = mkPrimTyCon eqPrimTyConName binders res_kind roles where -- Kind :: forall k1 k2. k1 -> k2 -> Void# - binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks) + binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] id res_kind = unboxedTupleKind [] roles = [Nominal, Nominal, Nominal, Nominal] @@ -885,7 +885,7 @@ eqReprPrimTyCon :: TyCon -- See Note [The equality types story] eqReprPrimTyCon = mkPrimTyCon eqReprPrimTyConName binders res_kind roles where -- Kind :: forall k1 k2. k1 -> k2 -> Void# - binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks) + binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] id res_kind = unboxedTupleKind [] roles = [Nominal, Nominal, Representational, Representational] @@ -896,7 +896,7 @@ eqPhantPrimTyCon :: TyCon eqPhantPrimTyCon = mkPrimTyCon eqPhantPrimTyConName binders res_kind roles where -- Kind :: forall k1 k2. k1 -> k2 -> Void# - binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks) + binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] id res_kind = unboxedTupleKind [] roles = [Nominal, Nominal, Phantom, Phantom] diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index a0a043d..6fea0e4 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -1074,7 +1074,7 @@ eqSCSelId, heqSCSelId, coercibleSCSelId :: Id datacon = pcDataCon heqDataConName tvs [sc_pred] tycon -- Kind: forall k1 k2. k1 -> k2 -> Constraint - binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] (\ks -> ks) + binders = mkTemplateTyConBinders [liftedTypeKind, liftedTypeKind] id roles = [Nominal, Nominal, Nominal, Nominal] rhs = mkDataTyConRhs [datacon] From git at git.haskell.org Thu Feb 21 15:09:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:28 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix bogus worker for newtypes (53b7655) Message-ID: <20190221150928.A5AE93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/53b765574b798529623748684063a3897e295ef7/ghc >--------------------------------------------------------------- commit 53b765574b798529623748684063a3897e295ef7 Author: Simon Peyton Jones Date: Wed Jan 16 16:34:24 2019 +0000 Fix bogus worker for newtypes The "worker" for a newtype is actually a function with a small (compulsory) unfolding, namely a cast. But the construction of this function was plain wrong for newtype /instances/; it cast the arguemnt to the family type rather than the representation type. This never actually bit us because, in the case of a family instance, we immediately cast the result to the family type. So we get \x. (x |> co1) |> co2 where the compositio of co1 and co2 is ill-kinded. However the optimiser (even the simple optimiser) just collapsed those casts, ignoring the mis-match in the middle, so we never saw the problem. Trac #16191 is indeed a dup of #16141; but the resaon these tickets produce Lint errors is not the unnecessary forcing; it's because of the ill-typed casts. This patch fixes the ill-typed casts, properly. I can't see a way to trigger an actual failure prior to this patch, but it's still wrong wrong wrong to have ill-typed casts, so better to get rid of them. >--------------------------------------------------------------- 53b765574b798529623748684063a3897e295ef7 compiler/basicTypes/MkId.hs | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 17916cf..3e70fdb 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -425,26 +425,26 @@ dictSelRule val_index n_ty_args _ id_unf _ args mkDataConWorkId :: Name -> DataCon -> Id mkDataConWorkId wkr_name data_con | isNewTyCon tycon - = mkGlobalId (DataConWrapId data_con) wkr_name nt_wrap_ty nt_work_info + = mkGlobalId (DataConWrapId data_con) wkr_name wkr_ty nt_work_info | otherwise - = mkGlobalId (DataConWorkId data_con) wkr_name alg_wkr_ty wkr_info + = mkGlobalId (DataConWorkId data_con) wkr_name wkr_ty alg_wkr_info where - tycon = dataConTyCon data_con + tycon = dataConTyCon data_con -- The representation TyCon + wkr_ty = dataConRepType data_con ----------- Workers for data types -------------- - alg_wkr_ty = dataConRepType data_con + alg_wkr_info = noCafIdInfo + `setArityInfo` wkr_arity + `setStrictnessInfo` wkr_sig + `setUnfoldingInfo` evaldUnfolding -- Record that it's evaluated, + -- even if arity = 0 + `setLevityInfoWithType` wkr_ty + -- NB: unboxed tuples have workers, so we can't use + -- setNeverLevPoly + wkr_arity = dataConRepArity data_con - wkr_info = noCafIdInfo - `setArityInfo` wkr_arity - `setStrictnessInfo` wkr_sig - `setUnfoldingInfo` evaldUnfolding -- Record that it's evaluated, - -- even if arity = 0 - `setLevityInfoWithType` alg_wkr_ty - -- NB: unboxed tuples have workers, so we can't use - -- setNeverLevPoly - - wkr_sig = mkClosedStrictSig (replicate wkr_arity topDmd) (dataConCPR data_con) + wkr_sig = mkClosedStrictSig (replicate wkr_arity topDmd) (dataConCPR data_con) -- Note [Data-con worker strictness] -- Notice that we do *not* say the worker Id is strict -- even if the data constructor is declared strict @@ -465,20 +465,21 @@ mkDataConWorkId wkr_name data_con -- not from the worker Id. ----------- Workers for newtypes -------------- - (nt_tvs, _, nt_arg_tys, _) = dataConSig data_con - res_ty_args = mkTyCoVarTys nt_tvs - nt_wrap_ty = dataConUserType data_con + univ_tvs = dataConUnivTyVars data_con + arg_tys = dataConRepArgTys data_con -- Should be same as dataConOrigArgTys nt_work_info = noCafIdInfo -- The NoCaf-ness is set by noCafIdInfo `setArityInfo` 1 -- Arity 1 `setInlinePragInfo` alwaysInlinePragma `setUnfoldingInfo` newtype_unf - `setLevityInfoWithType` nt_wrap_ty - id_arg1 = mkTemplateLocal 1 (head nt_arg_tys) + `setLevityInfoWithType` wkr_ty + id_arg1 = mkTemplateLocal 1 (head arg_tys) + res_ty_args = mkTyCoVarTys univ_tvs newtype_unf = ASSERT2( isVanillaDataCon data_con && - isSingleton nt_arg_tys, ppr data_con ) + isSingleton arg_tys + , ppr data_con ) -- Note [Newtype datacons] mkCompulsoryUnfolding $ - mkLams nt_tvs $ Lam id_arg1 $ + mkLams univ_tvs $ Lam id_arg1 $ wrapNewTypeBody tycon res_ty_args (Var id_arg1) dataConCPR :: DataCon -> DmdResult From git at git.haskell.org Thu Feb 21 15:09:31 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:31 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab: Collect artifacts on Windows (c1ac847) Message-ID: <20190221150931.A9FBC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/c1ac8477e79a5ab8fcf554c81d5fae0ab9dc1fd3/ghc >--------------------------------------------------------------- commit c1ac8477e79a5ab8fcf554c81d5fae0ab9dc1fd3 Author: Ben Gamari Date: Tue Jan 15 23:21:39 2019 -0500 gitlab: Collect artifacts on Windows >--------------------------------------------------------------- c1ac8477e79a5ab8fcf554c81d5fae0ab9dc1fd3 .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f426f3..9512380 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -361,11 +361,21 @@ validate-x86_64-windows: bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex' - bash -c "echo include mk/flavours/quick.mk > mk/build.mk" - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`" + - | + bash -c "make binary-dist TAR_COMP_OPTS=-1" + mv ghc-*.tar.xz ghc.tar.xz - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' cache: key: x86_64-windows tags: - x86_64-windows + artifacts: + when: always + reports: + junit: junit.xml + paths: + - ghc.tar.xz + - junit.xml # Note [Cleanup on Windows] # ~~~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Thu Feb 21 15:09:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:34 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Add myself to CODEOWNERS for a few files (7ce774f) Message-ID: <20190221150934.ABB023A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/7ce774f75bbb8eff1913e20fe70dce3833ec8f33/ghc >--------------------------------------------------------------- commit 7ce774f75bbb8eff1913e20fe70dce3833ec8f33 Author: Joachim Breitner Date: Tue Jan 22 10:57:52 2019 +0100 Add myself to CODEOWNERS for a few files >--------------------------------------------------------------- 7ce774f75bbb8eff1913e20fe70dce3833ec8f33 CODEOWNERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 6ad914b..2a6f508 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,6 +16,11 @@ /compiler/rename @simonpj @goldfire /compiler/typecheck/TcDeriv* @RyanGlScott /compiler/nativeGen @simonmar @bgamari @AndreasK +/compiler/simplCore/CallArity.hs @nomeata +/compiler/utils/UnVarGraph.hs @nomeata +/compiler/simplCore/Exitify.hs @nomeata +/compiler/simplStg/StgCse.hs @nomeata +/compiler/cmm/CmmSwitch.hs @nomeata # Core libraries /libraries/base @hvr From git at git.haskell.org Thu Feb 21 15:09:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:37 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Skip ghcilink002 when unregisterised (5be8b78) Message-ID: <20190221150937.AF3DE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/5be8b78b1792db56e630ac82ea26d330fb0acbae/ghc >--------------------------------------------------------------- commit 5be8b78b1792db56e630ac82ea26d330fb0acbae Author: Ben Gamari Date: Tue Jan 22 18:40:36 2019 -0500 testsuite: Skip ghcilink002 when unregisterised See #16085. >--------------------------------------------------------------- 5be8b78b1792db56e630ac82ea26d330fb0acbae testsuite/tests/ghci/linking/all.T | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 4f12d27..d5ee2ff 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -7,6 +7,8 @@ test('ghcilink001', ['$MAKE -s --no-print-directory ghcilink001']) test('ghcilink002', [extra_files(['TestLink.hs', 'f.c']), + # Fragile when unregisterised; see #16085 + when(unregisterised(), skip), unless(doing_ghci, skip)], run_command, ['$MAKE -s --no-print-directory ghcilink002']) From git at git.haskell.org Thu Feb 21 15:09:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:41 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab: Add merge request template (aaec1cc) Message-ID: <20190221150941.2854F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/aaec1ccb40c85d6bbc803ff9c51de1b6eccf3d94/ghc >--------------------------------------------------------------- commit aaec1ccb40c85d6bbc803ff9c51de1b6eccf3d94 Author: Ben Gamari Date: Sat Jan 19 15:47:33 2019 -0500 gitlab: Add merge request template This begins to define our expectations of contributions. [skip-ci] >--------------------------------------------------------------- aaec1ccb40c85d6bbc803ff9c51de1b6eccf3d94 .gitlab/merge_request_templates/merge-request.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitlab/merge_request_templates/merge-request.md b/.gitlab/merge_request_templates/merge-request.md new file mode 100644 index 0000000..7216cb2 --- /dev/null +++ b/.gitlab/merge_request_templates/merge-request.md @@ -0,0 +1,19 @@ +Thank you for your contribution to GHC! + +Please take a few moments to verify that your commits fulfill the following: + + * [ ] are either individually buildable or squashed + * [ ] have commit messages which describe *what they do* + (referring to [Notes][notes] and tickets using `#NNNN` syntax when + appropriate) + * [ ] have added source comments describing your change. For larger changes you + likely should add a [Note][notes] and cross-reference it from the relevant + places. + * [ ] add a [testcase to the + testsuite](https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding). + +If you have any questions don't hesitate to open your merge request and inquire +in a comment. If your patch isn't quite done yet please do add prefix your MR +title with `WIP:`. + +[notes]: https://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Commentsinthesourcecode From git at git.haskell.org Thu Feb 21 15:09:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:44 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Add support for ASM foreign files (.s) in TH (#16180) (b3ee7e3) Message-ID: <20190221150944.BB1273A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/b3ee7e330f7a98de36130f356bf32b95bc28859c/ghc >--------------------------------------------------------------- commit b3ee7e330f7a98de36130f356bf32b95bc28859c Author: Sylvain Henry Date: Tue Jan 15 13:14:45 2019 +0100 Add support for ASM foreign files (.s) in TH (#16180) >--------------------------------------------------------------- b3ee7e330f7a98de36130f356bf32b95bc28859c compiler/main/DriverPipeline.hs | 9 ++++---- libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs | 8 ++++++- .../template-haskell/Language/Haskell/TH/Syntax.hs | 9 ++++---- testsuite/tests/th/T16180.hs | 25 ++++++++++++++++++++++ .../objc/objcpp-hi.stdout => th/T16180.stdout} | 1 + testsuite/tests/th/all.T | 1 + 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index f1a5cb4..5fe2362 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -306,11 +306,12 @@ compileForeign :: HscEnv -> ForeignSrcLang -> FilePath -> IO FilePath compileForeign _ RawObject object_file = return object_file compileForeign hsc_env lang stub_c = do let phase = case lang of - LangC -> Cc - LangCxx -> Ccxx - LangObjc -> Cobjc + LangC -> Cc + LangCxx -> Ccxx + LangObjc -> Cobjc LangObjcxx -> Cobjcxx - RawObject -> panic "compileForeign: should be unreachable" + LangAsm -> As True -- allow CPP + RawObject -> panic "compileForeign: should be unreachable" (_, stub_o) <- runPipeline StopLn hsc_env (stub_c, Just (RealPhase phase)) Nothing (Temporary TFL_GhcSession) diff --git a/libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs b/libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs index 3106141..c40f6f9 100644 --- a/libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs +++ b/libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs @@ -6,6 +6,12 @@ module GHC.ForeignSrcLang.Type import Prelude -- See note [Why do we import Prelude here?] import GHC.Generics (Generic) +-- | Foreign formats supported by GHC via TH data ForeignSrcLang - = LangC | LangCxx | LangObjc | LangObjcxx | RawObject + = LangC -- ^ C + | LangCxx -- ^ C++ + | LangObjc -- ^ Objective C + | LangObjcxx -- ^ Objective C++ + | LangAsm -- ^ Assembly language (.s) + | RawObject -- ^ Object (.o) deriving (Eq, Show, Generic) diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index 705222a..3ff6393 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -503,11 +503,12 @@ addForeignFile = addForeignSource addForeignSource :: ForeignSrcLang -> String -> Q () addForeignSource lang src = do let suffix = case lang of - LangC -> "c" - LangCxx -> "cpp" - LangObjc -> "m" + LangC -> "c" + LangCxx -> "cpp" + LangObjc -> "m" LangObjcxx -> "mm" - RawObject -> "a" + LangAsm -> "s" + RawObject -> "a" path <- addTempFile suffix runIO $ writeFile path src addForeignFilePath lang path diff --git a/testsuite/tests/th/T16180.hs b/testsuite/tests/th/T16180.hs new file mode 100644 index 0000000..2a4b80c --- /dev/null +++ b/testsuite/tests/th/T16180.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Main where + +import Language.Haskell.TH.Syntax +import Foreign.C.String + +$(do + -- some architectures require a "_" symbol prefix... + -- GHC defines a LEADING_UNDERSCORE CPP constant to indicate this. + addForeignSource LangAsm + "#if defined(LEADING_UNDERSCORE)\n\ + \.global \"_mydata\"\n\ + \_mydata:\n\ + \#else\n\ + \.global \"mydata\"\n\ + \mydata:\n\ + \#endif\n\ + \.ascii \"Hello world\\0\"\n" + return []) + +foreign import ccall "&mydata" mystring :: CString + +main :: IO () +main = putStrLn =<< peekCString mystring diff --git a/testsuite/tests/driver/objc/objcpp-hi.stdout b/testsuite/tests/th/T16180.stdout similarity index 92% copy from testsuite/tests/driver/objc/objcpp-hi.stdout copy to testsuite/tests/th/T16180.stdout index 802992c..a378710 100644 --- a/testsuite/tests/driver/objc/objcpp-hi.stdout +++ b/testsuite/tests/th/T16180.stdout @@ -1 +1,2 @@ Hello world + diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 6783bb6..9ddf283 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -467,3 +467,4 @@ test('T15437', expect_broken(15437), multimod_compile, test('T15985', normal, compile, ['']) test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) +test('T16180', normal, compile_and_run, ['']) From git at git.haskell.org Thu Feb 21 15:09:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:47 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Minor typo in docs for KProxy (4765a4a) Message-ID: <20190221150947.BE6203A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/4765a4a593443ea21b669d944d60c54014c5f2cc/ghc >--------------------------------------------------------------- commit 4765a4a593443ea21b669d944d60c54014c5f2cc Author: Joachim Breitner Date: Tue Jan 22 11:17:57 2019 +0100 Minor typo in docs for KProxy really minor, but it annoyed me when reading it :-) >--------------------------------------------------------------- 4765a4a593443ea21b669d944d60c54014c5f2cc libraries/base/Data/Proxy.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/Data/Proxy.hs b/libraries/base/Data/Proxy.hs index e8f9151..92fef0e 100644 --- a/libraries/base/Data/Proxy.hs +++ b/libraries/base/Data/Proxy.hs @@ -57,7 +57,7 @@ data Proxy t = Proxy deriving ( Bounded -- ^ @since 4.7.0.0 , Read -- ^ @since 4.7.0.0 ) --- | A concrete, promotable proxy type, for use at the kind level +-- | A concrete, promotable proxy type, for use at the kind level. -- There are no instances for this because it is intended at the kind level only data KProxy (t :: Type) = KProxy From git at git.haskell.org Thu Feb 21 15:09:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:50 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Error out of invalid Int/Word bit shifts (0d917db) Message-ID: <20190221150950.CAE203A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/0d917dbb46f91151314a2d50573d5acd4b70213f/ghc >--------------------------------------------------------------- commit 0d917dbb46f91151314a2d50573d5acd4b70213f Author: Alec Theriault Date: Thu Jan 10 23:44:04 2019 -0800 Error out of invalid Int/Word bit shifts Although the Haddock's for `shiftL` and `shiftR` do require the number of bits to be non-negative, we should still check this before calling out to primitives (which also have undefined behaviour for negative bit shifts). If a user _really_ wants to bypass checks that the number of bits is sensible, they already have the aptly-named `unsafeShiftL`/`unsafeShiftR` at their disposal. See #16111. >--------------------------------------------------------------- 0d917dbb46f91151314a2d50573d5acd4b70213f compiler/prelude/PrelRules.hs | 5 ++--- libraries/base/Data/Bits.hs | 22 ++++++++++++++++------ libraries/base/GHC/Int.hs | 40 ++++++++++++++++++++++++++++++---------- libraries/base/GHC/Word.hs | 40 ++++++++++++++++++++++++++++++---------- libraries/base/changelog.md | 4 ++++ 5 files changed, 82 insertions(+), 29 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 0d917dbb46f91151314a2d50573d5acd4b70213f From git at git.haskell.org Thu Feb 21 15:09:53 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:53 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: A few typofixes (9c09935) Message-ID: <20190221150953.EF3EE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/9c09935adf5958564e51f6cef9a8e972e34add87/ghc >--------------------------------------------------------------- commit 9c09935adf5958564e51f6cef9a8e972e34add87 Author: Gabor Greif Date: Tue Jan 22 12:07:47 2019 +0100 A few typofixes >--------------------------------------------------------------- 9c09935adf5958564e51f6cef9a8e972e34add87 compiler/basicTypes/BasicTypes.hs | 2 +- compiler/coreSyn/CoreArity.hs | 2 +- compiler/coreSyn/CoreSyn.hs | 2 +- compiler/coreSyn/CoreUnfold.hs | 2 +- compiler/hieFile/HieAst.hs | 2 +- compiler/hsSyn/HsDecls.hs | 2 +- compiler/main/InteractiveEval.hs | 2 +- compiler/nativeGen/CFG.hs | 2 +- compiler/prelude/primops.txt.pp | 2 +- compiler/simplCore/Simplify.hs | 5 ++--- compiler/stgSyn/CoreToStg.hs | 2 +- compiler/typecheck/FamInst.hs | 2 +- docs/users_guide/extending_ghc.rst | 2 +- hadrian/src/Rules/Documentation.hs | 2 +- libraries/base/Data/Either.hs | 4 ++-- libraries/base/Data/Foldable.hs | 2 +- rts/posix/Signals.c | 2 +- 17 files changed, 19 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 9c09935adf5958564e51f6cef9a8e972e34add87 From git at git.haskell.org Thu Feb 21 15:09:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:09:57 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Add predicate for CPU feature availability (afb136c) Message-ID: <20190221150957.4ACFA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/afb136c1adf40d8d115a9fc12890a72dc133fbb3/ghc >--------------------------------------------------------------- commit afb136c1adf40d8d115a9fc12890a72dc133fbb3 Author: Ben Gamari Date: Thu Dec 27 14:41:01 2018 -0500 testsuite: Add predicate for CPU feature availability Previously testing code-generation for ISA extensions was nearly impossible since we had no ability to determine whether the host supports the needed extension. Here we fix this by introducing a simple /proc/cpuinfo-based testsuite predicate. We really ought to >--------------------------------------------------------------- afb136c1adf40d8d115a9fc12890a72dc133fbb3 testsuite/driver/cpu_features.py | 71 ++++++++++++++++++++++++++++++++++++++++ testsuite/driver/runtests.py | 7 ++++ testsuite/driver/testlib.py | 1 + 3 files changed, 79 insertions(+) diff --git a/testsuite/driver/cpu_features.py b/testsuite/driver/cpu_features.py new file mode 100644 index 0000000..7716306 --- /dev/null +++ b/testsuite/driver/cpu_features.py @@ -0,0 +1,71 @@ +import os +from testglobals import config +import subprocess +import re + +# Feature names generally follow the naming used by Linux's /proc/cpuinfo. +SUPPORTED_CPU_FEATURES = { + # These aren't comprehensive; they are only CPU features that we care about + + # x86: + 'sse', 'sse2', 'sse3', 'ssse3', 'sse4_1', 'sse4_2', + 'avx1', 'avx2', + 'popcnt', 'bmi1', 'bmi2' +} + +cpu_feature_cache = None + +def get_cpu_features(): + if config.os in ['mingw32', 'linux'] and os.path.exists('/proc/cpuinfo'): + f = open('/proc/cpuinfo').read() + flags = re.search(r'flags\s*:\s*.*$', f, re.M) + if flags is None: + print('get_cpu_features: failed to find cpu features') + return {} + flags = set(flags.group(0).split()) + if 'pni' in flags: + flags.add('sse3') + flags.remove('pni') + return flags + + elif config.os == 'darwin': + out = subprocess.check_output(['sysctl', 'hw']).decode('UTF-8') + features = set() + def check_feature(darwin_name, our_name=None): + if re.search(r'hw\.optional.%s:\s*1' % darwin_name, out) is not None: + features.add(darwin_name if our_name is None else our_name) + + for feature in SUPPORTED_CPU_FEATURES: + check_feature(feature) + + # A few annoying cases + check_feature('avx1_0', 'avx1') + check_feature('avx2_0', 'avx2') + return features + + else: + # TODO: Add {Open,Free}BSD support + print('get_cpu_features: Lacking support for your platform') + + return {} + +def have_cpu_feature(feature): + """ + A testsuite predicate for testing the availability of CPU features. + """ + assert feature in SUPPORTED_CPU_FEATURES + if cpu_feature_cache is None: + cpu_feature_cache = get_cpu_features() + print('Found CPU features:', ' '.join(cpu_feature_cache)) + # Sanity checking + assert all(feat in SUPPORTED_CPU_FEATURES + for feat in cpu_feature_cache) + + return feature in cpu_feature_cache + + +if __name__ == '__main__': + import sys + config.os = sys.argv[1] + print(get_cpu_features()) + diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 55b13df..247a5cc 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -27,6 +27,7 @@ from testutil import getStdout, Watcher, str_warn, str_info from testglobals import getConfig, ghc_env, getTestRun, TestOptions, brokens from perf_notes import MetricChange, inside_git_repo, is_worktree_dirty from junit import junit +import cpu_features # Readline sometimes spews out ANSI escapes for some values of TERM, # which result in test failures. Thus set TERM to a nice, simple, safe @@ -274,6 +275,12 @@ t.start_time = time.localtime() print('Beginning test run at', time.strftime("%c %Z",t.start_time)) +# For reference +try: + print('Detected CPU features: ', cpu_features.get_cpu_features()) +except Exception as e: + print('Failed to detect CPU features: ', e) + sys.stdout.flush() # we output text, which cannot be unbuffered sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w") diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index c09d02a..ba4f6a5 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -20,6 +20,7 @@ import subprocess from testglobals import config, ghc_env, default_testopts, brokens, t from testutil import strip_quotes, lndir, link_or_copy_file, passed, failBecause, str_fail, str_pass +from cpu_features import have_cpu_feature import perf_notes as Perf from perf_notes import MetricChange extra_src_files = {'T4198': ['exitminus1.c']} # TODO: See #12223 From git at git.haskell.org Thu Feb 21 15:10:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:00 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Explicitly clear dependencies of all jobs (ece7284) Message-ID: <20190221151000.510783A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/ece728430d029b0f9c1d22dd9dfe298ea555c88b/ghc >--------------------------------------------------------------- commit ece728430d029b0f9c1d22dd9dfe298ea555c88b Author: Ben Gamari Date: Tue Jan 22 14:21:31 2019 -0500 gitlab-ci: Explicitly clear dependencies of all jobs Apparently GitLab CI defaults to declaring all jobs of the previous stage as dependencies of a job. This meant that we would end up downloading all of our binary distributions during the `cleanup` stage, eating up a truly remarkable amount of S3 tranfers. >--------------------------------------------------------------- ece728430d029b0f9c1d22dd9dfe298ea555c88b .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 218bd78..d739eff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,6 +42,7 @@ ghc-linters: .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA .gitlab/linters/check-cpp.py $base $CI_COMMIT_SHA fi + dependencies: [] tags: - lint @@ -98,6 +99,7 @@ validate-x86_64-linux-deb8-hadrian: - | THREADS=`mk/detect-cpu-count.sh` make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml + dependencies: [] artifacts: reports: junit: junit.xml @@ -317,6 +319,7 @@ validate-x86_64-linux-deb9-unreg: - rd /s /q tmp - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache - bash -c 'make clean || true' + dependencies: [] cache: paths: - cabal-cache @@ -394,6 +397,7 @@ cleanup-windows: tags: - x86_64-windows when: always + dependencies: [] before_script: - echo "Time to clean up" script: From git at git.haskell.org Thu Feb 21 15:10:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:03 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Update Darwin CI to use new toplevel --with-intree-gmp configure flag (474c31a) Message-ID: <20190221151003.678BD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/474c31acf8f7bb14fef6d3908ff9cce4ccda69c2/ghc >--------------------------------------------------------------- commit 474c31acf8f7bb14fef6d3908ff9cce4ccda69c2 Author: Alec Theriault Date: Mon Jan 21 19:25:29 2019 -0800 Update Darwin CI to use new toplevel --with-intree-gmp configure flag >--------------------------------------------------------------- 474c31acf8f7bb14fef6d3908ff9cce4ccda69c2 .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 158e740..4f426f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,6 +117,7 @@ validate-x86_64-darwin: # Only Sierra and onwards supports clock_gettime. See #12858 ac_cv_func_clock_gettime: "no" LANG: "en_US.UTF-8" + CONFIGURE_ARGS: --with-intree-gmp before_script: - git clean -xdf && git submodule foreach git clean -xdf - python3 .gitlab/fix-submodules.py @@ -126,7 +127,6 @@ validate-x86_64-darwin: - bash .gitlab/darwin-init.sh - PATH="`pwd`/toolchain/bin:$PATH" - - echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk after_script: - cp -Rf $HOME/.cabal cabal-cache artifacts: From git at git.haskell.org Thu Feb 21 15:10:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:06 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Extend linker-script workaround to work with musl libc (4d9b4dd) Message-ID: <20190221151006.712E23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/4d9b4dda63eb6613e4cf810296b440c568d1c7fe/ghc >--------------------------------------------------------------- commit 4d9b4dda63eb6613e4cf810296b440c568d1c7fe Author: Samuel Holland Date: Sun Jan 20 20:20:16 2019 -0600 Extend linker-script workaround to work with musl libc GHC has code to handle unsuffixed .so files that are linker scripts pointing to the real shared library. The detection is done by parsing the result of `dlerror()` after calling `dlopen()` and looking for certain error strings. On musl libc, the error message is "Exec format error", which happens to be `strerror(ENOEXEC)`: ``` $ cat tmp.c #include #include int main(void) { dlopen("libz.so", RTLD_NOW | RTLD_GLOBAL); puts(dlerror()); return 0; } $ gcc -o tmp tmp.c $ ./tmp Error loading shared library libz.so: Exec format error $ ``` This change fixes the workaround to also work on musl libc. Link: https://phabricator.haskell.org/D5474 >--------------------------------------------------------------- 4d9b4dda63eb6613e4cf810296b440c568d1c7fe rts/Linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index 5b10b79..ac030af 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -483,7 +483,7 @@ initLinker_ (int retain_cafs) # endif /* RTLD_DEFAULT */ compileResult = regcomp(&re_invalid, - "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)", + "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format|Exec format error)", REG_EXTENDED); if (compileResult != 0) { barf("Compiling re_invalid failed"); From git at git.haskell.org Thu Feb 21 15:10:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:09 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Update transformers module (0be6609) Message-ID: <20190221151009.76DF13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/0be6609e5ff2d3a9fd27d30a911465b356505dad/ghc >--------------------------------------------------------------- commit 0be6609e5ff2d3a9fd27d30a911465b356505dad Author: Herbert Valerio Riedel Date: Tue Jan 22 01:00:10 2019 +0100 Update transformers module >--------------------------------------------------------------- 0be6609e5ff2d3a9fd27d30a911465b356505dad libraries/transformers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/transformers b/libraries/transformers index 8055784..4965519 160000 --- a/libraries/transformers +++ b/libraries/transformers @@ -1 +1 @@ -Subproject commit 80557845cdc0e72bc05cec19cf7a1bf5495e9e69 +Subproject commit 49655191d33912815a9389b764e2d89e92140938 From git at git.haskell.org Thu Feb 21 15:10:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:13 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Add test for #16104 (c442c93) Message-ID: <20190221151013.9F2033A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/c442c93a462a52054cc4243126fbe3d138d5a535/ghc >--------------------------------------------------------------- commit c442c93a462a52054cc4243126fbe3d138d5a535 Author: Ben Gamari Date: Tue Jan 15 11:48:59 2019 -0500 testsuite: Add test for #16104 >--------------------------------------------------------------- c442c93a462a52054cc4243126fbe3d138d5a535 testsuite/tests/plugins/Makefile | 4 ++++ .../tc-plugin-ghci => plugins/T16104-plugin}/LICENSE | 0 .../{rule-defining-plugin => T16104-plugin}/Makefile | 0 .../T16104-plugin}/Setup.hs | 0 .../T16104-plugin.cabal} | 8 ++------ .../tests/plugins/T16104-plugin/T16104_Plugin.hs | 20 ++++++++++++++++++++ testsuite/tests/plugins/T16104.hs | 4 ++++ testsuite/tests/plugins/T16104.stdout | 1 + testsuite/tests/plugins/all.T | 6 ++++++ 9 files changed, 37 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/plugins/Makefile b/testsuite/tests/plugins/Makefile index 8a6af5b..d913ca5 100644 --- a/testsuite/tests/plugins/Makefile +++ b/testsuite/tests/plugins/Makefile @@ -121,3 +121,7 @@ plugin-recomp-change-prof: "$(MAKE)" -s --no-print-directory -C plugin-recomp package.plugins01 TOP=$(TOP) RUN=-DRUN2 "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 plugin-recomp-test.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -fplugin PurePlugin "$(TEST_HC)" $(TEST_HC_OPTS) -prof -osuf p_o -hisuf p_hi -v0 plugin-recomp-test.hs -package-db plugin-recomp/pkg.plugins01/local.package.conf -fplugin PurePlugin + +.PHONY: T16104 +T16104: + "$(TEST_HC)" $(TEST_HC_OPTS) $(ghcPluginWayFlags) -v0 T16104.hs -package-db T16104-plugin/pkg.T16104-plugin/local.package.conf diff --git a/testsuite/tests/ghci/should_run/tc-plugin-ghci/LICENSE b/testsuite/tests/plugins/T16104-plugin/LICENSE similarity index 100% copy from testsuite/tests/ghci/should_run/tc-plugin-ghci/LICENSE copy to testsuite/tests/plugins/T16104-plugin/LICENSE diff --git a/testsuite/tests/plugins/rule-defining-plugin/Makefile b/testsuite/tests/plugins/T16104-plugin/Makefile similarity index 100% copy from testsuite/tests/plugins/rule-defining-plugin/Makefile copy to testsuite/tests/plugins/T16104-plugin/Makefile diff --git a/testsuite/tests/ghci/should_run/tc-plugin-ghci/Setup.hs b/testsuite/tests/plugins/T16104-plugin/Setup.hs similarity index 100% copy from testsuite/tests/ghci/should_run/tc-plugin-ghci/Setup.hs copy to testsuite/tests/plugins/T16104-plugin/Setup.hs diff --git a/testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal b/testsuite/tests/plugins/T16104-plugin/T16104-plugin.cabal similarity index 51% copy from testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal copy to testsuite/tests/plugins/T16104-plugin/T16104-plugin.cabal index b354f6b..5288e8f 100644 --- a/testsuite/tests/plugins/rule-defining-plugin/rule-defining-plugin.cabal +++ b/testsuite/tests/plugins/T16104-plugin/T16104-plugin.cabal @@ -1,15 +1,11 @@ -Name: rule-defining-plugin +Name: T16104-plugin Version: 0.1 Synopsis: For testing Cabal-Version: >= 1.2 Build-Type: Simple License: BSD3 License-File: LICENSE -Author: Edward Z. Yang -Homepage: http://ezyang.com Library Build-Depends: base, ghc - ghc-options: -O - Exposed-Modules: - RuleDefiningPlugin + Exposed-Modules: T16104_Plugin diff --git a/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs b/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs new file mode 100644 index 0000000..79cd0fe --- /dev/null +++ b/testsuite/tests/plugins/T16104-plugin/T16104_Plugin.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T16104_Plugin (plugin) where + +import GhcPlugins +import Data.Bits + +plugin :: Plugin +plugin = defaultPlugin {installCoreToDos = install} + where install _ todos = return (test : todos) + + test = CoreDoPluginPass "Test" check + + check :: ModGuts -> CoreM ModGuts + check m = do mbN <- thNameToGhcName 'complement + case mbN of + Just _ -> liftIO $ putStrLn "Found complement!" + Nothing -> error "Failed to locate complement" + + return m diff --git a/testsuite/tests/plugins/T16104.hs b/testsuite/tests/plugins/T16104.hs new file mode 100644 index 0000000..bfef697 --- /dev/null +++ b/testsuite/tests/plugins/T16104.hs @@ -0,0 +1,4 @@ +{-# OPTIONS_GHC -fplugin T16104_Plugin #-} + +main :: IO () +main = return () diff --git a/testsuite/tests/plugins/T16104.stdout b/testsuite/tests/plugins/T16104.stdout new file mode 100644 index 0000000..a1eb7b6 --- /dev/null +++ b/testsuite/tests/plugins/T16104.stdout @@ -0,0 +1 @@ +Found complement! diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index da6294e..82e9fcb 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -208,3 +208,9 @@ test('T15858', extra_hc_opts("-package-db plugin-recomp/pkg.plugins01/local.package.conf ") ], ghci_script, ['T15858.script']) + +test('T16104', + [extra_files(['T16104-plugin/']), + pre_cmd('$MAKE -s --no-print-directory -C T16104-plugin package.T16104-plugin TOP={top}') + ], + run_command, ['$MAKE -s --no-print-directory T16104']) From git at git.haskell.org Thu Feb 21 15:10:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:16 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Add @sgraf to CODEOWNERS (204ee8d) Message-ID: <20190221151016.A4D2F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/204ee8de06f615bd64dcc289207c8530573bb5bf/ghc >--------------------------------------------------------------- commit 204ee8de06f615bd64dcc289207c8530573bb5bf Author: Sebastian Graf Date: Sat Jan 26 12:44:23 2019 -0500 Add @sgraf to CODEOWNERS [skip ci] >--------------------------------------------------------------- 204ee8de06f615bd64dcc289207c8530573bb5bf CODEOWNERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 30d05f5..97ec69d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -16,11 +16,13 @@ /compiler/rename @simonpj @goldfire /compiler/typecheck/TcDeriv* @RyanGlScott /compiler/nativeGen @simonmar @bgamari @AndreasK -/compiler/simplCore/CallArity.hs @nomeata +/compiler/simplCore/CallArity.hs @nomeata @sgraf /compiler/utils/UnVarGraph.hs @nomeata /compiler/simplCore/Exitify.hs @nomeata /compiler/simplStg/StgCse.hs @nomeata +/compiler/simplStg/StgLiftLams.hs @sgraf /compiler/cmm/CmmSwitch.hs @nomeata +/compiler/stranal/DmdAnal.hs @simonpj @sgraf /compiler/types @simonpj @goldfire /compiler/deSugar @simonpj @goldfire /compiler/hsSyn/Convert.hs @goldfire From git at git.haskell.org Thu Feb 21 15:10:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:19 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Normalise style (fff1306) Message-ID: <20190221151019.A63883A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/fff13068b9a1829036cf64d69153f0290e7368d4/ghc >--------------------------------------------------------------- commit fff13068b9a1829036cf64d69153f0290e7368d4 Author: Ben Gamari Date: Sun Jan 20 22:32:09 2019 -0500 testsuite: Normalise style >--------------------------------------------------------------- fff13068b9a1829036cf64d69153f0290e7368d4 testsuite/tests/plugins/all.T | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 82e9fcb..30b8fd6 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -7,27 +7,28 @@ setTestOpts(req_interp) test('plugins01', [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]), - when(opsys('mingw32'), multi_cpu_race), + when(opsys('mingw32'), multi_cpu_race), pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins01 TOP={top}')], run_command, ['$MAKE -s --no-print-directory plugins01']) test('plugins02', [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]), - when(opsys('mingw32'), multi_cpu_race), + when(opsys('mingw32'), multi_cpu_race), pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins02 TOP={top}')], compile_fail, ['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.plugin_way_flags]) test('plugins03', [extra_files(['simple-plugin/']), only_ways([config.ghc_plugin_way]), - when(opsys('mingw32'), multi_cpu_race), + when(opsys('mingw32'), multi_cpu_race), pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins03 TOP={top}')], compile_fail, ['-package-db simple-plugin/pkg.plugins03/local.package.conf -fplugin Simple.NonExistentPlugin -package simple-plugin']) -test('plugins04', [extra_files(['HomePackagePlugin.hs']), - only_ways([config.ghc_plugin_way]), - when(opsys('mingw32'), multi_cpu_race)], +test('plugins04', + [extra_files(['HomePackagePlugin.hs']), + only_ways([config.ghc_plugin_way]), + when(opsys('mingw32'), multi_cpu_race)], multimod_compile_fail, ['plugins04', '-package ghc -fplugin HomePackagePlugin']) From git at git.haskell.org Thu Feb 21 15:10:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:22 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: hadrian: use new-exec to make sure alex & happy are in PATH (#16120) (940fc50) Message-ID: <20190221151022.AEBDD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/940fc50f33dd89ac848479049c86a678bff7f6fb/ghc >--------------------------------------------------------------- commit 940fc50f33dd89ac848479049c86a678bff7f6fb Author: Adam Sandberg Eriksson Date: Wed Jan 2 22:08:49 2019 +0100 hadrian: use new-exec to make sure alex & happy are in PATH (#16120) (cherry picked from commit 5cb071af5b02b7433b2bb4d06062ac8b6fb387e8) >--------------------------------------------------------------- 940fc50f33dd89ac848479049c86a678bff7f6fb hadrian/build.cabal.bat | 3 ++- hadrian/build.cabal.sh | 3 ++- hadrian/src/Environment.hs | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hadrian/build.cabal.bat b/hadrian/build.cabal.bat index 96f2725..3344791 100644 --- a/hadrian/build.cabal.bat +++ b/hadrian/build.cabal.bat @@ -31,7 +31,8 @@ if %CABMAJOR% equ 2 ( ) if %_cabal_ok% equ 1 ( "%CABAL%" --project-file=%PROJ% new-build %CABFLAGS% -j exe:hadrian - "%CABAL%" --project-file=%PROJ% new-run %CABFLAGS% exe:hadrian -- ^ + rem use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH + "%CABAL%" --project-file=%PROJ% new-exec %CABFLAGS% hadrian -- ^ --directory "%CD%" ^ %* ) else ( diff --git a/hadrian/build.cabal.sh b/hadrian/build.cabal.sh index 8c7b594..f28c3e0 100755 --- a/hadrian/build.cabal.sh +++ b/hadrian/build.cabal.sh @@ -24,7 +24,8 @@ CABVER=( ${CABVERSTR//./ } ) if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ]; then "$CABAL" --project-file="$PROJ" new-build $CABFLAGS -j exe:hadrian - "$CABAL" --project-file="$PROJ" new-run $CABFLAGS exe:hadrian -- \ + # use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH + "$CABAL" --project-file="$PROJ" new-exec $CABFLAGS hadrian -- \ --directory "$PWD" \ "$@" else diff --git a/hadrian/src/Environment.hs b/hadrian/src/Environment.hs index 1666c68..ef98bb1 100644 --- a/hadrian/src/Environment.hs +++ b/hadrian/src/Environment.hs @@ -10,6 +10,10 @@ setupEnvironment = do -- Cabal refuses to work when GHC_PACKAGE_PATH is set (e.g. by Stack) unsetEnv "GHC_PACKAGE_PATH" + -- cabal new-exec sets GHC_ENVIRONMENT, it needs to be unset for GHC + -- invocations to work properly + unsetEnv "GHC_ENVIRONMENT" + -- in MinGW if PWD is set to a Windows "C:\\" style path then configure -- `pwd` will return the Windows path, and then modifying $PATH will fail. -- See https://github.com/snowleopard/hadrian/issues/189 for details. From git at git.haskell.org Thu Feb 21 15:10:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:25 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix incorrectly named configure options (4d778c7) Message-ID: <20190221151025.B4A7F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/4d778c7f4b39645ad55bf12fbe1fedc40f52be25/ghc >--------------------------------------------------------------- commit 4d778c7f4b39645ad55bf12fbe1fedc40f52be25 Author: Alec Theriault Date: Sat Jan 26 18:07:48 2019 -0800 Fix incorrectly named configure options Although we should use 'AC_ARG_ENABLE' for boolean flags, it also means options get named '--enable-*', not '--with-*'. This should unbreak the --with-intree-gmp option. (cherry picked from commit b89b6e71c798996724ba99f273f88d8a3637fb8d) >--------------------------------------------------------------- 4d778c7f4b39645ad55bf12fbe1fedc40f52be25 aclocal.m4 | 4 ++-- libraries/integer-gmp/configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 62825c3..9d2390e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1780,13 +1780,13 @@ AC_DEFUN([FP_GMP], [directory containing gmp library])], [GMP_LIB_DIRS=$withval]) - AC_ARG_ENABLE([intree-gmp], + AC_ARG_WITH([intree-gmp], [AC_HELP_STRING([--with-intree-gmp], [force using the in-tree GMP])], [GMP_FORCE_INTREE=YES], [GMP_FORCE_INTREE=NO]) - AC_ARG_ENABLE([gmp-framework-preferred], + AC_ARG_WITH([gmp-framework-preferred], [AC_HELP_STRING([--with-gmp-framework-preferred], [on OSX, prefer the GMP framework to the gmp lib])], [GMP_PREFER_FRAMEWORK=YES], diff --git a/libraries/integer-gmp/configure.ac b/libraries/integer-gmp/configure.ac index d189375..1ccd48e 100644 --- a/libraries/integer-gmp/configure.ac +++ b/libraries/integer-gmp/configure.ac @@ -27,13 +27,13 @@ AC_ARG_WITH([gmp-libraries], [GMP_LIB_DIRS=$withval; LDFLAGS="-L$withval"], [GMP_LIB_DIRS=]) -AC_ARG_ENABLE([gmp-framework-preferred], +AC_ARG_WITH([gmp-framework-preferred], [AC_HELP_STRING([--with-gmp-framework-preferred], [on OSX, prefer the GMP framework to the gmp lib])], [GMP_PREFER_FRAMEWORK=YES], [GMP_PREFER_FRAMEWORK=NO]) -AC_ARG_ENABLE([intree-gmp], +AC_ARG_WITH([intree-gmp], [AC_HELP_STRING([--with-intree-gmp], [force using the in-tree GMP])], [GMP_FORCE_INTREE=YES], From git at git.haskell.org Thu Feb 21 15:10:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:29 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: [T16199] Adds a verify-packages script (b69e4e6) Message-ID: <20190221151029.26B713A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/b69e4e6258793e8411d375e6e7f27666a170380f/ghc >--------------------------------------------------------------- commit b69e4e6258793e8411d375e6e7f27666a170380f Author: Moritz Angermann Date: Sun Jan 20 05:24:21 2019 -0500 [T16199] Adds a verify-packages script >--------------------------------------------------------------- b69e4e6258793e8411d375e6e7f27666a170380f utils/verify-release/verify-packages.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/utils/verify-release/verify-packages.sh b/utils/verify-release/verify-packages.sh new file mode 100755 index 0000000..d5c6bf1 --- /dev/null +++ b/utils/verify-release/verify-packages.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# This script will verify that the packages in ghc, +# correspond to packages on hackage. +rm -fR ghc-packages hackage-packages package-diffs +mkdir -p ghc-packages hackage-packages package-diffs +# We'll skip Cabal and tarballs, while looking only at packages in libraries +# that we reference as gitmodules. +for lib in $(git submodule status|grep libraries|grep -v tarballs|grep -v Cabal|awk -F\ '{ print $2 }'); do + (cd $lib && cabal new-sdist -o ../../ghc-packages); +done + +for pkg in $(cd ghc-packages && ls *.tar.gz); do + PKG=${pkg%%.tar.gz} + (cd hackage-packages && cabal get --pristine ${PKG}) + (cd hackage-packages/${PKG} && git init && git add . && git commit -q -m "hackage packages" && rm -fR *) + (cd hackage-packages && tar xzf ../ghc-packages/$pkg) + (cd hackage-packages/${PKG} && git -c core.fileMode=false diff > ../$PKG.patch) +done +find hackage-packages -name "*.patch" -not -empty -type f -print -exec false {} + From git at git.haskell.org Thu Feb 21 15:10:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:32 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: users guide: fix typesetting of pragmas (4d2b804) Message-ID: <20190221151032.2B62E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/4d2b804f73b4d4f38c5108ed248569312104705c/ghc >--------------------------------------------------------------- commit 4d2b804f73b4d4f38c5108ed248569312104705c Author: Ben Price Date: Tue Jan 22 00:16:14 2019 +0000 users guide: fix typesetting of pragmas >--------------------------------------------------------------- 4d2b804f73b4d4f38c5108ed248569312104705c docs/users_guide/conf.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/users_guide/conf.py b/docs/users_guide/conf.py index c64e0a3..e48992d 100644 --- a/docs/users_guide/conf.py +++ b/docs/users_guide/conf.py @@ -147,9 +147,10 @@ def parse_ghci_cmd(env, sig, signode): return name def parse_pragma(env, sig, signode): - name = sig.split(' ')[0] - signode += addnodes.desc_name('{-# '+name, sig + ' #-}') - return name + idx = sig.split(' ')[0] + name = '{-# ' + sig + ' #-}' + signode += addnodes.desc_name(name, name) + return idx def parse_flag(env, sig, signode): From git at git.haskell.org Thu Feb 21 15:10:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:35 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Hadrian: support in-tree GMP (86002ee) Message-ID: <20190221151035.3997E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/86002ee23e23110ae08eb896c2f086778ff44c17/ghc >--------------------------------------------------------------- commit 86002ee23e23110ae08eb896c2f086778ff44c17 Author: Alec Theriault Date: Wed Dec 5 20:46:21 2018 -0800 Hadrian: support in-tree GMP Summary: This adds top-level configure flags '--with-intree-gmp' and '--with-framework-preferred', both of which are especially relevant on MacOS. Besides gaining two new flags, Hadrian also had to be taught what to do with the 'framework' in .cabal files. Test Plan: ./boot && ./configure --with-intree-gmp && ./hadrian/build.sh ./boot && ./configure --with-gmp-framework-preferred && ./hadrian/build.sh # on macos Reviewers: carter, snowleopard, alpmestan, hvr, goldfire, bgamari Subscribers: rwbarton, erikd GHC Trac Issues: #16001 Differential Revision: https://phabricator.haskell.org/D5417 >--------------------------------------------------------------- 86002ee23e23110ae08eb896c2f086778ff44c17 aclocal.m4 | 14 ++++++++++++++ hadrian/cfg/system.config.in | 6 ++++-- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 3 ++- hadrian/src/Hadrian/Haskell/Cabal/Type.hs | 1 + hadrian/src/Oracles/Flag.hs | 4 ++++ hadrian/src/Settings/Builders/Ghc.hs | 2 ++ hadrian/src/Settings/Packages.hs | 12 ++++-------- libraries/integer-gmp/config.mk.in | 2 ++ libraries/integer-gmp/configure.ac | 4 ++-- mk/config.mk.in | 2 ++ rules/build-package-data.mk | 8 ++++++++ 11 files changed, 45 insertions(+), 13 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 86002ee23e23110ae08eb896c2f086778ff44c17 From git at git.haskell.org Thu Feb 21 15:10:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:38 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Reenable Hadrian build on Windows (5c02d67) Message-ID: <20190221151038.3E3113A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/5c02d6726b74e4ee4b4ca6f650bd41239fdaac88/ghc >--------------------------------------------------------------- commit 5c02d6726b74e4ee4b4ca6f650bd41239fdaac88 Author: Ben Gamari Date: Mon Jan 21 15:55:05 2019 -0500 gitlab-ci: Reenable Hadrian build on Windows >--------------------------------------------------------------- 5c02d6726b74e4ee4b4ca6f650bd41239fdaac88 .gitlab-ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 162c19c..6354d72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -327,8 +327,6 @@ validate-x86_64-linux-deb9-unreg: validate-x86_64-windows-hadrian: extends: .validate-windows stage: full-build - # due to #16073 - allow_failure: true variables: GHC_VERSION: "8.6.2" LANG: "en_US.UTF-8" @@ -339,10 +337,11 @@ validate-x86_64-windows-hadrian: bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex' mkdir -p _build cp -R inplace/mingw _build/mingw - # FIXME: --no-lint due to #15950 - - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --no-lint" - - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist" - - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' + - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick" + # FIXME: Bindist disabled due to #16073 + #- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh binary-dist" + # FIXME: Testsuite disabled due to #16156. + #- bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml' cache: key: x86_64-windows tags: From git at git.haskell.org Thu Feb 21 15:10:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:42 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Mention DerivingStrategies in the warning when DAC and GND are both enabled (2420b36) Message-ID: <20190221151042.0DFA73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/2420b368f31f350601db2e38c2e059b4e372ddf6/ghc >--------------------------------------------------------------- commit 2420b368f31f350601db2e38c2e059b4e372ddf6 Author: Chaitanya Koparkar Date: Mon Jan 14 14:36:29 2019 -0500 Mention DerivingStrategies in the warning when DAC and GND are both enabled Summary: When DeriveAnyClass and GeneralizedNewtypeDeriving are both enabled, GHC prints out a warning that specifies the strategy it used to derive a class. This patch updates the warning to mention that users may pick a particular strategy by using DerivingStrategies. Test plan: make test TEST=T16179 >--------------------------------------------------------------- 2420b368f31f350601db2e38c2e059b4e372ddf6 compiler/typecheck/TcDeriv.hs | 5 ++++- testsuite/tests/deriving/should_compile/T16179.hs | 7 +++++++ testsuite/tests/deriving/should_compile/T16179.stderr | 5 +++++ testsuite/tests/deriving/should_compile/all.T | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 90b230a..6078a7a 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -1640,7 +1640,10 @@ mkNewTypeEqn [ text "Both DeriveAnyClass and" <+> text "GeneralizedNewtypeDeriving are enabled" , text "Defaulting to the DeriveAnyClass strategy" - <+> text "for instantiating" <+> ppr cls ] + <+> text "for instantiating" <+> ppr cls + , text "Use DerivingStrategies to pick" + <+> text "a different strategy" + ] mk_originative_eqn DerivSpecAnyClass -- CanDeriveStock CanDeriveStock gen_fn -> mk_originative_eqn $ diff --git a/testsuite/tests/deriving/should_compile/T16179.hs b/testsuite/tests/deriving/should_compile/T16179.hs new file mode 100644 index 0000000..5873f89 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T16179.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + +module T16179 where + +class C a +newtype T a = MkT a deriving C diff --git a/testsuite/tests/deriving/should_compile/T16179.stderr b/testsuite/tests/deriving/should_compile/T16179.stderr new file mode 100644 index 0000000..c3815d1 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T16179.stderr @@ -0,0 +1,5 @@ +T16179.hs:7:30: warning: + Both DeriveAnyClass and GeneralizedNewtypeDeriving are enabled + Defaulting to the DeriveAnyClass strategy for instantiating C + Use DerivingStrategies to pick a different strategy + In the newtype declaration for ‘T’ diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index 8c84bcc..ef6259d 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -114,3 +114,4 @@ test('T15290c', normal, compile, ['']) test('T15290d', normal, compile, ['']) test('T15398', normal, compile, ['']) test('T15637', normal, compile, ['']) +test('T16179', normal, compile, ['']) From git at git.haskell.org Thu Feb 21 15:10:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:45 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Disallow failure (9c71476) Message-ID: <20190221151045.154223A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/9c71476af7df1f1e9ba6a8a6c2a92446b20b398a/ghc >--------------------------------------------------------------- commit 9c71476af7df1f1e9ba6a8a6c2a92446b20b398a Author: Ben Gamari Date: Thu Jan 17 13:56:00 2019 -0500 gitlab-ci: Disallow failure >--------------------------------------------------------------- 9c71476af7df1f1e9ba6a8a6c2a92446b20b398a .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6354d72..158e740 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -109,7 +109,6 @@ validate-x86_64-linux-deb8-hadrian: validate-x86_64-darwin: extends: .validate stage: full-build - allow_failure: true tags: - x86_64-darwin variables: From git at git.haskell.org Thu Feb 21 15:10:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:48 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Mark T16180 as broken on Darwin (1f0e426) Message-ID: <20190221151048.17D1A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/1f0e426e9a05f84545cd5fb66b35da5611fbbb81/ghc >--------------------------------------------------------------- commit 1f0e426e9a05f84545cd5fb66b35da5611fbbb81 Author: Ben Gamari Date: Tue Jan 22 19:08:07 2019 -0500 testsuite: Mark T16180 as broken on Darwin See #16218. >--------------------------------------------------------------- 1f0e426e9a05f84545cd5fb66b35da5611fbbb81 testsuite/tests/th/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 9ddf283..4062cf2 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -467,4 +467,4 @@ test('T15437', expect_broken(15437), multimod_compile, test('T15985', normal, compile, ['']) test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) -test('T16180', normal, compile_and_run, ['']) +test('T16180', when(opsys('darwin'), expect_broken(16218)), compile_and_run, ['']) From git at git.haskell.org Thu Feb 21 15:10:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:52 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Lexer: Alternate Layout Rule injects actual not virtual braces (e0375ba) Message-ID: <20190221151052.53CDE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/e0375ba980fd5639d23a29575efb00c30d97c743/ghc >--------------------------------------------------------------- commit e0375ba980fd5639d23a29575efb00c30d97c743 Author: Alan Zimmerman Date: Sun Feb 3 10:27:42 2019 +0200 Lexer: Alternate Layout Rule injects actual not virtual braces When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Likewise, any injected ITsemi should have a zero-width SrcSpan. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279 (cherry picked from commit c1cf2693d6efddeeeb813cd8995a1be136800d17) >--------------------------------------------------------------- e0375ba980fd5639d23a29575efb00c30d97c743 compiler/parser/Lexer.x | 32 ++++++++++++---------- libraries/Cabal | 2 +- libraries/transformers | 2 +- testsuite/tests/ghc-api/annotations/Makefile | 20 ++++++++++++++ testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++ .../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 2 ++ utils/haddock | 2 +- utils/hsc2hs | 2 +- 9 files changed, 75 insertions(+), 19 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 e0375ba980fd5639d23a29575efb00c30d97c743 From git at git.haskell.org Thu Feb 21 15:10:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:55 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Include type info for only some exprs in HIE files (897b3dc) Message-ID: <20190221151055.560C83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/897b3dc801e0bbe1712bbb1361eecc9a62998d25/ghc >--------------------------------------------------------------- commit 897b3dc801e0bbe1712bbb1361eecc9a62998d25 Author: Alec Theriault Date: Thu Jan 24 17:33:52 2019 -0800 Include type info for only some exprs in HIE files This commit relinquishes some some type information in `.hie` files in exchange for better performance. See #16233 for more on this. Using `.hie` files to generate hyperlinked sources is a crucial milestone towards Hi Haddock (the initiative to move Haddock to work over `.hi` files and embed docstrings in those). Unfortunately, even after much optimization on the Haddock side, the `.hie` based solution is still considerably slower and more memory hungry than the existing implementation - and the @.hie@ code is to blame. This changes `.hie` file generation to track type information for only a limited subset of expressions (specifically, those that might eventually turn into hyperlinks in the Haddock's hyperlinker backend). (cherry picked from commit 5ed48d25decc9dec29659482644b136cff91606e) >--------------------------------------------------------------- 897b3dc801e0bbe1712bbb1361eecc9a62998d25 compiler/hieFile/HieAst.hs | 71 +++++++++++++++++++++++++++---- docs/users_guide/separate_compilation.rst | 5 +++ 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 401b861..0f491f1 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -29,8 +29,9 @@ import Module ( ModuleName, ml_hs_file ) import MonadUtils ( concatMapM, liftIO ) import Name ( Name, nameSrcSpan, setNameLoc ) import SrcLoc -import TcHsSyn ( hsPatType ) -import Type ( Type ) +import TcHsSyn ( hsLitType, hsPatType ) +import Type ( mkFunTys, Type ) +import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) import HieTypes @@ -432,13 +433,67 @@ instance HasType (LPat GhcTc) where instance HasType (LHsExpr GhcRn) where getTypeNode (L spn e) = makeNode e spn +-- | This instance tries to construct 'HieAST' nodes which include the type of +-- the expression. It is not yet possible to do this efficiently for all +-- expression forms, so we skip filling in the type for those inputs. +-- +-- 'HsApp', for example, doesn't have any type information available directly on +-- the node. Our next recourse would be to desugar it into a 'CoreExpr' then +-- query the type of that. Yet both the desugaring call and the type query both +-- involve recursive calls to the function and argument! This is particularly +-- problematic when you realize that the HIE traversal will eventually visit +-- those nodes too and ask for their types again. +-- +-- Since the above is quite costly, we just skip cases where computing the +-- expression's type is going to be expensive. +-- +-- See #16233 instance HasType (LHsExpr GhcTc) where - getTypeNode e@(L spn e') = lift $ do - hs_env <- Hsc $ \e w -> return (e,w) - (_,mbe) <- liftIO $ deSugarExpr hs_env e - case mbe of - Just te -> makeTypeNode e' spn (exprType te) - Nothing -> makeNode e' spn + getTypeNode e@(L spn e') = lift $ + -- Some expression forms have their type immediately available + let tyOpt = case e' of + HsLit _ l -> Just (hsLitType l) + HsOverLit _ o -> Just (overLitType o) + + HsLam _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy) + HsLamCase _ (MG { mg_ext = groupTy }) -> Just (matchGroupType groupTy) + HsCase _ _ (MG { mg_ext = groupTy }) -> Just (mg_res_ty groupTy) + + ExplicitList ty _ _ -> Just (mkListTy ty) + ExplicitSum ty _ _ _ -> Just (mkSumTy ty) + HsDo ty _ _ -> Just ty + HsMultiIf ty _ -> Just ty + + _ -> Nothing + + in + case tyOpt of + _ | skipDesugaring e' -> fallback + | otherwise -> do + hs_env <- Hsc $ \e w -> return (e,w) + (_,mbe) <- liftIO $ deSugarExpr hs_env e + maybe fallback (makeTypeNode e' spn . exprType) mbe + where + fallback = makeNode e' spn + + matchGroupType :: MatchGroupTc -> Type + matchGroupType (MatchGroupTc args res) = mkFunTys args res + + -- | Skip desugaring of these expressions for performance reasons. + -- + -- See impact on Haddock output (esp. missing type annotations or links) + -- before marking more things here as 'False'. See impact on Haddock + -- performance before marking more things as 'True'. + skipDesugaring :: HsExpr a -> Bool + skipDesugaring e = case e of + HsVar{} -> False + HsUnboundVar{} -> False + HsConLikeOut{} -> False + HsRecFld{} -> False + HsOverLabel{} -> False + HsIPVar{} -> False + HsWrap{} -> False + _ -> True instance ( ToHie (Context (Located (IdP a))) , ToHie (MatchGroup a (LHsExpr a)) diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst index 338c438..8c997f0 100644 --- a/docs/users_guide/separate_compilation.rst +++ b/docs/users_guide/separate_compilation.rst @@ -588,6 +588,11 @@ The GHC API exposes functions for reading and writing these files. that are being written out. These include testing things properties such as variables not occuring outside of their expected scopes. +The format in which GHC currently stores its typechecked AST, makes it costly +to collect the types for some expressions nodes. For the sake of performance, +GHC currently chooses to skip over these, so not all expression nodes should be +expected to have type information on them. See :ghc-ticket:`16233` for more. + .. _recomp: The recompilation checker From git at git.haskell.org Thu Feb 21 15:10:59 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:10:59 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix #14729 by making the normaliser homogeneous (a53b2f4) Message-ID: <20190221151059.F11D13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/a53b2f45bd1c73a43b4df938790b177bc1ebf80d/ghc >--------------------------------------------------------------- commit a53b2f45bd1c73a43b4df938790b177bc1ebf80d Author: Richard Eisenberg Date: Thu Jan 24 10:22:58 2019 -0500 Fix #14729 by making the normaliser homogeneous This ports the fix to #12919 to the normaliser. (#12919 was about the flattener.) Because the fix is involved, this is done by moving the critical piece of code to Coercion, and then calling this from both the flattener and the normaliser. The key bit is: simplifying type families in a type is always a *homogeneous* operation. See #12919 for a discussion of why this is the Right Way to simplify type families. Also fixes #15549. test case: dependent/should_compile/T14729{,kind} typecheck/should_compile/T15549[ab] (cherry picked from commit 2b90356d26b4699227816ad9424e766eccdb6c36) >--------------------------------------------------------------- a53b2f45bd1c73a43b4df938790b177bc1ebf80d compiler/deSugar/Check.hs | 8 +- compiler/typecheck/TcFlatten.hs | 371 ++----------------- compiler/types/Coercion.hs | 398 ++++++++++++++++++++- compiler/types/FamInstEnv.hs | 133 +++++-- compiler/types/Type.hs | 6 +- testsuite/tests/dependent/should_compile/T14729.hs | 15 + .../tests/dependent/should_compile/T14729.stderr | 15 + .../dependent/should_compile/T14729kind.script | 6 + .../dependent/should_compile/T14729kind.stdout | 2 + testsuite/tests/dependent/should_compile/all.T | 2 + .../tests/typecheck/should_compile/T15549a.hs | 20 ++ .../tests/typecheck/should_compile/T15549b.hs | 29 ++ testsuite/tests/typecheck/should_compile/all.T | 2 + 13 files changed, 636 insertions(+), 371 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 a53b2f45bd1c73a43b4df938790b177bc1ebf80d From git at git.haskell.org Thu Feb 21 15:11:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:03 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: make ghc-pkg shut up (f144eaa) Message-ID: <20190221151103.01A0C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/f144eaa819e9bd1c93a9872a90cdba85a91d7174/ghc >--------------------------------------------------------------- commit f144eaa819e9bd1c93a9872a90cdba85a91d7174 Author: Moritz Angermann Date: Wed Jan 23 10:59:38 2019 +0800 make ghc-pkg shut up (cherry picked from commit f00b35f4ddcc61fb1b1f09854bbbf38934ff0865) >--------------------------------------------------------------- f144eaa819e9bd1c93a9872a90cdba85a91d7174 utils/ghc-pkg/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 8b7655b..534bbac 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1822,7 +1822,7 @@ liftIO k = V (k >>= \a -> return (a,[],[])) reportValidateErrors :: Verbosity -> [ValidateError] -> [ValidateWarning] -> String -> Maybe Force -> IO Bool reportValidateErrors verbosity es ws prefix mb_force = do - mapM_ (warn . (prefix++)) ws + when (verbosity >= Normal) $ mapM_ (warn . (prefix++)) ws oks <- mapM report es return (and oks) where From git at git.haskell.org Thu Feb 21 15:11:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:06 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Allow resizing the stack for the graph allocator. (2eeabfd) Message-ID: <20190221151106.1065B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/2eeabfdb48228e4f17a54cdf74a497c6259cc982/ghc >--------------------------------------------------------------- commit 2eeabfdb48228e4f17a54cdf74a497c6259cc982 Author: klebinger.andreas at gmx.at Date: Sat Jan 26 00:26:02 2019 +0100 Allow resizing the stack for the graph allocator. The graph allocator now dynamically resizes the number of stack slots when running into the limit. This fixes #8657. Also loop membership of basic blocks is now available in the register allocator for cost heuristics. (cherry picked from commit 03b7abc19c8b0ec5c606cc2da208d2d004807fe9) >--------------------------------------------------------------- 2eeabfdb48228e4f17a54cdf74a497c6259cc982 compiler/nativeGen/AsmCodeGen.hs | 18 +++++++-- compiler/nativeGen/CFG.hs | 18 +++++++++ compiler/nativeGen/RegAlloc/Graph/Main.hs | 38 +++++++++++++------ compiler/nativeGen/RegAlloc/Graph/Spill.hs | 14 +++++-- compiler/nativeGen/RegAlloc/Graph/SpillCost.hs | 51 +++++++++++++++++--------- compiler/nativeGen/X86/Instr.hs | 2 + 6 files changed, 105 insertions(+), 36 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 2eeabfdb48228e4f17a54cdf74a497c6259cc982 From git at git.haskell.org Thu Feb 21 15:11:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:09 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: PPC NCG: Promote integers to word size in C calls (e1b41ac) Message-ID: <20190221151109.1B9753A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/e1b41ac3322e7b9636a68b969b2412a566ed57a0/ghc >--------------------------------------------------------------- commit e1b41ac3322e7b9636a68b969b2412a566ed57a0 Author: Peter Trommler Date: Wed Jan 23 23:13:57 2019 +0100 PPC NCG: Promote integers to word size in C calls Fixes #16222 (cherry picked from commit 4376d8811418d91bb4d19d61801e95a449b98378) >--------------------------------------------------------------- e1b41ac3322e7b9636a68b969b2412a566ed57a0 compiler/cmm/CmmType.hs | 8 ++++++-- compiler/nativeGen/PPC/CodeGen.hs | 36 +++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/compiler/cmm/CmmType.hs b/compiler/cmm/CmmType.hs index 77d894b..0d6e770 100644 --- a/compiler/cmm/CmmType.hs +++ b/compiler/cmm/CmmType.hs @@ -4,7 +4,8 @@ module CmmType , cInt , cmmBits, cmmFloat , typeWidth, cmmEqType, cmmEqType_ignoring_ptrhood - , isFloatType, isGcPtrType, isWord32, isWord64, isFloat64, isFloat32 + , isFloatType, isGcPtrType, isBitsType + , isWord32, isWord64, isFloat64, isFloat32 , Width(..) , widthInBits, widthInBytes, widthInLog, widthFromBytes @@ -132,13 +133,16 @@ cInt :: DynFlags -> CmmType cInt dflags = cmmBits (cIntWidth dflags) ------------ Predicates ---------------- -isFloatType, isGcPtrType :: CmmType -> Bool +isFloatType, isGcPtrType, isBitsType :: CmmType -> Bool isFloatType (CmmType FloatCat _) = True isFloatType _other = False isGcPtrType (CmmType GcPtrCat _) = True isGcPtrType _other = False +isBitsType (CmmType BitsCat _) = True +isBitsType _ = False + isWord32, isWord64, isFloat32, isFloat64 :: CmmType -> Bool -- isWord64 is true of 64-bit non-floats (both gc-ptrs and otherwise) -- isFloat32 and 64 are obvious diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs index c6e5304..516a49a 100644 --- a/compiler/nativeGen/PPC/CodeGen.hs +++ b/compiler/nativeGen/PPC/CodeGen.hs @@ -1634,15 +1634,13 @@ genCCall' genCCall' dflags gcp target dest_regs args - = ASSERT(not $ any (`elem` [II16]) $ map cmmTypeFormat argReps) - -- we rely on argument promotion in the codeGen - do + = do (finalStack,passArgumentsCode,usedRegs) <- passArguments - (zip args argReps) - allArgRegs - (allFPArgRegs platform) - initialStackOffset - (toOL []) [] + (zip3 args argReps argHints) + allArgRegs + (allFPArgRegs platform) + initialStackOffset + nilOL [] (labelOrExpr, reduceToFF32) <- case target of ForeignTarget (CmmLit (CmmLabel lbl)) _ -> do @@ -1733,6 +1731,7 @@ genCCall' dflags gcp target dest_regs args _ -> panic "genCall': unknown calling conv." argReps = map (cmmExprType dflags) args + (argHints, _) = foreignTargetHints target roundTo a x | x `mod` a == 0 = x | otherwise = x + a - (x `mod` a) @@ -1769,7 +1768,7 @@ genCCall' dflags gcp target dest_regs args _ -> panic "maybeNOP: Unknown PowerPC 64-bit ABI" passArguments [] _ _ stackOffset accumCode accumUsed = return (stackOffset, accumCode, accumUsed) - passArguments ((arg,arg_ty):args) gprs fprs stackOffset + passArguments ((arg,arg_ty,_):args) gprs fprs stackOffset accumCode accumUsed | isWord64 arg_ty && target32Bit (targetPlatform dflags) = do @@ -1811,9 +1810,9 @@ genCCall' dflags gcp target dest_regs args stackCode accumUsed GCP64ELF _ -> panic "passArguments: 32 bit code" - passArguments ((arg,rep):args) gprs fprs stackOffset accumCode accumUsed + passArguments ((arg,rep,hint):args) gprs fprs stackOffset accumCode accumUsed | reg : _ <- regs = do - register <- getRegister arg + register <- getRegister arg_pro let code = case register of Fixed _ freg fcode -> fcode `snocOL` MR reg freg Any _ acode -> acode reg @@ -1833,14 +1832,25 @@ genCCall' dflags gcp target dest_regs args (accumCode `appOL` code) (reg : accumUsed) | otherwise = do - (vr, code) <- getSomeReg arg + (vr, code) <- getSomeReg arg_pro passArguments args (drop nGprs gprs) (drop nFprs fprs) (stackOffset' + stackBytes) - (accumCode `appOL` code `snocOL` ST (cmmTypeFormat rep) vr stackSlot) + (accumCode `appOL` code + `snocOL` ST format_pro vr stackSlot) accumUsed where + arg_pro + | isBitsType rep = CmmMachOp (conv_op (typeWidth rep) (wordWidth dflags)) [arg] + | otherwise = arg + format_pro + | isBitsType rep = intFormat (wordWidth dflags) + | otherwise = cmmTypeFormat rep + conv_op = case hint of + SignedHint -> MO_SS_Conv + _ -> MO_UU_Conv + stackOffset' = case gcp of GCPAIX -> -- The 32bit PowerOPEN ABI is happy with From git at git.haskell.org Thu Feb 21 15:11:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:12 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix #15849 by checking whether there's a do block (3ac4232) Message-ID: <20190221151112.6BEE73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/3ac42326d7185e74fdf7529e5a589cade60093d2/ghc >--------------------------------------------------------------- commit 3ac42326d7185e74fdf7529e5a589cade60093d2 Author: nineonine Date: Sat Feb 9 00:20:19 2019 -0800 Fix #15849 by checking whether there's a do block (cherry picked from commit a08f463bcc9727d91cec4c6e952ad0f5bbc3fbf9) >--------------------------------------------------------------- 3ac42326d7185e74fdf7529e5a589cade60093d2 compiler/parser/Lexer.x | 3 ++- testsuite/tests/parser/should_fail/T15849.hs | 4 ++++ testsuite/tests/parser/should_fail/T15849.stderr | 3 +++ testsuite/tests/parser/should_fail/all.T | 1 + testsuite/tests/parser/should_fail/readFail011.stderr | 2 -- testsuite/tests/parser/should_fail/readFail034.stderr | 2 -- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 4ba50c1..147e678 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2574,7 +2574,7 @@ srcParseErr options buf len (if mdoInLast100 then text "Perhaps you intended to use RecursiveDo" else text "Perhaps this statement should be within a 'do' block?") - $$ ppWhen (token == "=") + $$ ppWhen (token == "=" && doInLast100) -- #15849 (text "Perhaps you need a 'let' in a 'do' block?" $$ text "e.g. 'let x = 5' instead of 'x = 5'") $$ ppWhen (not ps_enabled && pattern == "pattern ") -- #12429 @@ -2582,6 +2582,7 @@ srcParseErr options buf len where token = lexemeToString (offsetBytes (-len) buf) len pattern = decodePrevNChars 8 buf last100 = decodePrevNChars 100 buf + doInLast100 = "do" `isInfixOf` last100 mdoInLast100 = "mdo" `isInfixOf` last100 th_enabled = ThBit `xtest` pExtsBitmap options ps_enabled = PatternSynonymsBit `xtest` pExtsBitmap options diff --git a/testsuite/tests/parser/should_fail/T15849.hs b/testsuite/tests/parser/should_fail/T15849.hs new file mode 100644 index 0000000..eea8e4f --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15849.hs @@ -0,0 +1,4 @@ +module T15849 where + +main = return () + foo = return () diff --git a/testsuite/tests/parser/should_fail/T15849.stderr b/testsuite/tests/parser/should_fail/T15849.stderr new file mode 100644 index 0000000..e974dbd --- /dev/null +++ b/testsuite/tests/parser/should_fail/T15849.stderr @@ -0,0 +1,3 @@ + +T15849.hs:4:6: error: + parse error on input ‘=’ diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 2d7c241..a8d685c 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -133,6 +133,7 @@ test('typeops_C', normal, compile_fail, ['']) test('typeops_D', normal, compile_fail, ['']) test('T15053', normal, compile_fail, ['']) test('T15233', normal, compile_fail, ['']) +test('T15849', normal, compile_fail, ['']) test('typeopsDataCon_A', normal, compile_fail, ['']) test('typeopsDataCon_B', normal, compile_fail, ['']) test('strictnessDataCon_A', normal, compile_fail, ['']) diff --git a/testsuite/tests/parser/should_fail/readFail011.stderr b/testsuite/tests/parser/should_fail/readFail011.stderr index 25accd2..08388e5 100644 --- a/testsuite/tests/parser/should_fail/readFail011.stderr +++ b/testsuite/tests/parser/should_fail/readFail011.stderr @@ -1,5 +1,3 @@ readFail011.hs:7:10: error: parse error on input ‘=’ - Perhaps you need a 'let' in a 'do' block? - e.g. 'let x = 5' instead of 'x = 5' diff --git a/testsuite/tests/parser/should_fail/readFail034.stderr b/testsuite/tests/parser/should_fail/readFail034.stderr index 75156c9..ad2fb00 100644 --- a/testsuite/tests/parser/should_fail/readFail034.stderr +++ b/testsuite/tests/parser/should_fail/readFail034.stderr @@ -1,5 +1,3 @@ readFail034.hs:4:6: error: parse error on input ‘=’ - Perhaps you need a 'let' in a 'do' block? - e.g. 'let x = 5' instead of 'x = 5' From git at git.haskell.org Thu Feb 21 15:11:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:16 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Use sigPrec in more places in Convert and HsUtils (46ff73d) Message-ID: <20190221151116.6D61D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/46ff73df2bd12f270f447ab070d6a9b20cbab6fa/ghc >--------------------------------------------------------------- commit 46ff73df2bd12f270f447ab070d6a9b20cbab6fa Author: Ryan Scott Date: Mon Jan 14 21:45:17 2019 -0500 Use sigPrec in more places in Convert and HsUtils Trac #16183 was caused by TH conversion (in `Convert`) not properly inserting parentheses around occurrences of explicit signatures where appropriate, such as in applications, function types, and type family equations. Solution: use `parenthesizeHsType sigPrec` in these places. While I was in town, I also updated `nlHsFunTy` to do the same thing. (cherry picked from commit b1e569a54085bf1093b4f858f8c7c739e3be769b) >--------------------------------------------------------------- 46ff73df2bd12f270f447ab070d6a9b20cbab6fa compiler/hsSyn/Convert.hs | 67 +++++++++++++++++++------------------ compiler/hsSyn/HsUtils.hs | 8 +---- testsuite/tests/th/T12045TH1.stderr | 4 +-- testsuite/tests/th/T16183.hs | 11 ++++++ testsuite/tests/th/T16183.stderr | 12 +++++++ testsuite/tests/th/all.T | 1 + 6 files changed, 62 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 46ff73df2bd12f270f447ab070d6a9b20cbab6fa From git at git.haskell.org Thu Feb 21 15:11:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:19 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: HIE: Save module name and module exports (612e7dd) Message-ID: <20190221151119.7B9B23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/612e7dd633f375774e89af3f072721fe4632a806/ghc >--------------------------------------------------------------- commit 612e7dd633f375774e89af3f072721fe4632a806 Author: Matthew Pickering Date: Fri Feb 15 10:14:29 2019 +0000 HIE: Save module name and module exports (cherry picked from commit 69ebf5cb4592b4c89e268937ef7eb96f7c9d4532) >--------------------------------------------------------------- 612e7dd633f375774e89af3f072721fe4632a806 compiler/hieFile/HieAst.hs | 12 ++++++++++-- compiler/hieFile/HieTypes.hs | 13 ++++++++++++- compiler/main/HscMain.hs | 5 +++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compiler/hieFile/HieAst.hs b/compiler/hieFile/HieAst.hs index 0f491f1..8025447 100644 --- a/compiler/hieFile/HieAst.hs +++ b/compiler/hieFile/HieAst.hs @@ -33,6 +33,8 @@ import TcHsSyn ( hsLitType, hsPatType ) import Type ( mkFunTys, Type ) import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) +import TcRnTypes +import MkIface ( mkIfaceExports ) import HieTypes import HieUtils @@ -86,17 +88,23 @@ modifyState = foldr go id type HieM = ReaderT HieState Hsc -- | Construct an 'HieFile' from the outputs of the typechecker. -mkHieFile :: ModSummary -> TypecheckedSource -> RenamedSource -> Hsc HieFile +mkHieFile :: ModSummary + -> TcGblEnv + -> RenamedSource -> Hsc HieFile mkHieFile ms ts rs = do - (asts', arr) <- getCompressedAsts ts rs + let tc_binds = tcg_binds ts + (asts', arr) <- getCompressedAsts tc_binds rs let Just src_file = ml_hs_file $ ms_location ms src <- liftIO $ BS.readFile src_file return $ HieFile { hie_version = curHieVersion , hie_ghc_version = BSC.pack cProjectVersion , hie_hs_file = src_file + , hie_module = ms_mod ms , hie_types = arr , hie_asts = asts' + -- mkIfaceExports sorts the AvailInfos for stability + , hie_exports = mkIfaceExports (tcg_exports ts) , hie_hs_src = src } diff --git a/compiler/hieFile/HieTypes.hs b/compiler/hieFile/HieTypes.hs index c20887f..1b1d8c5 100644 --- a/compiler/hieFile/HieTypes.hs +++ b/compiler/hieFile/HieTypes.hs @@ -10,10 +10,11 @@ import GhcPrelude import Binary import FastString ( FastString ) import IfaceType -import Module ( ModuleName ) +import Module ( ModuleName, Module ) import Name ( Name ) import Outputable hiding ( (<>) ) import SrcLoc ( RealSrcSpan ) +import Avail import qualified Data.Array as A import qualified Data.Map as M @@ -56,6 +57,9 @@ data HieFile = HieFile , hie_hs_file :: FilePath -- ^ Initial Haskell source file path + , hie_module :: Module + -- ^ The module this HIE file is for + , hie_types :: A.Array TypeIndex HieTypeFlat -- ^ Types referenced in the 'hie_asts'. -- @@ -64,6 +68,9 @@ data HieFile = HieFile , hie_asts :: HieASTs TypeIndex -- ^ Type-annotated abstract syntax trees + , hie_exports :: [AvailInfo] + -- ^ The names that this module exports + , hie_hs_src :: ByteString -- ^ Raw bytes of the initial Haskell source } @@ -73,8 +80,10 @@ instance Binary HieFile where put_ bh $ hie_version hf put_ bh $ hie_ghc_version hf put_ bh $ hie_hs_file hf + put_ bh $ hie_module hf put_ bh $ hie_types hf put_ bh $ hie_asts hf + put_ bh $ hie_exports hf put_ bh $ hie_hs_src hf get bh = HieFile @@ -84,6 +93,8 @@ instance Binary HieFile where <*> get bh <*> get bh <*> get bh + <*> get bh + <*> get bh {- diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 9a4dd4a..674afc9 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -408,8 +408,9 @@ extract_renamed_stuff mod_summary tc_result = do -- Create HIE files when (gopt Opt_WriteHie dflags) $ do - hieFile <- mkHieFile mod_summary (tcg_binds tc_result) - (fromJust rn_info) + -- I assume this fromJust is safe because `-fwrite-hie-file` + -- enables the option which keeps the renamed source. + hieFile <- mkHieFile mod_summary tc_result (fromJust rn_info) let out_file = ml_hie_file $ ms_location mod_summary liftIO $ writeHieFile out_file hieFile From git at git.haskell.org Thu Feb 21 15:11:23 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:23 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Capture and simplify constraints arising from running typed splices (ac37ab7) Message-ID: <20190221151123.372CD3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/ac37ab795fbe7a07894ce1d6b0fe9863c0e29135/ghc >--------------------------------------------------------------- commit ac37ab795fbe7a07894ce1d6b0fe9863c0e29135 Author: Matthew Pickering Date: Sun Feb 3 11:46:28 2019 +0000 Capture and simplify constraints arising from running typed splices This fixes a regression caused by #15471 where splicing in a trivial program such as `[|| return () ||]` would fail as the dictionary for `return` would never get bound in the module containing the splice. Arguably this is symptomatic of a major problem affecting TTH where we serialise renamed asts and then retype check them. The reference to the dictionary should be fully determined at the quote site so that splicing doesn't have to solve any implicits at all. It's a coincidence this works due to coherence but see #15863 and #15865 for examples where things do go very wrong. Fixes #16195 (cherry picked from commit a48753bdbc99cda36890e851950f5b79e1c3b2b2) >--------------------------------------------------------------- ac37ab795fbe7a07894ce1d6b0fe9863c0e29135 compiler/typecheck/TcSplice.hs | 11 ++++++++--- testsuite/tests/th/T16195.hs | 15 +++++++++++++++ testsuite/tests/th/T16195A.hs | 13 +++++++++++++ testsuite/tests/th/all.T | 1 + 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 1bb844a..73a9e9e 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -525,9 +525,14 @@ runTopSplice (DelayedSplice lcl_env orig_expr res_ty q_expr) -- Rename and typecheck the spliced-in expression, -- making sure it has type res_ty -- These steps should never fail; this is a *typed* splice - ; addErrCtxt (spliceResultDoc zonked_q_expr) $ do - { (exp3, _fvs) <- rnLExpr expr2 - ; unLoc <$> tcMonoExpr exp3 (mkCheckExpType zonked_ty)} } + ; (res, wcs) <- + captureConstraints $ + addErrCtxt (spliceResultDoc zonked_q_expr) $ do + { (exp3, _fvs) <- rnLExpr expr2 + ; tcMonoExpr exp3 (mkCheckExpType zonked_ty)} + ; ev <- simplifyTop wcs + ; return $ unLoc (mkHsDictLet (EvBinds ev) res) + } {- diff --git a/testsuite/tests/th/T16195.hs b/testsuite/tests/th/T16195.hs new file mode 100644 index 0000000..70e9365 --- /dev/null +++ b/testsuite/tests/th/T16195.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TemplateHaskell #-} +module T16195 where + +import T16195A + +main2 :: IO () +main2 = return () + +main :: IO () +main = $$foo + +main3 :: IO () +main3 = putStrLn ($$showC $$unitC) + + diff --git a/testsuite/tests/th/T16195A.hs b/testsuite/tests/th/T16195A.hs new file mode 100644 index 0000000..b79aff7 --- /dev/null +++ b/testsuite/tests/th/T16195A.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE TemplateHaskell #-} +module T16195A where + +import Language.Haskell.TH + +foo :: Q (TExp (IO ())) +foo = [|| return () ||] + +showC :: Q (TExp (() -> String)) +showC = [|| show ||] + +unitC :: Q (TExp ()) +unitC = [|| () ||] diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index b93673c..4d95e20 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -469,3 +469,4 @@ test('T16133', normal, compile_fail, ['']) test('T15471', normal, multimod_compile, ['T15471.hs', '-v0']) test('T16180', when(opsys('darwin'), expect_broken(16218)), compile_and_run, ['']) test('T16183', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques']) +test('T16195', normal, multimod_compile, ['T16195.hs', '-v0']) From git at git.haskell.org Thu Feb 21 15:11:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:27 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix #16287 by checking for more unsaturated synonym arguments (a7c1f9b) Message-ID: <20190221151127.125D83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/a7c1f9bb17933816f7d56c9ad016a2c26ad5c8a8/ghc >--------------------------------------------------------------- commit a7c1f9bb17933816f7d56c9ad016a2c26ad5c8a8 Author: Ryan Scott Date: Tue Feb 5 08:50:59 2019 -0500 Fix #16287 by checking for more unsaturated synonym arguments Trac #16287 shows that we were checking for unsaturated type synonym arguments (in `:kind`) when the argument was to a type synonym, but _not_ when the argument was to some other form of type constructor, such as a data type. The solution is to use the machinery that rejects unsaturated type synonym arguments (previously confined to `check_syn_tc_app`) to `check_arg_type`, which checks these other forms of arguments. While I was in town, I cleaned up `check_syn_tc_app` a bit to only invoke `check_arg_type` so as to minimize the number of different code paths that that function could go down. (cherry picked from commit c07e7ecbdfc05429fb6ce84c547c0365d2754db7) >--------------------------------------------------------------- a7c1f9bb17933816f7d56c9ad016a2c26ad5c8a8 compiler/typecheck/TcValidity.hs | 47 +++++++++++++------------- testsuite/tests/ghci/should_fail/T16287.script | 10 ++++++ testsuite/tests/ghci/should_fail/T16287.stderr | 12 +++++++ testsuite/tests/ghci/should_fail/all.T | 1 + 4 files changed, 46 insertions(+), 24 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 3b88fe1..53c8dbf 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -599,13 +599,13 @@ check_type _ (TyVarTy _) = return () check_type ve (AppTy ty1 ty2) = do { check_type ve ty1 - ; check_arg_type ve ty2 } + ; check_arg_type False ve ty2 } check_type ve ty@(TyConApp tc tys) | isTypeSynonymTyCon tc || isTypeFamilyTyCon tc = check_syn_tc_app ve ty tc tys | isUnboxedTupleTyCon tc = check_ubx_tuple ve ty tys - | otherwise = mapM_ (check_arg_type ve) tys + | otherwise = mapM_ (check_arg_type False ve) tys check_type _ (LitTy {}) = return () @@ -693,14 +693,8 @@ check_syn_tc_app (ve at ValidityEnv{ ve_ctxt = ctxt, ve_expand = expand }) tc_arity = tyConArity tc check_arg :: ExpandMode -> KindOrType -> TcM () - check_arg expand - | isTypeFamilyTyCon tc - = check_arg_type ve' - | otherwise - = check_type (ve'{ve_rank = synArgMonoType}) - where - ve' :: ValidityEnv - ve' = ve{ve_ctxt = arg_ctxt, ve_expand = expand} + check_arg expand = + check_arg_type (isTypeSynonymTyCon tc) (ve{ve_expand = expand}) check_args_only, check_expansion_only :: ExpandMode -> TcM () check_args_only expand = mapM_ (check_arg expand) tys @@ -713,15 +707,6 @@ check_syn_tc_app (ve at ValidityEnv{ ve_ctxt = ctxt, ve_expand = expand }) check_type (ve{ve_expand = expand}) ty' Nothing -> pprPanic "check_syn_tc_app" (ppr ty) - arg_ctxt :: UserTypeCtxt - arg_ctxt - | GhciCtxt _ <- ctxt = GhciCtxt False - -- When checking an argument, set the field of GhciCtxt to False to - -- indicate that we are no longer in an outermost position (and thus - -- unsaturated synonyms are no longer allowed). - -- See Note [Unsaturated type synonyms in GHCi] - | otherwise = ctxt - {- Note [Unsaturated type synonyms in GHCi] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -774,7 +759,9 @@ check_ubx_tuple (ve at ValidityEnv{ve_tidy_env = env}) ty tys ; mapM_ (check_type (ve{ve_rank = rank'})) tys } ---------------------------------------- -check_arg_type :: ValidityEnv -> KindOrType -> TcM () +check_arg_type + :: Bool -- ^ Is this the argument to a type synonym? + -> ValidityEnv -> KindOrType -> TcM () -- The sort of type that can instantiate a type variable, -- or be the argument of a type constructor. -- Not an unboxed tuple, but now *can* be a forall (since impredicativity) @@ -793,11 +780,14 @@ check_arg_type :: ValidityEnv -> KindOrType -> TcM () -- But not in user code. -- Anyway, they are dealt with by a special case in check_tau_type -check_arg_type _ (CoercionTy {}) = return () +check_arg_type _ _ (CoercionTy {}) = return () -check_arg_type (ve at ValidityEnv{ve_rank = rank}) ty +check_arg_type type_syn (ve at ValidityEnv{ve_ctxt = ctxt, ve_rank = rank}) ty = do { impred <- xoptM LangExt.ImpredicativeTypes ; let rank' = case rank of -- Predictive => must be monotype + -- Rank-n arguments to type synonyms are OK, provided + -- that LiberalTypeSynonyms is enabled. + _ | type_syn -> synArgMonoType MustBeMonoType -> MustBeMonoType -- Monotype, regardless _other | impred -> ArbitraryRank | otherwise -> tyConArgMonoType @@ -805,8 +795,17 @@ check_arg_type (ve at ValidityEnv{ve_rank = rank}) ty -- so that we don't suggest -XImpredicativeTypes in -- (Ord (forall a.a)) => a -> a -- and so that if it Must be a monotype, we check that it is! - - ; check_type (ve{ve_rank = rank'}) ty } + ctxt' :: UserTypeCtxt + ctxt' + | GhciCtxt _ <- ctxt = GhciCtxt False + -- When checking an argument, set the field of GhciCtxt to + -- False to indicate that we are no longer in an outermost + -- position (and thus unsaturated synonyms are no longer + -- allowed). + -- See Note [Unsaturated type synonyms in GHCi] + | otherwise = ctxt + + ; check_type (ve{ve_ctxt = ctxt', ve_rank = rank'}) ty } ---------------------------------------- forAllTyErr :: TidyEnv -> Rank -> Type -> (TidyEnv, SDoc) diff --git a/testsuite/tests/ghci/should_fail/T16287.script b/testsuite/tests/ghci/should_fail/T16287.script new file mode 100644 index 0000000..9976832 --- /dev/null +++ b/testsuite/tests/ghci/should_fail/T16287.script @@ -0,0 +1,10 @@ +:set -XPolyKinds -XRankNTypes -XTypeFamilies +import Data.Kind +type F1 a = a +type family F2 :: k +data T1 :: (Type -> Type) -> Type +data T2 :: (forall k. k) -> Type +:kind T1 F1 +:kind T2 F2 +:kind Maybe (T1 F1) +:kind Maybe (T2 F2) diff --git a/testsuite/tests/ghci/should_fail/T16287.stderr b/testsuite/tests/ghci/should_fail/T16287.stderr new file mode 100644 index 0000000..13f0852 --- /dev/null +++ b/testsuite/tests/ghci/should_fail/T16287.stderr @@ -0,0 +1,12 @@ + +:1:1: error: + The type synonym ‘F1’ should have 1 argument, but has been given none + +:1:1: error: + The type family ‘F2’ should have no arguments, but has been given none + +:1:1: error: + The type synonym ‘F1’ should have 1 argument, but has been given none + +:1:1: error: + The type family ‘F2’ should have no arguments, but has been given none diff --git a/testsuite/tests/ghci/should_fail/all.T b/testsuite/tests/ghci/should_fail/all.T index 5e0a18c..da01a98 100644 --- a/testsuite/tests/ghci/should_fail/all.T +++ b/testsuite/tests/ghci/should_fail/all.T @@ -3,3 +3,4 @@ test('T10549a', [], ghci_script, ['T10549a.script']) test('T14608', [], ghci_script, ['T14608.script']) test('T15055', normalise_version('ghc'), ghci_script, ['T15055.script']) test('T16013', [], ghci_script, ['T16013.script']) +test('T16287', [], ghci_script, ['T16287.script']) From git at git.haskell.org Thu Feb 21 15:11:31 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:31 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Reject oversaturated VKAs in type family equations (3d923ee) Message-ID: <20190221151131.72FB23A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/3d923ee52a7f56f9c4b6ad9cf314a21142b97c49/ghc >--------------------------------------------------------------- commit 3d923ee52a7f56f9c4b6ad9cf314a21142b97c49 Author: Ryan Scott Date: Fri Feb 1 19:10:55 2019 -0500 Reject oversaturated VKAs in type family equations (cherry picked from commit f0cd728fde9bb582930a616cff8d0c5a178c5e14) >--------------------------------------------------------------- 3d923ee52a7f56f9c4b6ad9cf314a21142b97c49 compiler/typecheck/TcTyClsDecls.hs | 3 + compiler/typecheck/TcValidity.hs | 68 +++++++++++++++++++++- testsuite/tests/typecheck/should_compile/all.T | 1 - .../{should_compile => should_fail}/T15793.hs | 0 .../tests/typecheck/should_fail/T15793.stderr | 5 ++ testsuite/tests/typecheck/should_fail/T16255.hs | 21 +++++++ .../tests/typecheck/should_fail/T16255.stderr | 10 ++++ testsuite/tests/typecheck/should_fail/all.T | 2 + 8 files changed, 108 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 3d923ee52a7f56f9c4b6ad9cf314a21142b97c49 From git at git.haskell.org Thu Feb 21 15:11:34 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:34 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: testsuite: Always skip T15897 (3ac2d66) Message-ID: <20190221151134.756BB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/3ac2d665efb4aadf62c310710e83a2e945bb25b4/ghc >--------------------------------------------------------------- commit 3ac2d665efb4aadf62c310710e83a2e945bb25b4 Author: Ben Gamari Date: Mon Feb 4 22:02:52 2019 -0500 testsuite: Always skip T15897 See #16193. (cherry picked from commit f53ef1a72fdebeff19d4a4bd5552d25101c85147) >--------------------------------------------------------------- 3ac2d665efb4aadf62c310710e83a2e945bb25b4 testsuite/tests/profiling/should_run/all.T | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 9bca86b..52dcf98 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -147,6 +147,9 @@ test('T12962', [], compile_and_run, ['']) test('T14257', [], run_command, ['$MAKE -s --no-print-directory T14257']) test('T15897', - [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2)], + [extra_ways(['profasm']), only_ways(['profasm']), + run_timeout_multiplier(2), + # Takes too long and is quite fragile (#15467, #16193) + skip], run_command, ['$MAKE -s --no-print-directory T15897']) From git at git.haskell.org Thu Feb 21 15:11:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:38 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: Fix #16188 (52a5400) Message-ID: <20190221151138.D5F743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/52a5400baefb6425438356e3c74856352324f01b/ghc >--------------------------------------------------------------- commit 52a5400baefb6425438356e3c74856352324f01b Author: Richard Eisenberg Date: Thu Jan 17 17:17:02 2019 -0700 Fix #16188 There was an awful lot of zipping going on in canDecomposableTyConAppOK, and one of the lists being zipped was too short, causing the result to be too short. Easily fixed. Also fixes #16204 and #16225 test case: typecheck/should_compile/T16188 typecheck/should_compile/T16204[ab] typecheck/should_fail/T16204c typecheck/should_compile/T16225 (cherry picked from commit 4a4ae70f09009c5d32696445a06eacb273f364b5) >--------------------------------------------------------------- 52a5400baefb6425438356e3c74856352324f01b compiler/typecheck/TcCanonical.hs | 40 +++++++++------ compiler/types/Coercion.hs | 3 ++ .../tests/indexed-types/should_fail/T2544.stderr | 12 ----- testsuite/tests/polykinds/T14172.stderr | 15 ------ testsuite/tests/typecheck/should_compile/T16188.hs | 48 ++++++++++++++++++ .../tests/typecheck/should_compile/T16204a.hs | 58 ++++++++++++++++++++++ .../tests/typecheck/should_compile/T16204b.hs | 58 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/T16225.hs | 25 ++++++++++ testsuite/tests/typecheck/should_compile/all.T | 4 ++ testsuite/tests/typecheck/should_fail/T16204c.hs | 16 ++++++ .../tests/typecheck/should_fail/T16204c.stderr | 12 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 12 files changed, 251 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 52a5400baefb6425438356e3c74856352324f01b From git at git.haskell.org Thu Feb 21 15:11:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:41 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: base: Document errno behaviour in haddocks. (beb7f9b) Message-ID: <20190221151141.E0C023A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/beb7f9ba73b8cac469f15fa8ab31f1e21b4c1cb9/ghc >--------------------------------------------------------------- commit beb7f9ba73b8cac469f15fa8ab31f1e21b4c1cb9 Author: Niklas Hambüchen Date: Thu Feb 14 16:52:17 2019 -0500 base: Document errno behaviour in haddocks. Also add an implementation comment for details. (cherry picked from commit 76ac103f5021cba5cd000293c7cb8c2bd3148e7a) >--------------------------------------------------------------- beb7f9ba73b8cac469f15fa8ab31f1e21b4c1cb9 libraries/base/Foreign/C/Error.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/base/Foreign/C/Error.hs b/libraries/base/Foreign/C/Error.hs index 90b949b..6d6c0cc 100644 --- a/libraries/base/Foreign/C/Error.hs +++ b/libraries/base/Foreign/C/Error.hs @@ -255,11 +255,15 @@ isValidErrno (Errno errno) = errno /= -1 -- | Get the current value of @errno@ in the current thread. -- +-- On GHC, the runtime will ensure that any Haskell thread will only see "its own" +-- @errno@, by saving and restoring the value when Haskell threads are scheduled +-- across OS threads. getErrno :: IO Errno -- We must call a C function to get the value of errno in general. On -- threaded systems, errno is hidden behind a C macro so that each OS --- thread gets its own copy. +-- thread gets its own copy (`saved_errno`, which `rts/Schedule.c` restores +-- back into the thread-local `errno` when a Haskell thread is rescheduled). getErrno = do e <- get_errno; return (Errno e) foreign import ccall unsafe "HsBase.h __hscore_get_errno" get_errno :: IO CInt From git at git.haskell.org Thu Feb 21 15:11:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:44 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: rts/ProfilerReportJson: Fix format string (60a71df) Message-ID: <20190221151144.E139D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/60a71dfde532bd5c9811da10a90bf08563e6ed70/ghc >--------------------------------------------------------------- commit 60a71dfde532bd5c9811da10a90bf08563e6ed70 Author: Ben Gamari Date: Mon Feb 4 21:42:41 2019 -0500 rts/ProfilerReportJson: Fix format string This was warning on i386. (cherry picked from commit 7ff127f9e455402da183d1bb1808db024d1fa944) >--------------------------------------------------------------- 60a71dfde532bd5c9811da10a90bf08563e6ed70 rts/ProfilerReportJson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ProfilerReportJson.c b/rts/ProfilerReportJson.c index a786921..ea7c852 100644 --- a/rts/ProfilerReportJson.c +++ b/rts/ProfilerReportJson.c @@ -66,7 +66,7 @@ logCostCentreStack(FILE *prof_file, CostCentreStack const *ccs) fprintf(prof_file, "{\"id\": %" FMT_Int ", " "\"entries\": %" FMT_Word64 ", " - "\"alloc\": %" FMT_Word ", " + "\"alloc\": %" FMT_Word64 ", " "\"ticks\": %" FMT_Word ", ", ccs->cc->ccID, ccs->scc_count, From git at git.haskell.org Thu Feb 21 15:11:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:47 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-merges: gitlab-ci: Use build cleanup logic on Darwin as well (60b46c5) Message-ID: <20190221151147.E8BEC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-merges Link : http://ghc.haskell.org/trac/ghc/changeset/60b46c5108f18c92839ae8309f1e811dd47e7c1d/ghc >--------------------------------------------------------------- commit 60b46c5108f18c92839ae8309f1e811dd47e7c1d Author: Ben Gamari Date: Mon Jan 21 10:55:48 2019 -0500 gitlab-ci: Use build cleanup logic on Darwin as well We use the shell executor on Darwin as well as Windows. See https://gitlab.com/gitlab-org/gitlab-runner/issues/3856. (cherry picked from commit cfbd39bd405b4cedd3ee10a6d4a2bdd89b6e2e2d) >--------------------------------------------------------------- 60b46c5108f18c92839ae8309f1e811dd47e7c1d .gitlab-ci.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2478d0d..8497632 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -380,8 +380,8 @@ validate-x86_64-windows: - ghc.tar.xz - junit.xml -# Note [Cleanup on Windows] -# ~~~~~~~~~~~~~~~~~~~~~~~~~ +# Note [Cleaning up after shell executor] +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # As noted in [1], gitlab-runner's shell executor doesn't clean up its working # directory after builds. Unfortunately, we are forced to use the shell executor @@ -391,7 +391,7 @@ validate-x86_64-windows: # # [1] https://gitlab.com/gitlab-org/gitlab-runner/issues/3856 -# See Note [Cleanup on Windows] +# See Note [Cleanup after shell executor] cleanup-windows: stage: cleanup tags: @@ -412,3 +412,21 @@ cleanup-windows: - del %BUILD_DIR%\* /F /Q - for /d %%p in (%BUILD_DIR%\*) do rd /Q /S "%%p" - exit /b 0 + +# See Note [Cleanup after shell executor] +cleanup-darwin: + stage: cleanup + tags: + - x86_64-darwin + when: always + before_script: + - echo "Time to clean up" + script: + - echo "Let's go" + after_script: + - BUILD_DIR=$CI_PROJECT_DIR + - echo "Cleaning $BUILD_DIR" + - cd $HOME + - rm -Rf $BUILD_DIR/* + - exit 0 + From git at git.haskell.org Thu Feb 21 15:11:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:51 +0000 (UTC) Subject: [commit: ghc] wip/gc/aligned-block-allocation, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts/BlockAlloc: Allow aligned allocation requests (fee8f29) Message-ID: <20190221151151.014703A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/aligned-block-allocation,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/fee8f29373213f9425d1144440a7b6b6354adee5/ghc >--------------------------------------------------------------- commit fee8f29373213f9425d1144440a7b6b6354adee5 Author: Ömer Sinan Ağacan Date: Mon Mar 5 15:57:47 2018 +0300 rts/BlockAlloc: Allow aligned allocation requests This implements support for block group allocations which are aligned to an integral number of blocks. This will be used by the nonmoving garbage collector, which uses the block allocator to allocate the segments which back its heap. These segments are a fixed number of blocks in size, with each segment being aligned to the segment size boundary. This allows us to easily find the segment metadata stored at the beginning of the segment. >--------------------------------------------------------------- fee8f29373213f9425d1144440a7b6b6354adee5 includes/rts/storage/Block.h | 7 +++ rts/sm/BlockAlloc.c | 111 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/includes/rts/storage/Block.h b/includes/rts/storage/Block.h index ecd6bf5..792a72d 100644 --- a/includes/rts/storage/Block.h +++ b/includes/rts/storage/Block.h @@ -290,6 +290,13 @@ EXTERN_INLINE bdescr* allocBlock(void) bdescr *allocGroupOnNode(uint32_t node, W_ n); +// Allocate n blocks, aligned at n-block boundary. The returned bdescr will +// have this invariant +// +// bdescr->start % BLOCK_SIZE*n == 0 +// +bdescr *allocAlignedGroupOnNode(uint32_t node, W_ n); + EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node); EXTERN_INLINE bdescr* allocBlockOnNode(uint32_t node) { diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index bbb4f8a..7f4c8a2 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -310,7 +310,7 @@ setup_tail (bdescr *bd) // Take a free block group bd, and split off a group of size n from // it. Adjust the free list as necessary, and return the new group. static bdescr * -split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln) +split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln /* log_2_ceil(n) */) { bdescr *fg; // free group @@ -325,6 +325,46 @@ split_free_block (bdescr *bd, uint32_t node, W_ n, uint32_t ln) return fg; } +// Take N blocks off the end, free the rest. +static bdescr * +split_block_high (bdescr *bd, W_ n) +{ + ASSERT(bd->blocks > n); + + bdescr* ret = bd + bd->blocks - n; // take n blocks off the end + ret->blocks = n; + ret->start = ret->free = bd->start + (bd->blocks - n)*BLOCK_SIZE_W; + ret->link = NULL; + + bd->blocks -= n; + + setup_tail(ret); + setup_tail(bd); + freeGroup(bd); + + return ret; +} + +// Like `split_block_high`, but takes n blocks off the beginning rather +// than the end. +static bdescr * +split_block_low (bdescr *bd, W_ n) +{ + ASSERT(bd->blocks > n); + + bdescr* bd_ = bd + n; + bd_->blocks = bd->blocks - n; + bd_->start = bd_->free = bd->start + n*BLOCK_SIZE_W; + + bd->blocks = n; + + setup_tail(bd_); + setup_tail(bd); + freeGroup(bd_); + + return bd; +} + /* Only initializes the start pointers on the first megablock and the * blocks field of the first bdescr; callers are responsible for calling * initGroup afterwards. @@ -461,6 +501,75 @@ finish: return bd; } +bdescr * +allocAlignedGroupOnNode (uint32_t node, W_ n) +{ + // allocate enough blocks to have enough space aligned at n-block boundary + // free any slops on the low and high side of this space + + // number of blocks to allocate to make sure we have enough aligned space + uint32_t num_blocks = 2*n - 1; + W_ group_size = n * BLOCK_SIZE; + + bdescr *bd = allocGroupOnNode(node, num_blocks); + + // slop on the low side + W_ slop_low = 0; + if ((uintptr_t)bd->start % group_size != 0) { + slop_low = group_size - ((uintptr_t)bd->start % group_size); + } + + W_ slop_high = (bd->blocks*BLOCK_SIZE) - group_size - slop_low; + + ASSERT((slop_low % BLOCK_SIZE) == 0); + ASSERT((slop_high % BLOCK_SIZE) == 0); + + W_ slop_low_blocks = slop_low / BLOCK_SIZE; + W_ slop_high_blocks = slop_high / BLOCK_SIZE; + + ASSERT(slop_low_blocks + slop_high_blocks + n == num_blocks); + +#ifdef DEBUG + checkFreeListSanity(); + W_ free_before = countFreeList(); +#endif + + if (slop_low_blocks != 0) { + bd = split_block_high(bd, num_blocks - slop_low_blocks); + ASSERT(countBlocks(bd) == num_blocks - slop_low_blocks); + } + +#ifdef DEBUG + ASSERT(countFreeList() == free_before + slop_low_blocks); + checkFreeListSanity(); +#endif + + // At this point the bd should be aligned, but we may have slop on the high side + ASSERT((uintptr_t)bd->start % group_size == 0); + +#ifdef DEBUG + free_before = countFreeList(); +#endif + + if (slop_high_blocks != 0) { + bd = split_block_low(bd, n); + ASSERT(countBlocks(bd) == n); + } + +#ifdef DEBUG + ASSERT(countFreeList() == free_before + slop_high_blocks); + checkFreeListSanity(); +#endif + + // Should still be aligned + ASSERT((uintptr_t)bd->start % group_size == 0); + + // Just to make sure I get this right + ASSERT(Bdescr(bd->start) == bd); + + return bd; +} + STATIC_INLINE uint32_t nodeWithLeastBlocks (void) { From git at git.haskell.org Thu Feb 21 15:11:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:54 +0000 (UTC) Subject: [commit: ghc] wip/gc/factor-out-bitmap-walking, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts: Factor out large bitmap walking (b1d3772) Message-ID: <20190221151154.73B793A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/factor-out-bitmap-walking,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/b1d37721abdc083fd5e28cb5dfac9f437c986d16/ghc >--------------------------------------------------------------- commit b1d37721abdc083fd5e28cb5dfac9f437c986d16 Author: Ben Gamari Date: Tue Feb 5 10:59:32 2019 -0500 rts: Factor out large bitmap walking This will be needed by the mark phase of the non-moving collector so let's factor it out. >--------------------------------------------------------------- b1d37721abdc083fd5e28cb5dfac9f437c986d16 rts/sm/HeapUtils.h | 33 +++++++++++++++++++++++++++++++++ rts/sm/Scav.c | 23 +++++++---------------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/rts/sm/HeapUtils.h b/rts/sm/HeapUtils.h new file mode 100644 index 0000000..2e9ca34 --- /dev/null +++ b/rts/sm/HeapUtils.h @@ -0,0 +1,33 @@ +/* ----------------------------------------------------------------------------- + * + * (c) The GHC Team 1998-2008 + * + * General utilities for walking the heap + * + * ---------------------------------------------------------------------------*/ + +#pragma once + +typedef void (walk_closures_cb)(StgClosure **, void *); + +INLINE_HEADER void +walk_large_bitmap(walk_closures_cb *cb, + StgClosure **p, + StgLargeBitmap *large_bitmap, + StgWord size, + void *user) +{ + uint32_t b = 0; + + for (uint32_t i = 0; i < size; b++) { + StgWord bitmap = large_bitmap->bitmap[b]; + uint32_t j = stg_min(size-i, BITS_IN(W_)); + i += j; + for (; j > 0; j--, p++) { + if ((bitmap & 1) == 0) { + cb(p, user); + } + bitmap = bitmap >> 1; + } + } +} diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 8bc7029..36592af 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -58,6 +58,7 @@ #include "Sanity.h" #include "Capability.h" #include "LdvProfile.h" +#include "HeapUtils.h" #include "Hash.h" #include "sm/MarkWeak.h" @@ -77,6 +78,11 @@ static void scavenge_large_bitmap (StgPtr p, # define scavenge_capability_mut_lists(cap) scavenge_capability_mut_Lists1(cap) #endif +static void do_evacuate(StgClosure **p, void *user STG_UNUSED) +{ + evacuate(p); +} + /* ----------------------------------------------------------------------------- Scavenge a TSO. -------------------------------------------------------------------------- */ @@ -1777,22 +1783,7 @@ scavenge_static(void) static void scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ) { - uint32_t i, j, b; - StgWord bitmap; - - b = 0; - - for (i = 0; i < size; b++) { - bitmap = large_bitmap->bitmap[b]; - j = stg_min(size-i, BITS_IN(W_)); - i += j; - for (; j > 0; j--, p++) { - if ((bitmap & 1) == 0) { - evacuate((StgClosure **)p); - } - bitmap = bitmap >> 1; - } - } + walk_large_bitmap(do_evacuate, (StgClosure **) p, large_bitmap, size, NULL); } From git at git.haskell.org Thu Feb 21 15:11:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:11:57 +0000 (UTC) Subject: [commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts/GC: Add an obvious assertion during block initialization (09ab2a9) Message-ID: <20190221151157.7DB3B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/09ab2a9c50e53a7200a4c8adb8b760eb156136a0/ghc >--------------------------------------------------------------- commit 09ab2a9c50e53a7200a4c8adb8b760eb156136a0 Author: Ömer Sinan Ağacan Date: Tue Feb 5 10:40:29 2019 -0500 rts/GC: Add an obvious assertion during block initialization Namely ensure that block descriptors are initialized with valid generation numbers. >--------------------------------------------------------------- 09ab2a9c50e53a7200a4c8adb8b760eb156136a0 includes/rts/storage/GC.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/rts/storage/GC.h b/includes/rts/storage/GC.h index 1571975..81850f1 100644 --- a/includes/rts/storage/GC.h +++ b/includes/rts/storage/GC.h @@ -240,9 +240,14 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); /* (needed when dynamic libraries are used). */ extern bool keepCAFs; +#include "rts/Flags.h" + INLINE_HEADER void initBdescr(bdescr *bd, generation *gen, generation *dest) { bd->gen = gen; bd->gen_no = gen->no; bd->dest_no = dest->no; + + ASSERT(gen->no < RtsFlags.GcFlags.generations); + ASSERT(dest->no < RtsFlags.GcFlags.generations); } From git at git.haskell.org Thu Feb 21 15:12:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:00 +0000 (UTC) Subject: [commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts/GC: Refactor gcCAFs (7d7b866) Message-ID: <20190221151200.83FDB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/7d7b866c63b04dc2e2fcf655c043160acbb8f6b4/ghc >--------------------------------------------------------------- commit 7d7b866c63b04dc2e2fcf655c043160acbb8f6b4 Author: Ben Gamari Date: Tue Feb 5 21:17:36 2019 -0500 rts/GC: Refactor gcCAFs >--------------------------------------------------------------- 7d7b866c63b04dc2e2fcf655c043160acbb8f6b4 rts/sm/GC.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 70d6d8e..0bb7809 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -1836,21 +1836,16 @@ resize_nursery (void) #if defined(DEBUG) -static void gcCAFs(void) +void gcCAFs(void) { - StgIndStatic *p, *prev; + uint32_t i = 0; + StgIndStatic *prev = NULL; - const StgInfoTable *info; - uint32_t i; - - i = 0; - p = debug_caf_list; - prev = NULL; - - for (p = debug_caf_list; p != (StgIndStatic*)END_OF_CAF_LIST; - p = (StgIndStatic*)p->saved_info) { - - info = get_itbl((StgClosure*)p); + for (StgIndStatic *p = debug_caf_list; + p != (StgIndStatic*) END_OF_CAF_LIST; + p = (StgIndStatic*) p->saved_info) + { + const StgInfoTable *info = get_itbl((StgClosure*)p); ASSERT(info->type == IND_STATIC); // See Note [STATIC_LINK fields] in Storage.h From git at git.haskell.org Thu Feb 21 15:12:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:03 +0000 (UTC) Subject: [commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts: Add Note explaining applicability of selector optimisation depth limit (1ed35cb) Message-ID: <20190221151203.8FAC33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/1ed35cb0d7b6f5172b50294d554ca1d95ae59372/ghc >--------------------------------------------------------------- commit 1ed35cb0d7b6f5172b50294d554ca1d95ae59372 Author: Ben Gamari Date: Tue Jul 3 19:58:37 2018 -0400 rts: Add Note explaining applicability of selector optimisation depth limit This was slightly non-obvious so a note seems deserved. >--------------------------------------------------------------- 1ed35cb0d7b6f5172b50294d554ca1d95ae59372 rts/sm/Evac.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 2890319..45431fe 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -39,7 +39,19 @@ copy_tag(p, info, src, size, stp, tag) #endif -/* Used to avoid long recursion due to selector thunks +/* Note [Selector optimisation depth limit] + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * MAX_THUNK_SELECTOR_DEPTH is used to avoid long recursion of + * eval_thunk_selector due to nested selector thunks. Note that this *only* + * counts nested selector thunks, e.g. `fst (fst (... (fst x)))`. The collector + * will traverse interleaved selector-constructor pairs without limit, e.g. + * + * a = (fst b, _) + * b = (fst c, _) + * c = (fst d, _) + * d = (x, _) + * */ #define MAX_THUNK_SELECTOR_DEPTH 16 @@ -1252,6 +1264,7 @@ selector_loop: // recursively evaluate this selector. We don't want to // recurse indefinitely, so we impose a depth bound. + // See Note [Selector optimisation depth limit]. if (gct->thunk_selector_depth >= MAX_THUNK_SELECTOR_DEPTH) { goto bale_out; } From git at git.haskell.org Thu Feb 21 15:12:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:06 +0000 (UTC) Subject: [commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts/Capability: A few documentation comments (0915a8c) Message-ID: <20190221151206.949873A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/0915a8c773c0f2b78d8bf40e1ec463c518edd6a2/ghc >--------------------------------------------------------------- commit 0915a8c773c0f2b78d8bf40e1ec463c518edd6a2 Author: Ben Gamari Date: Tue Feb 5 10:43:56 2019 -0500 rts/Capability: A few documentation comments >--------------------------------------------------------------- 0915a8c773c0f2b78d8bf40e1ec463c518edd6a2 rts/Capability.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rts/Capability.c b/rts/Capability.c index bda3b0e..a1f994d 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -748,6 +748,8 @@ static Capability * waitForReturnCapability (Task *task) * result of the external call back to the Haskell thread that * made it. * + * pCap is strictly an output. + * * ------------------------------------------------------------------------- */ void waitForCapability (Capability **pCap, Task *task) @@ -840,6 +842,9 @@ void waitForCapability (Capability **pCap, Task *task) * SYNC_GC_PAR), either to do a sequential GC, forkProcess, or * setNumCapabilities. We should give up the Capability temporarily. * + * When yieldCapability returns *pCap will have been updated to the new + * capability held by the caller. + * * ------------------------------------------------------------------------- */ #if defined (THREADED_RTS) From git at git.haskell.org Thu Feb 21 15:12:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:09 +0000 (UTC) Subject: [commit: ghc] wip/gc/misc-rts, wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: rts: Give stack flags proper macros (1f4e9de) Message-ID: <20190221151209.A86CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/misc-rts,wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/1f4e9de7fb3912cffbb59d4a4d58b3d6814edfa5/ghc >--------------------------------------------------------------- commit 1f4e9de7fb3912cffbb59d4a4d58b3d6814edfa5 Author: Ben Gamari Date: Tue Feb 5 11:01:10 2019 -0500 rts: Give stack flags proper macros This were previously quite unclear and will change a bit under the non-moving collector so let's clear this up now. >--------------------------------------------------------------- 1f4e9de7fb3912cffbb59d4a4d58b3d6814edfa5 includes/rts/storage/TSO.h | 5 +++++ rts/PrimOps.cmm | 4 ++-- rts/Threads.c | 4 ++-- rts/sm/Sanity.c | 8 ++++---- rts/sm/Storage.c | 4 ++-- utils/deriveConstants/Main.hs | 3 +++ 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/includes/rts/storage/TSO.h b/includes/rts/storage/TSO.h index 9301858..63d2a11 100644 --- a/includes/rts/storage/TSO.h +++ b/includes/rts/storage/TSO.h @@ -185,6 +185,11 @@ typedef struct StgTSO_ { } *StgTSOPtr; // StgTSO defined in rts/Types.h + +#define STACK_DIRTY 1 +// used by sanity checker to verify that all dirty stacks are on the mutable list +#define STACK_SANE 64 + typedef struct StgStack_ { StgHeader header; StgWord32 stack_size; // stack size in *words* diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 625f5f5..364a075 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1721,7 +1721,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } @@ -1802,7 +1802,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } diff --git a/rts/Threads.c b/rts/Threads.c index 9776353..674ba80 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -85,7 +85,7 @@ createThread(Capability *cap, W_ size) SET_HDR(stack, &stg_STACK_info, cap->r.rCCCS); stack->stack_size = stack_size - sizeofW(StgStack); stack->sp = stack->stack + stack->stack_size; - stack->dirty = 1; + stack->dirty = STACK_DIRTY; tso = (StgTSO *)allocate(cap, sizeofW(StgTSO)); TICK_ALLOC_TSO(); @@ -788,7 +788,7 @@ loop: // indicate that the MVar operation has now completed. tso->_link = (StgTSO*)&stg_END_TSO_QUEUE_closure; - if (stack->dirty == 0) { + if ((stack->dirty & STACK_DIRTY) == 0) { dirty_STACK(cap, stack); } diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 28c9b43..1b13f4f 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -619,9 +619,9 @@ checkGlobalTSOList (bool checkTSOs) stack = tso->stackobj; while (1) { - if (stack->dirty & 1) { - ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & TSO_MARKED)); - stack->dirty &= ~TSO_MARKED; + if (stack->dirty & STACK_DIRTY) { + ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & STACK_SANE)); + stack->dirty &= ~STACK_SANE; } frame = (StgUnderflowFrame*) (stack->stack + stack->stack_size - sizeofW(StgUnderflowFrame)); @@ -656,7 +656,7 @@ checkMutableList( bdescr *mut_bd, uint32_t gen ) ((StgTSO *)p)->flags |= TSO_MARKED; break; case STACK: - ((StgStack *)p)->dirty |= TSO_MARKED; + ((StgStack *)p)->dirty |= STACK_SANE; break; } } diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index dcc5b3a..8a46787 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -1133,8 +1133,8 @@ dirty_TSO (Capability *cap, StgTSO *tso) void dirty_STACK (Capability *cap, StgStack *stack) { - if (stack->dirty == 0) { - stack->dirty = 1; + if (! (stack->dirty & STACK_DIRTY)) { + stack->dirty = STACK_DIRTY; recordClosureMutated(cap,(StgClosure*)stack); } } diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs index 5d5dbc4..335afcd 100644 --- a/utils/deriveConstants/Main.hs +++ b/utils/deriveConstants/Main.hs @@ -307,6 +307,9 @@ wanteds os = concat "sizeofW(StgHeader) - sizeofW(StgProfHeader)" ,constantWord Both "PROF_HDR_SIZE" "sizeofW(StgProfHeader)" + -- Stack flags for C-- + ,constantWord C "STACK_DIRTY" "STACK_DIRTY" + -- Size of a storage manager block (in bytes). ,constantWord Both "BLOCK_SIZE" "BLOCK_SIZE" ,constantWord C "MBLOCK_SIZE" "MBLOCK_SIZE" From git at git.haskell.org Thu Feb 21 15:12:12 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:12 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent, wip/gc/preparation, wip/gc/sync-without-capability: rts/Schedule: Allow synchronization without holding a capability (3ce969b) Message-ID: <20190221151212.B67593A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/nonmoving-nonconcurrent,wip/gc/preparation,wip/gc/sync-without-capability Link : http://ghc.haskell.org/trac/ghc/changeset/3ce969bb518ad5f056be18756d93d1472f372b61/ghc >--------------------------------------------------------------- commit 3ce969bb518ad5f056be18756d93d1472f372b61 Author: Ben Gamari Date: Thu Jul 19 21:57:14 2018 -0400 rts/Schedule: Allow synchronization without holding a capability The concurrent mark-and-sweep will be performed by a GHC task which will not hold a capability. This is necessary to avoid a concurrent mark from interfering with minor generation collections. However, the major collector must synchronize with the mutators at the end of marking to flush their update remembered sets. This patch extends the `requestSync` mechanism used to synchronize garbage collectors to allow synchronization without holding a capability. This change is fairly straightforward as the capability was previously only required for two reasons: 1. to ensure that we don't try to re-acquire a capability that we the sync requestor already holds. 2. to provide a way to suspend and later resume the sync request if there is already a sync pending. When synchronizing without holding a capability we needn't worry about consideration (1) at all. (2) is slightly trickier and may happen, for instance, when a capability requests a minor collection and shortly thereafter the non-moving mark thread requests a post-mark synchronization. In this case we need to ensure that the non-moving mark thread suspends his request until after the minor GC has concluded to avoid dead-locking. For this we introduce a condition variable, `sync_finished_cond`, which a non-capability-bearing requestor will wait on and which is signalled after a synchronization or GC has finished. >--------------------------------------------------------------- 3ce969bb518ad5f056be18756d93d1472f372b61 rts/Schedule.c | 90 +++++++++++++++++++++++++++++++++++++++++++--------------- rts/Schedule.h | 6 ++++ 2 files changed, 73 insertions(+), 23 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index 02055d2..683871c 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -110,6 +110,19 @@ Mutex sched_mutex; #define FORKPROCESS_PRIMOP_SUPPORTED #endif +/* + * sync_finished_cond allows threads which do not own any capability (e.g. the + * concurrent mark thread) to participate in the sync protocol. In particular, + * if such a thread requests a sync while sync is already in progress it will + * block on sync_finished_cond, which will be signalled when the sync is + * finished (by releaseAllCapabilities). + */ +#if defined(THREADED_RTS) +static Condition sync_finished_cond; +static Mutex sync_finished_mutex; +#endif + + /* ----------------------------------------------------------------------------- * static function prototypes * -------------------------------------------------------------------------- */ @@ -130,7 +143,6 @@ static void scheduleYield (Capability **pcap, Task *task); static bool requestSync (Capability **pcap, Task *task, PendingSync *sync_type, SyncType *prev_sync_type); static void acquireAllCapabilities(Capability *cap, Task *task); -static void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task); static void startWorkerTasks (uint32_t from USED_IF_THREADS, uint32_t to USED_IF_THREADS); #endif @@ -1368,17 +1380,24 @@ scheduleNeedHeapProfile( bool ready_to_gc ) * change to the system, such as altering the number of capabilities, or * forking. * + * pCap may be NULL in the event that the caller doesn't yet own a capability. + * * To resume after stopAllCapabilities(), use releaseAllCapabilities(). * -------------------------------------------------------------------------- */ #if defined(THREADED_RTS) -static void stopAllCapabilities (Capability **pCap, Task *task) +void stopAllCapabilities (Capability **pCap, Task *task) +{ + stopAllCapabilitiesWith(pCap, task, SYNC_OTHER); +} + +void stopAllCapabilitiesWith (Capability **pCap, Task *task, SyncType sync_type) { bool was_syncing; SyncType prev_sync_type; PendingSync sync = { - .type = SYNC_OTHER, + .type = sync_type, .idle = NULL, .task = task }; @@ -1387,9 +1406,10 @@ static void stopAllCapabilities (Capability **pCap, Task *task) was_syncing = requestSync(pCap, task, &sync, &prev_sync_type); } while (was_syncing); - acquireAllCapabilities(*pCap,task); + acquireAllCapabilities(pCap ? *pCap : NULL, task); pending_sync = 0; + signalCondition(&sync_finished_cond); } #endif @@ -1400,6 +1420,16 @@ static void stopAllCapabilities (Capability **pCap, Task *task) * directly, instead use stopAllCapabilities(). This is used by the GC, which * has some special synchronisation requirements. * + * Note that this can be called in two ways: + * + * - where *pcap points to a capability owned by the caller: in this case + * *prev_sync_type will reflect the in-progress sync type on return, if one + * *was found + * + * - where pcap == NULL: in this case the caller doesn't hold a capability. + * we only return whether or not a pending sync was found and prev_sync_type + * is unchanged. + * * Returns: * false if we successfully got a sync * true if there was another sync request in progress, @@ -1424,13 +1454,25 @@ static bool requestSync ( // After the sync is completed, we cannot read that struct any // more because it has been freed. *prev_sync_type = sync->type; - do { - debugTrace(DEBUG_sched, "someone else is trying to sync (%d)...", - sync->type); - ASSERT(*pcap); - yieldCapability(pcap,task,true); - sync = pending_sync; - } while (sync != NULL); + if (pcap == NULL) { + // The caller does not hold a capability (e.g. may be a concurrent + // mark thread). Consequently we must wait until the pending sync is + // finished before proceeding to ensure we don't loop. + // TODO: Don't busy-wait + ACQUIRE_LOCK(&sync_finished_mutex); + while (pending_sync) { + waitCondition(&sync_finished_cond, &sync_finished_mutex); + } + RELEASE_LOCK(&sync_finished_mutex); + } else { + do { + debugTrace(DEBUG_sched, "someone else is trying to sync (%d)...", + sync->type); + ASSERT(*pcap); + yieldCapability(pcap,task,true); + sync = pending_sync; + } while (sync != NULL); + } // NOTE: task->cap might have changed now return true; @@ -1445,9 +1487,9 @@ static bool requestSync ( /* ----------------------------------------------------------------------------- * acquireAllCapabilities() * - * Grab all the capabilities except the one we already hold. Used - * when synchronising before a single-threaded GC (SYNC_SEQ_GC), and - * before a fork (SYNC_OTHER). + * Grab all the capabilities except the one we already hold (cap may be NULL is + * the caller does not currently hold a capability). Used when synchronising + * before a single-threaded GC (SYNC_SEQ_GC), and before a fork (SYNC_OTHER). * * Only call this after requestSync(), otherwise a deadlock might * ensue if another thread is trying to synchronise. @@ -1477,29 +1519,30 @@ static void acquireAllCapabilities(Capability *cap, Task *task) } } } - task->cap = cap; + task->cap = cap == NULL ? tmpcap : cap; } #endif /* ----------------------------------------------------------------------------- - * releaseAllcapabilities() + * releaseAllCapabilities() * - * Assuming this thread holds all the capabilities, release them all except for - * the one passed in as cap. + * Assuming this thread holds all the capabilities, release them all (except for + * the one passed in as keep_cap, if non-NULL). * -------------------------------------------------------------------------- */ #if defined(THREADED_RTS) -static void releaseAllCapabilities(uint32_t n, Capability *cap, Task *task) +void releaseAllCapabilities(uint32_t n, Capability *keep_cap, Task *task) { uint32_t i; for (i = 0; i < n; i++) { - if (cap->no != i) { - task->cap = capabilities[i]; - releaseCapability(capabilities[i]); + Capability *tmpcap = capabilities[i]; + if (keep_cap != tmpcap) { + task->cap = tmpcap; + releaseCapability(tmpcap); } } - task->cap = cap; + task->cap = keep_cap; } #endif @@ -1801,6 +1844,7 @@ delete_threads_and_gc: // reset pending_sync *before* GC, so that when the GC threads // emerge they don't immediately re-enter the GC. pending_sync = 0; + signalCondition(&sync_finished_cond); GarbageCollect(collect_gen, heap_census, gc_type, cap, idle_cap); #else GarbageCollect(collect_gen, heap_census, 0, cap, NULL); diff --git a/rts/Schedule.h b/rts/Schedule.h index 66cf839..a477229 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -49,6 +49,12 @@ StgWord findRetryFrameHelper (Capability *cap, StgTSO *tso); /* Entry point for a new worker */ void scheduleWorker (Capability *cap, Task *task); +#if defined(THREADED_RTS) +void stopAllCapabilitiesWith (Capability **pCap, Task *task, SyncType sync_type); +void stopAllCapabilities (Capability **pCap, Task *task); +void releaseAllCapabilities(uint32_t n, Capability *keep_cap, Task *task); +#endif + /* The state of the scheduler. This is used to control the sequence * of events during shutdown. See Note [shutdown] in Schedule.c. */ From git at git.haskell.org Thu Feb 21 15:12:17 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:17 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: Merge branches 'wip/gc/sync-without-capability', 'wip/gc/factor-out-bitmap-walking', 'wip/gc/aligned-block-allocation', 'wip/gc/misc-rts' and 'wip/gc/printer-improvements' into wip/gc/preparation (98c9ca6) Message-ID: <20190221151217.A68873A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/98c9ca65f64f33d992954757e1fcde16f4ad14b6/ghc >--------------------------------------------------------------- commit 98c9ca65f64f33d992954757e1fcde16f4ad14b6 Merge: 3ce969b b1d3772 fee8f29 7d7b866 ad8da70 Author: Ben Gamari Date: Wed Feb 20 15:27:33 2019 -0500 Merge branches 'wip/gc/sync-without-capability', 'wip/gc/factor-out-bitmap-walking', 'wip/gc/aligned-block-allocation', 'wip/gc/misc-rts' and 'wip/gc/printer-improvements' into wip/gc/preparation >--------------------------------------------------------------- 98c9ca65f64f33d992954757e1fcde16f4ad14b6 includes/rts/storage/Block.h | 7 +++ includes/rts/storage/GC.h | 5 ++ includes/rts/storage/TSO.h | 5 ++ rts/Capability.c | 5 ++ rts/PrimOps.cmm | 4 +- rts/Printer.c | 86 ++++++++++++++++++++++++++++++-- rts/Printer.h | 3 ++ rts/Threads.c | 4 +- rts/sm/BlockAlloc.c | 111 +++++++++++++++++++++++++++++++++++++++++- rts/sm/Evac.c | 15 +++++- rts/sm/GC.c | 21 +++----- rts/sm/HeapUtils.h | 33 +++++++++++++ rts/sm/Sanity.c | 8 +-- rts/sm/Scav.c | 23 +++------ rts/sm/Storage.c | 4 +- utils/deriveConstants/Main.hs | 3 ++ 16 files changed, 293 insertions(+), 44 deletions(-) From git at git.haskell.org Thu Feb 21 15:12:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:20 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent, wip/gc/preparation, wip/gc/unglobalize-gc-state: rts: Unglobalize dead_weak_ptr_list and resurrected_threads (39d7a76) Message-ID: <20190221151220.ACBF33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/nonmoving-nonconcurrent,wip/gc/preparation,wip/gc/unglobalize-gc-state Link : http://ghc.haskell.org/trac/ghc/changeset/39d7a76cac5269c389abc60a9559b30578062fad/ghc >--------------------------------------------------------------- commit 39d7a76cac5269c389abc60a9559b30578062fad Author: Ömer Sinan Ağacan Date: Tue Feb 5 12:45:17 2019 -0500 rts: Unglobalize dead_weak_ptr_list and resurrected_threads In the concurrent nonmoving collector we will need the ability to call `traverseWeakPtrList` concurrently with minor generation collections. This global state stands in the way of this. However, refactoring it away is straightforward since this list only persists the length of a single GC. >--------------------------------------------------------------- 39d7a76cac5269c389abc60a9559b30578062fad rts/sm/Compact.c | 2 +- rts/sm/Compact.h | 4 +++- rts/sm/GC.c | 9 +++++++-- rts/sm/MarkWeak.c | 30 +++++++++++------------------- rts/sm/MarkWeak.h | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index 004e042..bd45489 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -940,7 +940,7 @@ update_bkwd_compact( generation *gen ) } void -compact(StgClosure *static_objects) +compact(StgClosure *static_objects, StgWeak *dead_weak_ptr_list, StgTSO *resurrected_threads) { W_ n, g, blocks; generation *gen; diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h index 63abfc7..ba39c30 100644 --- a/rts/sm/Compact.h +++ b/rts/sm/Compact.h @@ -45,6 +45,8 @@ is_marked(StgPtr p, bdescr *bd) return (*bitmap_word & bit_mask); } -void compact (StgClosure *static_objects); +void compact (StgClosure *static_objects, + StgWeak *dead_weak_ptr_list, + StgTSO *resurrected_threads); #include "EndPrivate.h" diff --git a/rts/sm/GC.c b/rts/sm/GC.c index 70d6d8e..b3cc448 100644 --- a/rts/sm/GC.c +++ b/rts/sm/GC.c @@ -416,15 +416,20 @@ GarbageCollect (uint32_t collect_gen, * Repeatedly scavenge all the areas we know about until there's no * more scavenging to be done. */ + + StgWeak *dead_weak_ptr_list = NULL; + StgTSO *resurrected_threads = END_TSO_QUEUE; + for (;;) { scavenge_until_all_done(); + // The other threads are now stopped. We might recurse back to // here, but from now on this is the only thread. // must be last... invariant is that everything is fully // scavenged at this point. - if (traverseWeakPtrList()) { // returns true if evaced something + if (traverseWeakPtrList(&dead_weak_ptr_list, &resurrected_threads)) { // returns true if evaced something inc_running(); continue; } @@ -468,7 +473,7 @@ GarbageCollect (uint32_t collect_gen, // Finally: compact or sweep the oldest generation. if (major_gc && oldest_gen->mark) { if (oldest_gen->compact) - compact(gct->scavenged_static_objects); + compact(gct->scavenged_static_objects, dead_weak_ptr_list, resurrected_threads); else sweep(oldest_gen); } diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index d7b8fe6..3aa2887 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -77,15 +77,9 @@ typedef enum { WeakPtrs, WeakThreads, WeakDone } WeakStage; static WeakStage weak_stage; -// List of weak pointers whose key is dead -StgWeak *dead_weak_ptr_list; - -// List of threads found to be unreachable -StgTSO *resurrected_threads; - -static void collectDeadWeakPtrs (generation *gen); +static void collectDeadWeakPtrs (generation *gen, StgWeak **dead_weak_ptr_list); static bool tidyWeakList (generation *gen); -static bool resurrectUnreachableThreads (generation *gen); +static bool resurrectUnreachableThreads (generation *gen, StgTSO **resurrected_threads); static void tidyThreadList (generation *gen); void @@ -100,12 +94,10 @@ initWeakForGC(void) } weak_stage = WeakThreads; - dead_weak_ptr_list = NULL; - resurrected_threads = END_TSO_QUEUE; } bool -traverseWeakPtrList(void) +traverseWeakPtrList(StgWeak **dead_weak_ptr_list, StgTSO **resurrected_threads) { bool flag = false; @@ -140,7 +132,7 @@ traverseWeakPtrList(void) // Resurrect any threads which were unreachable for (g = 0; g <= N; g++) { - if (resurrectUnreachableThreads(&generations[g])) { + if (resurrectUnreachableThreads(&generations[g], resurrected_threads)) { flag = true; } } @@ -175,7 +167,7 @@ traverseWeakPtrList(void) */ if (flag == false) { for (g = 0; g <= N; g++) { - collectDeadWeakPtrs(&generations[g]); + collectDeadWeakPtrs(&generations[g], dead_weak_ptr_list); } weak_stage = WeakDone; // *now* we're done, @@ -190,7 +182,7 @@ traverseWeakPtrList(void) } } -static void collectDeadWeakPtrs (generation *gen) +static void collectDeadWeakPtrs (generation *gen, StgWeak **dead_weak_ptr_list) { StgWeak *w, *next_w; for (w = gen->old_weak_ptr_list; w != NULL; w = next_w) { @@ -201,12 +193,12 @@ static void collectDeadWeakPtrs (generation *gen) } evacuate(&w->finalizer); next_w = w->link; - w->link = dead_weak_ptr_list; - dead_weak_ptr_list = w; + w->link = *dead_weak_ptr_list; + *dead_weak_ptr_list = w; } } -static bool resurrectUnreachableThreads (generation *gen) +static bool resurrectUnreachableThreads (generation *gen, StgTSO **resurrected_threads) { StgTSO *t, *tmp, *next; bool flag = false; @@ -225,8 +217,8 @@ static bool resurrectUnreachableThreads (generation *gen) default: tmp = t; evacuate((StgClosure **)&tmp); - tmp->global_link = resurrected_threads; - resurrected_threads = tmp; + tmp->global_link = *resurrected_threads; + *resurrected_threads = tmp; flag = true; } } diff --git a/rts/sm/MarkWeak.h b/rts/sm/MarkWeak.h index cd58ec9..2756cb0 100644 --- a/rts/sm/MarkWeak.h +++ b/rts/sm/MarkWeak.h @@ -19,7 +19,7 @@ extern StgTSO *resurrected_threads; void collectFreshWeakPtrs ( void ); void initWeakForGC ( void ); -bool traverseWeakPtrList ( void ); +bool traverseWeakPtrList ( StgWeak **dead_weak_ptr_list, StgTSO **resurrected_threads ); void markWeakPtrList ( void ); void scavengeLiveWeak ( StgWeak * ); From git at git.haskell.org Thu Feb 21 15:12:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:24 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent, wip/gc/preparation: Merge branch 'wip/gc/unglobalize-gc-state' into wip/gc/preparation (412abe8) Message-ID: <20190221151224.3901B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gc/nonmoving-nonconcurrent,wip/gc/preparation Link : http://ghc.haskell.org/trac/ghc/changeset/412abe8b6eb1b17af9c0db503ab7a4ed74064faa/ghc >--------------------------------------------------------------- commit 412abe8b6eb1b17af9c0db503ab7a4ed74064faa Merge: 98c9ca6 39d7a76 Author: Ben Gamari Date: Wed Feb 20 15:32:20 2019 -0500 Merge branch 'wip/gc/unglobalize-gc-state' into wip/gc/preparation >--------------------------------------------------------------- 412abe8b6eb1b17af9c0db503ab7a4ed74064faa rts/sm/Compact.c | 2 +- rts/sm/Compact.h | 4 +++- rts/sm/GC.c | 9 +++++++-- rts/sm/MarkWeak.c | 30 +++++++++++------------------- rts/sm/MarkWeak.h | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) From git at git.haskell.org Thu Feb 21 15:12:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:27 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts/Scav: Expose scavenging functions (60bef7e) Message-ID: <20190221151227.453273A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/60bef7e45f217d76cc15dc7918738a11554d18c7/ghc >--------------------------------------------------------------- commit 60bef7e45f217d76cc15dc7918738a11554d18c7 Author: Ömer Sinan Ağacan Date: Tue Feb 5 11:46:25 2019 -0500 rts/Scav: Expose scavenging functions To keep the non-moving collector nicely separated from the moving collector its scavenging phase will live in another file, `NonMovingScav.c`. However, it will need to use these functions so let's expose them. >--------------------------------------------------------------- 60bef7e45f217d76cc15dc7918738a11554d18c7 rts/sm/Scav.c | 28 +++++++++++++++++----------- rts/sm/Scav.h | 14 ++++++++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 36592af..711bfbb 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -63,8 +63,6 @@ #include "sm/MarkWeak.h" -static void scavenge_stack (StgPtr p, StgPtr stack_end); - static void scavenge_large_bitmap (StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ); @@ -76,6 +74,14 @@ static void scavenge_large_bitmap (StgPtr p, # define scavenge_block(a) scavenge_block1(a) # define scavenge_mutable_list(bd,g) scavenge_mutable_list1(bd,g) # define scavenge_capability_mut_lists(cap) scavenge_capability_mut_Lists1(cap) +# define scavengeTSO(tso) scavengeTSO1(tso) +# define scavenge_stack(p, stack_end) scavenge_stack1(p, stack_end) +# define scavenge_fun_srt(info) scavenge_fun_srt1(info) +# define scavenge_fun_srt(info) scavenge_fun_srt1(info) +# define scavenge_thunk_srt(info) scavenge_thunk_srt1(info) +# define scavenge_mut_arr_ptrs(info) scavenge_mut_arr_ptrs1(info) +# define scavenge_PAP(pap) scavenge_PAP1(pap) +# define scavenge_AP(ap) scavenge_AP1(ap) #endif static void do_evacuate(StgClosure **p, void *user STG_UNUSED) @@ -87,7 +93,7 @@ static void do_evacuate(StgClosure **p, void *user STG_UNUSED) Scavenge a TSO. -------------------------------------------------------------------------- */ -static void +void scavengeTSO (StgTSO *tso) { bool saved_eager; @@ -198,7 +204,7 @@ scavenge_compact(StgCompactNFData *str) Mutable arrays of pointers -------------------------------------------------------------------------- */ -static StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a) +StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a) { W_ m; bool any_failed; @@ -348,14 +354,14 @@ scavenge_PAP_payload (StgClosure *fun, StgClosure **payload, StgWord size) return p; } -STATIC_INLINE GNUC_ATTR_HOT StgPtr +GNUC_ATTR_HOT StgPtr scavenge_PAP (StgPAP *pap) { evacuate(&pap->fun); return scavenge_PAP_payload (pap->fun, pap->payload, pap->n_args); } -STATIC_INLINE StgPtr +StgPtr scavenge_AP (StgAP *ap) { evacuate(&ap->fun); @@ -366,7 +372,7 @@ scavenge_AP (StgAP *ap) Scavenge SRTs -------------------------------------------------------------------------- */ -STATIC_INLINE GNUC_ATTR_HOT void +GNUC_ATTR_HOT void scavenge_thunk_srt(const StgInfoTable *info) { StgThunkInfoTable *thunk_info; @@ -380,7 +386,7 @@ scavenge_thunk_srt(const StgInfoTable *info) } } -STATIC_INLINE GNUC_ATTR_HOT void +GNUC_ATTR_HOT void scavenge_fun_srt(const StgInfoTable *info) { StgFunInfoTable *fun_info; @@ -1570,10 +1576,10 @@ static void scavenge_mutable_list(bdescr *bd, generation *gen) { StgPtr p, q; - uint32_t gen_no; - gen_no = gen->no; + uint32_t gen_no = gen->no; gct->evac_gen_no = gen_no; + for (; bd != NULL; bd = bd->link) { for (q = bd->start; q < bd->free; q++) { p = (StgPtr)*q; @@ -1793,7 +1799,7 @@ scavenge_large_bitmap( StgPtr p, StgLargeBitmap *large_bitmap, StgWord size ) AP_STACK_UPDs, since these are just sections of copied stack. -------------------------------------------------------------------------- */ -static void +void scavenge_stack(StgPtr p, StgPtr stack_end) { const StgRetInfoTable* info; diff --git a/rts/sm/Scav.h b/rts/sm/Scav.h index 6d265a7..ba434f0 100644 --- a/rts/sm/Scav.h +++ b/rts/sm/Scav.h @@ -17,10 +17,24 @@ void scavenge_loop (void); void scavenge_capability_mut_lists (Capability *cap); +void scavengeTSO (StgTSO *tso); +void scavenge_stack (StgPtr p, StgPtr stack_end); +void scavenge_fun_srt (const StgInfoTable *info); +void scavenge_thunk_srt (const StgInfoTable *info); +StgPtr scavenge_mut_arr_ptrs (StgMutArrPtrs *a); +StgPtr scavenge_PAP (StgPAP *pap); +StgPtr scavenge_AP (StgAP *ap); #if defined(THREADED_RTS) void scavenge_loop1 (void); void scavenge_capability_mut_Lists1 (Capability *cap); +void scavengeTSO1 (StgTSO *tso); +void scavenge_stack1 (StgPtr p, StgPtr stack_end); +void scavenge_fun_srt1 (const StgInfoTable *info); +void scavenge_thunk_srt1 (const StgInfoTable *info); +StgPtr scavenge_mut_arr_ptrs1 (StgMutArrPtrs *a); +StgPtr scavenge_PAP1 (StgPAP *pap); +StgPtr scavenge_AP1 (StgAP *ap); #endif #include "EndPrivate.h" From git at git.haskell.org Thu Feb 21 15:12:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:30 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts: Introduce debug flag for non-moving GC (8c22738) Message-ID: <20190221151230.46C343A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/8c22738dd28af667e431cd9dd772005ace840d6d/ghc >--------------------------------------------------------------- commit 8c22738dd28af667e431cd9dd772005ace840d6d Author: Ben Gamari Date: Fri Jul 6 21:02:22 2018 -0400 rts: Introduce debug flag for non-moving GC >--------------------------------------------------------------- 8c22738dd28af667e431cd9dd772005ace840d6d libraries/base/GHC/RTS/Flags.hsc | 33 ++++++++++++++++++--------------- rts/Trace.h | 1 + 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index 12cb828..2fe2dbc 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -149,21 +149,22 @@ data MiscFlags = MiscFlags -- -- @since 4.8.0.0 data DebugFlags = DebugFlags - { scheduler :: Bool -- ^ @s@ - , interpreter :: Bool -- ^ @i@ - , weak :: Bool -- ^ @w@ - , gccafs :: Bool -- ^ @G@ - , gc :: Bool -- ^ @g@ - , block_alloc :: Bool -- ^ @b@ - , sanity :: Bool -- ^ @S@ - , stable :: Bool -- ^ @t@ - , prof :: Bool -- ^ @p@ - , linker :: Bool -- ^ @l@ the object linker - , apply :: Bool -- ^ @a@ - , stm :: Bool -- ^ @m@ - , squeeze :: Bool -- ^ @z@ stack squeezing & lazy blackholing - , hpc :: Bool -- ^ @c@ coverage - , sparks :: Bool -- ^ @r@ + { scheduler :: Bool -- ^ @s@ + , interpreter :: Bool -- ^ @i@ + , weak :: Bool -- ^ @w@ + , gccafs :: Bool -- ^ @G@ + , gc :: Bool -- ^ @g@ + , nonmoving_gc :: Bool -- ^ @n@ + , block_alloc :: Bool -- ^ @b@ + , sanity :: Bool -- ^ @S@ + , stable :: Bool -- ^ @t@ + , prof :: Bool -- ^ @p@ + , linker :: Bool -- ^ @l@ the object linker + , apply :: Bool -- ^ @a@ + , stm :: Bool -- ^ @m@ + , squeeze :: Bool -- ^ @z@ stack squeezing & lazy blackholing + , hpc :: Bool -- ^ @c@ coverage + , sparks :: Bool -- ^ @r@ } deriving ( Show -- ^ @since 4.8.0.0 ) @@ -460,6 +461,8 @@ getDebugFlags = do <*> (toBool <$> (#{peek DEBUG_FLAGS, gc} ptr :: IO CBool)) <*> (toBool <$> + (#{peek DEBUG_FLAGS, nonmoving_gc} ptr :: IO CBool)) + <*> (toBool <$> (#{peek DEBUG_FLAGS, block_alloc} ptr :: IO CBool)) <*> (toBool <$> (#{peek DEBUG_FLAGS, sanity} ptr :: IO CBool)) diff --git a/rts/Trace.h b/rts/Trace.h index 74b960c..a7c0cb2 100644 --- a/rts/Trace.h +++ b/rts/Trace.h @@ -50,6 +50,7 @@ enum CapsetType { CapsetTypeCustom = CAPSET_TYPE_CUSTOM, #define DEBUG_weak RtsFlags.DebugFlags.weak #define DEBUG_gccafs RtsFlags.DebugFlags.gccafs #define DEBUG_gc RtsFlags.DebugFlags.gc +#define DEBUG_nonmoving_gc RtsFlags.DebugFlags.nonmoving_gc #define DEBUG_block_alloc RtsFlags.DebugFlags.alloc #define DEBUG_sanity RtsFlags.DebugFlags.sanity #define DEBUG_stable RtsFlags.DebugFlags.stable From git at git.haskell.org Thu Feb 21 15:12:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:33 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: testsuite: Add nonmoving WAY (f50b734) Message-ID: <20190221151233.4C0843A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/f50b734a9386438a560047b87671fbb2352ff2f3/ghc >--------------------------------------------------------------- commit f50b734a9386438a560047b87671fbb2352ff2f3 Author: Ben Gamari Date: Tue Feb 5 14:39:52 2019 -0500 testsuite: Add nonmoving WAY This simply runs the compile_and_run tests with `-xn`, enabling the nonmoving oldest generation. >--------------------------------------------------------------- f50b734a9386438a560047b87671fbb2352ff2f3 testsuite/config/ghc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 24294da..5f39c7e 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -24,7 +24,8 @@ config.other_ways = ['prof', 'normal_h', 'profllvm', 'profoptllvm', 'profthreadedllvm', 'debug', 'ghci-ext', 'ghci-ext-prof', - 'ext-interp'] + 'ext-interp', + 'nonmoving'] if ghc_with_native_codegen: config.compile_ways.append('optasm') @@ -94,7 +95,8 @@ config.way_flags = { 'profthreadedllvm' : ['-O', '-prof', '-static', '-fprof-auto', '-threaded', '-fllvm'], 'ghci-ext' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '-fexternal-interpreter', '+RTS', '-I0.1', '-RTS'], 'ghci-ext-prof' : ['--interactive', '-v0', '-ignore-dot-ghci', '-fno-ghci-history', '-fexternal-interpreter', '-prof', '+RTS', '-I0.1', '-RTS'], - 'ext-interp' : ['-fexternal-interpreter'], + 'ext-interp' : ['-fexternal-interpreter'], + 'nonmoving' : ['-debug'], } config.way_rts_flags = { @@ -133,6 +135,7 @@ config.way_rts_flags = { 'ghci-ext' : [], 'ghci-ext-prof' : [], 'ext-interp' : [], + 'nonmoving' : ['-DS -xn'], } # Useful classes of ways that can be used with only_ways(), omit_ways() and From git at git.haskell.org Thu Feb 21 15:12:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:36 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts: Disable aggregate-return warnings from gcc (09af00e) Message-ID: <20190221151236.4C8C83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/09af00ebb6a43ed678d4b43759d679d8785a7b95/ghc >--------------------------------------------------------------- commit 09af00ebb6a43ed678d4b43759d679d8785a7b95 Author: Ben Gamari Date: Tue Feb 5 12:48:29 2019 -0500 rts: Disable aggregate-return warnings from gcc This warning is a bit of a relic; there is little reason to avoid aggregate return values in 2019. >--------------------------------------------------------------- 09af00ebb6a43ed678d4b43759d679d8785a7b95 rts/ghc.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rts/ghc.mk b/rts/ghc.mk index ff3f18f..cf29ae5 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -336,6 +336,8 @@ WARNING_OPTS += -Wredundant-decls ifeq "$(GccLT46)" "NO" WARNING_OPTS += -Wundef endif +# Some gccs annoyingly enable this archaic specimen by default +WARNING_OPTS += -Wno-aggregate-return # These ones are hard to avoid: #WARNING_OPTS += -Wconversion From git at git.haskell.org Thu Feb 21 15:12:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:41 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts: Non-concurrent mark and sweep (207c4b4) Message-ID: <20190221151241.F2FCE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/207c4b4cf09b9408442de9a4a20ecf99b6903a8d/ghc >--------------------------------------------------------------- commit 207c4b4cf09b9408442de9a4a20ecf99b6903a8d Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:18:44 2019 -0500 rts: Non-concurrent mark and sweep This implements the core heap structure and a serial mark/sweep collector which can be used to manage the oldest-generation heap. This is the first step towards a concurrent mark-and-sweep collector aimed at low-latency applications. The full design of the collector implemented here is described in detail in a technical note B. Gamari. "A Concurrent Garbage Collector For the Glasgow Haskell Compiler" (2018) The basic heap structure used in this design is heavily inspired by K. Ueno & A. Ohori. "A fully concurrent garbage collector for functional programs on multicore processors." /ACM SIGPLAN Notices/ Vol. 51. No. 9 (presented by ICFP 2016) This design is intended to allow both marking and sweeping concurrent to execution of a multi-core mutator. Unlike the Ueno design, which requires no global synchronization pauses, the collector introduced here requires a stop-the-world pause at the beginning and end of the mark phase. To avoid heap fragmentation, the allocator consists of a number of fixed-size /sub-allocators/. Each of these sub-allocators allocators into its own set of /segments/, themselves allocated from the block allocator. Each segment is broken into a set of fixed-size allocation blocks (which back allocations) in addition to a bitmap (used to track the liveness of blocks) and some additional metadata (used also used to track liveness). This heap structure enables collection via mark-and-sweep, which can be performed concurrently via a snapshot-at-the-beginning scheme (although concurrent collection is not implemented in this patch). The mark queue is a fairly straightforward chunked-array structure. The representation is a bit more verbose than a typical mark queue to accomodate a combination of two features: * a mark FIFO, which improves the locality of marking, reducing one of the major overheads seen in mark/sweep allocators (see [1] for details) * the selector optimization and indirection shortcutting, which requires that we track where we found each reference to an object in case we need to update the reference at a later point (e.g. when we find that it is an indirection). See Note [Origin references in the nonmoving collector] (in `NonMovingMark.h`) for details. Beyond this the mark/sweep is fairly run-of-the-mill. [1] R. Garner, S.M. Blackburn, D. Frampton. "Effective Prefetch for Mark-Sweep Garbage Collection." ISMM 2007. Co-Authored-By: Ben Gamari >--------------------------------------------------------------- 207c4b4cf09b9408442de9a4a20ecf99b6903a8d includes/rts/storage/Block.h | 11 +- rts/Capability.c | 1 + rts/Capability.h | 1 + rts/RtsStartup.c | 3 + rts/Weak.c | 18 +- rts/sm/Evac.c | 38 +- rts/sm/GC.c | 190 ++++--- rts/sm/GCAux.c | 8 + rts/sm/GCThread.h | 4 +- rts/sm/NonMoving.c | 819 ++++++++++++++++++++++++++++ rts/sm/NonMoving.h | 270 ++++++++++ rts/sm/NonMovingMark.c | 1212 ++++++++++++++++++++++++++++++++++++++++++ rts/sm/NonMovingMark.h | 140 +++++ rts/sm/NonMovingScav.c | 366 +++++++++++++ rts/sm/NonMovingScav.h | 10 + rts/sm/NonMovingSweep.c | 273 ++++++++++ rts/sm/NonMovingSweep.h | 32 ++ rts/sm/Sanity.c | 103 +++- rts/sm/Scav.c | 28 +- rts/sm/Storage.c | 19 +- rts/sm/Storage.h | 1 + 21 files changed, 3453 insertions(+), 94 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 207c4b4cf09b9408442de9a4a20ecf99b6903a8d From git at git.haskell.org Thu Feb 21 15:12:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:45 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts/StableName: Expose FOR_EACH_STABLE_NAME, freeSnEntry, SNT_size (2082c24) Message-ID: <20190221151245.1E7273A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/2082c24217e15e985a8f31ba80d8d5291835348f/ghc >--------------------------------------------------------------- commit 2082c24217e15e985a8f31ba80d8d5291835348f Author: Ömer Sinan Ağacan Date: Tue Feb 5 00:40:27 2019 -0500 rts/StableName: Expose FOR_EACH_STABLE_NAME, freeSnEntry, SNT_size These will be needed when we implement sweeping in the nonmoving collector. >--------------------------------------------------------------- 2082c24217e15e985a8f31ba80d8d5291835348f rts/StableName.c | 25 ++----------------------- rts/StableName.h | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/rts/StableName.c b/rts/StableName.c index 757eb59..383d87e 100644 --- a/rts/StableName.c +++ b/rts/StableName.c @@ -21,7 +21,7 @@ snEntry *stable_name_table = NULL; static snEntry *stable_name_free = NULL; -static unsigned int SNT_size = 0; +unsigned int SNT_size = 0; #define INIT_SNT_SIZE 64 #if defined(THREADED_RTS) @@ -128,7 +128,7 @@ exitStableNameTable(void) #endif } -STATIC_INLINE void +void freeSnEntry(snEntry *sn) { ASSERT(sn->sn_obj == NULL); @@ -218,27 +218,6 @@ lookupStableName (StgPtr p) * Remember old stable name addresses * -------------------------------------------------------------------------- */ -#define FOR_EACH_STABLE_NAME(p, CODE) \ - do { \ - snEntry *p; \ - snEntry *__end_ptr = &stable_name_table[SNT_size]; \ - for (p = stable_name_table + 1; p < __end_ptr; p++) { \ - /* Internal pointers are free slots. */ \ - /* If p->addr == NULL, it's a */ \ - /* stable name where the object has been GC'd, but the */ \ - /* StableName object (sn_obj) is still alive. */ \ - if ((p->addr < (P_)stable_name_table || \ - p->addr >= (P_)__end_ptr)) \ - { \ - /* NOTE: There is an ambiguity here if p->addr == NULL */ \ - /* it is either the last item in the free list or it */ \ - /* is a stable name whose pointee died. sn_obj == NULL */ \ - /* disambiguates as last free list item. */ \ - do { CODE } while(0); \ - } \ - } \ - } while(0) - void rememberOldStableNameAddresses(void) { diff --git a/rts/StableName.h b/rts/StableName.h index 6b5e551..e5903bb 100644 --- a/rts/StableName.h +++ b/rts/StableName.h @@ -11,7 +11,8 @@ #include "BeginPrivate.h" void initStableNameTable ( void ); -void exitStableNameTable ( void ); +void freeSnEntry ( snEntry *sn ); +void exitStableNameTable ( void ); StgWord lookupStableName ( StgPtr p ); void rememberOldStableNameAddresses ( void ); @@ -23,6 +24,29 @@ void updateStableNameTable ( bool full ); void stableNameLock ( void ); void stableNameUnlock ( void ); +extern unsigned int SNT_size; + +#define FOR_EACH_STABLE_NAME(p, CODE) \ + do { \ + snEntry *p; \ + snEntry *__end_ptr = &stable_name_table[SNT_size]; \ + for (p = stable_name_table + 1; p < __end_ptr; p++) { \ + /* Internal pointers are free slots. */ \ + /* If p->addr == NULL, it's a */ \ + /* stable name where the object has been GC'd, but the */ \ + /* StableName object (sn_obj) is still alive. */ \ + if ((p->addr < (P_)stable_name_table || \ + p->addr >= (P_)__end_ptr)) \ + { \ + /* NOTE: There is an ambiguity here if p->addr == NULL */ \ + /* it is either the last item in the free list or it */ \ + /* is a stable name whose pointee died. sn_obj == NULL */ \ + /* disambiguates as last free list item. */ \ + do { CODE } while(0); \ + } \ + } \ + } while(0) + #if defined(THREADED_RTS) // needed by Schedule.c:forkProcess() extern Mutex stable_name_mutex; From git at git.haskell.org Thu Feb 21 15:12:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:48 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts: Introduce flag to enable the nonmoving old generation (74833a8) Message-ID: <20190221151248.1DE143A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/74833a805ac924488d18110030cd9efe0df8e9cd/ghc >--------------------------------------------------------------- commit 74833a805ac924488d18110030cd9efe0df8e9cd Author: Ben Gamari Date: Tue Feb 5 00:10:43 2019 -0500 rts: Introduce flag to enable the nonmoving old generation This flag will enable the use of a non-moving oldest generation. >--------------------------------------------------------------- 74833a805ac924488d18110030cd9efe0df8e9cd docs/users_guide/runtime_control.rst | 18 ++++++++++++++++++ includes/rts/Flags.h | 2 ++ rts/RtsFlags.c | 23 +++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index a5c2f14..688543e 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -289,6 +289,24 @@ collection. Hopefully, you won't need any of these in normal operation, but there are several things that can be tweaked for maximum performance. +.. rts-flag:: -xn + + :default: off + :since: 8.8.1 + + .. index:: + single: concurrent mark and sweep + + Enable the concurrent mark-and-sweep garbage collector for old generation + collectors. Typically GHC uses a stop-the-world copying garbage collector + for all generations. This can cause long pauses in execution during major + garbage collections. :rts-flag:`-xn` enables the use of a concurrent + mark-and-sweep garbage collector for oldest generation collections. + Under this collection strategy oldest-generation garbage collection + can proceed concurrently with mutation. + + Note that :rts-flag:`-xn` cannot be used with ``-G1`` nor :rts-flag:`-c`. + .. rts-flag:: -A ⟨size⟩ :default: 1MB diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h index 63450d5..0558abd 100644 --- a/includes/rts/Flags.h +++ b/includes/rts/Flags.h @@ -52,6 +52,7 @@ typedef struct _GC_FLAGS { double oldGenFactor; double pcFreeHeap; + bool useNonmoving; uint32_t generations; bool squeezeUpdFrames; @@ -95,6 +96,7 @@ typedef struct _DEBUG_FLAGS { bool weak; /* 'w' */ bool gccafs; /* 'G' */ bool gc; /* 'g' */ + bool nonmoving_gc; /* 'n' */ bool block_alloc; /* 'b' */ bool sanity; /* 'S' warning: might be expensive! */ bool stable; /* 't' */ diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index ff9635a..716d8c7 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -153,6 +153,7 @@ void initRtsFlagsDefaults(void) RtsFlags.GcFlags.heapSizeSuggestionAuto = false; RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */ RtsFlags.GcFlags.oldGenFactor = 2; + RtsFlags.GcFlags.useNonmoving = false; RtsFlags.GcFlags.generations = 2; RtsFlags.GcFlags.squeezeUpdFrames = true; RtsFlags.GcFlags.compact = false; @@ -176,6 +177,7 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.weak = false; RtsFlags.DebugFlags.gccafs = false; RtsFlags.DebugFlags.gc = false; + RtsFlags.DebugFlags.nonmoving_gc = false; RtsFlags.DebugFlags.block_alloc = false; RtsFlags.DebugFlags.sanity = false; RtsFlags.DebugFlags.stable = false; @@ -294,6 +296,7 @@ usage_text[] = { " -xb Sets the address from which a suitable start for the heap memory", " will be searched from. This is useful if the default address", " clashes with some third-party library.", +" -xn Use the non-moving collector for the old generation.", " -m Minimum % of heap which must be available (default 3%)", " -G Number of generations (default: 2)", " -c Use in-place compaction instead of copying in the oldest generation", @@ -399,6 +402,7 @@ usage_text[] = { " -Dw DEBUG: weak", " -DG DEBUG: gccafs", " -Dg DEBUG: gc", +" -Dn DEBUG: non-moving gc", " -Db DEBUG: block", " -DS DEBUG: sanity", " -Dt DEBUG: stable", @@ -1517,6 +1521,12 @@ error = true; break; #endif + case 'n': + OPTION_SAFE; + RtsFlags.GcFlags.useNonmoving = true; + unchecked_arg_start++; + break; + case 'c': /* Debugging tool: show current cost centre on an exception */ OPTION_SAFE; @@ -1690,6 +1700,16 @@ static void normaliseRtsOpts (void) if (RtsFlags.MiscFlags.generate_dump_file) { RtsFlags.MiscFlags.install_seh_handlers = true; } + + if (RtsFlags.GcFlags.useNonmoving && RtsFlags.GcFlags.generations == 1) { + barf("The non-moving collector doesn't support -G1"); + } + + if (RtsFlags.GcFlags.compact && RtsFlags.GcFlags.useNonmoving) { + errorBelch("The non-moving collector cannot be used in conjunction with\n" + "the compacting collector."); + errorUsage(); + } } static void errorUsage (void) @@ -1841,6 +1861,9 @@ static void read_debug_flags(const char* arg) case 'g': RtsFlags.DebugFlags.gc = true; break; + case 'n': + RtsFlags.DebugFlags.nonmoving_gc = true; + break; case 'b': RtsFlags.DebugFlags.block_alloc = true; break; From git at git.haskell.org Thu Feb 21 15:12:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:51 +0000 (UTC) Subject: [commit: ghc] wip/gc/nonmoving-nonconcurrent: rts/StableName: Take stable name table lock in gcStableNameTable (809366b) Message-ID: <20190221151251.2739A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gc/nonmoving-nonconcurrent Link : http://ghc.haskell.org/trac/ghc/changeset/809366b7be4fc76aff3c12a8f6aefc98cd5587b5/ghc >--------------------------------------------------------------- commit 809366b7be4fc76aff3c12a8f6aefc98cd5587b5 Author: Ben Gamari Date: Wed Feb 13 16:02:45 2019 -0500 rts/StableName: Take stable name table lock in gcStableNameTable Otherwise we may potentially race with the nonmoving collector. I believe this was the cause of #155. >--------------------------------------------------------------- 809366b7be4fc76aff3c12a8f6aefc98cd5587b5 rts/StableName.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rts/StableName.c b/rts/StableName.c index 383d87e..4b26fee 100644 --- a/rts/StableName.c +++ b/rts/StableName.c @@ -263,6 +263,9 @@ threadStableNameTable( evac_fn evac, void *user ) void gcStableNameTable( void ) { + // We must take the stable name lock lest we race with the nonmoving + // collector (namely nonmovingSweepStableNameTable). + stableNameLock(); FOR_EACH_STABLE_NAME( p, { // FOR_EACH_STABLE_NAME traverses free entries too, so @@ -286,6 +289,7 @@ gcStableNameTable( void ) } } }); + stableNameUnlock(); } /* ----------------------------------------------------------------------------- From git at git.haskell.org Thu Feb 21 15:12:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:54 +0000 (UTC) Subject: [commit: ghc] wip/validate-ci: Use validate flavour rather than devel2 for DEBUG CI job (a72b7ff) Message-ID: <20190221151254.2849A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/validate-ci Link : http://ghc.haskell.org/trac/ghc/changeset/a72b7ff8361f4b618548aea3d10a9af92b3b8fdb/ghc >--------------------------------------------------------------- commit a72b7ff8361f4b618548aea3d10a9af92b3b8fdb Author: Matthew Pickering Date: Wed Feb 20 20:42:13 2019 +0000 Use validate flavour rather than devel2 for DEBUG CI job This also builds stage2 with optimisations and -dcore-lint >--------------------------------------------------------------- a72b7ff8361f4b618548aea3d10a9af92b3b8fdb .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33d96d8..28a5552 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -239,7 +239,7 @@ validate-x86_64-linux-deb9-debug: stage: build image: ghcci/x86_64-linux-deb9:0.2 variables: - BUILD_FLAVOUR: devel2 + BUILD_FLAVOUR: validate TEST_ENV: "x86_64-linux-deb9-debug" cache: key: linux-x86_64-deb9 From git at git.haskell.org Thu Feb 21 15:12:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:12:57 +0000 (UTC) Subject: [commit: ghc] wip/unexpected-pass-exit-code: Fix colorise header as well (6922578) Message-ID: <20190221151257.3254D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/unexpected-pass-exit-code Link : http://ghc.haskell.org/trac/ghc/changeset/69225787abf93c75b9313ac8da2a82bf448fa322/ghc >--------------------------------------------------------------- commit 69225787abf93c75b9313ac8da2a82bf448fa322 Author: Matthew Pickering Date: Wed Feb 20 20:52:29 2019 +0000 Fix colorise header as well >--------------------------------------------------------------- 69225787abf93c75b9313ac8da2a82bf448fa322 testsuite/driver/testlib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index e800772..eb9f2a8 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -2117,6 +2117,7 @@ def summary(t, file, short=False, color=False): if color: if len(t.unexpected_failures) > 0 or \ len(t.unexpected_stat_failures) > 0 or \ + len(t.unexpected_passes) > 0 or \ len(t.framework_failures) > 0: colorize = str_fail else: From git at git.haskell.org Thu Feb 21 15:13:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:00 +0000 (UTC) Subject: [commit: ghc] wip/unexpected-pass-exit-code: Mark broken LLVM tests as broken (67e349d) Message-ID: <20190221151300.376893A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/unexpected-pass-exit-code Link : http://ghc.haskell.org/trac/ghc/changeset/67e349d072e823489914204004c894078cf3f199/ghc >--------------------------------------------------------------- commit 67e349d072e823489914204004c894078cf3f199 Author: Matthew Pickering Date: Wed Feb 20 21:16:10 2019 +0000 Mark broken LLVM tests as broken >--------------------------------------------------------------- 67e349d072e823489914204004c894078cf3f199 testsuite/tests/th/all.T | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 56e4ac9..89ff39e 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -13,6 +13,14 @@ if config.have_ext_interp : setTestOpts(extra_ways(['ext-interp'])) setTestOpts(only_ways(['normal','ghci','ext-interp'])) +broken_tests = ["ClosedFam1TH","T10620","T10828","T11721_TH","T11797","T12045TH2","T12478_1","T12646","T13642","T14060","T15502","T15738","T15792","T15845","T16180","T1835","T3920","T4135","T4188","T5037","T5362","T7477","T7910","T8761","T8884","T8953","T9262","T9692","T9738","TH_Lift","TH_RichKinds","TH_RichKinds2","TH_Roles3","TH_TyInstWhere2","TH_implicitParams","TH_recursiveDo","TH_reifyDecl1","TH_reifyExplicitForAllFams","TH_reifyInstances","TH_reifyMkName","TH_repE2","TH_repGuard","TH_repPrim","TH_repPrim2","TH_repUnboxedTuples","TH_spliceE6"] +# ext-interp, integer-gmp and llvm is broken see #16087 +def broken_ext_interp(name, opts): + if name in broken_tests and config.ghc_built_by_llvm: + _expect_broken_for(name, opts, 16087, ['ext-interp']) + +setTestOpts(broken_ext_interp) + test('TH_mkName', normal, compile, ['-v0']) test('TH_overloadedlabels', normal, compile, ['-v0']) test('TH_1tuple', normal, compile_fail, ['-v0']) From git at git.haskell.org Thu Feb 21 15:13:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:03 +0000 (UTC) Subject: [commit: ghc] wip/test-hadrian-caching: gitlab-ci: Test Hadrian's caching (7dacefc) Message-ID: <20190221151303.4340C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/test-hadrian-caching Link : http://ghc.haskell.org/trac/ghc/changeset/7dacefcb39f6145980bcf7fa82049c3445493707/ghc >--------------------------------------------------------------- commit 7dacefcb39f6145980bcf7fa82049c3445493707 Author: Ben Gamari Date: Wed Feb 20 19:09:44 2019 -0500 gitlab-ci: Test Hadrian's caching We just delete the `_build` directory and verify that it is recreated successfully. This doesn't actually verify that we don't rebuild unnecessarily but it is at least a rough test that the dependency graph is reasonably complete. >--------------------------------------------------------------- 7dacefcb39f6145980bcf7fa82049c3445493707 .gitlab-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33d96d8..5156ad9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,11 +60,17 @@ ghc-linters: - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi - ./boot - ./configure $CONFIGURE_ARGS - - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` + - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` $HADRIAN_OPTS - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` docs-haddock + # Support for testing Hadrian caching + - if [[ -d ./_cache ]]; then + rm -R ./_build + hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` $HADRIAN_OPTS + fi cache: key: hadrian paths: + - _cache - cabal-cache validate-x86_64-linux-deb8-hadrian: @@ -82,6 +88,11 @@ validate-x86_64-linux-deb8-hadrian: tags: - x86_64-linux +validate-x86_64-linux-deb8-hadrian-cached: + extends: validate-x86_64-linux-deb8-hadrian + variables: + HADRIAN_OPTS: --shared=_cache + ############################################################ # Validation via Pipelines (make) ############################################################ From git at git.haskell.org Thu Feb 21 15:13:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:06 +0000 (UTC) Subject: [commit: ghc] wip/test-hadrian-caching: Always test with --shared (053af3c) Message-ID: <20190221151306.474BC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/test-hadrian-caching Link : http://ghc.haskell.org/trac/ghc/changeset/053af3cafac4f5a9fd64e80eb0444cebf078cb15/ghc >--------------------------------------------------------------- commit 053af3cafac4f5a9fd64e80eb0444cebf078cb15 Author: Ben Gamari Date: Wed Feb 20 19:16:25 2019 -0500 Always test with --shared It doesn't seem worthwhile to add an entire CI job just to test caching. >--------------------------------------------------------------- 053af3cafac4f5a9fd64e80eb0444cebf078cb15 .gitlab-ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5156ad9..9a0d93f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,13 +60,13 @@ ghc-linters: - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi - ./boot - ./configure $CONFIGURE_ARGS - - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` $HADRIAN_OPTS + - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --shared=_cache - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` docs-haddock - # Support for testing Hadrian caching - - if [[ -d ./_cache ]]; then - rm -R ./_build - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` $HADRIAN_OPTS - fi + # Make sure that caching works properly: _build should be recreated from + # the _cache if deleted + - | + rm -R ./_build + hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --shared=_cache cache: key: hadrian paths: @@ -88,11 +88,6 @@ validate-x86_64-linux-deb8-hadrian: tags: - x86_64-linux -validate-x86_64-linux-deb8-hadrian-cached: - extends: validate-x86_64-linux-deb8-hadrian - variables: - HADRIAN_OPTS: --shared=_cache - ############################################################ # Validation via Pipelines (make) ############################################################ From git at git.haskell.org Thu Feb 21 15:13:09 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:09 +0000 (UTC) Subject: [commit: ghc] wip/test-hadrian-caching: Clear hadrian cache if hadrian executable changed (eb9944b) Message-ID: <20190221151309.D8A3F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/test-hadrian-caching Link : http://ghc.haskell.org/trac/ghc/changeset/eb9944b8b4136096f284bfd6b1192c114e129e17/ghc >--------------------------------------------------------------- commit eb9944b8b4136096f284bfd6b1192c114e129e17 Author: Ben Gamari Date: Wed Feb 20 21:05:44 2019 -0500 Clear hadrian cache if hadrian executable changed >--------------------------------------------------------------- eb9944b8b4136096f284bfd6b1192c114e129e17 .gitlab-ci.yml | 9 +++++++-- .gitlab/clear-hadrian-cache.sh | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a0d93f..306966d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,10 +60,14 @@ ghc-linters: - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi - ./boot - ./configure $CONFIGURE_ARGS + + # Clear cache if Hadrian itself has changed + - bash .gitlab/clear-hadrian-cache.sh + - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --shared=_cache - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` docs-haddock - # Make sure that caching works properly: _build should be recreated from - # the _cache if deleted + # Make sure that caching works properly: _build should be recreated from + # the _cache if deleted - | rm -R ./_build hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --shared=_cache @@ -71,6 +75,7 @@ ghc-linters: key: hadrian paths: - _cache + - hadrian.sha256 - cabal-cache validate-x86_64-linux-deb8-hadrian: diff --git a/.gitlab/clear-hadrian-cache.sh b/.gitlab/clear-hadrian-cache.sh new file mode 100644 index 0000000..77f36d8 --- /dev/null +++ b/.gitlab/clear-hadrian-cache.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash + +set -e + +# Build hadrian +cd hadrian +cabal new-build hadrian +cd .. +hadrian=$(find hadrian/dist-newstyle -iname hadrian -executable -type f) + +# Did the executable change? +touch hadrian.sha256 +sha256 $hadrian > hadrian.sha256.new +if diff -q hadrian.sha256 hadrian.sha256.new; then + echo "Hadrian has changed. Deleting cache... " + mv hadrian.sha256.new hadrian.sha256 + rm -R _cache +fi + From git at git.haskell.org Thu Feb 21 15:13:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:13 +0000 (UTC) Subject: [commit: ghc] wip/dwarf-bindists: gitlab-ci: Produce DWARF-enabled binary distribution (138af87) Message-ID: <20190221151313.73E163A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dwarf-bindists Link : http://ghc.haskell.org/trac/ghc/changeset/138af8785ff441273c13115b794837353cf93d28/ghc >--------------------------------------------------------------- commit 138af8785ff441273c13115b794837353cf93d28 Author: Ben Gamari Date: Tue Feb 19 11:40:40 2019 -0500 gitlab-ci: Produce DWARF-enabled binary distribution >--------------------------------------------------------------- 138af8785ff441273c13115b794837353cf93d28 .circleci/images/x86_64-linux-deb9/Dockerfile | 2 +- .gitlab-ci.yml | 14 ++++++++++++++ mk/flavours/dwarf.mk | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.circleci/images/x86_64-linux-deb9/Dockerfile b/.circleci/images/x86_64-linux-deb9/Dockerfile index 5341abe..e47a3db 100644 --- a/.circleci/images/x86_64-linux-deb9/Dockerfile +++ b/.circleci/images/x86_64-linux-deb9/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update -qq RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \ ca-certificates g++ git make automake autoconf gcc \ perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \ - jq wget curl + jq wget curl libdw1 # Documentation tools RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33d96d8..d8b8d64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -256,6 +256,20 @@ validate-x86_64-linux-deb9: cache: key: linux-x86_64-deb9 +release-x86_64-linux-deb9-dwarf: + extends: .validate-linux + stage: build + image: ghcci/x86_64-linux-deb9:0.2 + variables: + CONFIGURE_ARGS: "--enable-dwarf-unwind" + BUILD_FLAVOUR: dwarf + TEST_ENV: "x86_64-linux-deb9" + artifacts: + when: always + expire_in: 2 week + cache: + key: linux-x86_64-deb9 + nightly-x86_64-linux-deb9: extends: validate-x86_64-linux-deb9 stage: build diff --git a/mk/flavours/dwarf.mk b/mk/flavours/dwarf.mk new file mode 100644 index 0000000..15f16e2 --- /dev/null +++ b/mk/flavours/dwarf.mk @@ -0,0 +1,14 @@ +# Build flavour which produces a compiler, RTS, and core libraries with DWARF +# debug information. For best results run ./configure with +# --enable-dwarf-unwind. + +SRC_HC_OPTS = -O -H64m +GhcStage1HcOpts = -O2 +GhcStage2HcOpts = -O2 -g3 +GhcRtsHcOpts = -O2 -g3 +GhcLibHcOpts = -O2 -g3 +BUILD_PROF_LIBS = YES +#SplitObjs +#HADDOCK_DOCS +#BUILD_SPHINX_HTML +#BUILD_SPHINX_PDF From git at git.haskell.org Thu Feb 21 15:13:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:16 +0000 (UTC) Subject: [commit: ghc] wip/pare-down-ci: gitlab-ci: Only build x86_64-deb8 and fedora27 for releases (6c074dd) Message-ID: <20190221151316.745AB3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/pare-down-ci Link : http://ghc.haskell.org/trac/ghc/changeset/6c074dd4b719701d8298ad0a8032700485a8f347/ghc >--------------------------------------------------------------- commit 6c074dd4b719701d8298ad0a8032700485a8f347 Author: Ben Gamari Date: Thu Feb 21 01:14:10 2019 -0500 gitlab-ci: Only build x86_64-deb8 and fedora27 for releases These are largely redundant as they are covered by x86_64-deb9. >--------------------------------------------------------------- 6c074dd4b719701d8298ad0a8032700485a8f347 .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33d96d8..69074dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -277,24 +277,28 @@ validate-x86_64-linux-deb9-llvm: cache: key: linux-x86_64-deb9 -validate-x86_64-linux-deb8: +release-x86_64-linux-deb8: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-deb8:0.1 variables: TEST_ENV: "x86_64-linux-deb8" + only: + - tags cache: key: linux-x86_64-deb8 artifacts: when: always expire_in: 2 week -validate-x86_64-linux-fedora27: +release-x86_64-linux-fedora27: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-fedora27:0.1 variables: TEST_ENV: "x86_64-linux-fedora27" + only: + - tags cache: key: linux-x86_64-fedora27 artifacts: From git at git.haskell.org Thu Feb 21 15:13:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:19 +0000 (UTC) Subject: [commit: ghc] wip/zip7-fusion: [#14037] Allow fusion for zip7 and related (de521be) Message-ID: <20190221151319.89A603A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/zip7-fusion Link : http://ghc.haskell.org/trac/ghc/changeset/de521be79f20d36d9b0d9792d8e3c44b7a584ecb/ghc >--------------------------------------------------------------- commit de521be79f20d36d9b0d9792d8e3c44b7a584ecb Author: Alexandre Date: Thu Feb 21 08:19:43 2019 +0000 [#14037] Allow fusion for zip7 and related Reviewers: bgamari, simonpj, hvr Reviewed By: simonpj Subscribers: AndreasK, simonpj, osa1, dfeuer, rwbarton, carter GHC Trac Issues: #14037 Differential Revision: https://phabricator.haskell.org/D5249 >--------------------------------------------------------------- de521be79f20d36d9b0d9792d8e3c44b7a584ecb compiler/utils/MonadUtils.hs | 110 +++++++++++++++++++++++++++------------- libraries/base/Control/Monad.hs | 2 + libraries/base/Data/OldList.hs | 28 ++++++++++ libraries/base/GHC/List.hs | 4 ++ 4 files changed, 109 insertions(+), 35 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 de521be79f20d36d9b0d9792d8e3c44b7a584ecb From git at git.haskell.org Thu Feb 21 15:13:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:22 +0000 (UTC) Subject: [commit: ghc] wip/std-hdr-llf: Text.ParserCombinators.ReadP: use NonEmpty in Final (2a0be14) Message-ID: <20190221151322.955B33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/std-hdr-llf Link : http://ghc.haskell.org/trac/ghc/changeset/2a0be1468cf440547e2ceb93f0d01d23637affc6/ghc >--------------------------------------------------------------- commit 2a0be1468cf440547e2ceb93f0d01d23637affc6 Author: Vaibhav Sagar Date: Sun Feb 17 19:41:38 2019 -0500 Text.ParserCombinators.ReadP: use NonEmpty in Final The `Final` constructor needed to maintain the invariant that the list it is provided is always non-empty. Since NonEmpty is in `base` now, I think it would be better to use it for this purpose. >--------------------------------------------------------------- 2a0be1468cf440547e2ceb93f0d01d23637affc6 libraries/base/Text/ParserCombinators/ReadP.hs | 41 ++++++++++++++------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/libraries/base/Text/ParserCombinators/ReadP.hs b/libraries/base/Text/ParserCombinators/ReadP.hs index 2f36439..e28f32d 100644 --- a/libraries/base/Text/ParserCombinators/ReadP.hs +++ b/libraries/base/Text/ParserCombinators/ReadP.hs @@ -99,7 +99,7 @@ data P a | Look (String -> P a) | Fail | Result a (P a) - | Final [(a,String)] -- invariant: list is non-empty! + | Final (NonEmpty (a,String)) deriving Functor -- ^ @since 4.8.0.0 -- Monad, MonadPlus @@ -114,11 +114,11 @@ instance MonadPlus P -- | @since 2.01 instance Monad P where - (Get f) >>= k = Get (\c -> f c >>= k) - (Look f) >>= k = Look (\s -> f s >>= k) - Fail >>= _ = Fail - (Result x p) >>= k = k x <|> (p >>= k) - (Final r) >>= k = final [ys' | (x,s) <- r, ys' <- run (k x) s] + (Get f) >>= k = Get (\c -> f c >>= k) + (Look f) >>= k = Look (\s -> f s >>= k) + Fail >>= _ = Fail + (Result x p) >>= k = k x <|> (p >>= k) + (Final (r:|rs)) >>= k = final [ys' | (x,s) <- (r:rs), ys' <- run (k x) s] fail _ = Fail @@ -144,11 +144,15 @@ instance Alternative P where -- two finals are combined -- final + look becomes one look and one final (=optimization) -- final + sthg else becomes one look and one final - Final r <|> Final t = Final (r ++ t) - Final r <|> Look f = Look (\s -> Final (r ++ run (f s) s)) - Final r <|> p = Look (\s -> Final (r ++ run p s)) - Look f <|> Final r = Look (\s -> Final (run (f s) s ++ r)) - p <|> Final r = Look (\s -> Final (run p s ++ r)) + Final r <|> Final t = Final (r <> t) + Final (r:|rs) <|> Look f = Look (\s -> Final (r:|(rs ++ run (f s) s))) + Final (r:|rs) <|> p = Look (\s -> Final (r:|(rs ++ run p s))) + Look f <|> Final r = Look (\s -> Final (case run (f s) s of + [] -> r + (x:xs) -> (x:|xs) <> r)) + p <|> Final r = Look (\s -> Final (case run p s of + [] -> r + (x:xs) -> (x:|xs) <> r)) -- two looks are combined (=optimization) -- look + sthg else floats upwards @@ -192,16 +196,15 @@ instance MonadPlus ReadP -- Operations over P final :: [(a,String)] -> P a --- Maintains invariant for Final constructor -final [] = Fail -final r = Final r +final [] = Fail +final (r:rs) = Final (r:|rs) run :: P a -> ReadS a -run (Get f) (c:s) = run (f c) s -run (Look f) s = run (f s) s -run (Result x p) s = (x,s) : run p s -run (Final r) _ = r -run _ _ = [] +run (Get f) (c:s) = run (f c) s +run (Look f) s = run (f s) s +run (Result x p) s = (x,s) : run p s +run (Final (r:|rs)) _ = (r:rs) +run _ _ = [] -- --------------------------------------------------------------------------- -- Operations over ReadP From git at git.haskell.org Thu Feb 21 15:13:25 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:25 +0000 (UTC) Subject: [commit: ghc] wip/std-hdr-llf: Fix test runner crash when not in a git repo (32f44ed) Message-ID: <20190221151325.97E3A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/std-hdr-llf Link : http://ghc.haskell.org/trac/ghc/changeset/32f44ed81b0f16099d780e73ad2ea1a3cd812448/ghc >--------------------------------------------------------------- commit 32f44ed81b0f16099d780e73ad2ea1a3cd812448 Author: David Eichmann Date: Tue Feb 19 11:38:51 2019 +0000 Fix test runner crash when not in a git repo Respect `inside_git_repo()` when checking performance stats. >--------------------------------------------------------------- 32f44ed81b0f16099d780e73ad2ea1a3cd812448 testsuite/driver/perf_notes.py | 16 ++++++++++------ testsuite/driver/runtests.py | 11 +++++------ testsuite/driver/testlib.py | 5 +++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py index 365732c..2b48353 100644 --- a/testsuite/driver/perf_notes.py +++ b/testsuite/driver/perf_notes.py @@ -23,13 +23,17 @@ from testutil import passed, failBecause # Check if "git rev-parse" can be run successfully. # True implies the current directory is a git repo. +_inside_git_repo_cache = None def inside_git_repo(): - try: - subprocess.check_call(['git', 'rev-parse', 'HEAD'], - stdout=subprocess.DEVNULL) - return True - except subprocess.CalledProcessError: - return False + global _inside_git_repo_cache + if _inside_git_repo_cache == None: + try: + subprocess.check_call(['git', 'rev-parse', 'HEAD'], + stdout=subprocess.DEVNULL) + _inside_git_repo_cache = True + except subprocess.CalledProcessError: + _inside_git_repo_cache = False + return _inside_git_repo_cache # Check if the worktree is dirty. def is_worktree_dirty(): diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index f61ebbc..51f682e 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -122,8 +122,7 @@ if args.verbose is not None: # Note force skip perf tests: skip if this is not a git repo (estimated with inside_git_repo) # and no metrics file is given. In this case there is no way to read the previous commit's # perf test results, nor a way to store new perf test results. -canGitStatus = inside_git_repo() -forceSkipPerfTests = not hasMetricsFile and not canGitStatus +forceSkipPerfTests = not hasMetricsFile and not inside_git_repo() config.skip_perf_tests = args.skip_perf_tests or forceSkipPerfTests config.only_perf_tests = args.only_perf_tests @@ -371,14 +370,14 @@ else: spacing = " " if forceSkipPerfTests and not args.skip_perf_tests: print() - print(str_warn('Skipping All Performance Tests') + ' `git status` exited with non-zero exit code.') - print(spacing + 'Git is required because performance test results are compared with the previous git commit\'s results (stored with git notes).') + print(str_warn('Skipping All Performance Tests') + ' `git` exited with non-zero exit code.') + print(spacing + 'Git is required because performance test results are compared with ancestor git commits\' results (stored with git notes).') print(spacing + 'You can still run the tests without git by specifying an output file with --metrics-file FILE.') # Warn of new metrics. new_metrics = [metric for (change, metric) in t.metrics if change == MetricChange.NewMetric] if any(new_metrics): - if canGitStatus: + if inside_git_repo(): reason = 'a baseline (expected value) cannot be recovered from' + \ ' previous git commits. This may be due to HEAD having' + \ ' new tests or having expected changes, the presence of' + \ @@ -421,7 +420,7 @@ else: print('Appending ' + str(len(stats)) + ' stats to file: ' + config.metrics_file) with open(config.metrics_file, 'a') as file: file.write("\n" + Perf.format_perf_stat(stats)) - elif canGitStatus and any(stats): + elif inside_git_repo() and any(stats): if is_worktree_dirty(): print() print(str_warn('Performance Metrics NOT Saved') + \ diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index e800772..fb7888c 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1182,7 +1182,7 @@ def metric_dict(name, way, metric, value): # Returns a pass/fail object. Passes if the stats are withing the expected value ranges. # This prints the results for the user. def check_stats(name, way, stats_file, range_fields): - head_commit = Perf.commit_hash('HEAD') + head_commit = Perf.commit_hash('HEAD') if Perf.inside_git_repo() else None result = passed() if range_fields: try: @@ -1205,7 +1205,8 @@ def check_stats(name, way, stats_file, range_fields): change = None # If this is the first time running the benchmark, then pass. - baseline = baseline_and_dev[0](way, head_commit) + baseline = baseline_and_dev[0](way, head_commit) \ + if Perf.inside_git_repo() else None if baseline == None: metric_result = passed() change = MetricChange.NewMetric From git at git.haskell.org Thu Feb 21 15:13:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:28 +0000 (UTC) Subject: [commit: ghc] wip/std-hdr-llf: Handle the (~) type operator in 'tyconsym' (e204431) Message-ID: <20190221151328.A60FC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/std-hdr-llf Link : http://ghc.haskell.org/trac/ghc/changeset/e204431e5a5e2fd16da52b04bda2798f16c51344/ghc >--------------------------------------------------------------- commit e204431e5a5e2fd16da52b04bda2798f16c51344 Author: Vladislav Zavialov Date: Tue Feb 19 19:44:13 2019 +0300 Handle the (~) type operator in 'tyconsym' By parsing '~' in 'tyconsym' instead of 'oqtycon', we get one less shift/reduce conflict. >--------------------------------------------------------------- e204431e5a5e2fd16da52b04bda2798f16c51344 compiler/parser/Parser.y | 12 +++++------- compiler/parser/RdrHsSyn.hs | 4 +++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 544d9d7..05bf674 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -88,7 +88,7 @@ import Util ( looksLikePackageName, fstOf3, sndOf3, thdOf3 ) import GhcPrelude } -%expect 237 -- shift/reduce conflicts +%expect 236 -- shift/reduce conflicts {- Last updated: 04 June 2018 @@ -1989,15 +1989,14 @@ tyapps :: { [Located TyEl] } -- NB: This list is reversed tyapp :: { Located TyEl } : atype { sL1 $1 $ TyElOpd (unLoc $1) } | TYPEAPP atype { sLL $1 $> $ (TyElKindApp (comb2 $1 $2) $2) } - | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) - then TyElBang - else TyElOpr (unLoc $1) } + | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) then TyElBang else + if isTildeRdr (unLoc $1) then TyElTilde else + TyElOpr (unLoc $1) } | tyvarop { sL1 $1 $ TyElOpr (unLoc $1) } | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } - | '~' { sL1 $1 TyElTilde } | unpackedness { sL1 $1 $ TyElUnpackedness (unLoc $1) } atype :: { LHsType GhcPs } @@ -3251,8 +3250,6 @@ oqtycon :: { Located RdrName } -- An "ordinary" qualified tycon; : qtycon { $1 } | '(' qtyconsym ')' {% ams (sLL $1 $> (unLoc $2)) [mop $1,mj AnnVal $2,mcp $3] } - | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) - [mop $1,mj AnnVal $2,mcp $3] } oqtycon_no_varcon :: { Located RdrName } -- Type constructor which cannot be mistaken -- for variable constructor in export lists @@ -3318,6 +3315,7 @@ tyconsym :: { Located RdrName } | '-' { sL1 $1 $! mkUnqual tcClsName (fsLit "-") } | '!' { sL1 $1 $! mkUnqual tcClsName (fsLit "!") } | '.' { sL1 $1 $! mkUnqual tcClsName (fsLit ".") } + | '~' { sL1 $1 $ eqTyCon_RDR } ----------------------------------------------------------------------------- diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index c65b814..12a9c05 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -50,6 +50,7 @@ module RdrHsSyn ( checkPattern, -- HsExp -> P HsPat bang_RDR, isBangRdr, + isTildeRdr, checkPatterns, -- SrcLoc -> [HsExp] -> P [HsPat] checkMonadComp, -- P (HsStmtContext RdrName) checkCommand, -- LHsExpr RdrName -> P (LHsCmd RdrName) @@ -1163,9 +1164,10 @@ plus_RDR = mkUnqual varName (fsLit "+") -- Hack bang_RDR = mkUnqual varName (fsLit "!") -- Hack pun_RDR = mkUnqual varName (fsLit "pun-right-hand-side") -isBangRdr :: RdrName -> Bool +isBangRdr, isTildeRdr :: RdrName -> Bool isBangRdr (Unqual occ) = occNameFS occ == fsLit "!" isBangRdr _ = False +isTildeRdr = (==eqTyCon_RDR) checkPatField :: SDoc -> LHsRecField GhcPs (LHsExpr GhcPs) -> P (LHsRecField GhcPs (LPat GhcPs)) From git at git.haskell.org Thu Feb 21 15:13:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:32 +0000 (UTC) Subject: [commit: ghc] wip/std-hdr-llf: Dot/bang operators in export lists (Trac #16339) (2f4af71) Message-ID: <20190221151332.611B83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/std-hdr-llf Link : http://ghc.haskell.org/trac/ghc/changeset/2f4af71e73ac3b59f4faba5bf1b25774b1008898/ghc >--------------------------------------------------------------- commit 2f4af71e73ac3b59f4faba5bf1b25774b1008898 Author: Vladislav Zavialov Date: Tue Feb 19 18:27:09 2019 +0300 Dot/bang operators in export lists (Trac #16339) The dot type operator was handled in the 'tyvarop' parser production, and the bang type operator in 'tyapp'. However, export lists and role annotations use 'oqtycon', so these type operators could not be exported or assigned roles. The fix is to handle them in a lower level production, 'tyconsym'. >--------------------------------------------------------------- 2f4af71e73ac3b59f4faba5bf1b25774b1008898 compiler/parser/Parser.y | 10 +++++----- compiler/parser/RdrHsSyn.hs | 5 +++++ testsuite/tests/parser/should_compile/T16339.hs | 18 ++++++++++++++++++ testsuite/tests/parser/should_compile/all.T | 1 + 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 78f1013..544d9d7 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1989,14 +1989,15 @@ tyapps :: { [Located TyEl] } -- NB: This list is reversed tyapp :: { Located TyEl } : atype { sL1 $1 $ TyElOpd (unLoc $1) } | TYPEAPP atype { sLL $1 $> $ (TyElKindApp (comb2 $1 $2) $2) } - | qtyconop { sL1 $1 $ TyElOpr (unLoc $1) } + | qtyconop { sL1 $1 $ if isBangRdr (unLoc $1) + then TyElBang + else TyElOpr (unLoc $1) } | tyvarop { sL1 $1 $ TyElOpr (unLoc $1) } | SIMPLEQUOTE qconop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | SIMPLEQUOTE varop {% ams (sLL $1 $> $ TyElOpr (unLoc $2)) [mj AnnSimpleQuote $1,mj AnnVal $2] } | '~' { sL1 $1 TyElTilde } - | '!' { sL1 $1 TyElBang } | unpackedness { sL1 $1 $ TyElUnpackedness (unLoc $1) } atype :: { LHsType GhcPs } @@ -3310,13 +3311,13 @@ qtyconsym :: { Located RdrName } | QVARSYM { sL1 $1 $! mkQual tcClsName (getQVARSYM $1) } | tyconsym { $1 } --- Does not include "!", because that is used for strictness marks --- or ".", because that separates the quantified type vars from the rest tyconsym :: { Located RdrName } : CONSYM { sL1 $1 $! mkUnqual tcClsName (getCONSYM $1) } | VARSYM { sL1 $1 $! mkUnqual tcClsName (getVARSYM $1) } | ':' { sL1 $1 $! consDataCon_RDR } | '-' { sL1 $1 $! mkUnqual tcClsName (fsLit "-") } + | '!' { sL1 $1 $! mkUnqual tcClsName (fsLit "!") } + | '.' { sL1 $1 $! mkUnqual tcClsName (fsLit ".") } ----------------------------------------------------------------------------- @@ -3371,7 +3372,6 @@ tyvarop :: { Located RdrName } tyvarop : '`' tyvarid '`' {% ams (sLL $1 $> (unLoc $2)) [mj AnnBackquote $1,mj AnnVal $2 ,mj AnnBackquote $3] } - | '.' { sL1 $1 $ mkUnqual tcClsName (fsLit ".") } tyvarid :: { Located RdrName } : VARID { sL1 $1 $! mkUnqual tvName (getVARID $1) } diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 606e2e7..c65b814 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -49,6 +49,7 @@ module RdrHsSyn ( checkContext, -- HsType -> P HsContext checkPattern, -- HsExp -> P HsPat bang_RDR, + isBangRdr, checkPatterns, -- SrcLoc -> [HsExp] -> P [HsPat] checkMonadComp, -- P (HsStmtContext RdrName) checkCommand, -- LHsExpr RdrName -> P (LHsCmd RdrName) @@ -1162,6 +1163,10 @@ plus_RDR = mkUnqual varName (fsLit "+") -- Hack bang_RDR = mkUnqual varName (fsLit "!") -- Hack pun_RDR = mkUnqual varName (fsLit "pun-right-hand-side") +isBangRdr :: RdrName -> Bool +isBangRdr (Unqual occ) = occNameFS occ == fsLit "!" +isBangRdr _ = False + checkPatField :: SDoc -> LHsRecField GhcPs (LHsExpr GhcPs) -> P (LHsRecField GhcPs (LPat GhcPs)) checkPatField msg (dL->L l fld) = do p <- checkLPat msg (hsRecFieldArg fld) diff --git a/testsuite/tests/parser/should_compile/T16339.hs b/testsuite/tests/parser/should_compile/T16339.hs new file mode 100644 index 0000000..9bb8349 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T16339.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE ExplicitNamespaces, TypeOperators, RoleAnnotations #-} +{-# OPTIONS -Wno-duplicate-exports #-} + +module T16339 + ( + type (!), + type (!)(Bang), + type (!)(..), + type (.), + type (.)(Dot), + type (.)(..), + ) where + +data a ! b = Bang +data f . g = Dot + +type role (!) phantom phantom +type role (.) phantom phantom diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index b3f693d..1c5c225 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -141,3 +141,4 @@ test('T15279', normalise_errmsg_fun(only_MG_loc), compile, ['']) test('T15457', normal, compile, ['']) test('T15675', normal, compile, ['']) test('T15781', normal, compile, ['']) +test('T16339', normal, compile, ['']) From git at git.haskell.org Thu Feb 21 15:13:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:35 +0000 (UTC) Subject: [commit: ghc] wip/validate-ci: Revert "Disable binder swap in OccurAnal (Trac #16288)" (f903a5b) Message-ID: <20190221151335.69C073A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/validate-ci Link : http://ghc.haskell.org/trac/ghc/changeset/f903a5b5ba6ef9de569a814c8d6e351ab99c336c/ghc >--------------------------------------------------------------- commit f903a5b5ba6ef9de569a814c8d6e351ab99c336c Author: Matthew Pickering Date: Thu Feb 21 13:52:57 2019 +0000 Revert "Disable binder swap in OccurAnal (Trac #16288)" This reverts commit 9049bfb1773cf114fd4e2d2d6daed46af2b73093. This causes a core lint error, see #16346 >--------------------------------------------------------------- f903a5b5ba6ef9de569a814c8d6e351ab99c336c compiler/coreSyn/CoreUnfold.hs | 43 +++------------------- .../dependent/should_compile/dynamic-paper.stderr | 4 +- .../tests/simplCore/should_compile/T16288A.hs | 17 --------- .../tests/simplCore/should_compile/T16288B.hs | 7 ---- .../tests/simplCore/should_compile/T16288C.hs | 13 ------- testsuite/tests/simplCore/should_compile/all.T | 1 - 6 files changed, 7 insertions(+), 78 deletions(-) diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs index 3ac35c9..11c2a75 100644 --- a/compiler/coreSyn/CoreUnfold.hs +++ b/compiler/coreSyn/CoreUnfold.hs @@ -47,7 +47,7 @@ import GhcPrelude import DynFlags import CoreSyn import PprCore () -- Instances -import OccurAnal ( occurAnalyseExpr_NoBinderSwap ) +import OccurAnal ( occurAnalyseExpr ) import CoreOpt import CoreArity ( manifestArity ) import CoreUtils @@ -101,7 +101,7 @@ mkDFunUnfolding :: [Var] -> DataCon -> [CoreExpr] -> Unfolding mkDFunUnfolding bndrs con ops = DFunUnfolding { df_bndrs = bndrs , df_con = con - , df_args = map occurAnalyseExpr_NoBinderSwap ops } + , df_args = map occurAnalyseExpr ops } -- See Note [Occurrence analysis of unfoldings] mkWwInlineRule :: DynFlags -> CoreExpr -> Arity -> Unfolding @@ -311,7 +311,7 @@ mkCoreUnfolding :: UnfoldingSource -> Bool -> CoreExpr -> UnfoldingGuidance -> Unfolding -- Occurrence-analyses the expression before capturing it mkCoreUnfolding src top_lvl expr guidance - = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = top_lvl, @@ -330,7 +330,7 @@ mkUnfolding :: DynFlags -> UnfoldingSource -- Calculates unfolding guidance -- Occurrence-analyses the expression before capturing it mkUnfolding dflags src is_top_lvl is_bottoming expr - = CoreUnfolding { uf_tmpl = occurAnalyseExpr_NoBinderSwap expr, + = CoreUnfolding { uf_tmpl = occurAnalyseExpr expr, -- See Note [Occurrence analysis of unfoldings] uf_src = src, uf_is_top = is_top_lvl, @@ -342,7 +342,7 @@ mkUnfolding dflags src is_top_lvl is_bottoming expr where is_top_bottoming = is_top_lvl && is_bottoming guidance = calcUnfoldingGuidance dflags is_top_bottoming expr - -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr_NoBinderSwap expr))! + -- NB: *not* (calcUnfoldingGuidance (occurAnalyseExpr expr))! -- See Note [Calculate unfolding guidance on the non-occ-anal'd expression] {- @@ -364,39 +364,6 @@ But more generally, the simplifier is designed on the basis that it is looking at occurrence-analysed expressions, so better ensure that they acutally are. -We use occurAnalyseExpr_NoBinderSwap instead of occurAnalyseExpr; -see Note [No binder swap in unfoldings]. - -Note [No binder swap in unfoldings] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The binder swap can temporarily violate Core Lint, by assinging -a LocalId binding to a GlobalId. For example, if A.foo{r872} -is a GlobalId with unique r872, then - - case A.foo{r872} of bar { - K x -> ...(A.foo{r872})... - } - -gets transformed to - - case A.foo{r872} of bar { - K x -> let foo{r872} = bar - in ...(A.foo{r872})... - -This is usually not a problem, because the simplifier will transform -this to: - - case A.foo{r872} of bar { - K x -> ...(bar)... - -However, after occurrence analysis but before simplification, this extra 'let' -violates the Core Lint invariant that we do not have local 'let' bindings for -GlobalIds. That seems (just) tolerable for the occurrence analysis that happens -just before the Simplifier, but not for unfoldings, which are Linted -independently. -As a quick workaround, we disable binder swap in this module. -See Trac #16288 and #16296 for further plans. - Note [Calculate unfolding guidance on the non-occ-anal'd expression] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Notice that we give the non-occur-analysed expression to diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr index a170d29..3ba4db2 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.stderr +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.stderr @@ -1,5 +1,5 @@ Simplifier ticks exhausted - When trying UnfoldingDone delta + When trying UnfoldingDone delta1 To increase the limit, use -fsimpl-tick-factor=N (default 100). If you need to increase the limit substantially, please file a @@ -12,4 +12,4 @@ Simplifier ticks exhausted simplifier non-termination has been judged acceptable. To see detailed counts use -ddump-simpl-stats - Total ticks: 140007 + Total ticks: 140004 diff --git a/testsuite/tests/simplCore/should_compile/T16288A.hs b/testsuite/tests/simplCore/should_compile/T16288A.hs deleted file mode 100644 index c6a52bf..0000000 --- a/testsuite/tests/simplCore/should_compile/T16288A.hs +++ /dev/null @@ -1,17 +0,0 @@ -module T16288A where - -import T16288C - -data License - -class Pretty a where - pretty :: a -> Doc - -instance Pretty License where - pretty _ = pretV - -bar :: (Pretty a) => a -> Doc -bar w = foo (pretty (u w w w w)) - -u :: a -> a -> a -> a -> a -u = u diff --git a/testsuite/tests/simplCore/should_compile/T16288B.hs b/testsuite/tests/simplCore/should_compile/T16288B.hs deleted file mode 100644 index c1a98d2..0000000 --- a/testsuite/tests/simplCore/should_compile/T16288B.hs +++ /dev/null @@ -1,7 +0,0 @@ -module T16288B where - -import T16288A -import T16288C - -bar2 :: License -> Doc -bar2 = bar diff --git a/testsuite/tests/simplCore/should_compile/T16288C.hs b/testsuite/tests/simplCore/should_compile/T16288C.hs deleted file mode 100644 index 5efbb2e..0000000 --- a/testsuite/tests/simplCore/should_compile/T16288C.hs +++ /dev/null @@ -1,13 +0,0 @@ -module T16288C where - -data Doc = Empty | Beside Doc - -hcat :: Doc -> Doc -hcat Empty = Empty -hcat xs = hcat xs - -pretV = hcat Empty - -foo :: Doc -> Doc -foo Empty = hcat Empty -foo val = Beside val diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 6e1979c..170c206 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -300,4 +300,3 @@ test('T15631', normal, makefile_test, ['T15631']) test('T15673', normal, compile, ['-O']) -test('T16288', normal, multimod_compile, ['T16288B', '-O -dcore-lint -v0']) From git at git.haskell.org Thu Feb 21 15:13:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 15:13:38 +0000 (UTC) Subject: [commit: ghc] wip/std-hdr-llf: Include closure header size in StgLamLift's estimations (07bba23) Message-ID: <20190221151338.6B4573A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/std-hdr-llf Link : http://ghc.haskell.org/trac/ghc/changeset/07bba23dccc51c9d7f286005495f596ce1554471/ghc >--------------------------------------------------------------- commit 07bba23dccc51c9d7f286005495f596ce1554471 Author: Sebastian Graf Date: Thu Feb 21 16:02:38 2019 +0100 Include closure header size in StgLamLift's estimations While playing around with late lambda lifting, I realised that StgLamLift.Analysis doesn't consider the removed closure header in its allocation estimations. That's because contrary to what I thought, the total word count returned by `mkVirtHeapOffsets` doesn't include the size of the closure header. We just add the header size manually now. >--------------------------------------------------------------- 07bba23dccc51c9d7f286005495f596ce1554471 compiler/simplStg/StgLiftLams/Analysis.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/simplStg/StgLiftLams/Analysis.hs b/compiler/simplStg/StgLiftLams/Analysis.hs index 7fb60df..3cdbfcb 100644 --- a/compiler/simplStg/StgLiftLams/Analysis.hs +++ b/compiler/simplStg/StgLiftLams/Analysis.hs @@ -484,13 +484,12 @@ rhsLambdaBndrs (StgRhsClosure _ _ _ bndrs _) = map binderInfoBndr bndrs -- | The size in words of a function closure closing over the given 'Id's, -- including the header. closureSize :: DynFlags -> [Id] -> WordOff -closureSize dflags ids = words +closureSize dflags ids = words + sTD_HDR_SIZE dflags + -- We go through sTD_HDR_SIZE rather than fixedHdrSizeW so that we don't + -- optimise differently when profiling is enabled. where (words, _, _) -- Functions have a StdHeader (as opposed to ThunkHeader). - -- Note that mkVirtHeadOffsets will account for profiling headers, so - -- lifting decisions vary if we begin to profile stuff. Maybe we shouldn't - -- do this or deactivate profiling in @dflags@? = StgCmmLayout.mkVirtHeapOffsets dflags StgCmmLayout.StdHeader . StgCmmClosure.addIdReps . StgCmmClosure.nonVoidIds From git at git.haskell.org Thu Feb 21 19:32:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 19:32:04 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-validate' created Message-ID: <20190221193204.D49393A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-validate Referencing: 448825eb7270eb8e886269df9e311ae15306acd0 From git at git.haskell.org Thu Feb 21 19:32:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 19:32:07 +0000 (UTC) Subject: [commit: ghc] wip/fix-validate: Remove tcTyConUserTyVars (1845c2b) Message-ID: <20190221193207.E8DA33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-validate Link : http://ghc.haskell.org/trac/ghc/changeset/1845c2ba57958541d00982de9064699510dd299c/ghc >--------------------------------------------------------------- commit 1845c2ba57958541d00982de9064699510dd299c Author: Simon Peyton Jones Date: Thu Feb 21 08:46:13 2019 +0000 Remove tcTyConUserTyVars The tcTyConUserTyVars field of TcTyCon was entirely unused. This patch kills it off entirely. >--------------------------------------------------------------- 1845c2ba57958541d00982de9064699510dd299c compiler/typecheck/TcHsType.hs | 8 ++++---- compiler/typecheck/TcTyClsDecls.hs | 6 ++---- compiler/types/TyCon.hs | 11 ++++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 91b7aa2..c40d8b5 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -1835,7 +1835,7 @@ kcLHsQTyVars_Cusk, kcLHsQTyVars_NonCusk ------------------------------ kcLHsQTyVars_Cusk name flav - user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns + (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns , hsq_dependent = dep_names } , hsq_explicit = hs_tvs }) thing_inside -- CUSK case @@ -1876,7 +1876,7 @@ kcLHsQTyVars_Cusk name flav ++ map (mkRequiredTyConBinder mentioned_kv_set) tc_tvs all_tv_prs = mkTyVarNamePairs (scoped_kvs ++ tc_tvs) - tycon = mkTcTyCon name (ppr user_tyvars) + tycon = mkTcTyCon name final_tc_binders res_kind all_tv_prs @@ -1918,7 +1918,7 @@ kcLHsQTyVars_Cusk _ _ (XLHsQTyVars _) _ = panic "kcLHsQTyVars" ------------------------------ kcLHsQTyVars_NonCusk name flav - user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns + (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns , hsq_dependent = dep_names } , hsq_explicit = hs_tvs }) thing_inside -- Non_CUSK case @@ -1940,7 +1940,7 @@ kcLHsQTyVars_NonCusk name flav -- Also, note that tc_binders has the tyvars from only the -- user-written tyvarbinders. See S1 in Note [How TcTyCons work] -- in TcTyClsDecls - tycon = mkTcTyCon name (ppr user_tyvars) tc_binders res_kind + tycon = mkTcTyCon name tc_binders res_kind (mkTyVarNamePairs (scoped_kvs ++ tc_tvs)) False -- not yet generalised flav diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 55c06fc..8dfdbb2 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -540,7 +540,6 @@ generaliseTcTyCon tc tc_flav = tyConFlavour tc tc_res_kind = tyConResKind tc tc_tvs = tyConTyVars tc - user_tyvars = tcTyConUserTyVars tc -- ToDo: nuke (scoped_tv_names, scoped_tvs) = unzip (tcTyConScopedTyVars tc) -- NB: scoped_tvs includes both specified and required (tc_tvs) @@ -596,7 +595,7 @@ generaliseTcTyCon tc scoped_tv_pairs = scoped_tv_names `zip` scoped_tvs -- Step 7: Make the result TcTyCon - tycon = mkTcTyCon tc_name user_tyvars final_tcbs tc_res_kind + tycon = mkTcTyCon tc_name final_tcbs tc_res_kind scoped_tv_pairs True {- it's generalised now -} (tyConFlavour tc) @@ -1497,7 +1496,6 @@ tcFamDecl1 :: Maybe Class -> FamilyDecl GhcRn -> TcM TyCon tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info , fdLName = tc_lname@(dL->L _ tc_name) , fdResultSig = (dL->L _ sig) - , fdTyVars = user_tyvars , fdInjectivityAnn = inj }) | DataFamily <- fam_info = bindTyClTyVars tc_name $ \ binders res_kind -> do @@ -1559,7 +1557,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info Just eqns -> do { -- Process the equations, creating CoAxBranches - ; let tc_fam_tc = mkTcTyCon tc_name (ppr user_tyvars) binders res_kind + ; let tc_fam_tc = mkTcTyCon tc_name binders res_kind [] False {- this doesn't matter here -} ClosedTypeFamilyFlavour diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 058f090..ca49560 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -99,7 +99,7 @@ module TyCon( algTcFields, tyConRuntimeRepInfo, tyConBinders, tyConResKind, tyConTyVarBinders, - tcTyConScopedTyVars, tcTyConUserTyVars, tcTyConIsPoly, + tcTyConScopedTyVars, tcTyConIsPoly, mkTyConTagMap, -- ** Manipulating TyCons @@ -861,7 +861,6 @@ data TyCon -- without a CUSK, it's the original left-to-right -- that the user wrote. Nec'y for getting Specified -- variables in the right order. - tcTyConUserTyVars :: SDoc, -- ^ Original, user-written tycon tyvars tcTyConIsPoly :: Bool, -- ^ Is this TcTyCon already generalized? tcTyConFlavour :: TyConFlavour @@ -1583,7 +1582,6 @@ mkSumTyCon name binders res_kind arity tyvars cons parent -- See also Note [Kind checking recursive type and class declarations] -- in TcTyClsDecls. mkTcTyCon :: Name - -> SDoc -- ^ user-written tycon tyvars -> [TyConBinder] -> Kind -- ^ /result/ kind only -> [(Name,TcTyVar)] -- ^ Scoped type variables; @@ -1591,7 +1589,7 @@ mkTcTyCon :: Name -> Bool -- ^ Is this TcTyCon generalised already? -> TyConFlavour -- ^ What sort of 'TyCon' this represents -> TyCon -mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav +mkTcTyCon name binders res_kind scoped_tvs poly flav = TcTyCon { tyConUnique = getUnique name , tyConName = name , tyConTyVars = binderVars binders @@ -1601,8 +1599,7 @@ mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav , tyConArity = length binders , tcTyConScopedTyVars = scoped_tvs , tcTyConIsPoly = poly - , tcTyConFlavour = flav - , tcTyConUserTyVars = tyvars } + , tcTyConFlavour = flav } -- | Create an unlifted primitive 'TyCon', such as @Int#@. mkPrimTyCon :: Name -> [TyConBinder] @@ -1719,7 +1716,7 @@ isAbstractTyCon _ = False -- Used when recovering from errors makeRecoveryTyCon :: TyCon -> TyCon makeRecoveryTyCon tc - = mkTcTyCon (tyConName tc) empty + = mkTcTyCon (tyConName tc) (tyConBinders tc) (tyConResKind tc) [{- no scoped vars -}] True From git at git.haskell.org Thu Feb 21 19:32:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 19:32:10 +0000 (UTC) Subject: [commit: ghc] wip/fix-validate: Don't do binder-swap for GlobalIds (561ba84) Message-ID: <20190221193210.EA97D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-validate Link : http://ghc.haskell.org/trac/ghc/changeset/561ba841e566e6463e7c6db1712b554be2879af5/ghc >--------------------------------------------------------------- commit 561ba841e566e6463e7c6db1712b554be2879af5 Author: Simon Peyton Jones Date: Thu Feb 21 09:34:01 2019 +0000 Don't do binder-swap for GlobalIds This patch disables the binder-swap transformation in the (relatively rare) case when the scrutinee is a GlobalId. Reason: we are getting Lint errors so that GHC doesn't even validate. Trac #16346. This is NOT the final solution -- it's just a stop-gap to get us running again. The final solution is in Trac #16296 >--------------------------------------------------------------- 561ba841e566e6463e7c6db1712b554be2879af5 compiler/simplCore/OccurAnal.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 5287817..c3414b1 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2402,9 +2402,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr _ -> (env { occ_encl = OccVanilla }, Nothing) where - add_scrut v rhs = ( env { occ_encl = OccVanilla - , occ_gbl_scrut = pe `extendVarSet` v } - , Just (localise v, rhs) ) + add_scrut v rhs + | isGlobalId v = (env { occ_encl = OccVanilla }, Nothing) + | otherwise = ( env { occ_encl = OccVanilla + , occ_gbl_scrut = pe `extendVarSet` v } + , Just (localise v, rhs) ) + -- ToDO: this isGlobalId stuff is a TEMPORARY FIX + -- to avoid the binder-swap for GlobalIds + -- See Trac #16346 case_bndr' = Var (zapIdOccInfo case_bndr) -- See Note [Zap case binders in proxy bindings] From git at git.haskell.org Thu Feb 21 19:32:14 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Feb 2019 19:32:14 +0000 (UTC) Subject: [commit: ghc] wip/fix-validate: Fix exprIsConApp_maybe (448825e) Message-ID: <20190221193214.AD9443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-validate Link : http://ghc.haskell.org/trac/ghc/changeset/448825eb7270eb8e886269df9e311ae15306acd0/ghc >--------------------------------------------------------------- commit 448825eb7270eb8e886269df9e311ae15306acd0 Author: Simon Peyton Jones Date: Thu Feb 21 12:03:22 2019 +0000 Fix exprIsConApp_maybe In this commit commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6 Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) we made exprIsConApp_maybe quite a bit cleverer. But I had not paid enough attention to keeping exactly the correct substitution and in-scope set, which led to Trac #16348. There were several buglets (like applying the substitution twice in exprIsConApp_maybe, but the proximate source of the bug was that we were calling addNewInScopeIds, which deleted things from the substitution as well as adding them to the in-scope set. That's usually right, but not here! This was quite tricky to track down. But it is nicer now. >--------------------------------------------------------------- 448825eb7270eb8e886269df9e311ae15306acd0 compiler/basicTypes/MkId.hs | 2 +- compiler/coreSyn/CoreOpt.hs | 105 ++++++++++++--------- compiler/prelude/PrelRules.hs | 2 +- compiler/simplCore/Simplify.hs | 20 ++-- testsuite/tests/simplCore/should_compile/T16348.hs | 6 ++ testsuite/tests/simplCore/should_compile/all.T | 1 + 6 files changed, 81 insertions(+), 55 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 448825eb7270eb8e886269df9e311ae15306acd0 From git at git.haskell.org Fri Feb 22 15:21:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:38 +0000 (UTC) Subject: [commit: ghc] branch 'wip/users-guide-forall-keyword' created Message-ID: <20190222152138.399FF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/users-guide-forall-keyword Referencing: 5f4b28332a08d0cee8315293d87fba8e039d2051 From git at git.haskell.org Fri Feb 22 15:21:40 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:40 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-ghc-in-ghci' created Message-ID: <20190222152140.3A2283A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-ghc-in-ghci Referencing: 057b36f744b2bedf7034fd66762c5f534f55bb95 From git at git.haskell.org Fri Feb 22 15:21:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:42 +0000 (UTC) Subject: [commit: ghc] branch 'wip/users-guide-kind-inference' created Message-ID: <20190222152142.3A9CA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/users-guide-kind-inference Referencing: 308622279b7f5c03e1af0199c48bb65ab3e72af5 From git at git.haskell.org Fri Feb 22 15:21:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:45 +0000 (UTC) Subject: [commit: ghc] wip/fix-ghc-in-ghci: ghc-in-ghci: Fix capitalization of hieFile (057b36f) Message-ID: <20190222152145.427503A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-ghc-in-ghci Link : http://ghc.haskell.org/trac/ghc/changeset/057b36f744b2bedf7034fd66762c5f534f55bb95/ghc >--------------------------------------------------------------- commit 057b36f744b2bedf7034fd66762c5f534f55bb95 Author: Ben Gamari Date: Thu Feb 21 11:53:34 2019 -0500 ghc-in-ghci: Fix capitalization of hieFile >--------------------------------------------------------------- 057b36f744b2bedf7034fd66762c5f534f55bb95 utils/ghc-in-ghci/settings.ghci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ghc-in-ghci/settings.ghci b/utils/ghc-in-ghci/settings.ghci index 8529631..f6a6843 100644 --- a/utils/ghc-in-ghci/settings.ghci +++ b/utils/ghc-in-ghci/settings.ghci @@ -5,7 +5,7 @@ :set -icompiler/coreSyn :set -icompiler/deSugar :set -icompiler/ghci -:set -icompiler/hiefile +:set -icompiler/hieFile :set -icompiler/hsSyn :set -icompiler/iface :set -icompiler/llvmGen From git at git.haskell.org Fri Feb 22 15:21:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:48 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword, wip/users-guide-kind-inference: Set builder env (9db92cf) Message-ID: <20190222152148.43E533A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/users-guide-forall-keyword,wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/9db92cf0baada362f2b1bd69fbfd156f415d4053/ghc >--------------------------------------------------------------- commit 9db92cf0baada362f2b1bd69fbfd156f415d4053 Author: Tamar Christina Date: Sun Feb 17 18:37:47 2019 +0000 Set builder env >--------------------------------------------------------------- 9db92cf0baada362f2b1bd69fbfd156f415d4053 .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33d96d8..6ac6100 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -360,6 +360,8 @@ validate-x86_64-linux-deb9-unreg: - robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache - bash -c 'make clean || true' dependencies: [] + variables: + FORCE_SYMLINKS: 1 cache: paths: - cabal-cache From git at git.haskell.org Fri Feb 22 15:21:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:51 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword, wip/users-guide-kind-inference: Testsuite: opt-in to symlinks on Windows (48aafc2) Message-ID: <20190222152151.473D13A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/users-guide-forall-keyword,wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/48aafc247316a15f2fe412d5dcf07c0bc6e5cbbf/ghc >--------------------------------------------------------------- commit 48aafc247316a15f2fe412d5dcf07c0bc6e5cbbf Author: Tamar Christina Date: Tue Feb 12 20:51:41 2019 +0000 Testsuite: opt-in to symlinks on Windows >--------------------------------------------------------------- 48aafc247316a15f2fe412d5dcf07c0bc6e5cbbf testsuite/driver/testutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py index b73204f..09c50b4 100644 --- a/testsuite/driver/testutil.py +++ b/testsuite/driver/testutil.py @@ -64,7 +64,7 @@ def lndir(srcdir, dstdir): # # We define the following function to make this magic more # explicit/discoverable. You are enouraged to use it instead of os.symlink. -if platform.system() == 'Windows': +if platform.system() == 'Windows' and os.getenv('FORCE_SYMLINKS') == None: link_or_copy_file = shutil.copyfile else: link_or_copy_file = os.symlink From git at git.haskell.org Fri Feb 22 15:21:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:54 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword, wip/users-guide-kind-inference: compiler: Refactor: extract `withAtomicRename` (e8a08f4) Message-ID: <20190222152154.561703A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/users-guide-forall-keyword,wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/e8a08f400744a860d1366c6680c8419d30f7cc2a/ghc >--------------------------------------------------------------- commit e8a08f400744a860d1366c6680c8419d30f7cc2a Author: Niklas Hambüchen Date: Sun Feb 17 21:09:29 2019 +0100 compiler: Refactor: extract `withAtomicRename` >--------------------------------------------------------------- e8a08f400744a860d1366c6680c8419d30f7cc2a compiler/main/DriverPipeline.hs | 13 ++++++------- compiler/utils/Util.hs | 24 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 3f59ed3..f1ef637 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1341,7 +1341,10 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags let local_includes = [ SysTools.Option ("-iquote" ++ p) | p <- includePathsQuote cmdline_include_paths ] let runAssembler inputFilename outputFilename - = liftIO $ as_prog dflags + = liftIO $ do + withAtomicRename outputFilename $ \temp_outputFilename -> do + as_prog + dflags (local_includes ++ global_includes -- See Note [-fPIC for assembler] ++ map SysTools.Option pic_c_flags @@ -1371,15 +1374,11 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags , SysTools.Option "-c" , SysTools.FileOption "" inputFilename , SysTools.Option "-o" - , SysTools.FileOption "" outputFilename + , SysTools.FileOption "" temp_outputFilename ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") - - -- Atomic write by writing to temp file and then renaming - let temp_output_fn = output_fn <.> "tmp" - runAssembler input_fn temp_output_fn - liftIO $ renameFile temp_output_fn output_fn + runAssembler input_fn output_fn return (RealPhase next_phase, output_fn) diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index 16864fe..41f63f2 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -99,6 +99,7 @@ module Util ( doesDirNameExist, getModificationUTCTime, modificationTimeIfExists, + withAtomicRename, global, consIORef, globalM, sharedGlobal, sharedGlobalM, @@ -145,9 +146,10 @@ import GHC.Stack (HasCallStack) import Control.Applicative ( liftA2 ) import Control.Monad ( liftM, guard ) +import Control.Monad.IO.Class ( MonadIO, liftIO ) import GHC.Conc.Sync ( sharedCAF ) import System.IO.Error as IO ( isDoesNotExistError ) -import System.Directory ( doesDirectoryExist, getModificationTime ) +import System.Directory ( doesDirectoryExist, getModificationTime, renameFile ) import System.FilePath import Data.Char ( isUpper, isAlphaNum, isSpace, chr, ord, isDigit, toUpper @@ -1304,6 +1306,26 @@ modificationTimeIfExists f = do else ioError e -- -------------------------------------------------------------- +-- atomic file writing by writing to a temporary file first (see #14533) +-- +-- This should be used in all cases where GHC writes files to disk +-- and uses their modification time to skip work later, +-- as otherwise a partially written file (e.g. due to crash or Ctrl+C) +-- also results in a skip. + +withAtomicRename :: (MonadIO m) => FilePath -> (FilePath -> m a) -> m a +withAtomicRename targetFile f = do + -- The temp file must be on the same file system (mount) as the target file + -- to result in an atomic move on most platforms. + -- The standard way to ensure that is to place it into the same directory. + -- This can still be fooled when somebody mounts a different file system + -- at just the right time, but that is not a case we aim to cover here. + let temp = targetFile <.> "tmp" + res <- f temp + liftIO $ renameFile temp targetFile + return res + +-- -------------------------------------------------------------- -- split a string at the last character where 'pred' is True, -- returning a pair of strings. The first component holds the string -- up (but not including) the last character for which 'pred' returned From git at git.haskell.org Fri Feb 22 15:21:57 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:21:57 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword, wip/users-guide-kind-inference: compiler: Write .o files atomically. See #14533 (0e2d300) Message-ID: <20190222152157.692763A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/users-guide-forall-keyword,wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/0e2d300a59b1b5c167d2e7d99a448c8663ba6d7d/ghc >--------------------------------------------------------------- commit 0e2d300a59b1b5c167d2e7d99a448c8663ba6d7d Author: Niklas Hambüchen Date: Sun Feb 17 20:48:45 2019 +0100 compiler: Write .o files atomically. See #14533 This issue was reproduced with, and the fix confirmed with, the `hatrace` tool for syscall-based fault injection: https://github.com/nh2/hatrace The concrete test case for GHC is at https://github.com/nh2/hatrace/blob/e23d35a2d2c79e8bf49e9e2266b3ff7094267f29/test/HatraceSpec.hs#L185 A previous, nondeterministic reproducer for the issue was provided by Alexey Kuleshevich in https://github.com/lehins/exec-kill-loop Signed-off-by: Niklas Hambüchen Reviewed-by: Alexey Kuleshevich >--------------------------------------------------------------- 0e2d300a59b1b5c167d2e7d99a448c8663ba6d7d compiler/main/DriverPipeline.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 5fe2362..3f59ed3 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1375,7 +1375,12 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") - runAssembler input_fn output_fn + + -- Atomic write by writing to temp file and then renaming + let temp_output_fn = output_fn <.> "tmp" + runAssembler input_fn temp_output_fn + liftIO $ renameFile temp_output_fn output_fn + return (RealPhase next_phase, output_fn) From git at git.haskell.org Fri Feb 22 15:22:00 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:22:00 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword, wip/users-guide-kind-inference: Bump nofib submodule. (473632d) Message-ID: <20190222152200.6A3973A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/users-guide-forall-keyword,wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/473632d7671619ee08a2a0025aa22bd4f79eca2d/ghc >--------------------------------------------------------------- commit 473632d7671619ee08a2a0025aa22bd4f79eca2d Author: klebinger.andreas at gmx.at Date: Mon Feb 18 00:35:01 2019 +0100 Bump nofib submodule. >--------------------------------------------------------------- 473632d7671619ee08a2a0025aa22bd4f79eca2d nofib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nofib b/nofib index f87d446..7a702cc 160000 --- a/nofib +++ b/nofib @@ -1 +1 @@ -Subproject commit f87d446b4e361cc82f219cf78917db9681af69b3 +Subproject commit 7a702cc1f4c0cd0a360953d31aaf54ca56c40a3d From git at git.haskell.org Fri Feb 22 15:22:03 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:22:03 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-kind-inference: User's Guide: remove outdated info on kind inference (3086222) Message-ID: <20190222152203.7D1873A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/users-guide-kind-inference Link : http://ghc.haskell.org/trac/ghc/changeset/308622279b7f5c03e1af0199c48bb65ab3e72af5/ghc >--------------------------------------------------------------- commit 308622279b7f5c03e1af0199c48bb65ab3e72af5 Author: Vladislav Zavialov Date: Fri Feb 22 15:49:20 2019 +0300 User's Guide: remove outdated info on kind inference We no longer put class variables in front, see "Taming the Kind Inference Monster" (also fix some markup issues) >--------------------------------------------------------------- 308622279b7f5c03e1af0199c48bb65ab3e72af5 docs/users_guide/glasgow_exts.rst | 40 +++++++++------------------------------ 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index c3090b0..978ae4e 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8881,18 +8881,18 @@ using kind signatures: :: The general principle is this: -- *When there is a right-hand side, GHC infers the most polymorphic - kind consistent with the right-hand side.* Examples: ordinary data +- When there is a right-hand side, GHC infers the most polymorphic + kind consistent with the right-hand side. Examples: ordinary data type and GADT declarations, class declarations. In the case of a class declaration the role of "right hand side" is played by the class method signatures. -- *When there is no right hand side, GHC defaults argument and result - kinds to ``Type``, except when directed otherwise by a kind signature*. +- When there is no right hand side, GHC defaults argument and result + kinds to ``Type``, except when directed otherwise by a kind signature. Examples: data and open type family declarations. This rule has occasionally-surprising consequences (see -:ghc-ticket:`10132`. :: +:ghc-ticket:`10132`). :: class C a where -- Class declarations are generalised -- so C :: forall k. k -> Constraint @@ -8956,28 +8956,6 @@ is implicitly declared in ``c``\'s kind. Thus, according to our general principle, ``b`` must come *before* ``k``. However, ``b`` *depends on* ``k``. We thus reject ``T2`` with a suitable error message. -In keeping with the way that class methods list their class variables -first, associated types also list class variables before others. This -means that the inferred variables from the class come before the -specified variables from the class, which come before other implicitly -bound variables. Here is an example:: - - class C (a :: k) b where - type F (c :: j) (d :: Proxy m) a b - -We infer these kinds:: - - C :: forall {k2 :: Type} (k :: Type). k -> k2 -> Constraint - F :: forall {k2 :: Type} (k :: Type) - {k3 :: Type} (j :: Type) (m :: k3). - j -> Proxy m -> k -> k2 -> Type - -The "general principle" described here is meant to make all this more -predictable for users. It would not be hard to extend GHC to relax -this principle. If you should want a change here, consider writing -a `proposal `_ to -do so. - .. index:: single: CUSK single: complete user-supplied kind signature @@ -9411,8 +9389,8 @@ Here are the key definitions, all available from ``GHC.Exts``: :: data RuntimeRep = LiftedRep -- for things like `Int` | UnliftedRep -- for things like `Array#` | IntRep -- for `Int#` - | TupleRep [RuntimeRep] -- unboxed tuples, indexed by the representations of the elements - | SumRep [RuntimeRep] -- unboxed sums, indexed by the representations of the disjuncts + | TupleRep [RuntimeRep] -- unboxed tuples, indexed by the representations of the elements + | SumRep [RuntimeRep] -- unboxed sums, indexed by the representations of the disjuncts | ... type Type = TYPE LiftedRep -- Type is just an ordinary type synonym @@ -10797,11 +10775,11 @@ application. This isn't true, however! Be sure to use :ghci-cmd:`:type +v` if you want the most accurate information with respect to visible type application properties. -.. _ScopedSort: - .. index:: single: ScopedSort +.. _ScopedSort: + Ordering of specified variables ------------------------------- From git at git.haskell.org Fri Feb 22 15:22:06 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Feb 2019 15:22:06 +0000 (UTC) Subject: [commit: ghc] wip/users-guide-forall-keyword: User's Guide: forall is a keyword nowadays (5f4b283) Message-ID: <20190222152206.985053A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/users-guide-forall-keyword Link : http://ghc.haskell.org/trac/ghc/changeset/5f4b28332a08d0cee8315293d87fba8e039d2051/ghc >--------------------------------------------------------------- commit 5f4b28332a08d0cee8315293d87fba8e039d2051 Author: Vladislav Zavialov Date: Fri Feb 22 16:51:48 2019 +0300 User's Guide: forall is a keyword nowadays >--------------------------------------------------------------- 5f4b28332a08d0cee8315293d87fba8e039d2051 docs/users_guide/glasgow_exts.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index c3090b0..f6c8fe5 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2236,9 +2236,10 @@ The following syntax is stolen: .. index:: single: forall - Stolen (in types) by: :extension:`ExplicitForAll`, and hence by - :extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`, - :extension:`RankNTypes`, :extension:`ExistentialQuantification` + Stolen (in types) by default. ``forall`` is a reserved keyword and never a + type variable. + See `GHC Proposal #43 `__. + ``mdo`` .. index:: @@ -10083,9 +10084,6 @@ in :ref:`data-instance-declarations`, :ref:`type-instance-declarations`, Notes: -- With :extension:`ExplicitForAll`, ``forall`` becomes a keyword; you can't use ``forall`` as a - type variable any more! - - As well in type signatures, you can also use an explicit ``forall`` in an instance declaration: :: From git at git.haskell.org Sat Feb 23 19:22:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:22 +0000 (UTC) Subject: [commit: ghc] branch 'wip/over-poly-kinds' created Message-ID: <20190223192222.0293C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/over-poly-kinds Referencing: c0e959388899eab168b422ac37846025f697de7f From git at git.haskell.org Sat Feb 23 19:22:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:24 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-whitespace' created Message-ID: <20190223192224.022C03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-whitespace Referencing: efeae3f96e32015dfd984a581d178679449f09ed From git at git.haskell.org Sat Feb 23 19:22:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:26 +0000 (UTC) Subject: [commit: ghc] branch 'wip/gitlab-registry' created Message-ID: <20190223192226.0324C3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/gitlab-registry Referencing: 59feedc8aa9189d4a1ab0699e4ed09579ca93435 From git at git.haskell.org Sat Feb 23 19:22:29 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:29 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry, wip/over-poly-kinds: Don't do binder-swap for GlobalIds (0eb7cf0) Message-ID: <20190223192229.15F9A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gitlab-registry,wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/0eb7cf03da3783ca887d5de44d312cf6f3a4113c/ghc >--------------------------------------------------------------- commit 0eb7cf03da3783ca887d5de44d312cf6f3a4113c Author: Simon Peyton Jones Date: Thu Feb 21 09:34:01 2019 +0000 Don't do binder-swap for GlobalIds This patch disables the binder-swap transformation in the (relatively rare) case when the scrutinee is a GlobalId. Reason: we are getting Lint errors so that GHC doesn't even validate. Trac #16346. This is NOT the final solution -- it's just a stop-gap to get us running again. The final solution is in Trac #16296 >--------------------------------------------------------------- 0eb7cf03da3783ca887d5de44d312cf6f3a4113c compiler/simplCore/OccurAnal.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 5287817..c3414b1 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -2402,9 +2402,14 @@ mkAltEnv env@(OccEnv { occ_gbl_scrut = pe }) scrut case_bndr _ -> (env { occ_encl = OccVanilla }, Nothing) where - add_scrut v rhs = ( env { occ_encl = OccVanilla - , occ_gbl_scrut = pe `extendVarSet` v } - , Just (localise v, rhs) ) + add_scrut v rhs + | isGlobalId v = (env { occ_encl = OccVanilla }, Nothing) + | otherwise = ( env { occ_encl = OccVanilla + , occ_gbl_scrut = pe `extendVarSet` v } + , Just (localise v, rhs) ) + -- ToDO: this isGlobalId stuff is a TEMPORARY FIX + -- to avoid the binder-swap for GlobalIds + -- See Trac #16346 case_bndr' = Var (zapIdOccInfo case_bndr) -- See Note [Zap case binders in proxy bindings] From git at git.haskell.org Sat Feb 23 19:22:32 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:32 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry, wip/over-poly-kinds: Fix exprIsConApp_maybe (c25b135) Message-ID: <20190223192232.D14CE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gitlab-registry,wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1/ghc >--------------------------------------------------------------- commit c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1 Author: Simon Peyton Jones Date: Thu Feb 21 12:03:22 2019 +0000 Fix exprIsConApp_maybe In this commit commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6 Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) we made exprIsConApp_maybe quite a bit cleverer. But I had not paid enough attention to keeping exactly the correct substitution and in-scope set, which led to Trac #16348. There were several buglets (like applying the substitution twice in exprIsConApp_maybe, but the proximate source of the bug was that we were calling addNewInScopeIds, which deleted things from the substitution as well as adding them to the in-scope set. That's usually right, but not here! This was quite tricky to track down. But it is nicer now. >--------------------------------------------------------------- c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1 compiler/basicTypes/MkId.hs | 2 +- compiler/coreSyn/CoreOpt.hs | 105 ++++++++++++--------- compiler/prelude/PrelRules.hs | 2 +- compiler/simplCore/Simplify.hs | 20 ++-- testsuite/tests/simplCore/should_compile/T16348.hs | 6 ++ testsuite/tests/simplCore/should_compile/all.T | 1 + 6 files changed, 81 insertions(+), 55 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 c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1 From git at git.haskell.org Sat Feb 23 19:22:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:35 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry, wip/over-poly-kinds: Use validate flavour rather than devel2 for DEBUG CI job (44ad721) Message-ID: <20190223192235.D0EB73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gitlab-registry,wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/44ad7215a11cb49651233646c30ced9eb72eaad2/ghc >--------------------------------------------------------------- commit 44ad7215a11cb49651233646c30ced9eb72eaad2 Author: Matthew Pickering Date: Wed Feb 20 20:42:13 2019 +0000 Use validate flavour rather than devel2 for DEBUG CI job This also builds stage2 with optimisations and -dcore-lint >--------------------------------------------------------------- 44ad7215a11cb49651233646c30ced9eb72eaad2 .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ac6100..2b3580f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -239,7 +239,7 @@ validate-x86_64-linux-deb9-debug: stage: build image: ghcci/x86_64-linux-deb9:0.2 variables: - BUILD_FLAVOUR: devel2 + BUILD_FLAVOUR: validate TEST_ENV: "x86_64-linux-deb9-debug" cache: key: linux-x86_64-deb9 From git at git.haskell.org Sat Feb 23 19:22:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:38 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry, wip/over-poly-kinds: Remove tcTyConUserTyVars (a07f46e) Message-ID: <20190223192238.E2DC93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/gitlab-registry,wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/a07f46ead660caa7fc6073e7b9bd1c8b7c4cdfe2/ghc >--------------------------------------------------------------- commit a07f46ead660caa7fc6073e7b9bd1c8b7c4cdfe2 Author: Simon Peyton Jones Date: Thu Feb 21 08:46:13 2019 +0000 Remove tcTyConUserTyVars The tcTyConUserTyVars field of TcTyCon was entirely unused. This patch kills it off entirely. >--------------------------------------------------------------- a07f46ead660caa7fc6073e7b9bd1c8b7c4cdfe2 compiler/typecheck/TcHsType.hs | 8 ++++---- compiler/typecheck/TcTyClsDecls.hs | 6 ++---- compiler/types/TyCon.hs | 11 ++++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 91b7aa2..c40d8b5 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -1835,7 +1835,7 @@ kcLHsQTyVars_Cusk, kcLHsQTyVars_NonCusk ------------------------------ kcLHsQTyVars_Cusk name flav - user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns + (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns , hsq_dependent = dep_names } , hsq_explicit = hs_tvs }) thing_inside -- CUSK case @@ -1876,7 +1876,7 @@ kcLHsQTyVars_Cusk name flav ++ map (mkRequiredTyConBinder mentioned_kv_set) tc_tvs all_tv_prs = mkTyVarNamePairs (scoped_kvs ++ tc_tvs) - tycon = mkTcTyCon name (ppr user_tyvars) + tycon = mkTcTyCon name final_tc_binders res_kind all_tv_prs @@ -1918,7 +1918,7 @@ kcLHsQTyVars_Cusk _ _ (XLHsQTyVars _) _ = panic "kcLHsQTyVars" ------------------------------ kcLHsQTyVars_NonCusk name flav - user_tyvars@(HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns + (HsQTvs { hsq_ext = HsQTvsRn { hsq_implicit = kv_ns , hsq_dependent = dep_names } , hsq_explicit = hs_tvs }) thing_inside -- Non_CUSK case @@ -1940,7 +1940,7 @@ kcLHsQTyVars_NonCusk name flav -- Also, note that tc_binders has the tyvars from only the -- user-written tyvarbinders. See S1 in Note [How TcTyCons work] -- in TcTyClsDecls - tycon = mkTcTyCon name (ppr user_tyvars) tc_binders res_kind + tycon = mkTcTyCon name tc_binders res_kind (mkTyVarNamePairs (scoped_kvs ++ tc_tvs)) False -- not yet generalised flav diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 55c06fc..8dfdbb2 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -540,7 +540,6 @@ generaliseTcTyCon tc tc_flav = tyConFlavour tc tc_res_kind = tyConResKind tc tc_tvs = tyConTyVars tc - user_tyvars = tcTyConUserTyVars tc -- ToDo: nuke (scoped_tv_names, scoped_tvs) = unzip (tcTyConScopedTyVars tc) -- NB: scoped_tvs includes both specified and required (tc_tvs) @@ -596,7 +595,7 @@ generaliseTcTyCon tc scoped_tv_pairs = scoped_tv_names `zip` scoped_tvs -- Step 7: Make the result TcTyCon - tycon = mkTcTyCon tc_name user_tyvars final_tcbs tc_res_kind + tycon = mkTcTyCon tc_name final_tcbs tc_res_kind scoped_tv_pairs True {- it's generalised now -} (tyConFlavour tc) @@ -1497,7 +1496,6 @@ tcFamDecl1 :: Maybe Class -> FamilyDecl GhcRn -> TcM TyCon tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info , fdLName = tc_lname@(dL->L _ tc_name) , fdResultSig = (dL->L _ sig) - , fdTyVars = user_tyvars , fdInjectivityAnn = inj }) | DataFamily <- fam_info = bindTyClTyVars tc_name $ \ binders res_kind -> do @@ -1559,7 +1557,7 @@ tcFamDecl1 parent (FamilyDecl { fdInfo = fam_info Just eqns -> do { -- Process the equations, creating CoAxBranches - ; let tc_fam_tc = mkTcTyCon tc_name (ppr user_tyvars) binders res_kind + ; let tc_fam_tc = mkTcTyCon tc_name binders res_kind [] False {- this doesn't matter here -} ClosedTypeFamilyFlavour diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 058f090..ca49560 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -99,7 +99,7 @@ module TyCon( algTcFields, tyConRuntimeRepInfo, tyConBinders, tyConResKind, tyConTyVarBinders, - tcTyConScopedTyVars, tcTyConUserTyVars, tcTyConIsPoly, + tcTyConScopedTyVars, tcTyConIsPoly, mkTyConTagMap, -- ** Manipulating TyCons @@ -861,7 +861,6 @@ data TyCon -- without a CUSK, it's the original left-to-right -- that the user wrote. Nec'y for getting Specified -- variables in the right order. - tcTyConUserTyVars :: SDoc, -- ^ Original, user-written tycon tyvars tcTyConIsPoly :: Bool, -- ^ Is this TcTyCon already generalized? tcTyConFlavour :: TyConFlavour @@ -1583,7 +1582,6 @@ mkSumTyCon name binders res_kind arity tyvars cons parent -- See also Note [Kind checking recursive type and class declarations] -- in TcTyClsDecls. mkTcTyCon :: Name - -> SDoc -- ^ user-written tycon tyvars -> [TyConBinder] -> Kind -- ^ /result/ kind only -> [(Name,TcTyVar)] -- ^ Scoped type variables; @@ -1591,7 +1589,7 @@ mkTcTyCon :: Name -> Bool -- ^ Is this TcTyCon generalised already? -> TyConFlavour -- ^ What sort of 'TyCon' this represents -> TyCon -mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav +mkTcTyCon name binders res_kind scoped_tvs poly flav = TcTyCon { tyConUnique = getUnique name , tyConName = name , tyConTyVars = binderVars binders @@ -1601,8 +1599,7 @@ mkTcTyCon name tyvars binders res_kind scoped_tvs poly flav , tyConArity = length binders , tcTyConScopedTyVars = scoped_tvs , tcTyConIsPoly = poly - , tcTyConFlavour = flav - , tcTyConUserTyVars = tyvars } + , tcTyConFlavour = flav } -- | Create an unlifted primitive 'TyCon', such as @Int#@. mkPrimTyCon :: Name -> [TyConBinder] @@ -1719,7 +1716,7 @@ isAbstractTyCon _ = False -- Used when recovering from errors makeRecoveryTyCon :: TyCon -> TyCon makeRecoveryTyCon tc - = mkTcTyCon (tyConName tc) empty + = mkTcTyCon (tyConName tc) (tyConBinders tc) (tyConResKind tc) [{- no scoped vars -}] True From git at git.haskell.org Sat Feb 23 19:22:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:41 +0000 (UTC) Subject: [commit: ghc] wip/fix-whitespace: testsuite: Fix whitespace in hp2ps error message (efeae3f) Message-ID: <20190223192241.E5F293A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-whitespace Link : http://ghc.haskell.org/trac/ghc/changeset/efeae3f96e32015dfd984a581d178679449f09ed/ghc >--------------------------------------------------------------- commit efeae3f96e32015dfd984a581d178679449f09ed Author: Ben Gamari Date: Fri Feb 22 12:29:35 2019 -0500 testsuite: Fix whitespace in hp2ps error message >--------------------------------------------------------------- efeae3f96e32015dfd984a581d178679449f09ed testsuite/driver/testlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index c09d02a..132c10a 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1566,7 +1566,7 @@ def check_hp_ok(name): if (gsResult == 0): return (True) else: - print("hp2ps output for " + name + "is not valid PostScript") + print("hp2ps output for " + name + " is not valid PostScript") else: return (True) # assume postscript is valid without ghostscript else: print("hp2ps did not generate PostScript for " + name) From git at git.haskell.org Sat Feb 23 19:22:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:44 +0000 (UTC) Subject: [commit: ghc] wip/over-poly-kinds: Build and copy libffi shared libraries correctly and enable dynamically linking ghc. (806cc23) Message-ID: <20190223192244.F2A293A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/806cc234426dca41e1c799e9e6212cf9e352d180/ghc >--------------------------------------------------------------- commit 806cc234426dca41e1c799e9e6212cf9e352d180 Author: David Eichmann Date: Tue Jan 15 12:34:06 2019 -0700 Build and copy libffi shared libraries correctly and enable dynamically linking ghc. Test Plan: Ensure build environment does NOT have a system libffi installed (you may want to use a nix environment). Then `hadrian/build.sh -c --flavour=default` Reviewers: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15837 >--------------------------------------------------------------- 806cc234426dca41e1c799e9e6212cf9e352d180 hadrian/src/Packages.hs | 12 ++- hadrian/src/Rules/Libffi.hs | 121 +++++++++++++++++++++++++---- hadrian/src/Rules/Library.hs | 9 +++ hadrian/src/Rules/Program.hs | 20 ++--- hadrian/src/Rules/Test.hs | 6 +- hadrian/src/Settings.hs | 11 ++- hadrian/src/Settings/Builders/Configure.hs | 6 +- hadrian/src/Settings/Builders/Ghc.hs | 43 +++++----- libraries/Cabal | 2 +- 9 files changed, 165 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 806cc234426dca41e1c799e9e6212cf9e352d180 From git at git.haskell.org Sat Feb 23 19:22:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:48 +0000 (UTC) Subject: [commit: ghc] wip/over-poly-kinds: Update CI images to GHC-8.4.4 & cabal-install-2.4.1.0 (4b752d5) Message-ID: <20190223192248.0D21A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/4b752d52761be4795fd83698b3290df455f0c3ea/ghc >--------------------------------------------------------------- commit 4b752d52761be4795fd83698b3290df455f0c3ea Author: Oleg Grenrus Date: Mon Feb 18 22:44:54 2019 +0200 Update CI images to GHC-8.4.4 & cabal-install-2.4.1.0 Use official bindists, except for Debian 9/Stretch http://downloads.haskell.org/debian/ is used. (There are no recent GHC/cabal-install for Debian 8/Jessie there) Use v2-update/v2-install to install Haskell tools. Try to unify structure of the different Dockerfiles, incl installing GHC in one step (this will prevent sublayers from existing, making final image slightly smaller) >--------------------------------------------------------------- 4b752d52761be4795fd83698b3290df455f0c3ea .circleci/images/aarch64-linux-deb9/Dockerfile | 1 + .circleci/images/i386-linux-deb8/Dockerfile | 19 ++++++++-------- .circleci/images/i386-linux-deb9/Dockerfile | 21 +++++++++--------- .circleci/images/x86_64-linux-centos7/Dockerfile | 22 ++++++++++-------- .circleci/images/x86_64-linux-deb8/Dockerfile | 27 +++++++++++++---------- .circleci/images/x86_64-linux-deb9/Dockerfile | 16 +++++++------- .circleci/images/x86_64-linux-fedora27/Dockerfile | 22 ++++++++++-------- 7 files changed, 69 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 4b752d52761be4795fd83698b3290df455f0c3ea From git at git.haskell.org Sat Feb 23 19:22:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:51 +0000 (UTC) Subject: [commit: ghc] wip/over-poly-kinds: Drop support for i386 and PowerPC in MachO linker (e87ae47) Message-ID: <20190223192251.1B1BE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/e87ae4733adb7420d13e96c2423aa71f804a2c46/ghc >--------------------------------------------------------------- commit e87ae4733adb7420d13e96c2423aa71f804a2c46 Author: Artem Pyanykh Date: Mon Feb 11 14:05:23 2019 +0300 Drop support for i386 and PowerPC in MachO linker Some code is broken, there are no CI targets (so not obvious how to test), and no one seems to have built GHC for any of the above platforms in years. >--------------------------------------------------------------- e87ae4733adb7420d13e96c2423aa71f804a2c46 rts/Linker.c | 4 +- rts/linker/MachO.c | 226 ++---------------------------------------------- rts/linker/MachO.h | 4 - rts/linker/MachOTypes.h | 5 -- 4 files changed, 8 insertions(+), 231 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 e87ae4733adb7420d13e96c2423aa71f804a2c46 From git at git.haskell.org Sat Feb 23 19:22:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:54 +0000 (UTC) Subject: [commit: ghc] wip/over-poly-kinds: ghc-in-ghci: Fix capitalization of hieFile (04b7f4c) Message-ID: <20190223192254.227783A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/04b7f4c1c6ea910ab378f27c5f9efd6c88f65425/ghc >--------------------------------------------------------------- commit 04b7f4c1c6ea910ab378f27c5f9efd6c88f65425 Author: Ben Gamari Date: Thu Feb 21 11:53:34 2019 -0500 ghc-in-ghci: Fix capitalization of hieFile >--------------------------------------------------------------- 04b7f4c1c6ea910ab378f27c5f9efd6c88f65425 utils/ghc-in-ghci/settings.ghci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/ghc-in-ghci/settings.ghci b/utils/ghc-in-ghci/settings.ghci index 8529631..f6a6843 100644 --- a/utils/ghc-in-ghci/settings.ghci +++ b/utils/ghc-in-ghci/settings.ghci @@ -5,7 +5,7 @@ :set -icompiler/coreSyn :set -icompiler/deSugar :set -icompiler/ghci -:set -icompiler/hiefile +:set -icompiler/hieFile :set -icompiler/hsSyn :set -icompiler/iface :set -icompiler/llvmGen From git at git.haskell.org Sat Feb 23 19:22:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:22:58 +0000 (UTC) Subject: [commit: ghc] wip/over-poly-kinds: Stop inferring over-polymorphic kinds (c0e9593) Message-ID: <20190223192258.2837E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/over-poly-kinds Link : http://ghc.haskell.org/trac/ghc/changeset/c0e959388899eab168b422ac37846025f697de7f/ghc >--------------------------------------------------------------- commit c0e959388899eab168b422ac37846025f697de7f Author: Simon Peyton Jones Date: Thu Feb 21 15:27:17 2019 +0000 Stop inferring over-polymorphic kinds Before this patch GHC was trying to be too clever (Trac #16344); it succeeded in kind-checking this polymorphic-recursive declaration data T ka (a::ka) b = MkT (T Type Int Bool) (T (Type -> Type) Maybe Bool) As Note [No polymorphic recursion] discusses, the "solution" was horribly fragile. So this patch deletes the key lines in TcHsType, and a wodge of supporting stuff in the renamer. There were two regressions, both the same: a closed type family decl like this (T12785b) does not have a CUSK: type family Payload (n :: Peano) (s :: HTree n x) where Payload Z (Point a) = a Payload (S n) (a `Branch` stru) = a To kind-check the equations we need a dependent kind for Payload, and we don't get that any more. Solution: make it a CUSK by giving the result kind -- probably a good thing anyway. The other case (T12442) was very similar: a close type family declaration without a CUSK. >--------------------------------------------------------------- c0e959388899eab168b422ac37846025f697de7f compiler/deSugar/DsMeta.hs | 15 +--- compiler/hieFile/HieAst.hs | 2 +- compiler/hsSyn/HsTypes.hs | 32 +++---- compiler/rename/RnSource.hs | 4 +- compiler/rename/RnTypes.hs | 14 +--- compiler/typecheck/TcHsType.hs | 97 +++++++++------------- compiler/typecheck/TcTyClsDecls.hs | 6 +- testsuite/tests/dependent/should_compile/T12442.hs | 3 +- testsuite/tests/dependent/should_fail/T16344.hs | 8 ++ .../tests/dependent/should_fail/T16344.stderr | 6 ++ testsuite/tests/dependent/should_fail/all.T | 1 + .../parser/should_compile/DumpRenamedAst.stderr | 32 ++----- .../tests/parser/should_compile/T14189.stderr | 15 ++-- testsuite/tests/typecheck/should_fail/T12785b.hs | 4 +- 14 files changed, 93 insertions(+), 146 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 c0e959388899eab168b422ac37846025f697de7f From git at git.haskell.org Sat Feb 23 19:23:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:23:01 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry: gitlab-ci: Pull docker images from ghc/ci-images registry (4f45278) Message-ID: <20190223192301.301153A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gitlab-registry Link : http://ghc.haskell.org/trac/ghc/changeset/4f452782ab9ed239813e20bbf64fd69ea6c11f71/ghc >--------------------------------------------------------------- commit 4f452782ab9ed239813e20bbf64fd69ea6c11f71 Author: Ben Gamari Date: Fri Feb 22 14:52:50 2019 -0500 gitlab-ci: Pull docker images from ghc/ci-images registry >--------------------------------------------------------------- 4f452782ab9ed239813e20bbf64fd69ea6c11f71 .gitlab-ci.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b3580f..c74d150 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,7 @@ variables: GIT_SSL_NO_VERIFY: "1" + # Commit of ghc/ci-images repository from which to pull Docker images + DOCKER_REV: 2757db588256b0f96dd44d602f0857ae8f86a704 before_script: - python3 .gitlab/fix-submodules.py @@ -32,7 +34,7 @@ stages: ghc-linters: stage: lint - image: ghcci/linters:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV" script: - | if [ -n "$CI_MERGE_REQUEST_ID" ]; then @@ -70,7 +72,7 @@ ghc-linters: validate-x86_64-linux-deb8-hadrian: extends: .validate-hadrian stage: build - image: ghcci/x86_64-linux-deb8:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV" before_script: # workaround for docker permissions - sudo chown ghc:ghc -R . @@ -180,7 +182,7 @@ validate-x86_64-darwin: validate-aarch64-linux-deb9: extends: .validate-linux stage: full-build - image: ghcci/aarch64-linux-deb9:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb9:$DOCKER_REV" allow_failure: true variables: TEST_ENV: "aarch64-linux-deb9" @@ -206,7 +208,7 @@ nightly-aarch64-linux-deb9: validate-i386-linux-deb9: extends: .validate-linux stage: full-build - image: ghcci/i386-linux-deb9:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb9:$DOCKER_REV" allow_failure: true variables: TEST_ENV: "i386-linux-deb9" @@ -219,7 +221,7 @@ validate-i386-linux-deb9: nightly-i386-linux-deb9: extends: .validate-linux stage: full-build - image: ghcci/i386-linux-deb9:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/i386-linux-deb9:$DOCKER_REV" allow_failure: true variables: TEST_TYPE: slowtest @@ -237,7 +239,7 @@ nightly-i386-linux-deb9: validate-x86_64-linux-deb9-debug: extends: .validate-linux stage: build - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" variables: BUILD_FLAVOUR: validate TEST_ENV: "x86_64-linux-deb9-debug" @@ -247,7 +249,7 @@ validate-x86_64-linux-deb9-debug: validate-x86_64-linux-deb9: extends: .validate-linux stage: build - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" variables: TEST_ENV: "x86_64-linux-deb9" artifacts: @@ -270,7 +272,7 @@ nightly-x86_64-linux-deb9: validate-x86_64-linux-deb9-llvm: extends: .validate-linux stage: full-build - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" variables: BUILD_FLAVOUR: perf-llvm TEST_ENV: "x86_64-linux-deb9-llvm" @@ -280,7 +282,7 @@ validate-x86_64-linux-deb9-llvm: validate-x86_64-linux-deb8: extends: .validate-linux stage: full-build - image: ghcci/x86_64-linux-deb8:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb8:$DOCKER_REV" variables: TEST_ENV: "x86_64-linux-deb8" cache: @@ -292,7 +294,7 @@ validate-x86_64-linux-deb8: validate-x86_64-linux-fedora27: extends: .validate-linux stage: full-build - image: ghcci/x86_64-linux-fedora27:0.1 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora27:$DOCKER_REV" variables: TEST_ENV: "x86_64-linux-fedora27" cache: @@ -307,7 +309,7 @@ validate-x86_64-linux-deb9-integer-simple: variables: INTEGER_LIBRARY: integer-simple TEST_ENV: "x86_64-linux-deb9-integer-simple" - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" cache: key: linux-x86_64-deb9 @@ -328,7 +330,7 @@ validate-x86_64-linux-deb9-unreg: variables: CONFIGURE_ARGS: --enable-unregisterised TEST_ENV: "x86_64-linux-deb9-unreg" - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" cache: key: linux-x86_64-deb9 From git at git.haskell.org Sat Feb 23 19:23:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Feb 2019 19:23:04 +0000 (UTC) Subject: [commit: ghc] wip/gitlab-registry: Drop Docker images (59feedc) Message-ID: <20190223192304.459B53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gitlab-registry Link : http://ghc.haskell.org/trac/ghc/changeset/59feedc8aa9189d4a1ab0699e4ed09579ca93435/ghc >--------------------------------------------------------------- commit 59feedc8aa9189d4a1ab0699e4ed09579ca93435 Author: Ben Gamari Date: Fri Feb 22 17:04:27 2019 -0500 Drop Docker images These have been moved to the ghc/ci-images project. >--------------------------------------------------------------- 59feedc8aa9189d4a1ab0699e4ed09579ca93435 .circleci/images/aarch64-linux-deb9/Dockerfile | 69 -------------- .circleci/images/i386-linux-deb8/Dockerfile | 45 --------- .circleci/images/i386-linux-deb9/Dockerfile | 45 --------- .circleci/images/linters/Dockerfile | 30 ------ .circleci/images/update-image | 34 ------- .circleci/images/x86_64-freebsd/Dockerfile | 25 ----- .circleci/images/x86_64-freebsd/build-toolchain.sh | 102 --------------------- .circleci/images/x86_64-linux-centos7/Dockerfile | 54 ----------- .circleci/images/x86_64-linux-deb8/Dockerfile | 35 ------- .circleci/images/x86_64-linux-deb9/Dockerfile | 46 ---------- .circleci/images/x86_64-linux-fedora27/Dockerfile | 50 ---------- 11 files changed, 535 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 59feedc8aa9189d4a1ab0699e4ed09579ca93435 From git at git.haskell.org Sun Feb 24 20:54:36 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:36 +0000 (UTC) Subject: [commit: ghc] branch 'wip/non-det-ci' created Message-ID: <20190224205436.5F6DF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/non-det-ci Referencing: f1dead9a1e2e450e12c3271dc170bddbc98160da From git at git.haskell.org Sun Feb 24 20:54:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:38 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T13633' created Message-ID: <20190224205438.602443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T13633 Referencing: c470b8ac5c7ef4eb97efe25c4c2bde1add7e60be From git at git.haskell.org Sun Feb 24 20:54:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:41 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: hWaitForInput-accurate-socket test (2e9426d) Message-ID: <20190224205441.E30F43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/2e9426df902cd2e118f162876d6991ffa5be9137/ghc >--------------------------------------------------------------- commit 2e9426df902cd2e118f162876d6991ffa5be9137 Author: Tom Sydney Kerckhove Date: Fri Dec 21 12:35:32 2018 +0200 hWaitForInput-accurate-socket test >--------------------------------------------------------------- 2e9426df902cd2e118f162876d6991ffa5be9137 libraries/base/tests/all.T | 1 + .../base/tests/hWaitForInput-accurate-pipe.hs | 23 ++++++++++++++++++++++ ...t.stdout => hWaitForInput-accurate-pipe.stdout} | 0 3 files changed, 24 insertions(+) diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 25e851b..dc16246 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -203,6 +203,7 @@ test('T8089', test('hWaitForInput-accurate-socket', reqlib('unix'), compile_and_run, ['']) test('T8684', expect_broken(8684), compile_and_run, ['']) test('hWaitForInput-accurate-stdin', normal, compile_and_run, ['']) +test('hWaitForInput-accurate-pipe', reqlib('unix'), compile_and_run, ['']) test('T9826',normal, compile_and_run,['']) test('T9848', [ collect_stats('bytes allocated') diff --git a/libraries/base/tests/hWaitForInput-accurate-pipe.hs b/libraries/base/tests/hWaitForInput-accurate-pipe.hs new file mode 100644 index 0000000..409c60c --- /dev/null +++ b/libraries/base/tests/hWaitForInput-accurate-pipe.hs @@ -0,0 +1,23 @@ +import Control.Concurrent +import Control.Monad +import GHC.Clock +import System.IO +import System.Posix.IO +import System.Timeout + +main :: IO () +main = do + (readPipe, _) <- createPipe + readPipeHandle <- fdToHandle readPipe + let nanoSecondsPerSecond = 1000 * 1000 * 1000 + let milliSecondsPerSecond = 1000 + let timeToSpend = 1 + let timeToSpendNano = timeToSpend * nanoSecondsPerSecond + let timeToSpendMilli = timeToSpend * milliSecondsPerSecond + start <- getMonotonicTimeNSec + b <- hWaitForInput readPipeHandle timeToSpendMilli + end <- getMonotonicTimeNSec + let timeSpentNano = fromIntegral $ end - start + let delta = timeSpentNano - timeToSpendNano + -- We can never wait for a shorter amount of time than specified + putStrLn $ "delta >= 0: " ++ show (delta > 0) diff --git a/libraries/base/tests/hWaitForInput-accurate-socket.stdout b/libraries/base/tests/hWaitForInput-accurate-pipe.stdout similarity index 100% copy from libraries/base/tests/hWaitForInput-accurate-socket.stdout copy to libraries/base/tests/hWaitForInput-accurate-pipe.stdout From git at git.haskell.org Sun Feb 24 20:54:46 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:46 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Add AnonArgFlag to FunTy (6cce36f) Message-ID: <20190224205446.15C953A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/6cce36f83aec33d33545e0ef2135894d22dff5ca/ghc >--------------------------------------------------------------- commit 6cce36f83aec33d33545e0ef2135894d22dff5ca Author: Simon Peyton Jones Date: Fri Feb 15 09:53:48 2019 +0000 Add AnonArgFlag to FunTy The big payload of this patch is: Add an AnonArgFlag to the FunTy constructor of Type, so that (FunTy VisArg t1 t2) means (t1 -> t2) (FunTy InvisArg t1 t2) means (t1 => t2) The big payoff is that we have a simple, local test to make when decomposing a type, leading to many fewer calls to isPredTy. To me the code seems a lot tidier, and probably more efficient (isPredTy has to take the kind of the type). See Note [Function types] in TyCoRep. There are lots of consequences * I made FunTy into a record, so that it'll be easier when we add a linearity field, something that is coming down the road. * Lots of code gets touched in a routine way, simply because it pattern matches on FunTy. * I wanted to make a pattern synonym for (FunTy2 arg res), which picks out just the argument and result type from the record. But alas the pattern-match overlap checker has a heart attack, and either reports false positives, or takes too long. In the end I gave up on pattern synonyms. There's some commented-out code in TyCoRep that shows what I wanted to do. * Much more clarity about predicate types, constraint types and (in particular) equality constraints in kinds. See TyCoRep Note [Types for coercions, predicates, and evidence] and Note [Constraints in kinds]. This made me realise that we need an AnonArgFlag on AnonTCB in a TyConBinder, something that was really plain wrong before. See TyCon Note [AnonTCB InivsArg] * When building function types we must know whether we need VisArg (mkVisFunTy) or InvisArg (mkInvisFunTy). This turned out to be pretty easy in practice. * Pretty-printing of types, esp in IfaceType, gets tidier, because we were already recording the (->) vs (=>) distinction in an ad-hoc way. Death to IfaceFunTy. * mkLamType needs to keep track of whether it is building (t1 -> t2) or (t1 => t2). See Type Note [mkLamType: dictionary arguments] Other minor stuff * Some tidy-up in validity checking involving constraints; Trac #16263 >--------------------------------------------------------------- 6cce36f83aec33d33545e0ef2135894d22dff5ca compiler/backpack/RnModIface.hs | 6 +- compiler/basicTypes/DataCon.hs | 39 +-- compiler/basicTypes/MkId.hs | 19 +- compiler/basicTypes/PatSyn.hs | 4 +- compiler/basicTypes/Var.hs | 32 +- compiler/basicTypes/Var.hs-boot | 15 + compiler/codeGen/StgCmmClosure.hs | 6 +- compiler/coreSyn/CoreFVs.hs | 2 +- compiler/coreSyn/CoreLint.hs | 6 +- compiler/coreSyn/CoreMap.hs | 6 +- compiler/coreSyn/CoreUtils.hs | 9 +- compiler/coreSyn/MkCore.hs | 6 +- compiler/deSugar/DsCCall.hs | 6 +- compiler/deSugar/DsForeign.hs | 4 +- compiler/deSugar/DsListComp.hs | 6 +- compiler/deSugar/DsUtils.hs | 2 +- compiler/ghci/ByteCodeGen.hs | 2 +- compiler/ghci/RtClosureInspect.hs | 6 +- compiler/hieFile/HieAst.hs | 4 +- compiler/hieFile/HieUtils.hs | 14 +- compiler/hsSyn/HsUtils.hs | 15 +- compiler/iface/BuildTyCl.hs | 3 +- compiler/iface/IfaceSyn.hs | 5 +- compiler/iface/IfaceType.hs | 53 ++- compiler/iface/TcIface.hs | 11 +- compiler/iface/ToIface.hs | 7 +- compiler/prelude/PrimOp.hs | 8 +- compiler/prelude/TysPrim.hs | 13 +- compiler/prelude/TysWiredIn.hs | 39 ++- compiler/prelude/TysWiredIn.hs-boot | 5 - compiler/simplCore/SimplUtils.hs | 4 +- compiler/simplStg/RepType.hs | 4 +- compiler/typecheck/ClsInst.hs | 2 +- compiler/typecheck/FamInst.hs | 2 +- compiler/typecheck/Inst.hs | 166 ++------- compiler/typecheck/TcArrows.hs | 4 +- compiler/typecheck/TcCanonical.hs | 15 +- compiler/typecheck/TcDerivInfer.hs | 2 +- compiler/typecheck/TcErrors.hs | 5 +- compiler/typecheck/TcEvidence.hs | 2 +- compiler/typecheck/TcExpr.hs | 10 +- compiler/typecheck/TcFlatten.hs | 14 +- compiler/typecheck/TcForeign.hs | 4 +- compiler/typecheck/TcGenDeriv.hs | 8 +- compiler/typecheck/TcGenFunctor.hs | 9 +- compiler/typecheck/TcHoleErrors.hs | 2 +- compiler/typecheck/TcHsType.hs | 57 ++-- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 22 +- compiler/typecheck/TcMatches.hs | 28 +- compiler/typecheck/TcPat.hs | 2 +- compiler/typecheck/TcPatSyn.hs | 12 +- compiler/typecheck/TcRnDriver.hs | 3 +- compiler/typecheck/TcRnTypes.hs | 2 +- compiler/typecheck/TcSMonad.hs | 6 +- compiler/typecheck/TcSigs.hs | 5 +- compiler/typecheck/TcSimplify.hs | 2 +- compiler/typecheck/TcSplice.hs | 8 +- compiler/typecheck/TcTyClsDecls.hs | 26 +- compiler/typecheck/TcTyDecls.hs | 22 +- compiler/typecheck/TcType.hs | 102 +++--- compiler/typecheck/TcTypeable.hs | 15 +- compiler/typecheck/TcUnify.hs | 29 +- compiler/typecheck/TcValidity.hs | 68 ++-- compiler/types/Coercion.hs | 11 +- compiler/types/FamInstEnv.hs | 13 +- compiler/types/Kind.hs | 2 +- compiler/types/OptCoercion.hs | 4 - compiler/types/TyCoRep.hs | 378 ++++++++++++++++----- compiler/types/TyCoRep.hs-boot | 6 +- compiler/types/TyCon.hs | 101 +++--- compiler/types/Type.hs | 320 +++++++++-------- compiler/types/Unify.hs | 4 +- docs/users_guide/glasgow_exts.rst | 22 ++ testsuite/tests/callarity/unittest/CallArity1.hs | 12 +- testsuite/tests/dependent/should_fail/T15215.hs | 4 + .../tests/dependent/should_fail/T15215.stderr | 11 +- testsuite/tests/polykinds/all.T | 1 - testsuite/tests/typecheck/should_fail/T12102.hs | 5 +- .../tests/typecheck/should_fail/T12102.stderr | 6 - testsuite/tests/typecheck/should_fail/all.T | 2 +- utils/genprimopcode/Main.hs | 4 +- utils/haddock | 2 +- 83 files changed, 1046 insertions(+), 880 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 6cce36f83aec33d33545e0ef2135894d22dff5ca From git at git.haskell.org Sun Feb 24 20:54:49 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:49 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Remove bogus assertion (ac34e78) Message-ID: <20190224205449.270E53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/ac34e784775a0fa8b7284d42ff89571907afdc36/ghc >--------------------------------------------------------------- commit ac34e784775a0fa8b7284d42ff89571907afdc36 Author: Simon Peyton Jones Date: Fri Feb 15 09:52:53 2019 +0000 Remove bogus assertion Remove a bogus assertion in FamInst.newFamInst (There is a comment to explain.) This fixes Trac #16112. >--------------------------------------------------------------- ac34e784775a0fa8b7284d42ff89571907afdc36 compiler/typecheck/FamInst.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs index aec8e41..7efcb97 100644 --- a/compiler/typecheck/FamInst.hs +++ b/compiler/typecheck/FamInst.hs @@ -158,8 +158,10 @@ newFamInst :: FamFlavor -> CoAxiom Unbranched -> TcM FamInst -- Freshen the type variables of the FamInst branches newFamInst flavor axiom@(CoAxiom { co_ax_tc = fam_tc }) = ASSERT2( tyCoVarsOfTypes lhs `subVarSet` tcv_set, text "lhs" <+> pp_ax ) - ASSERT2( tyCoVarsOfType rhs `subVarSet` tcv_set, text "rhs" <+> pp_ax ) ASSERT2( lhs_kind `eqType` rhs_kind, text "kind" <+> pp_ax $$ ppr lhs_kind $$ ppr rhs_kind ) + -- We used to have an assertion that the tyvars of the RHS were bound + -- by tcv_set, but in error situations like F Int = a that isn't + -- true; a later check in checkValidFamInst rejects it do { (subst, tvs') <- freshenTyVarBndrs tvs ; (subst, cvs') <- freshenCoVarBndrsX subst cvs ; dflags <- getDynFlags From git at git.haskell.org Sun Feb 24 20:54:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:52 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Expression/command ambiguity resolution (e61f6e3) Message-ID: <20190224205452.555463A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/e61f6e35e2fffb1e82e9559852481010fe84d8d3/ghc >--------------------------------------------------------------- commit e61f6e35e2fffb1e82e9559852481010fe84d8d3 Author: Vladislav Zavialov Date: Fri Feb 1 20:03:54 2019 +0300 Expression/command ambiguity resolution This patch removes 'HsArrApp' and 'HsArrForm' from 'HsExpr' by introducing a new ambiguity resolution system in the parser. Problem: there are places in the grammar where we do not know whether we are parsing an expression or a command: proc x -> do { (stuff) -< x } -- 'stuff' is an expression proc x -> do { (stuff) } -- 'stuff' is a command Until we encounter arrow syntax (-<) we don't know whether to parse 'stuff' as an expression or a command. The old solution was to parse as HsExpr always, and rejig later: checkCommand :: LHsExpr GhcPs -> P (LHsCmd GhcPs) This meant polluting 'HsExpr' with command-related constructors. In other words, limitations of the parser were affecting the AST, and all other code (the renamer, the typechecker) had to deal with these extra constructors by panicking. We fix this abstraction leak by parsing into an intermediate representation, 'ExpCmd': data ExpCmdG b where ExpG :: ExpCmdG HsExpr CmdG :: ExpCmdG HsCmd type ExpCmd = forall b. ExpCmdG b -> PV (Located (b GhcPs)) checkExp :: ExpCmd -> PV (LHsExpr GhcPs) checkCmd :: ExpCmd -> PV (LHsCmd GhcPs) checkExp f = f ExpG -- interpret as an expression checkCmd f = f CmdG -- interpret as a command See Note [Ambiguous syntactic categories] for details. Now the intricacies of parsing have no effect on the hsSyn AST when it comes to the expression/command ambiguity. Future work: apply the same principles to the expression/pattern ambiguity. >--------------------------------------------------------------- e61f6e35e2fffb1e82e9559852481010fe84d8d3 compiler/deSugar/DsExpr.hs | 2 - compiler/hieFile/HieAst.hs | 8 - compiler/hsSyn/HsExpr.hs | 50 --- compiler/hsSyn/HsUtils.hs | 5 + compiler/parser/Parser.y | 476 ++++++++++++++-------- compiler/parser/RdrHsSyn.hs | 628 ++++++++++++++++++++++++------ compiler/rename/RnExpr.hs | 12 - compiler/typecheck/TcRnTypes.hs | 2 - hadrian/src/Settings/Builders/Happy.hs | 2 +- mk/config.mk.in | 3 +- testsuite/tests/ghci/scripts/T8959.stderr | 42 +- 11 files changed, 881 insertions(+), 349 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 e61f6e35e2fffb1e82e9559852481010fe84d8d3 From git at git.haskell.org Sun Feb 24 20:54:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:55 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Fix regression incorrectly advertising TH support (ee284b8) Message-ID: <20190224205455.5F8743A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/ee284b854e514685036dc21a1ee61241c76d14b5/ghc >--------------------------------------------------------------- commit ee284b854e514685036dc21a1ee61241c76d14b5 Author: Herbert Valerio Riedel Date: Sat Feb 16 22:08:46 2019 +0100 Fix regression incorrectly advertising TH support `--supported-languages` must only advertise language extensions which are supported by the compiler in order for tooling such as Cabal relying on this signalling not to behave incorrectly. Fixes #16331 >--------------------------------------------------------------- ee284b854e514685036dc21a1ee61241c76d14b5 compiler/main/DynFlags.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index f929d98..dca692e 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -4290,6 +4290,14 @@ supportedExtensions :: [String] supportedExtensions = concatMap toFlagSpecNamePair xFlags where toFlagSpecNamePair flg +#if !defined(GHCI) + -- IMPORTANT! Make sure that `ghc --supported-extensions` omits + -- "TemplateHaskell"/"QuasiQuotes" when it's known not to work out of the + -- box. See also GHC #11102 and #16331 for more details about + -- the rationale + | flagSpecFlag flg == LangExt.TemplateHaskell = [noName] + | flagSpecFlag flg == LangExt.QuasiQuotes = [noName] +#endif | otherwise = [name, noName] where noName = "No" ++ name From git at git.haskell.org Sun Feb 24 20:54:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:54:58 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Exit with exit code 1 when tests unexpectedly pass (a990312) Message-ID: <20190224205458.6A3DF3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/a990312e3d36e0e1b18bb966ac3297aa0aae142a/ghc >--------------------------------------------------------------- commit a990312e3d36e0e1b18bb966ac3297aa0aae142a Author: Matthew Pickering Date: Tue Feb 19 20:23:48 2019 +0000 Exit with exit code 1 when tests unexpectedly pass This was causing gitlab to not report from builds as failing. It also highlighted a problem with the LLVM tests where some of the external interpreter tests are failing. >--------------------------------------------------------------- a990312e3d36e0e1b18bb966ac3297aa0aae142a testsuite/driver/runtests.py | 1 + testsuite/driver/testlib.py | 1 + testsuite/tests/th/all.T | 10 ++++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 51f682e..b439abd 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -439,6 +439,7 @@ else: if len(t.unexpected_failures) > 0 or \ len(t.unexpected_stat_failures) > 0 or \ + len(t.unexpected_passes) > 0 or \ len(t.framework_failures) > 0: exitcode = 1 else: diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index fb7888c..11c828c 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -2118,6 +2118,7 @@ def summary(t, file, short=False, color=False): if color: if len(t.unexpected_failures) > 0 or \ len(t.unexpected_stat_failures) > 0 or \ + len(t.unexpected_passes) > 0 or \ len(t.framework_failures) > 0: colorize = str_fail else: diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 2aaa48c..7d6340b 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -12,8 +12,14 @@ setTestOpts(req_interp) if config.have_ext_interp : setTestOpts(extra_ways(['ext-interp'])) setTestOpts(only_ways(['normal','ghci','ext-interp'])) - if config.ghc_built_by_llvm: - setTestOpts(expect_broken_for(16087, ['ext-interp'])) + +broken_tests = ["ClosedFam1TH","T10620","T10828","T11721_TH","T11797","T12045TH2","T12478_1","T12646","T13642","T14060","T15502","T15738","T15792","T15845","T16180","T1835","T3920","T4135","T4188","T5037","T5362","T7477","T7910","T8761","T8884","T8953","T9262","T9692","T9738","TH_Lift","TH_RichKinds","TH_RichKinds2","TH_Roles3","TH_TyInstWhere2","TH_implicitParams","TH_recursiveDo","TH_reifyDecl1","TH_reifyExplicitForAllFams","TH_reifyInstances","TH_reifyMkName","TH_repE2","TH_repGuard","TH_repPrim","TH_repPrim2","TH_repUnboxedTuples","TH_spliceE6"] +# ext-interp, integer-gmp and llvm is broken see #16087 +def broken_ext_interp(name, opts): + if name in broken_tests and config.ghc_built_by_llvm: + expect_broken_for(16087, ['ext-interp'])(name, opts) + +setTestOpts(broken_ext_interp) test('TH_mkName', normal, compile, ['-v0']) test('TH_overloadedlabels', normal, compile, ['-v0']) From git at git.haskell.org Sun Feb 24 20:55:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:01 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: gitlab-ci: Only build x86_64-deb8 and fedora27 for releases (1059e23) Message-ID: <20190224205501.7EAB93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/1059e234b04a041291cc422cad715011011724d1/ghc >--------------------------------------------------------------- commit 1059e234b04a041291cc422cad715011011724d1 Author: Ben Gamari Date: Thu Feb 21 01:14:10 2019 -0500 gitlab-ci: Only build x86_64-deb8 and fedora27 for releases These are largely redundant as they are covered by x86_64-deb9. >--------------------------------------------------------------- 1059e234b04a041291cc422cad715011011724d1 .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b3580f..217b297 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -277,24 +277,28 @@ validate-x86_64-linux-deb9-llvm: cache: key: linux-x86_64-deb9 -validate-x86_64-linux-deb8: +release-x86_64-linux-deb8: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-deb8:0.1 variables: TEST_ENV: "x86_64-linux-deb8" + only: + - tags cache: key: linux-x86_64-deb8 artifacts: when: always expire_in: 2 week -validate-x86_64-linux-fedora27: +release-x86_64-linux-fedora27: extends: .validate-linux stage: full-build image: ghcci/x86_64-linux-fedora27:0.1 variables: TEST_ENV: "x86_64-linux-fedora27" + only: + - tags cache: key: linux-x86_64-fedora27 artifacts: From git at git.haskell.org Sun Feb 24 20:55:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:04 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: Include closure header size in StgLamLift's estimations (b85068f) Message-ID: <20190224205504.A756D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/b85068f6843eb0b16ff898e0dfa811fede8e1ca1/ghc >--------------------------------------------------------------- commit b85068f6843eb0b16ff898e0dfa811fede8e1ca1 Author: Sebastian Graf Date: Thu Feb 21 16:02:38 2019 +0100 Include closure header size in StgLamLift's estimations While playing around with late lambda lifting, I realised that StgLamLift.Analysis doesn't consider the removed closure header in its allocation estimations. That's because contrary to what I thought, the total word count returned by `mkVirtHeapOffsets` doesn't include the size of the closure header. We just add the header size manually now. >--------------------------------------------------------------- b85068f6843eb0b16ff898e0dfa811fede8e1ca1 compiler/simplStg/StgLiftLams/Analysis.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/simplStg/StgLiftLams/Analysis.hs b/compiler/simplStg/StgLiftLams/Analysis.hs index 7fb60df..3cdbfcb 100644 --- a/compiler/simplStg/StgLiftLams/Analysis.hs +++ b/compiler/simplStg/StgLiftLams/Analysis.hs @@ -484,13 +484,12 @@ rhsLambdaBndrs (StgRhsClosure _ _ _ bndrs _) = map binderInfoBndr bndrs -- | The size in words of a function closure closing over the given 'Id's, -- including the header. closureSize :: DynFlags -> [Id] -> WordOff -closureSize dflags ids = words +closureSize dflags ids = words + sTD_HDR_SIZE dflags + -- We go through sTD_HDR_SIZE rather than fixedHdrSizeW so that we don't + -- optimise differently when profiling is enabled. where (words, _, _) -- Functions have a StdHeader (as opposed to ThunkHeader). - -- Note that mkVirtHeadOffsets will account for profiling headers, so - -- lifting decisions vary if we begin to profile stuff. Maybe we shouldn't - -- do this or deactivate profiling in @dflags@? = StgCmmLayout.mkVirtHeapOffsets dflags StgCmmLayout.StdHeader . StgCmmClosure.addIdReps . StgCmmClosure.nonVoidIds From git at git.haskell.org Sun Feb 24 20:55:07 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:07 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: User's Guide: update info on kind inference (8897018) Message-ID: <20190224205507.C03C63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/88970187779166abd9c13b6e48430bfccc9ee880/ghc >--------------------------------------------------------------- commit 88970187779166abd9c13b6e48430bfccc9ee880 Author: Vladislav Zavialov Date: Fri Feb 22 15:49:20 2019 +0300 User's Guide: update info on kind inference We no longer put class variables in front, see "Taming the Kind Inference Monster" (also fix some markup issues) >--------------------------------------------------------------- 88970187779166abd9c13b6e48430bfccc9ee880 docs/users_guide/glasgow_exts.rst | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 3880cb9..c8afa44 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8881,18 +8881,18 @@ using kind signatures: :: The general principle is this: -- *When there is a right-hand side, GHC infers the most polymorphic - kind consistent with the right-hand side.* Examples: ordinary data +- When there is a right-hand side, GHC infers the most polymorphic + kind consistent with the right-hand side. Examples: ordinary data type and GADT declarations, class declarations. In the case of a class declaration the role of "right hand side" is played by the class method signatures. -- *When there is no right hand side, GHC defaults argument and result - kinds to ``Type``, except when directed otherwise by a kind signature*. +- When there is no right hand side, GHC defaults argument and result + kinds to ``Type``, except when directed otherwise by a kind signature. Examples: data and open type family declarations. This rule has occasionally-surprising consequences (see -:ghc-ticket:`10132`. :: +:ghc-ticket:`10132`). :: class C a where -- Class declarations are generalised -- so C :: forall k. k -> Constraint @@ -8956,21 +8956,21 @@ is implicitly declared in ``c``\'s kind. Thus, according to our general principle, ``b`` must come *before* ``k``. However, ``b`` *depends on* ``k``. We thus reject ``T2`` with a suitable error message. -In keeping with the way that class methods list their class variables -first, associated types also list class variables before others. This -means that the inferred variables from the class come before the -specified variables from the class, which come before other implicitly -bound variables. Here is an example:: +In associated types, we order the type variables as if the type family was a +top-level declaration, ignoring the visibilities of the class's type variable +binders. Here is an example: :: class C (a :: k) b where type F (c :: j) (d :: Proxy m) a b We infer these kinds:: - C :: forall {k2 :: Type} (k :: Type). k -> k2 -> Constraint - F :: forall {k2 :: Type} (k :: Type) - {k3 :: Type} (j :: Type) (m :: k3). - j -> Proxy m -> k -> k2 -> Type + C :: forall {k1 :: Type} (k :: Type). k -> k1 -> Constraint + F :: forall {k1 :: Type} {k2 :: Type} {k3 :: Type} j (m :: k1). + j -> Proxy m -> k2 -> k3 -> Type + +Note that the kind of ``a`` is specified in the kind of ``C`` but inferred in +the kind of ``F``. The "general principle" described here is meant to make all this more predictable for users. It would not be hard to extend GHC to relax @@ -9433,8 +9433,8 @@ Here are the key definitions, all available from ``GHC.Exts``: :: data RuntimeRep = LiftedRep -- for things like `Int` | UnliftedRep -- for things like `Array#` | IntRep -- for `Int#` - | TupleRep [RuntimeRep] -- unboxed tuples, indexed by the representations of the elements - | SumRep [RuntimeRep] -- unboxed sums, indexed by the representations of the disjuncts + | TupleRep [RuntimeRep] -- unboxed tuples, indexed by the representations of the elements + | SumRep [RuntimeRep] -- unboxed sums, indexed by the representations of the disjuncts | ... type Type = TYPE LiftedRep -- Type is just an ordinary type synonym @@ -10819,11 +10819,11 @@ application. This isn't true, however! Be sure to use :ghci-cmd:`:type +v` if you want the most accurate information with respect to visible type application properties. -.. _ScopedSort: - .. index:: single: ScopedSort +.. _ScopedSort: + Ordering of specified variables ------------------------------- From git at git.haskell.org Sun Feb 24 20:55:10 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:10 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: User's Guide: forall is a keyword nowadays (ae7d1ff) Message-ID: <20190224205510.CF16E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78/ghc >--------------------------------------------------------------- commit ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78 Author: Vladislav Zavialov Date: Fri Feb 22 16:51:48 2019 +0300 User's Guide: forall is a keyword nowadays >--------------------------------------------------------------- ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78 docs/users_guide/bugs.rst | 7 +++++++ docs/users_guide/glasgow_exts.rst | 10 ++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst index 96cdd25..c563083 100644 --- a/docs/users_guide/bugs.rst +++ b/docs/users_guide/bugs.rst @@ -42,6 +42,13 @@ Lexical syntax as a single qualified operator rather than the two lexemes ``M`` and ``.\``. +- ``forall`` is always a reserved keyword at the type level, contrary + to the Haskell Report, which allows type variables to be named ``forall``. + Note that this does not imply that GHC always enables the + :ghc-flag:`-XExplicitForAll` extension. Even without this extension enabled, + reserving ``forall`` as a keyword has significance. For instance, GHC will + not parse the type signature ``foo :: forall x``. + .. _infelicities-syntax: Context-free syntax diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index c8afa44..eae0283 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2236,9 +2236,10 @@ The following syntax is stolen: .. index:: single: forall - Stolen (in types) by: :extension:`ExplicitForAll`, and hence by - :extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`, - :extension:`RankNTypes`, :extension:`ExistentialQuantification` + Stolen (in types) by default (see :ref:`infelicities-lexical`). ``forall`` is + a reserved keyword and never a type variable, in accordance with `GHC Proposal #43 + `__. + ``mdo`` .. index:: @@ -10105,9 +10106,6 @@ in :ref:`data-instance-declarations`, :ref:`type-instance-declarations`, Notes: -- With :extension:`ExplicitForAll`, ``forall`` becomes a keyword; you can't use ``forall`` as a - type variable any more! - - As well in type signatures, you can also use an explicit ``forall`` in an instance declaration: :: From git at git.haskell.org Sun Feb 24 20:55:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:13 +0000 (UTC) Subject: [commit: ghc] wip/T13633, wip/non-det-ci: testsuite: Fix whitespace in hp2ps error message (6ba3421) Message-ID: <20190224205513.DAD043A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T13633,wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/6ba3421efd1caf469e30ce53fef8c5406adde357/ghc >--------------------------------------------------------------- commit 6ba3421efd1caf469e30ce53fef8c5406adde357 Author: Ben Gamari Date: Fri Feb 22 12:29:35 2019 -0500 testsuite: Fix whitespace in hp2ps error message >--------------------------------------------------------------- 6ba3421efd1caf469e30ce53fef8c5406adde357 testsuite/driver/testlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 11c828c..edd43fb 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1601,7 +1601,7 @@ def check_hp_ok(name): if (gsResult == 0): return (True) else: - print("hp2ps output for " + name + "is not valid PostScript") + print("hp2ps output for " + name + " is not valid PostScript") else: return (True) # assume postscript is valid without ghostscript else: print("hp2ps did not generate PostScript for " + name) From git at git.haskell.org Sun Feb 24 20:55:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:16 +0000 (UTC) Subject: [commit: ghc] wip/non-det-ci: Disable fragile test cases: T14697 T5559 T3424 (f1dead9) Message-ID: <20190224205516.EE8E73A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/non-det-ci Link : http://ghc.haskell.org/trac/ghc/changeset/f1dead9a1e2e450e12c3271dc170bddbc98160da/ghc >--------------------------------------------------------------- commit f1dead9a1e2e450e12c3271dc170bddbc98160da Author: Vladislav Zavialov Date: Sun Feb 24 01:03:35 2019 +0300 Disable fragile test cases: T14697 T5559 T3424 See Trac #15072, Trac #16349, Trac #16350 >--------------------------------------------------------------- f1dead9a1e2e450e12c3271dc170bddbc98160da testsuite/tests/perf/compiler/all.T | 7 +++++-- testsuite/tests/profiling/should_run/all.T | 4 +++- testsuite/tests/rts/all.T | 10 +++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 82847c2..c6548c1 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -355,8 +355,11 @@ test('T13719', test('T14697', [ collect_compiler_stats('bytes allocated',10), - # This generates too large of a command-line for poor Windows - when(opsys('mingw32'), expect_broken(15072)), + # This generates too large of a command-line for poor Windows and + # Darwin. The failure is non-deterministic, so we 'skip' it rather than + # 'expect_broken'. The solution is to teach the testsuite driver to + # invoke GHC with a response file, see Trac #15072 + when(opsys('mingw32') or opsys('darwin'), skip), pre_cmd('./genT14697'), extra_files(['genT14697']), extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 8baddcb..9b6018c 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -87,7 +87,9 @@ test('prof-doc-fib', [], compile_and_run, ['']) test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness']) # unicode in cost centre names -test('T5559', [], compile_and_run, ['']) +test('T5559', + [ skip # Skip due to non-deterministic failures on CI, see Trac #16350 + ], compile_and_run, ['']) # Note [consistent stacks] # Certain optimisations can change the stacks we get out of the diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 43c0764..6808e7e 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -106,9 +106,13 @@ test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], com test('atomicxchg', [ c_src, only_ways(['threaded1', 'threaded2']) ], compile_and_run, ['']) -test('T3424', # it's slow: - [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ], - compile_and_run, ['']) +test('T3424', + [ # Skip due to non-deterministic timeouts on CI, see Trac #16349 + when(unregisterised(), skip), + # And it's slow in general + only_ways(['normal','threaded1','ghci']) + ], + compile_and_run, ['']) # Test for out-of-range heap size test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, ['']) From git at git.haskell.org Sun Feb 24 20:55:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:20 +0000 (UTC) Subject: [commit: ghc] wip/T13633: RTS: Add missing memory barrier (eafa6ab) Message-ID: <20190224205520.07A5B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T13633 Link : http://ghc.haskell.org/trac/ghc/changeset/eafa6ab26a06bfc006b048021a7611d54a2ef7d8/ghc >--------------------------------------------------------------- commit eafa6ab26a06bfc006b048021a7611d54a2ef7d8 Author: Peter Trommler Date: Sun Feb 24 17:11:00 2019 +0100 RTS: Add missing memory barrier >--------------------------------------------------------------- eafa6ab26a06bfc006b048021a7611d54a2ef7d8 rts/WSDeque.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/WSDeque.c b/rts/WSDeque.c index b9393b1..9502df0 100644 --- a/rts/WSDeque.c +++ b/rts/WSDeque.c @@ -195,7 +195,9 @@ stealWSDeque_ (WSDeque *q) if ((long)b - (long)t <= 0 ) { return NULL; /* already looks empty, abort */ } - + // NB. these loads must be ordered so writes from pushWSDeque + // will be seen. + load_load_barrier(); /* now access array, see pushBottom() */ stolen = q->elements[t & q->moduloSize]; From git at git.haskell.org Sun Feb 24 20:55:23 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Feb 2019 20:55:23 +0000 (UTC) Subject: [commit: ghc] wip/T13633: testsuite RTS: Add barrier to debug code (c470b8a) Message-ID: <20190224205523.287703A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T13633 Link : http://ghc.haskell.org/trac/ghc/changeset/c470b8ac5c7ef4eb97efe25c4c2bde1add7e60be/ghc >--------------------------------------------------------------- commit c470b8ac5c7ef4eb97efe25c4c2bde1add7e60be Author: Peter Trommler Date: Sun Feb 24 19:13:53 2019 +0100 testsuite RTS: Add barrier to debug code >--------------------------------------------------------------- c470b8ac5c7ef4eb97efe25c4c2bde1add7e60be testsuite/tests/rts/testwsdeque.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/rts/testwsdeque.c b/testsuite/tests/rts/testwsdeque.c index 3f17f32..a21f9bd 100644 --- a/testsuite/tests/rts/testwsdeque.c +++ b/testsuite/tests/rts/testwsdeque.c @@ -51,7 +51,9 @@ myStealWSDeque_ (WSDeque *q, uint32_t n) if ((long)b - (long)t <= 0 ) { return NULL; /* already looks empty, abort */ } - + // NB. these loads must be ordered so writes from pushWSDeque + // will be seen. + load_load_barrier(); /* now access array, see pushBottom() */ stolen = q->elements[t & q->moduloSize]; From git at git.haskell.org Mon Feb 25 12:38:20 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 12:38:20 +0000 (UTC) Subject: [commit: nofib] master: Build nofib-analyse with cabal v2-build (807930f) Message-ID: <20190225123820.4CAE63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/807930f1cf47b5c1b6e9e39e7dd7f5f8b9de0567/nofib >--------------------------------------------------------------- commit 807930f1cf47b5c1b6e9e39e7dd7f5f8b9de0567 Author: Oleg Grenrus Date: Mon Feb 18 15:03:21 2019 +0200 Build nofib-analyse with cabal v2-build >--------------------------------------------------------------- 807930f1cf47b5c1b6e9e39e7dd7f5f8b9de0567 .gitignore | 2 ++ README.md | 28 +++++++++++++++------------- mk/target.mk | 1 - nofib-analyse/Makefile | 6 +++--- nofib-analyse/cabal.project | 2 ++ nofib-analyse/nofib-analyse.cabal | 17 +++++++++++++++++ 6 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 80345db..d884c44 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ cachegrind.out.* cachegrind.out.summary perf.data perf.data.* +dist-newstyle/ +.ghc.environment.* # Specific generated files nofib-analyse/nofib-analyse diff --git a/README.md b/README.md index 6e610a6..005db88 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,6 @@ pick `$(which ghc)` or whatever the `HC` environment variable is set to. Additional information can also be found on [NoFib's wiki page](https://ghc.haskell.org/trac/ghc/wiki/Building/RunningNoFib). -## Package Depedencies - -Please make sure you have the following packages installed for your -system GHC: - * html - * regex-compat (will install: mtl, regex-base, regex-posix) - ## Using
@@ -34,11 +27,7 @@ system GHC: `git clone -c core.symlinks=true `.
-Install the [package dependencies](#package-dependencies): - -``` -$ cabal install html regex-compat -``` +Install [`cabal-install-2.4`](https://www.haskell.org/cabal/download.html) or later. Then, to run the tests, execute: @@ -61,7 +50,7 @@ $ make EXTRA_HC_OPTS="-fllvm" ``` To compare the results of multiple runs, save the output in a logfile -and use the program in `../utils/nofib-analyse`, for example: +and use the program in `./nofib-analyse/nofib-analyse`, for example: ``` ... @@ -115,6 +104,19 @@ This is the default of its `-i` option, which is of course incompatible with `mode=fast`. In that case, you should just set `-i` as appropriate, even deactivate it with `-i 0`. +## Boot vs. benchmarked GHC + +The `nofib-analyse` utility is compiled with `BOOT_HC` compiler, +which may be different then the GHC under the benchmark. + +You can control which GHC you benchmark with `HC` variable + +``` +$ make clean +$ make boot HC=ghc-head +$ make HC=ghc-head 2>&1 | tee nofib-log-ghc-head +``` + ## Configuration There are some options you might want to tweak; search for nofib in diff --git a/mk/target.mk b/mk/target.mk index a8c92a2..3239feb 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -37,7 +37,6 @@ STDIN_FILE = $(wildcard $(NOFIB_PROG).stdin) endif endif - # Bogosity needed here to cope with .exe suffix for strip & size files. # (shouldn't have to be our problem.) ifneq "$(HC_FAIL)" "YES" diff --git a/nofib-analyse/Makefile b/nofib-analyse/Makefile index 0e9236b..229f804 100644 --- a/nofib-analyse/Makefile +++ b/nofib-analyse/Makefile @@ -4,7 +4,8 @@ include $(TOP)/mk/boilerplate.mk PROG = nofib-analyse $(PROG): *.hs - $(BOOT_HC) -O -cpp --make Main -o $(PROG) + cabal v2-build -w $(BOOT_HC) + cp $$(cabal v2-exec -w $(BOOT_HC) -- which $(PROG)) $(PROG) all :: $(PROG) @@ -16,8 +17,7 @@ boot :: $(PROG) .PHONY: mostlyclean clean distclean maintainer-clean mostlyclean:: - rm -f CmdLine.hi GenUtils.hi Main.hi Slurp.hi - rm -f CmdLine.o GenUtils.o Main.o Slurp.o + rm -rf dist-newstyle clean:: mostlyclean rm -f $(PROG) diff --git a/nofib-analyse/cabal.project b/nofib-analyse/cabal.project new file mode 100644 index 0000000..229326e --- /dev/null +++ b/nofib-analyse/cabal.project @@ -0,0 +1,2 @@ +-- project file for "boot" utilities +packages: . diff --git a/nofib-analyse/nofib-analyse.cabal b/nofib-analyse/nofib-analyse.cabal new file mode 100644 index 0000000..371b0a3 --- /dev/null +++ b/nofib-analyse/nofib-analyse.cabal @@ -0,0 +1,17 @@ +cabal-version: 2.4 +name: nofib-analyse +version: 0 + +executable nofib-analyse + default-language: Haskell2010 + main-is: Main.hs + other-modules: + CmdLine + GenUtils + Slurp + + build-depends: + , array + , base + , containers + , regex-compat From git at git.haskell.org Mon Feb 25 12:38:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 12:38:22 +0000 (UTC) Subject: [commit: nofib] master: Check versions in CI (8947fb2) Message-ID: <20190225123822.533463A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8947fb20d3802766c5cf36198731f49e5b6962d5/nofib >--------------------------------------------------------------- commit 8947fb20d3802766c5cf36198731f49e5b6962d5 Author: Oleg Grenrus Date: Mon Feb 18 15:21:34 2019 +0200 Check versions in CI >--------------------------------------------------------------- 8947fb20d3802766c5cf36198731f49e5b6962d5 .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b6c308..ec8ed5b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,11 +3,11 @@ validate: before_script: - git clean -xdf - sudo apt install -y time + - ghc --version + - cabal --version script: - make clean - - | - cabal update - cabal install regex-compat html + - cabal update - make boot mode=fast - "make mode=fast NoFibRuns=1 2>&1 | tee log" - "nofib-analyse/nofib-analyse log" From git at git.haskell.org Mon Feb 25 12:38:24 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 12:38:24 +0000 (UTC) Subject: [commit: nofib] master: Update .gitlab-ci.yml (7815bbb) Message-ID: <20190225123824.5BD773A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7815bbba91ade7bf3e1dd27006ea0becd97e19e2/nofib >--------------------------------------------------------------- commit 7815bbba91ade7bf3e1dd27006ea0becd97e19e2 Author: Oleg Grenrus Date: Mon Feb 25 10:33:56 2019 +0200 Update .gitlab-ci.yml >--------------------------------------------------------------- 7815bbba91ade7bf3e1dd27006ea0becd97e19e2 .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec8ed5b..ce8559e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,8 @@ +variables: + DOCKER_REV: 6d19c3adc1f5c28c82aed8c5b1ac40931ac60f3f + validate: - image: ghcci/x86_64-linux-deb9:0.2 + image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" before_script: - git clean -xdf - sudo apt install -y time From git at git.haskell.org Mon Feb 25 12:38:26 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 12:38:26 +0000 (UTC) Subject: [commit: nofib] master: mostyclean dist and .ghc.environment (291463e) Message-ID: <20190225123826.6400B3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/291463e56831c064cc97eabfebafc6a093e01ffd/nofib >--------------------------------------------------------------- commit 291463e56831c064cc97eabfebafc6a093e01ffd Author: Oleg Grenrus Date: Mon Feb 25 11:03:58 2019 +0200 mostyclean dist and .ghc.environment >--------------------------------------------------------------- 291463e56831c064cc97eabfebafc6a093e01ffd nofib-analyse/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nofib-analyse/Makefile b/nofib-analyse/Makefile index 229f804..3b0a3d4 100644 --- a/nofib-analyse/Makefile +++ b/nofib-analyse/Makefile @@ -17,7 +17,7 @@ boot :: $(PROG) .PHONY: mostlyclean clean distclean maintainer-clean mostlyclean:: - rm -rf dist-newstyle + rm -rf dist-newstyle dist .ghc.environment.* clean:: mostlyclean rm -f $(PROG) From git at git.haskell.org Mon Feb 25 12:38:28 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 12:38:28 +0000 (UTC) Subject: [commit: nofib] master: Move DOCKER_REV to commit in master (0675e13) Message-ID: <20190225123828.6BA823A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0675e131ba07a7807b2f4dc83d0b3a0d4448b4ed/nofib >--------------------------------------------------------------- commit 0675e131ba07a7807b2f4dc83d0b3a0d4448b4ed Author: Oleg Grenrus Date: Mon Feb 25 14:26:17 2019 +0200 Move DOCKER_REV to commit in master >--------------------------------------------------------------- 0675e131ba07a7807b2f4dc83d0b3a0d4448b4ed .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce8559e..ceec9a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - DOCKER_REV: 6d19c3adc1f5c28c82aed8c5b1ac40931ac60f3f + DOCKER_REV: 2b69e99de97bd5bf1fbdbf45852231c3dcb602b6 validate: image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" From git at git.haskell.org Mon Feb 25 22:05:31 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:31 +0000 (UTC) Subject: [commit: ghc] branch 'wip/trac-16201' created Message-ID: <20190225220531.1BF003A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/trac-16201 Referencing: f320f3b2f2f421af41b8f7588529ed46bbe6ccf3 From git at git.haskell.org Mon Feb 25 22:05:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:33 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hadrian-ghc-in-ghci' created Message-ID: <20190225220533.1BAF43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hadrian-ghc-in-ghci Referencing: 72aaf1fa5bf2ec98e119d0f03c25d3920e7833a0 From git at git.haskell.org Mon Feb 25 22:05:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:35 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16342' created Message-ID: <20190225220535.1CBD33A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16342 Referencing: 5911aa63d739d435007028300cf613fe1f4673d9 From git at git.haskell.org Mon Feb 25 22:05:38 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:38 +0000 (UTC) Subject: [commit: ghc] wip/T16342, wip/hadrian-ghc-in-ghci, wip/trac-16201: base: Allow fusion for zip7 and related (9059343) Message-ID: <20190225220538.3683E3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16342,wip/hadrian-ghc-in-ghci,wip/trac-16201 Link : http://ghc.haskell.org/trac/ghc/changeset/9059343e8d1fc94ac62145688d6fdd70a791eaf1/ghc >--------------------------------------------------------------- commit 9059343e8d1fc94ac62145688d6fdd70a791eaf1 Author: Alexandre Date: Thu Feb 21 08:19:43 2019 +0000 base: Allow fusion for zip7 and related Fixes #14037. Metric Decrease: T9872b T9872d Reviewers: bgamari, simonpj, hvr Reviewed By: simonpj Subscribers: AndreasK, simonpj, osa1, dfeuer, rwbarton, carter GHC Trac Issues: #14037 Differential Revision: https://phabricator.haskell.org/D5249 >--------------------------------------------------------------- 9059343e8d1fc94ac62145688d6fdd70a791eaf1 compiler/utils/MonadUtils.hs | 110 +++++++++++++++++++++++++++------------- libraries/base/Control/Monad.hs | 2 + libraries/base/Data/OldList.hs | 28 ++++++++++ libraries/base/GHC/List.hs | 4 ++ 4 files changed, 109 insertions(+), 35 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 9059343e8d1fc94ac62145688d6fdd70a791eaf1 From git at git.haskell.org Mon Feb 25 22:05:41 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:41 +0000 (UTC) Subject: [commit: ghc] wip/T16342, wip/hadrian-ghc-in-ghci, wip/trac-16201: Disable fragile test cases: T14697 T5559 T3424 (14586f5) Message-ID: <20190225220541.424413A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branches: wip/T16342,wip/hadrian-ghc-in-ghci,wip/trac-16201 Link : http://ghc.haskell.org/trac/ghc/changeset/14586f5d737ec5dc828633267b50dcf0d47e1696/ghc >--------------------------------------------------------------- commit 14586f5d737ec5dc828633267b50dcf0d47e1696 Author: Vladislav Zavialov Date: Sun Feb 24 01:03:35 2019 +0300 Disable fragile test cases: T14697 T5559 T3424 See Trac #15072, Trac #16349, Trac #16350 >--------------------------------------------------------------- 14586f5d737ec5dc828633267b50dcf0d47e1696 testsuite/tests/perf/compiler/all.T | 7 +++++-- testsuite/tests/profiling/should_run/all.T | 4 +++- testsuite/tests/rts/all.T | 10 +++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 82847c2..c6548c1 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -355,8 +355,11 @@ test('T13719', test('T14697', [ collect_compiler_stats('bytes allocated',10), - # This generates too large of a command-line for poor Windows - when(opsys('mingw32'), expect_broken(15072)), + # This generates too large of a command-line for poor Windows and + # Darwin. The failure is non-deterministic, so we 'skip' it rather than + # 'expect_broken'. The solution is to teach the testsuite driver to + # invoke GHC with a response file, see Trac #15072 + when(opsys('mingw32') or opsys('darwin'), skip), pre_cmd('./genT14697'), extra_files(['genT14697']), extra_hc_opts('$(cat T14697-flags)'), # 10k -optP arguments diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 8baddcb..9b6018c 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -87,7 +87,9 @@ test('prof-doc-fib', [], compile_and_run, ['']) test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness']) # unicode in cost centre names -test('T5559', [], compile_and_run, ['']) +test('T5559', + [ skip # Skip due to non-deterministic failures on CI, see Trac #16350 + ], compile_and_run, ['']) # Note [consistent stacks] # Certain optimisations can change the stacks we get out of the diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 43c0764..6808e7e 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -106,9 +106,13 @@ test('atomicinc', [ c_src, only_ways(['normal','threaded1', 'threaded2']) ], com test('atomicxchg', [ c_src, only_ways(['threaded1', 'threaded2']) ], compile_and_run, ['']) -test('T3424', # it's slow: - [ when(fast(), skip), only_ways(['normal','threaded1','ghci']) ], - compile_and_run, ['']) +test('T3424', + [ # Skip due to non-deterministic timeouts on CI, see Trac #16349 + when(unregisterised(), skip), + # And it's slow in general + only_ways(['normal','threaded1','ghci']) + ], + compile_and_run, ['']) # Test for out-of-range heap size test('rtsflags001', [ only_ways(['normal']), exit_code(1), extra_run_opts('+RTS -H0m -RTS') ], compile_and_run, ['']) From git at git.haskell.org Mon Feb 25 22:05:44 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:44 +0000 (UTC) Subject: [commit: ghc] wip/T16342: Be more careful about tyvar naming for TyClDecls (5911aa6) Message-ID: <20190225220544.6953A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16342 Link : http://ghc.haskell.org/trac/ghc/changeset/5911aa63d739d435007028300cf613fe1f4673d9/ghc >--------------------------------------------------------------- commit 5911aa63d739d435007028300cf613fe1f4673d9 Author: Simon Peyton Jones Date: Mon Feb 25 08:31:33 2019 +0000 Be more careful about tyvar naming for TyClDecls This is work in progress on Trac #16221 and #16342 >--------------------------------------------------------------- 5911aa63d739d435007028300cf613fe1f4673d9 compiler/deSugar/DsMeta.hs | 4 +- compiler/hsSyn/HsTypes.hs | 13 ++- compiler/rename/RnSource.hs | 5 +- compiler/typecheck/TcHsSyn.hs | 57 ++++++++--- compiler/typecheck/TcHsType.hs | 89 ++++++++-------- compiler/typecheck/TcMType.hs | 202 ++++++++++++++++++++----------------- compiler/typecheck/TcSigs.hs | 4 +- compiler/typecheck/TcTyClsDecls.hs | 130 +++++++++++++----------- compiler/types/TyCon.hs | 19 ++-- 9 files changed, 290 insertions(+), 233 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 5911aa63d739d435007028300cf613fe1f4673d9 From git at git.haskell.org Mon Feb 25 22:05:47 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:47 +0000 (UTC) Subject: [commit: ghc] wip/trac-16201: Fix the ghci063 test on Darwin (Trac #16201) (f320f3b) Message-ID: <20190225220547.72D1D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/trac-16201 Link : http://ghc.haskell.org/trac/ghc/changeset/f320f3b2f2f421af41b8f7588529ed46bbe6ccf3/ghc >--------------------------------------------------------------- commit f320f3b2f2f421af41b8f7588529ed46bbe6ccf3 Author: Vladislav Zavialov Date: Mon Feb 25 01:23:42 2019 +0300 Fix the ghci063 test on Darwin (Trac #16201) We use "touch -r" to set modification timestamps, which leads to precision loss on Darwin. For example, before: 2019-02-25 01:11:23.807627350 +0300 after: 2019-02-25 01:11:23.807627000 +0300 ^^^ This means we can't trick GHCi into thinking the file hasn't been changed by restoring its old timestamp, as we cannot faithfully restore all digits. The solution is to nullify the insignificant digits before the first :load >--------------------------------------------------------------- f320f3b2f2f421af41b8f7588529ed46bbe6ccf3 testsuite/tests/ghci/scripts/all.T | 2 +- testsuite/tests/ghci/scripts/ghci063.script | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 575d9eb..946c6ef 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -104,7 +104,7 @@ test('ghci061', normal, ghci_script, ['ghci061.script']) test('ghci062', [extra_files(['ghci062/', 'ghci062/Test.hs']), when(config.have_ext_interp, extra_ways(['ghci-ext']))], ghci_script, ['ghci062.script']) -test('ghci063', when(opsys('darwin'), expect_broken(16201)), ghci_script, ['ghci063.script']) +test('ghci063', normal, ghci_script, ['ghci063.script']) test('T2452', [extra_hc_opts("-fno-implicit-import-qualified")], ghci_script, ['T2452.script']) diff --git a/testsuite/tests/ghci/scripts/ghci063.script b/testsuite/tests/ghci/scripts/ghci063.script index 87a19ba..377f659 100644 --- a/testsuite/tests/ghci/scripts/ghci063.script +++ b/testsuite/tests/ghci/scripts/ghci063.script @@ -1,6 +1,18 @@ :! echo module A where {} >A.hs :! echo module B where { import A } >B.hs +-- Workaround for Trac #16201. We use "touch -r" to set modification +-- timestamps, which leads to precision loss on Darwin. For example, +-- +-- before: 2019-02-25 01:11:23.807627350 +0300 +-- after: 2019-02-25 01:11:23.807627000 +0300 +-- ^^^ +-- This means we can't trick GHCi into thinking the file hasn't been changed +-- by restoring its old timestamp, as we cannot faithfully restore all digits. +-- +-- The solution is to nullify the insignificant digits before the first load. +:! touch -r B.hs B.hs + :load B -- We're going to replace B.hs with an invalid module but without From git at git.haskell.org Mon Feb 25 22:05:50 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Feb 2019 22:05:50 +0000 (UTC) Subject: [commit: ghc] wip/hadrian-ghc-in-ghci: WIP Ghc-in-ghci/IDE support target (72aaf1f) Message-ID: <20190225220550.78ACA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hadrian-ghc-in-ghci Link : http://ghc.haskell.org/trac/ghc/changeset/72aaf1fa5bf2ec98e119d0f03c25d3920e7833a0/ghc >--------------------------------------------------------------- commit 72aaf1fa5bf2ec98e119d0f03c25d3920e7833a0 Author: Matthew Pickering Date: Mon Feb 25 18:14:22 2019 +0000 WIP Ghc-in-ghci/IDE support target >--------------------------------------------------------------- 72aaf1fa5bf2ec98e119d0f03c25d3920e7833a0 compiler/utils/Encoding.hs | 1 - compiler/utils/FastMutInt.hs | 1 - hadrian/build.cabal.sh | 4 ++-- hadrian/src/Builder.hs | 6 +++++- hadrian/src/Main.hs | 1 + hadrian/src/Rules.hs | 24 +++++++++++++++++++++++- hadrian/src/Settings/Builders/Ghc.hs | 6 +++++- hadrian/src/Settings/Warnings.hs | 2 +- 8 files changed, 37 insertions(+), 8 deletions(-) diff --git a/compiler/utils/Encoding.hs b/compiler/utils/Encoding.hs index b4af686..4d269d6 100644 --- a/compiler/utils/Encoding.hs +++ b/compiler/utils/Encoding.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} -{-# OPTIONS_GHC -O2 #-} -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected diff --git a/compiler/utils/FastMutInt.hs b/compiler/utils/FastMutInt.hs index 20206f8..27d228d 100644 --- a/compiler/utils/FastMutInt.hs +++ b/compiler/utils/FastMutInt.hs @@ -1,5 +1,4 @@ {-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} -{-# OPTIONS_GHC -O2 #-} -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected -- diff --git a/hadrian/build.cabal.sh b/hadrian/build.cabal.sh index 13ef927..b28f727 100755 --- a/hadrian/build.cabal.sh +++ b/hadrian/build.cabal.sh @@ -23,9 +23,9 @@ CABVER=( ${CABVERSTR//./ } ) if [ "${CABVER[0]}" -gt 2 -o "${CABVER[0]}" -eq 2 -a "${CABVER[1]}" -ge 2 ]; then - "$CABAL" --project-file="$PROJ" new-build $CABFLAGS -j exe:hadrian + "$CABAL" --project-file="$PROJ" new-build $CABFLAGS -v0 -j exe:hadrian # use new-exec instead of new-run to make sure that the build-tools (alex & happy) are in PATH - "$CABAL" --project-file="$PROJ" new-exec $CABFLAGS hadrian -- \ + "$CABAL" --project-file="$PROJ" new-exec $CABFLAGS -v0 hadrian -- \ --directory "$PWD" \ "$@" else diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs index 02edb19..50d36ab 100644 --- a/hadrian/src/Builder.hs +++ b/hadrian/src/Builder.hs @@ -45,7 +45,11 @@ instance NFData CcMode -- * Compile a C source file. -- * Extract source dependencies by passing @-M@ command line argument. -- * Link object files & static libraries into an executable. -data GhcMode = CompileHs | CompileCWithGhc | FindHsDependencies | LinkHs +data GhcMode = CompileHs + | CompileCWithGhc + | FindHsDependencies + | LinkHs + | GhcInGhci deriving (Eq, Generic, Show) instance Binary GhcMode diff --git a/hadrian/src/Main.hs b/hadrian/src/Main.hs index 083e683..ef16806 100644 --- a/hadrian/src/Main.hs +++ b/hadrian/src/Main.hs @@ -50,6 +50,7 @@ main = do Rules.SourceDist.sourceDistRules Rules.Test.testRules Rules.topLevelTargets + Rules.dumpArgsTarget shakeArgsWith options CommandLine.optDescrs $ \_ targets -> do Environment.setupEnvironment diff --git a/hadrian/src/Rules.hs b/hadrian/src/Rules.hs index c5be5a7..3e62584 100644 --- a/hadrian/src/Rules.hs +++ b/hadrian/src/Rules.hs @@ -1,4 +1,5 @@ -module Rules (buildRules, oracleRules, packageTargets, topLevelTargets) where +module Rules (buildRules, oracleRules, packageTargets, topLevelTargets + , dumpArgsTarget ) where import qualified Hadrian.Oracles.ArgsHash import qualified Hadrian.Oracles.Cabal.Rules @@ -26,6 +27,27 @@ import Target import UserSettings import Utilities + +dumpArgsTarget :: Rules () +dumpArgsTarget = do + "dump-args" ~> do + root <- buildRoot + let fake_target = target (vanillaContext Stage0 compiler) + (Ghc GhcInGhci Stage0) [] ["ignored"] + + -- need the autogenerated files so that they are precompiled + let dir = buildDir (vanillaContext Stage0 compiler) + generatedGhcDependencies Stage0 >>= need + interpret fake_target Rules.Generate.compilerDependencies >>= need + need [ root dir -/- "Config.hs" ] + need [ root dir -/- "Fingerprint.hs" ] + need [ root dir -/- "Parser.hs" ] + need [ root dir -/- "Lexer.hs" ] + need [ root dir -/- "CmmParse.hs" ] + need [ root dir -/- "CmmLex.hs" ] + arg_list <- interpret fake_target getArgs + liftIO $ putStrLn (intercalate " " arg_list) + allStages :: [Stage] allStages = [minBound .. maxBound] diff --git a/hadrian/src/Settings/Builders/Ghc.hs b/hadrian/src/Settings/Builders/Ghc.hs index 4bc10e5..ea5cebc 100644 --- a/hadrian/src/Settings/Builders/Ghc.hs +++ b/hadrian/src/Settings/Builders/Ghc.hs @@ -11,7 +11,11 @@ import qualified Context as Context import Rules.Libffi (libffiName) ghcBuilderArgs :: Args -ghcBuilderArgs = mconcat [compileAndLinkHs, compileC, findHsDependencies] +ghcBuilderArgs = mconcat [compileAndLinkHs, compileC, findHsDependencies, ghcInGhciArgs] + +ghcInGhciArgs :: Args +ghcInGhciArgs = builder (Ghc GhcInGhci) ? mconcat [commonGhcArgs, arg "-fno-worker-wrapper" + , arg "-O0" ] compileAndLinkHs :: Args compileAndLinkHs = (builder (Ghc CompileHs) ||^ builder (Ghc LinkHs)) ? do diff --git a/hadrian/src/Settings/Warnings.hs b/hadrian/src/Settings/Warnings.hs index 42e7662..393856d 100644 --- a/hadrian/src/Settings/Warnings.hs +++ b/hadrian/src/Settings/Warnings.hs @@ -23,7 +23,7 @@ ghcWarningsArgs = do isIntegerSimple <- (== integerSimple) <$> getIntegerPackage mconcat [ stage0 ? mconcat - [ libraryPackage ? pure [ "-fno-warn-deprecated-flags" ] + [ libraryPackage ? pure [ "-fno-warn-deprecated-flags -O0" ] , package terminfo ? pure [ "-fno-warn-unused-imports" ] , package transformers ? pure [ "-fno-warn-unused-matches" , "-fno-warn-unused-imports" ] ] From git at git.haskell.org Tue Feb 26 16:29:14 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Feb 2019 16:29:14 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T16208' created Message-ID: <20190226162914.428C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T16208 Referencing: 7cc5844bfc3d5b1460f441ca48c5a7d2f5945be7 From git at git.haskell.org Tue Feb 26 16:29:18 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Feb 2019 16:29:18 +0000 (UTC) Subject: [commit: ghc] wip/T16208: Fix map/coerce rule for newtypes with wrappers (7cc5844) Message-ID: <20190226162918.72FD83A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16208 Link : http://ghc.haskell.org/trac/ghc/changeset/7cc5844bfc3d5b1460f441ca48c5a7d2f5945be7/ghc >--------------------------------------------------------------- commit 7cc5844bfc3d5b1460f441ca48c5a7d2f5945be7 Author: Krzysztof Gogolewski Date: Tue Feb 26 17:22:28 2019 +0100 Fix map/coerce rule for newtypes with wrappers This addresses Trac #16208 by marking newtype wrapper unfoldings as compulsory. Furthermore, we can remove the special case for newtypes in exprIsConApp_maybe (introduced in 7833cf407d1f). >--------------------------------------------------------------- 7cc5844bfc3d5b1460f441ca48c5a7d2f5945be7 compiler/basicTypes/MkId.hs | 25 +++++++++++++++- compiler/coreSyn/CoreOpt.hs | 35 +++++----------------- compiler/coreSyn/CoreUtils.hs | 1 - testsuite/tests/simplCore/should_run/T16208.hs | 17 +++++++++++ testsuite/tests/simplCore/should_run/T16208.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 6 files changed, 51 insertions(+), 29 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 7cc5844bfc3d5b1460f441ca48c5a7d2f5945be7 From git at git.haskell.org Wed Feb 27 01:13:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:33 +0000 (UTC) Subject: [commit: ghc] branch 'wip/dont-leak-libffi' created Message-ID: <20190227011333.AC62D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/dont-leak-libffi Referencing: 05e6129ea31ea3e57bdfe4573bf769f257241f2b From git at git.haskell.org Wed Feb 27 01:13:35 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:35 +0000 (UTC) Subject: [commit: ghc] branch 'wip/fix-i386' created Message-ID: <20190227011335.AC36F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/fix-i386 Referencing: 2c44ce5486b48a160e73e4d6882bfaa75a993b4c From git at git.haskell.org Wed Feb 27 01:13:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:37 +0000 (UTC) Subject: [commit: ghc] branch 'wip/test-t3424' created Message-ID: <20190227011337.AD7DE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/test-t3424 Referencing: 4dbacba5d2831bc80c48f3986e59b1a1c91cc620 From git at git.haskell.org Wed Feb 27 01:13:39 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:39 +0000 (UTC) Subject: [commit: ghc] branch 'wip/hie002-stabilize' created Message-ID: <20190227011339.AE8803A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/hie002-stabilize Referencing: 1aa0fc97715ba1dd0234c3b7eb1bf3a676546955 From git at git.haskell.org Wed Feb 27 01:13:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:42 +0000 (UTC) Subject: [commit: ghc] wip/T16342: Wibbles in response to Richard (c8ecee55) Message-ID: <20190227011342.CBF6A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T16342 Link : http://ghc.haskell.org/trac/ghc/changeset/c8ecee5587d234f777e9d2d72211d0e972604504/ghc >--------------------------------------------------------------- commit c8ecee5587d234f777e9d2d72211d0e972604504 Author: Simon Peyton Jones Date: Tue Feb 26 13:19:39 2019 +0000 Wibbles in response to Richard >--------------------------------------------------------------- c8ecee5587d234f777e9d2d72211d0e972604504 compiler/typecheck/TcHsSyn.hs | 12 +++--- compiler/typecheck/TcHsType.hs | 14 +++++-- compiler/typecheck/TcMType.hs | 64 ++++++++++++++--------------- compiler/typecheck/TcTyClsDecls.hs | 83 +++++++++++++++++++++++++++++++++----- compiler/types/TyCon.hs | 41 ++++++++++++------- 5 files changed, 148 insertions(+), 66 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 c8ecee5587d234f777e9d2d72211d0e972604504 From git at git.haskell.org Wed Feb 27 01:13:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:45 +0000 (UTC) Subject: [commit: ghc] wip/hie002-stabilize: Fix intermittent hie002 failure (1aa0fc9) Message-ID: <20190227011345.DA9973A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/hie002-stabilize Link : http://ghc.haskell.org/trac/ghc/changeset/1aa0fc97715ba1dd0234c3b7eb1bf3a676546955/ghc >--------------------------------------------------------------- commit 1aa0fc97715ba1dd0234c3b7eb1bf3a676546955 Author: Vladislav Zavialov Date: Tue Feb 26 16:54:07 2019 +0300 Fix intermittent hie002 failure hie002 is a performance test that used to fail unpredictably: max_bytes_used Decrease from x86_64-linux-deb9-debug baseline @ HEAD~2: Expected hie002 (normal) max_bytes_used: 1190923992.0 +/-20% Lower bound hie002 (normal) max_bytes_used: 952739193 Upper bound hie002 (normal) max_bytes_used: 1429108791 Actual hie002 (normal) max_bytes_used: 726270784 Deviation hie002 (normal) max_bytes_used: -39.0 % peak_megabytes_allocated Decrease from x86_64-linux-deb9-debug baseline @ HEAD~2: Expected hie002 (normal) peak_megabytes_allocated: 2538.0 +/-20% Lower bound hie002 (normal) peak_megabytes_allocated: 2030 Upper bound hie002 (normal) peak_megabytes_allocated: 3046 Actual hie002 (normal) peak_megabytes_allocated: 1587 Deviation hie002 (normal) peak_megabytes_allocated: -37.5 % *** unexpected stat test failure for hie002(normal) 'max_bytes_used' and 'peak_megabytes_allocated' are too unstable without careful control of the runtime configuration. We fix this by using a more predictable metric, 'bytes allocated'. >--------------------------------------------------------------- 1aa0fc97715ba1dd0234c3b7eb1bf3a676546955 testsuite/tests/hiefile/should_compile/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/hiefile/should_compile/all.T b/testsuite/tests/hiefile/should_compile/all.T index 9770bae..fb8092d 100644 --- a/testsuite/tests/hiefile/should_compile/all.T +++ b/testsuite/tests/hiefile/should_compile/all.T @@ -1,5 +1,6 @@ test('hie001', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) -test('hie002', collect_compiler_stats(), compile, ['-fno-code -fwrite-ide-info']) +test('hie002', collect_compiler_stats('bytes allocated',10), + compile, ['-fno-code -fwrite-ide-info']) test('hie003', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie004', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie005', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) From git at git.haskell.org Wed Feb 27 01:13:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:48 +0000 (UTC) Subject: [commit: ghc] wip/dont-leak-libffi: Don't shadow libffi tarballs with boot libffi installation (05e6129) Message-ID: <20190227011348.E888F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/dont-leak-libffi Link : http://ghc.haskell.org/trac/ghc/changeset/05e6129ea31ea3e57bdfe4573bf769f257241f2b/ghc >--------------------------------------------------------------- commit 05e6129ea31ea3e57bdfe4573bf769f257241f2b Author: Sebastian Graf Date: Tue Feb 26 18:17:25 2019 +0100 Don't shadow libffi tarballs with boot libffi installation In Trac #16368, I realised that `ghc-cabal` picked up the libffi installation from the boot GHC and inserted it into include and library paths of stage 1 libraries. That's rectified by this commit. Fixes Trac #16368. >--------------------------------------------------------------- 05e6129ea31ea3e57bdfe4573bf769f257241f2b utils/ghc-cabal/Main.hs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs index 8b77649..f4a2313 100644 --- a/utils/ghc-cabal/Main.hs +++ b/utils/ghc-cabal/Main.hs @@ -338,14 +338,22 @@ generate directory distdir config_args [(_,[rts])] -> PackageIndex.insert rts{ Installed.ldOptions = [], - Installed.libraryDirs = filter (not . ("gcc-lib" `isSuffixOf`)) (Installed.libraryDirs rts)} index - -- GHC <= 6.12 had $topdir/gcc-lib in their - -- library-dirs for the rts package, which causes - -- problems when we try to use the in-tree mingw, - -- due to accidentally picking up the incompatible - -- libraries there. So we filter out gcc-lib from - -- the RTS's library-dirs here. + Installed.libraryDirs = filter_dirs (Installed.libraryDirs rts), + Installed.includeDirs = filter_dirs (Installed.includeDirs rts) + } index _ -> error "No (or multiple) ghc rts package is registered!!" + filter_dirs = filter (\dir -> not (or [is_gcc_lib dir, is_libffi dir])) + -- GHC <= 6.12 had $topdir/gcc-lib in their + -- library-dirs for the rts package, which causes + -- problems when we try to use the in-tree mingw, + -- due to accidentally picking up the incompatible + -- libraries there. So we filter out gcc-lib from + -- the RTS's library-dirs here. + is_gcc_lib = ("gcc-lib" `isSuffixOf`) + -- In Trac #16368, we noticed that libffi paths + -- from the boot GHC shadow the local libffi tarballs + -- in a similar manner. + is_libffi = ("libffi" `isInfixOf`) dep_ids = map snd (externalPackageDeps lbi) deps = map display dep_ids From git at git.haskell.org Wed Feb 27 01:13:52 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:52 +0000 (UTC) Subject: [commit: ghc] wip/test-t3424: Skip T3424 when fast() (4dbacba) Message-ID: <20190227011352.014413A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/test-t3424 Link : http://ghc.haskell.org/trac/ghc/changeset/4dbacba5d2831bc80c48f3986e59b1a1c91cc620/ghc >--------------------------------------------------------------- commit 4dbacba5d2831bc80c48f3986e59b1a1c91cc620 Author: Vladislav Zavialov Date: Tue Feb 26 08:32:48 2019 +0300 Skip T3424 when fast() 14586f5d removed this by accident. >--------------------------------------------------------------- 4dbacba5d2831bc80c48f3986e59b1a1c91cc620 testsuite/tests/rts/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 6808e7e..ac0fbff 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -110,6 +110,7 @@ test('T3424', [ # Skip due to non-deterministic timeouts on CI, see Trac #16349 when(unregisterised(), skip), # And it's slow in general + when(fast(), skip), only_ways(['normal','threaded1','ghci']) ], compile_and_run, ['']) From git at git.haskell.org Wed Feb 27 01:13:55 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:55 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386: testsuite: Use fragile modifier for more tests (2c44ce5) Message-ID: <20190227011355.100073A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/2c44ce5486b48a160e73e4d6882bfaa75a993b4c/ghc >--------------------------------------------------------------- commit 2c44ce5486b48a160e73e4d6882bfaa75a993b4c Author: Ben Gamari Date: Tue Feb 26 10:24:31 2019 -0500 testsuite: Use fragile modifier for more tests >--------------------------------------------------------------- 2c44ce5486b48a160e73e4d6882bfaa75a993b4c testsuite/tests/concurrent/should_run/all.T | 5 ++--- testsuite/tests/ffi/should_run/all.T | 6 ++---- testsuite/tests/ghci/linking/all.T | 6 ++---- testsuite/tests/ghci/should_run/all.T | 2 +- testsuite/tests/profiling/should_run/all.T | 7 ++----- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index 5ba0657..f5f399e 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -75,7 +75,7 @@ test('T5558', test('T5421', normal, compile_and_run, ['']) # See #12751, the test fails non-deterministically so we skip it. -test('T5611', when ( opsys('darwin'), skip) , compile_and_run, ['']) +test('T5611', when ( opsys('darwin'), fragile(12751)) , compile_and_run, ['']) test('T5238', normal, compile_and_run, ['']) test('T5866', exit_code(1), compile_and_run, ['']) @@ -196,8 +196,7 @@ test('conc036', skip, compile_and_run, ['']) # Interrupting foreign calls only makes sense if we are threaded test('foreignInterruptible', [when(fast(), skip), when(opsys('mingw32'),expect_fail), - # Fragile in unregisterised way; see #15467. - when(unregisterised(), skip), + when(unregisterised(), fragile(15467)), # I don't think we support interrupting Sleep() # on Windows. --SDM only_threaded_ways, diff --git a/testsuite/tests/ffi/should_run/all.T b/testsuite/tests/ffi/should_run/all.T index e9ea975..96ab506 100644 --- a/testsuite/tests/ffi/should_run/all.T +++ b/testsuite/tests/ffi/should_run/all.T @@ -87,8 +87,7 @@ test('ffi018', [omit_ways(['ghci'])], compile_and_run, ['ffi018_c.c']) test('ffi018_ghci', [extra_files(['ffi018.h']), only_ways(['ghci']), - # This test is fragile when unregisterised; see #16085 - when(unregisterised(), skip), + when(unregisterised(), fragile(16085)), pre_cmd('$MAKE -s --no-print-directory ffi018_ghci_setup')], compile_and_run, ['ffi018_ghci_c.o']) @@ -100,8 +99,7 @@ test('T1679', normal, compile_and_run, ['']) test('T1288', [omit_ways(['ghci'])], compile_and_run, ['T1288_c.c']) test('T1288_ghci', [only_ways(['ghci']), - # This test is fragile when unregisterised; see #16085 - when(unregisterised(), skip), + when(unregisterised(), fragile(16085)), pre_cmd('$MAKE -s --no-print-directory T1288_ghci_setup')], compile_and_run, ['T1288_ghci_c.o']) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 792e91b..88ada22 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -6,8 +6,7 @@ test('ghcilink001', makefile_test, ['ghcilink001']) test('ghcilink002', [extra_files(['TestLink.hs', 'f.c']), - # Fragile when unregisterised; see #16085 - when(unregisterised(), skip), + when(unregisterised(), fragile(16085)), unless(doing_ghci, skip)], makefile_test, ['ghcilink002']) @@ -21,8 +20,7 @@ test('ghcilink004', test('ghcilink005', [extra_files(['TestLink.hs', 'f.c']), - # Fragile when unregisterised; see #16085 - when(unregisterised(), skip), + when(unregisterised(), fragile(16085)), unless(doing_ghci, skip)], makefile_test, ['ghcilink005']) diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T index 5440019..84693d7 100644 --- a/testsuite/tests/ghci/should_run/all.T +++ b/testsuite/tests/ghci/should_run/all.T @@ -11,7 +11,7 @@ test('T2881', just_ghci, compile_and_run, ['']) test('T3171', [when(opsys('mingw32'),skip), - skip, # This test is quite flaky (#15383) + fragile(15383), req_interp, combined_output], makefile_test, []) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 044d4fe..f6891c3 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -87,9 +87,7 @@ test('prof-doc-fib', [], compile_and_run, ['']) test('prof-doc-last', [], compile_and_run, ['-fno-full-laziness']) # unicode in cost centre names -test('T5559', - [ skip # Skip due to non-deterministic failures on CI, see Trac #16350 - ], compile_and_run, ['']) +test('T5559', fragile(16350), compile_and_run, ['']) # Note [consistent stacks] # Certain optimisations can change the stacks we get out of the @@ -150,6 +148,5 @@ test('T14257', [], makefile_test, ['T14257']) test('T15897', [extra_ways(['profasm']), only_ways(['profasm']), run_timeout_multiplier(2), - # Takes too long and is quite fragile (#15467, #16193) - skip], + fragile(15467)], makefile_test, ['T15897']) From git at git.haskell.org Wed Feb 27 01:13:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:13:58 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386: gitlab-ci: Don't allow i386-deb9 to fail (5c32b98) Message-ID: <20190227011358.18CCE3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/5c32b980d4912ead1171befea5ae30d3fbc1e42f/ghc >--------------------------------------------------------------- commit 5c32b980d4912ead1171befea5ae30d3fbc1e42f Author: Ben Gamari Date: Tue Feb 26 10:14:15 2019 -0500 gitlab-ci: Don't allow i386-deb9 to fail Also account for testsuite metric drift. Metric Decrease: haddock.Cabal >--------------------------------------------------------------- 5c32b980d4912ead1171befea5ae30d3fbc1e42f .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 217b297..5abe977 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -207,7 +207,6 @@ validate-i386-linux-deb9: extends: .validate-linux stage: full-build image: ghcci/i386-linux-deb9:0.1 - allow_failure: true variables: TEST_ENV: "i386-linux-deb9" artifacts: From git at git.haskell.org Wed Feb 27 01:14:01 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:14:01 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386: testsuite: Mark heapprof001 as fragile on i386 (a988c89) Message-ID: <20190227011401.2B2B93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/a988c89c5d69013b1db2fbff3eef20968cd5e672/ghc >--------------------------------------------------------------- commit a988c89c5d69013b1db2fbff3eef20968cd5e672 Author: Ben Gamari Date: Tue Feb 26 10:14:02 2019 -0500 testsuite: Mark heapprof001 as fragile on i386 >--------------------------------------------------------------- a988c89c5d69013b1db2fbff3eef20968cd5e672 testsuite/tests/profiling/should_run/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 9b6018c..044d4fe 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -23,7 +23,7 @@ expect_broken_for_10037 = expect_broken_for( test('heapprof001', [when(have_profiling(), extra_ways(extra_prof_ways)), - when(arch('i386'), expect_broken_for(15382, ['prof_hc_hb'])), + when(arch('i386'), fragile(15382)), extra_run_opts('7')], compile_and_run, ['']) From git at git.haskell.org Wed Feb 27 01:14:04 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Feb 2019 01:14:04 +0000 (UTC) Subject: [commit: ghc] wip/fix-i386: testsuite: Introduce fragile modifier (2a8bd85) Message-ID: <20190227011404.471C53A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/fix-i386 Link : http://ghc.haskell.org/trac/ghc/changeset/2a8bd85974941fbff951ab43564fe787a0c6019e/ghc >--------------------------------------------------------------- commit 2a8bd85974941fbff951ab43564fe787a0c6019e Author: Ben Gamari Date: Tue Feb 26 10:13:44 2019 -0500 testsuite: Introduce fragile modifier Now since we have been a bit more stringent in testsuite cleanliness we have been marking a lot of tests as fragile using the `skip` modifier. However, this unfortunately means that we lose the association with the ticket number documenting the fragility. Here we introduce `fragile` and `fragile_for` to retain this information. >--------------------------------------------------------------- 2a8bd85974941fbff951ab43564fe787a0c6019e testsuite/driver/testlib.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index edd43fb..acf4b4e 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -247,6 +247,30 @@ def _expect_pass(way): # ----- +def fragile( bug ): + """ + Indicates that the test should be skipped due to fragility documented in + the given ticket. + """ + def helper( name, opts, bug ): + record_broken(name, opts, bug) + opts.skip = True + + return helper + +def fragile_for( name, opts, bug, ways ): + """ + Indicates that the test should be skipped due to fragility in the given + test ways as documented in the given ticket. + """ + def helper( name, opts, bug, ways ): + record_broken(name, opts, bug) + opts.omit_ways = ways + + return helper + +# ----- + def omit_ways( ways ): return lambda name, opts, w=ways: _omit_ways( name, opts, w ) From git at git.haskell.org Thu Feb 28 02:14:11 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:11 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ghc-8.8-az' created Message-ID: <20190228021411.6A5C03A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ghc-8.8-az Referencing: 3ad6d4f5623c8ddc86e71bd6c1ae31710fd9e14a From git at git.haskell.org Thu Feb 28 02:14:13 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:13 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ppc-reg-alloc' created Message-ID: <20190228021413.698E63A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ppc-reg-alloc Referencing: 9758dcadac31f9c9a0b4e84acaaabdc8c99fcdf1 From git at git.haskell.org Thu Feb 28 02:14:16 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:16 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: template-haskell: Document assembler foreign file support (1808e0d) Message-ID: <20190228021416.7D3423A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/1808e0d8e29c45ddecce2664359c3c389cd6800d/ghc >--------------------------------------------------------------- commit 1808e0d8e29c45ddecce2664359c3c389cd6800d Author: Ben Gamari Date: Wed Feb 20 14:38:05 2019 -0500 template-haskell: Document assembler foreign file support See #16180. >--------------------------------------------------------------- 1808e0d8e29c45ddecce2664359c3c389cd6800d docs/users_guide/8.8.1-notes.rst | 2 ++ libraries/template-haskell/changelog.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst index cd4c00d..2cdd1c8 100644 --- a/docs/users_guide/8.8.1-notes.rst +++ b/docs/users_guide/8.8.1-notes.rst @@ -132,6 +132,8 @@ Template Haskell - Template Haskell now supports implicit parameters and recursive do. +- Template Haskell splices can now embed assembler source (:ghc-ticket:`16180`) + ``ghc-prim`` library ~~~~~~~~~~~~~~~~~~~~ diff --git a/libraries/template-haskell/changelog.md b/libraries/template-haskell/changelog.md index b144434..b79b87e 100644 --- a/libraries/template-haskell/changelog.md +++ b/libraries/template-haskell/changelog.md @@ -20,6 +20,8 @@ * Add `Lift` instances for `NonEmpty` and `Void` + * `addForeignFilePath` now support assembler sources (#16180). + ## 2.14.0.0 *TBA* * Introduce an `addForeignFilePath` function, as well as a corresponding From git at git.haskell.org Thu Feb 28 02:14:19 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:19 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: Properly escape character literals in Haddocks (78af4a3) Message-ID: <20190228021419.9109A3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/78af4a329e8d368e2aa0b7ba44990876ae257c09/ghc >--------------------------------------------------------------- commit 78af4a329e8d368e2aa0b7ba44990876ae257c09 Author: Alec Theriault Date: Wed Feb 13 08:43:35 2019 -0500 Properly escape character literals in Haddocks Character literals in Haddock should not be written as plain `'\n'` since single quotes are for linking identifiers. Besides, since we want the character literal to be monospaced, we really should use `@\'\\n\'@`. [skip ci] >--------------------------------------------------------------- 78af4a329e8d368e2aa0b7ba44990876ae257c09 compiler/basicTypes/Literal.hs | 2 +- compiler/utils/StringBuffer.hs | 8 ++++---- libraries/base/GHC/IO/Device.hs | 2 +- libraries/base/GHC/IO/Encoding.hs | 2 +- libraries/base/GHC/IO/Handle/Types.hs | 12 ++++++------ libraries/base/GHC/ResponseFile.hs | 2 +- libraries/base/System/IO.hs | 10 +++++----- 7 files changed, 19 insertions(+), 19 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 78af4a329e8d368e2aa0b7ba44990876ae257c09 From git at git.haskell.org Thu Feb 28 02:14:22 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:22 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: Revert "Lexer: Alternate Layout Rule injects actual not virtual braces" (ca5b476) Message-ID: <20190228021422.A68323A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/ca5b476083e4b361720135dcb159980b1bca82de/ghc >--------------------------------------------------------------- commit ca5b476083e4b361720135dcb159980b1bca82de Author: Ben Gamari Date: Tue Feb 26 12:57:57 2019 -0500 Revert "Lexer: Alternate Layout Rule injects actual not virtual braces" This reverts commit e0375ba980fd5639d23a29575efb00c30d97c743. >--------------------------------------------------------------- ca5b476083e4b361720135dcb159980b1bca82de compiler/parser/Lexer.x | 32 +++++++++++------------ libraries/Cabal | 2 +- libraries/transformers | 2 +- testsuite/tests/ghc-api/annotations/Makefile | 20 -------------- testsuite/tests/ghc-api/annotations/T16279.stdout | 30 --------------------- testsuite/tests/ghc-api/annotations/Test16279.hs | 10 ------- testsuite/tests/ghc-api/annotations/all.T | 2 -- utils/haddock | 2 +- utils/hsc2hs | 2 +- 9 files changed, 19 insertions(+), 83 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 ca5b476083e4b361720135dcb159980b1bca82de From git at git.haskell.org Thu Feb 28 02:14:27 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:27 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: Lexer: Alternate Layout Rule injects actual not virtual braces (f6abc30) Message-ID: <20190228021427.09C213A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/f6abc30dbac109f514e469ddfdffc7d2e3c95811/ghc >--------------------------------------------------------------- commit f6abc30dbac109f514e469ddfdffc7d2e3c95811 Author: Alan Zimmerman Date: Sun Feb 3 10:27:42 2019 +0200 Lexer: Alternate Layout Rule injects actual not virtual braces When the alternate layout rule is activated via a pragma, it injects tokens for { and } to make sure that the source is parsed properly. But it injects ITocurly and ITccurly, rather than their virtual counterparts ITvocurly and ITvccurly. This causes problems for ghc-exactprint, which tries to print these. Likewise, any injected ITsemi should have a zero-width SrcSpan. Test case (the existing T13087.hs) {-# LANGUAGE AlternativeLayoutRule #-} {-# LANGUAGE LambdaCase #-} isOne :: Int -> Bool isOne = \case 1 -> True _ -> False main = return () Closes #16279 (cherry picked from commit c1cf2693d6efddeeeb813cd8995a1be136800d17) (cherry picked from commit e0375ba980fd5639d23a29575efb00c30d97c743) >--------------------------------------------------------------- f6abc30dbac109f514e469ddfdffc7d2e3c95811 compiler/parser/Lexer.x | 32 ++++++++++++---------- testsuite/tests/ghc-api/annotations/Makefile | 20 ++++++++++++++ testsuite/tests/ghc-api/annotations/T16279.stdout | 30 ++++++++++++++++++++ .../T13087.hs => ghc-api/annotations/Test16279.hs} | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 2 ++ 5 files changed, 71 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f6abc30dbac109f514e469ddfdffc7d2e3c95811 From git at git.haskell.org Thu Feb 28 02:14:30 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:30 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: Bump Cabal submodule (b85a5f1) Message-ID: <20190228021430.15DDA3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/b85a5f174a8b6c459bfb859d23c41ad2f29d78f8/ghc >--------------------------------------------------------------- commit b85a5f174a8b6c459bfb859d23c41ad2f29d78f8 Author: Ben Gamari Date: Tue Feb 26 13:05:26 2019 -0500 Bump Cabal submodule >--------------------------------------------------------------- b85a5f174a8b6c459bfb859d23c41ad2f29d78f8 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index 98fcb3a..27fc0fe 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 98fcb3a964a4deef67920020a4a02d4d8552cc19 +Subproject commit 27fc0fe9608ba502ef62647629a6d4ebe01fa33d From git at git.haskell.org Thu Feb 28 02:14:33 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:33 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: Bump hsc2hs for removed unused match (cfce6c4) Message-ID: <20190228021433.2A5653A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/cfce6c4dd12a55a8beeb1626da0e2c917925ba03/ghc >--------------------------------------------------------------- commit cfce6c4dd12a55a8beeb1626da0e2c917925ba03 Author: Sebastian Graf Date: Fri Feb 1 12:43:27 2019 +0100 Bump hsc2hs for removed unused match >--------------------------------------------------------------- cfce6c4dd12a55a8beeb1626da0e2c917925ba03 utils/hsc2hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hsc2hs b/utils/hsc2hs index fac8b62..efb556c 160000 --- a/utils/hsc2hs +++ b/utils/hsc2hs @@ -1 +1 @@ -Subproject commit fac8b62e48f4c99cfe8f3efff63c8fcd94b2a1d6 +Subproject commit efb556cc2689cae42abadae87d778ae20fbc0a14 From git at git.haskell.org Thu Feb 28 02:14:37 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:37 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: check-api-annotations checks for annotation preceding its span (6a2e19b) Message-ID: <20190228021437.6B2443A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/6a2e19bc5e89d69bfaa16499007b874976f9b614/ghc >--------------------------------------------------------------- commit 6a2e19bc5e89d69bfaa16499007b874976f9b614 Author: Alan Zimmerman Date: Tue Jan 22 23:29:25 2019 +0200 check-api-annotations checks for annotation preceding its span For an API annotation to be useful, it must not occur before the span it is enclosed in. So, for check-api-annotation output, a line such as ((Test16212.hs:3:22-36,AnnOpenP), [Test16212.hs:3:21]), should be flagged as an error, as the AnnOpenP location of 3:21 precedes its enclosing span of 3:22-26. This patch does this. Closes #16217 (cherry picked from commit 3cf12e6081e7a9f0c3d515de52ffd079186816a5) >--------------------------------------------------------------- 6a2e19bc5e89d69bfaa16499007b874976f9b614 testsuite/tests/ghc-api/annotations/Makefile | 12 ------ testsuite/tests/ghc-api/annotations/T10255.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10268.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10269.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10276.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10278.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10280.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10307.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10309.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10312.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10354.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10357.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10358.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10396.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10399.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T10598.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T11018.stdout | 8 +++- testsuite/tests/ghc-api/annotations/T11321.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T11332.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T12417.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T13163.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T15303.stdout | 7 +++- testsuite/tests/ghc-api/annotations/T16212.stdout | 49 ++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/Test16212.hs | 11 +++++ testsuite/tests/ghc-api/annotations/all.T | 6 ++- .../tests/ghc-api/annotations/boolFormula.stdout | 7 +++- .../tests/ghc-api/annotations/bundle-export.stdout | 7 +++- .../tests/ghc-api/annotations/exampleTest.stdout | 7 +++- .../tests/ghc-api/annotations/load-main.stdout | 7 +++- utils/check-api-annotations/Main.hs | 22 +++++++--- 30 files changed, 233 insertions(+), 43 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6a2e19bc5e89d69bfaa16499007b874976f9b614 From git at git.haskell.org Thu Feb 28 02:14:42 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:42 +0000 (UTC) Subject: [commit: ghc] wip/ppc-reg-alloc: Treat kind/type variables identically, demolish FKTV (5bc195b) Message-ID: <20190228021442.25FD43A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ppc-reg-alloc Link : http://ghc.haskell.org/trac/ghc/changeset/5bc195b1fe788e9a900a15fbe473967850517c3e/ghc >--------------------------------------------------------------- commit 5bc195b1fe788e9a900a15fbe473967850517c3e Author: Vladislav Zavialov Date: Wed Feb 13 17:15:49 2019 +0300 Treat kind/type variables identically, demolish FKTV Implements GHC Proposal #24: .../ghc-proposals/blob/master/proposals/0024-no-kind-vars.rst Fixes Trac #16334, Trac #16315 With this patch, scoping rules for type and kind variables have been unified: kind variables no longer receieve special treatment. This simplifies both the language and the implementation. User-facing changes ------------------- * Kind variables are no longer implicitly quantified when an explicit forall is used: p :: Proxy (a :: k) -- still accepted p :: forall k a. Proxy (a :: k) -- still accepted p :: forall a. Proxy (a :: k) -- no longer accepted In other words, now we adhere to the "forall-or-nothing" rule more strictly. Related function: RnTypes.rnImplicitBndrs * The -Wimplicit-kind-vars warning has been deprecated. * Kind variables are no longer implicitly quantified in constructor declarations: data T a = T1 (S (a :: k) | forall (b::k). T2 (S b) -- no longer accepted data T (a :: k) = T1 (S (a :: k) | forall (b::k). T2 (S b) -- still accepted Related function: RnTypes.extractRdrKindSigVars * Implicitly quantified kind variables are no longer put in front of other variables: f :: Proxy (a :: k) -> Proxy (b :: j) f :: forall k j (a :: k) (b :: j). Proxy a -> Proxy b -- old order f :: forall k (a :: k) j (b :: j). Proxy a -> Proxy b -- new order This is a breaking change for users of TypeApplications. Note that we still respect the dpendency order: 'k' before 'a', 'j' before 'b'. See "Ordering of specified variables" in the User's Guide. Related function: RnTypes.rnImplicitBndrs * In type synonyms and type family equations, free variables on the RHS are no longer implicitly quantified unless used in an outermost kind annotation: type T = Just (Nothing :: Maybe a) -- no longer accepted type T = Just Nothing :: Maybe (Maybe a) -- still accepted The latter form is a workaround due to temporary lack of an explicit quantification method. Ideally, we would write something along these lines: type T @a = Just (Nothing :: Maybe a) Related function: RnTypes.extractHsTyRdrTyVarsKindVars * Named wildcards in kinds are fixed (Trac #16334): x :: (Int :: _t) -- this compiles, infers (_t ~ Type) Related function: RnTypes.partition_nwcs Implementation notes -------------------- * One of the key changes is the removal of FKTV in RnTypes: - data FreeKiTyVars = FKTV { fktv_kis :: [Located RdrName] - , fktv_tys :: [Located RdrName] } + type FreeKiTyVars = [Located RdrName] We used to keep track of type and kind variables separately, but now that they are on equal footing when it comes to scoping, we can put them in the same list. * extract_lty and family are no longer parametrized by TypeOrKind, as we now do not distinguish kind variables from type variables. * PatSynExPE and the related Note [Pattern synonym existentials do not scope] have been removed (Trac #16315). With no implicit kind quantification, we can no longer trigger the error. * reportFloatingKvs and the related Note [Free-floating kind vars] have been removed. With no implicit kind quantification, we can no longer trigger the error. >--------------------------------------------------------------- 5bc195b1fe788e9a900a15fbe473967850517c3e compiler/main/DynFlags.hs | 4 +- compiler/rename/RnSource.hs | 16 +- compiler/rename/RnTypes.hs | 480 +++++++++------------ compiler/typecheck/TcHsType.hs | 116 ----- compiler/typecheck/TcPatSyn.hs | 51 --- compiler/typecheck/TcRnTypes.hs | 5 - compiler/typecheck/TcSplice.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 13 +- docs/users_guide/8.10.1-notes.rst | 28 ++ docs/users_guide/glasgow_exts.rst | 112 +++-- docs/users_guide/using-warnings.rst | 53 --- testsuite/tests/codeGen/should_fail/T13233.hs | 4 +- .../tests/dependent/should_compile/T15264.stderr | 10 - testsuite/tests/dependent/should_compile/all.T | 1 - .../tests/dependent/should_fail/BadTelescope2.hs | 2 +- .../dependent/should_fail/BadTelescope2.stderr | 6 +- .../{should_compile => should_fail}/T15264.hs | 1 - .../tests/dependent/should_fail/T15264.stderr | 6 + testsuite/tests/dependent/should_fail/T15825.hs | 4 +- .../tests/dependent/should_fail/T15825.stderr | 2 +- testsuite/tests/dependent/should_fail/all.T | 1 + testsuite/tests/ghci/scripts/T7873.stderr | 8 +- testsuite/tests/ghci/scripts/T9293.stdout | 4 - testsuite/tests/ghci/scripts/ghci024.stdout | 1 - testsuite/tests/ghci/scripts/ghci057.stdout | 4 - .../should_compile/ExplicitForAllFams1.hs | 2 +- .../parser/should_compile/DumpRenamedAst.stderr | 4 +- .../partial-sigs/should_compile/T15039a.stderr | 2 +- .../partial-sigs/should_compile/T15039b.stderr | 2 +- .../partial-sigs/should_compile/T15039c.stderr | 2 +- .../partial-sigs/should_compile/T15039d.stderr | 2 +- .../tests/partial-sigs/should_compile/T16334.hs | 6 + .../partial-sigs/should_compile/T16334.stderr | 4 + testsuite/tests/partial-sigs/should_compile/all.T | 1 + .../{should_fail => should_compile}/T14498.hs | 4 +- testsuite/tests/patsyn/should_compile/all.T | 1 + testsuite/tests/patsyn/should_fail/T14507.hs | 2 +- testsuite/tests/patsyn/should_fail/all.T | 1 - testsuite/tests/polykinds/BadKindVar.hs | 2 +- testsuite/tests/polykinds/BadKindVar.stderr | 2 +- testsuite/tests/polykinds/KindVarOrder.script | 9 + testsuite/tests/polykinds/KindVarOrder.stdout | 5 + testsuite/tests/polykinds/T10503.hs | 2 +- testsuite/tests/polykinds/T10503.stderr | 6 +- testsuite/tests/polykinds/T13985.stderr | 28 +- testsuite/tests/polykinds/T14561.hs | 2 +- testsuite/tests/polykinds/T14563.hs | 2 +- testsuite/tests/polykinds/T14846.stderr | 12 +- testsuite/tests/polykinds/T14887a.hs | 8 +- testsuite/tests/polykinds/T8616.hs | 4 +- testsuite/tests/polykinds/T8616.stderr | 2 +- testsuite/tests/polykinds/T9144.hs | 2 +- testsuite/tests/polykinds/all.T | 1 + testsuite/tests/typecheck/should_compile/T13343.hs | 2 +- testsuite/tests/typecheck/should_fail/T12973.hs | 2 +- .../tests/typecheck/should_fail/T13983.stderr | 8 +- testsuite/tests/typecheck/should_fail/T15629.hs | 2 +- .../tests/typecheck/should_fail/T15629.stderr | 10 +- testsuite/tests/typecheck/should_fail/T15797.hs | 2 +- 59 files changed, 399 insertions(+), 681 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 5bc195b1fe788e9a900a15fbe473967850517c3e From git at git.haskell.org Thu Feb 28 02:14:45 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:45 +0000 (UTC) Subject: [commit: ghc] wip/ppc-reg-alloc: RTS: Add missing memory barrier (5c084e0) Message-ID: <20190228021445.328123A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ppc-reg-alloc Link : http://ghc.haskell.org/trac/ghc/changeset/5c084e0468be46f5ab48b2c1669a7e4d4d0f3c43/ghc >--------------------------------------------------------------- commit 5c084e0468be46f5ab48b2c1669a7e4d4d0f3c43 Author: Peter Trommler Date: Sun Feb 24 17:11:00 2019 +0100 RTS: Add missing memory barrier In the work stealing queue a load-load-barrier is required to ensure that a read of queue data cannot be reordered before a read of the bottom pointer into the queue. The added load-load-barrier ensures that the ordering of writes enforced at the end of `pushWSDeque` is also respected in the order of reads in `stealWSDeque_`. In other words, when reading `q->bottom` we want to make sure that we see the updates to `q->elements`. Fixes #13633 >--------------------------------------------------------------- 5c084e0468be46f5ab48b2c1669a7e4d4d0f3c43 rts/WSDeque.c | 9 ++++++--- testsuite/tests/rts/testwsdeque.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rts/WSDeque.c b/rts/WSDeque.c index b9393b1..60b8948 100644 --- a/rts/WSDeque.c +++ b/rts/WSDeque.c @@ -194,14 +194,17 @@ stealWSDeque_ (WSDeque *q) // concurrent popWSQueue() operation. if ((long)b - (long)t <= 0 ) { return NULL; /* already looks empty, abort */ - } - + } + // NB. the load of q->bottom must be ordered before the load of + // q->elements[t & q-> moduloSize]. See comment "KG:..." below + // and Ticket #13633. + load_load_barrier(); /* now access array, see pushBottom() */ stolen = q->elements[t & q->moduloSize]; /* now decide whether we have won */ if ( !(CASTOP(&(q->top),t,t+1)) ) { - /* lost the race, someon else has changed top in the meantime */ + /* lost the race, someone else has changed top in the meantime */ return NULL; } /* else: OK, top has been incremented by the cas call */ diff --git a/testsuite/tests/rts/testwsdeque.c b/testsuite/tests/rts/testwsdeque.c index 3f17f32..0a2a64d 100644 --- a/testsuite/tests/rts/testwsdeque.c +++ b/testsuite/tests/rts/testwsdeque.c @@ -50,14 +50,17 @@ myStealWSDeque_ (WSDeque *q, uint32_t n) // concurrent popWSQueue() operation. if ((long)b - (long)t <= 0 ) { return NULL; /* already looks empty, abort */ - } - + } + // NB. the load of q->bottom must be ordered before the load of + // q->elements[t & q-> moduloSize]. See comment "KG:..." below + // and Ticket #13633. + load_load_barrier(); /* now access array, see pushBottom() */ stolen = q->elements[t & q->moduloSize]; /* now decide whether we have won */ if ( !(CASTOP(&(q->top),t,t+1)) ) { - /* lost the race, someon else has changed top in the meantime */ + /* lost the race, someone else has changed top in the meantime */ return NULL; } /* else: OK, top has been incremented by the cas call */ From git at git.haskell.org Thu Feb 28 02:14:48 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:48 +0000 (UTC) Subject: [commit: ghc] wip/ppc-reg-alloc: Fix intermittent hie002 failure (2e8f664) Message-ID: <20190228021448.433093A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ppc-reg-alloc Link : http://ghc.haskell.org/trac/ghc/changeset/2e8f664957dc3763dc4375894b8dc4d046d2e95b/ghc >--------------------------------------------------------------- commit 2e8f664957dc3763dc4375894b8dc4d046d2e95b Author: Vladislav Zavialov Date: Tue Feb 26 16:54:07 2019 +0300 Fix intermittent hie002 failure hie002 is a performance test that used to fail unpredictably: max_bytes_used Decrease from x86_64-linux-deb9-debug baseline @ HEAD~2: Expected hie002 (normal) max_bytes_used: 1190923992.0 +/-20% Lower bound hie002 (normal) max_bytes_used: 952739193 Upper bound hie002 (normal) max_bytes_used: 1429108791 Actual hie002 (normal) max_bytes_used: 726270784 Deviation hie002 (normal) max_bytes_used: -39.0 % peak_megabytes_allocated Decrease from x86_64-linux-deb9-debug baseline @ HEAD~2: Expected hie002 (normal) peak_megabytes_allocated: 2538.0 +/-20% Lower bound hie002 (normal) peak_megabytes_allocated: 2030 Upper bound hie002 (normal) peak_megabytes_allocated: 3046 Actual hie002 (normal) peak_megabytes_allocated: 1587 Deviation hie002 (normal) peak_megabytes_allocated: -37.5 % *** unexpected stat test failure for hie002(normal) 'max_bytes_used' and 'peak_megabytes_allocated' are too unstable without careful control of the runtime configuration. We fix this by using a more predictable metric, 'bytes allocated'. >--------------------------------------------------------------- 2e8f664957dc3763dc4375894b8dc4d046d2e95b testsuite/tests/hiefile/should_compile/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/hiefile/should_compile/all.T b/testsuite/tests/hiefile/should_compile/all.T index 9770bae..fb8092d 100644 --- a/testsuite/tests/hiefile/should_compile/all.T +++ b/testsuite/tests/hiefile/should_compile/all.T @@ -1,5 +1,6 @@ test('hie001', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) -test('hie002', collect_compiler_stats(), compile, ['-fno-code -fwrite-ide-info']) +test('hie002', collect_compiler_stats('bytes allocated',10), + compile, ['-fno-code -fwrite-ide-info']) test('hie003', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie004', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) test('hie005', normal, compile, ['-fno-code -fwrite-ide-info -fvalidate-ide-info']) From git at git.haskell.org Thu Feb 28 02:14:51 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:51 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: API Annotations: Parens not attached correctly for ClassDecl (09785b9) Message-ID: <20190228021451.5BD3D3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/09785b9e318e084e51213ae1a7dd023620814d99/ghc >--------------------------------------------------------------- commit 09785b9e318e084e51213ae1a7dd023620814d99 Author: Alan Zimmerman Date: Thu Jan 24 10:14:55 2019 +0200 API Annotations: Parens not attached correctly for ClassDecl The parens around the kinded tyvars should be attached to the class declaration as a whole, they are attached to the tyvar instead, outside the span. An annotation must always be within or after the span it is contained in. Closes #16212 (cherry picked from commit 4bf35da4fccd2a21153a1c19bfa80006e99e02a1) >--------------------------------------------------------------- 09785b9e318e084e51213ae1a7dd023620814d99 compiler/parser/RdrHsSyn.hs | 41 ++++++++++++----------- testsuite/tests/ghc-api/annotations/T11018.stdout | 11 +++--- testsuite/tests/ghc-api/annotations/T16212.stdout | 35 ++++++++++++++----- testsuite/tests/ghc-api/annotations/Test16212.hs | 2 ++ testsuite/tests/ghc-api/annotations/all.T | 6 ++-- 5 files changed, 57 insertions(+), 38 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 09785b9e318e084e51213ae1a7dd023620814d99 From git at git.haskell.org Thu Feb 28 02:14:54 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:54 +0000 (UTC) Subject: [commit: ghc] wip/ppc-reg-alloc: PPC NCG: Use liveness information in CmmCall (9758dca) Message-ID: <20190228021454.758FC3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ppc-reg-alloc Link : http://ghc.haskell.org/trac/ghc/changeset/9758dcadac31f9c9a0b4e84acaaabdc8c99fcdf1/ghc >--------------------------------------------------------------- commit 9758dcadac31f9c9a0b4e84acaaabdc8c99fcdf1 Author: Peter Trommler Date: Tue Dec 11 16:43:49 2018 +0100 PPC NCG: Use liveness information in CmmCall We make liveness information for global registers available on `JMP` and `BCTR`, which were the last instructions missing. With complete liveness information we do not need to reserve global registers in `freeReg` anymore and moreover assign R9 and R10 and HpLim to callee save registers. We change the calling convention so R1 to R10 occupy a contiguous range of registers. Cleanup by removing `Reg_Su`, which was unused, from `freeReg` and removing unused register definitions. The calculation of the number of floating point registers is too conservative. Just follow X86 and specify the constants directly. Overall this results in 0.3 % smaller code size in nofib while runtime is sligtly better in some tests. >--------------------------------------------------------------- 9758dcadac31f9c9a0b4e84acaaabdc8c99fcdf1 compiler/nativeGen/PPC/CodeGen.hs | 40 +++++++++++++--------- compiler/nativeGen/PPC/Instr.hs | 35 +++++++++++-------- compiler/nativeGen/PPC/Ppr.hs | 4 +-- compiler/nativeGen/PPC/Regs.hs | 12 +++---- includes/CodeGen.Platform.hs | 72 --------------------------------------- includes/stg/MachRegs.h | 13 ++++--- 6 files changed, 57 insertions(+), 119 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 9758dcadac31f9c9a0b4e84acaaabdc8c99fcdf1 From git at git.haskell.org Thu Feb 28 02:14:58 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:14:58 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: API Annotations: more explicit foralls fixup (a853099) Message-ID: <20190228021458.1428F3A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/a853099a4ec40cbbbdb88250fb4d0b0a399bcb61/ghc >--------------------------------------------------------------- commit a853099a4ec40cbbbdb88250fb4d0b0a399bcb61 Author: Alan Zimmerman Date: Thu Jan 24 23:22:59 2019 +0200 API Annotations: more explicit foralls fixup The AnnForall annotations introduced via Phab:D4894 are not always attached to the correct SourceSpan. Closes #16230 (cherry picked from commit be15f7457b98fa0378de7e8146c122757f03c4e9) >--------------------------------------------------------------- a853099a4ec40cbbbdb88250fb4d0b0a399bcb61 compiler/parser/Parser.y | 43 +++++++------- compiler/parser/RdrHsSyn.hs | 6 +- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T16230.stdout | 66 ++++++++++++++++++++++ .../hie010.hs => ghc-api/annotations/Test16230.hs} | 0 testsuite/tests/ghc-api/annotations/all.T | 2 + 6 files changed, 97 insertions(+), 24 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a853099a4ec40cbbbdb88250fb4d0b0a399bcb61 From git at git.haskell.org Thu Feb 28 02:15:02 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:15:02 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: API Annotations: AnnAt disconnected for TYPEAPP (91ba643) Message-ID: <20190228021502.47A763A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/91ba643c1bbdc2c10504a66674f9bd83fec5151d/ghc >--------------------------------------------------------------- commit 91ba643c1bbdc2c10504a66674f9bd83fec5151d Author: Alan Zimmerman Date: Wed Jan 30 16:20:52 2019 +0200 API Annotations: AnnAt disconnected for TYPEAPP For the code type family F1 (a :: k) (f :: k -> Type) :: Type where F1 @Peano a f = T @Peano f a the API annotation for the first @ is not attached to a SourceSpan in the ParsedSource Closes #16236 (cherry picked from commit cbfc9fcaa33c3b341830962906543dfca1dfedd7) >--------------------------------------------------------------- 91ba643c1bbdc2c10504a66674f9bd83fec5151d compiler/deSugar/DsMeta.hs | 6 +- compiler/hieFile/HieAst.hs | 4 +- compiler/hsSyn/Convert.hs | 9 ++- compiler/hsSyn/HsTypes.hs | 19 ++--- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 69 +++++++++++------- compiler/rename/RnTypes.hs | 10 +-- compiler/typecheck/TcExpr.hs | 24 +++--- compiler/typecheck/TcHsType.hs | 11 +-- testsuite/tests/ghc-api/annotations/Makefile | 4 + testsuite/tests/ghc-api/annotations/T16236.stdout | 85 ++++++++++++++++++++++ .../annotations/Test16236.hs} | 3 +- testsuite/tests/ghc-api/annotations/all.T | 2 + .../parser/should_compile/DumpParsedAst.stderr | 3 +- .../parser/should_compile/DumpRenamedAst.stderr | 3 +- utils/haddock | 2 +- 16 files changed, 183 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 91ba643c1bbdc2c10504a66674f9bd83fec5151d From git at git.haskell.org Thu Feb 28 02:15:05 2019 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Feb 2019 02:15:05 +0000 (UTC) Subject: [commit: ghc] wip/ghc-8.8-az: API Annotations: parens anns discarded for `(*)` operator (3ad6d4f) Message-ID: <20190228021505.B79D93A8E4@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ghc-8.8-az Link : http://ghc.haskell.org/trac/ghc/changeset/3ad6d4f5623c8ddc86e71bd6c1ae31710fd9e14a/ghc >--------------------------------------------------------------- commit 3ad6d4f5623c8ddc86e71bd6c1ae31710fd9e14a Author: Alan Zimmerman Date: Sat Feb 2 16:29:05 2019 +0200 API Annotations: parens anns discarded for `(*)` operator The patch from https://phabricator.haskell.org/D4865 introduces go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") ; return (cL l (Unqual name), acc, fix, ann) } which discards the parens annotations belonging to the HsParTy. Updates haddock submodule Closes #16265 (cherry picked from commit 5e9888bd9c22a1315a703f638591b50e657317c4) >--------------------------------------------------------------- 3ad6d4f5623c8ddc86e71bd6c1ae31710fd9e14a compiler/parser/RdrHsSyn.hs | 4 +-- testsuite/tests/ghc-api/annotations/Makefile | 4 +++ .../annotations/StarBinderAnns.hs} | 0 .../ghc-api/annotations/StarBinderAnns.stdout | 36 ++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/all.T | 2 ++ 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 00212c7..fba5863 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -960,10 +960,10 @@ checkTyClHdr is_cls ty goL (dL->L l ty) acc ann fix = go l ty acc ann fix -- workaround to define '*' despite StarIsType - go _ (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix + go lp (HsParTy _ (dL->L l (HsStarTy _ isUni))) acc ann fix = do { warnStarBndr l ; let name = mkOccName tcClsName (if isUni then "★" else "*") - ; return (cL l (Unqual name), acc, fix, ann) } + ; return (cL l (Unqual name), acc, fix, (ann ++ mkParensApiAnn lp)) } go l (HsTyVar _ _ (dL->L _ tc)) acc ann fix | isRdrTc tc = return (cL l tc, acc, fix, ann) diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 33eabde..37aaa8a 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -161,3 +161,7 @@ T16230: .PHONY: T16236 T16236: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test16236.hs + +.PHONY: StarBinderAnns +StarBinderAnns: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" StarBinderAnns.hs diff --git a/testsuite/tests/warnings/should_compile/StarBinder.hs b/testsuite/tests/ghc-api/annotations/StarBinderAnns.hs similarity index 100% copy from testsuite/tests/warnings/should_compile/StarBinder.hs copy to testsuite/tests/ghc-api/annotations/StarBinderAnns.hs diff --git a/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout new file mode 100644 index 0000000..d75f30a --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/StarBinderAnns.stdout @@ -0,0 +1,36 @@ +---Unattached Annotation Problems (should be empty list)--- +[] +---Ann before enclosing span problem (should be empty list)--- +[ + +] + +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((StarBinderAnns.hs:1:1,AnnModule), [StarBinderAnns.hs:4:1-6]), +((StarBinderAnns.hs:1:1,AnnWhere), [StarBinderAnns.hs:4:23-27]), +((StarBinderAnns.hs:4:10-21,AnnCloseP), [StarBinderAnns.hs:4:21]), +((StarBinderAnns.hs:4:10-21,AnnOpenP), [StarBinderAnns.hs:4:10]), +((StarBinderAnns.hs:4:11-20,AnnType), [StarBinderAnns.hs:4:11-14]), +((StarBinderAnns.hs:4:16-20,AnnCloseP), [StarBinderAnns.hs:4:20]), +((StarBinderAnns.hs:4:16-20,AnnOpenP), [StarBinderAnns.hs:4:16]), +((StarBinderAnns.hs:4:16-20,AnnVal), [StarBinderAnns.hs:4:17-19]), +((StarBinderAnns.hs:6:1-19,AnnCloseC), [StarBinderAnns.hs:6:50]), +((StarBinderAnns.hs:6:1-19,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:1-19,AnnFamily), [StarBinderAnns.hs:6:6-11]), +((StarBinderAnns.hs:6:1-19,AnnOpenC), [StarBinderAnns.hs:6:27]), +((StarBinderAnns.hs:6:1-19,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:1-19,AnnSemi), [StarBinderAnns.hs:7:1]), +((StarBinderAnns.hs:6:1-19,AnnType), [StarBinderAnns.hs:6:1-4]), +((StarBinderAnns.hs:6:1-19,AnnWhere), [StarBinderAnns.hs:6:21-25]), +((StarBinderAnns.hs:6:13-15,AnnCloseP), [StarBinderAnns.hs:6:15]), +((StarBinderAnns.hs:6:13-15,AnnOpenP), [StarBinderAnns.hs:6:13]), +((StarBinderAnns.hs:6:29-31,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-31,AnnOpenP), [StarBinderAnns.hs:6:29]), +((StarBinderAnns.hs:6:29-48,AnnCloseP), [StarBinderAnns.hs:6:31]), +((StarBinderAnns.hs:6:29-48,AnnEqual), [StarBinderAnns.hs:6:37]), +((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29]), +((,AnnEofPos), [StarBinderAnns.hs:7:1]) +] \ No newline at end of file diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index 8cad6fc..87ce66c 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -67,3 +67,5 @@ test('T16230', [extra_files(['Test16230.hs']), ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16230']) test('T16236', [extra_files(['Test16236.hs']), ignore_stderr], run_command, ['$MAKE -s --no-print-directory T16236']) +test('StarBinderAnns', [extra_files(['StarBinderAnns.hs']), + ignore_stderr], run_command, ['$MAKE -s --no-print-directory StarBinderAnns'])