summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GHCi should not filter instances involving cTuplesAlec Theriault2018-10-024-0/+17
| | | | | | | | | | | | | | | | Summary: See the new T12005 test case for an example of this. Test Plan: make TEST=T12005 Reviewers: bgamari, osa1 Reviewed By: osa1 Subscribers: osa1, rwbarton, carter GHC Trac Issues: #12005 Differential Revision: https://phabricator.haskell.org/D5182
* rts.cabal.in: add more flags to control the extra flavours (for hadrian)Alp Mestanogullari2018-10-021-16/+24
| | | | | | | | | | | | | | | | | Summary: In order to properly honor the different ways in which the RTS must be built by hadrian, and in particular to have fine grained control over that, I'm introducing new Cabal flags in rts.cabal[.in]. This should not affect the make build system and will only be used and picked up by hadrian, which uses Cabal directly to operate on cabal packages, including libHSrts. Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5166
* resolve T13704chessai2018-10-025-9/+45
| | | | | | | | | | | | | | | | | Summary: allow -main-is to change export list for default module header, allowing one to change the entry point to one's program. Test Plan: ./validate Reviewers: bgamari, nomeata, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #13704 Differential Revision: https://phabricator.haskell.org/D5189
* circleci: Create missing test-results directoryBen Gamari2018-10-021-1/+3
|
* Quantify class variables first in associated families' kindsRyan Scott2018-10-017-30/+138
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, `kcLHsQTyVars` would always quantify class-bound variables invisibly in the kinds of associated types, resulting in #15591. We counteract this by explicitly passing the class-bound variables to `kcLHsQTyVars` and quantifying over the ones that are mentioned in the associated type such that (1) they are specified, and (2) they come before other kind variables. See `Note [Kind variable ordering for associated types]`. Test Plan: make test TEST=T15591 Reviewers: goldfire, simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15591 Differential Revision: https://phabricator.haskell.org/D5159
* Fix #15637 by using VTA more in GNDRyan Scott2018-10-0110-55/+137
| | | | | | | | | | | | | | | | | | | | | | Summary: The code that GND was generating before could crumple over if it derived an instance for a class with an ambiguous type variable in the class head, such as the example in #15637. The solution is straightforward: simply instantiate all variables bound by the class head explicitly using visible type application, which will nip any ambiguity in the bud. Test Plan: make test TEST=T15637 Reviewers: bgamari, simonpj, goldfire Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15637 Differential Revision: https://phabricator.haskell.org/D5148
* circleci: Run slowtest with multiple threadsBen Gamari2018-10-011-1/+1
|
* ghc-prim: Fix typo in traceBinaryEvent# changelog entryBen Gamari2018-10-011-1/+2
|
* ghc-prim: Add missing changelog entryBen Gamari2018-10-011-0/+34
|
* primops: Fix documentation of compactAllocateBlock#Ben Gamari2018-10-011-4/+4
| | | | Pointed out by @andrewthad.
* ghc-bin.cabal.in: add a 'threaded' flag for hadrianAlp Mestanogullari2018-10-011-0/+12
| | | | | | | | | | | | | | | | | | | | | Summary: hadrian will explicitly enable this flag, but more importantly needs it as otherwise we just never end up passing -threaded to GHC when building a new GHC binary. We could quite likely unconditionally pass -threaded, as the corresponding logic for GhcThreaded in mk/config.mk.in seems to always lead to it being set to True, but we instead leave a way out for anyone in need of a GHC linked against a non-threaded runtime system in the future. Test Plan: T8242 (with a GHC built by hadrian) Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5146
* CodeGen: Teach CodeGen about aliasing of XMM/YMM/ZMM registersBen Gamari2018-10-011-32/+34
| | | | | | | | | | Reviewers: simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5186
* Always check the relocation value for x86_64Zejun Wu2018-10-011-47/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Always check that no overflow happens during relocation for x86_64. It's not safe to assume the result returned by `ocAllocateSymbolExtras` is always valid if we allocate it neither in lower 2G nor in a contiguous range with the image. There are also some minor fixes in this diff: * `off >= 0x7fffffffL` should be `>` * use of unaligned pointer is undefined behavior, use `memcpy` instead, gcc will be able to optimize it to `mov %edx, (%rax)`. Test Plan: build ghci with: ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` and play with it. ./validate Reviewers: simonmar, austin, bgamari, erikd Reviewed By: simonmar Subscribers: alpmestan, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5168
* Add -fkeep-cafsSimon Marlow2018-09-2811-1/+107
| | | | | | | | | | | | | | | | | | | | | | | | Summary: I noticed while playing around with https://github.com/fbsamples/ghc-hotswap/ that the main binary needs to have a custom main function to set `config.keep_cafs = true` when initialising the runtime. This is pretty annoying, it means an extra C file with some cryptic incantations in it, and a `-no-hs-main` flag. So I've replaced this with a link-time flag to GHC, `-fkeep-cafs` that does the same thing. Test Plan: New unit test that tests for the RTS's GC'd CAFs assertion, and also the -keep-cafs flag. Reviewers: bgamari, osa1, erikd, noamz Reviewed By: osa1 Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5183
* Expose wopt_set/unset_fatal in DynFlagsNeil Mitchell2018-09-281-1/+1
| | | | PR: https://github.com/ghc/ghc/pull/199/
* Normalise EmptyCase types using the constraint solverRyan Scott2018-09-289-43/+162
| | | | | | | | | | | | | | | | | | | | | Summary: Certain `EmptyCase` expressions were mistakently producing warnings since their types did not have as many type families reduced as they could have. The most direct way to fix this is to normalise these types initially using the constraint solver to solve for any local equalities that may be in scope. Test Plan: make test TEST=T14813 Reviewers: simonpj, bgamari, goldfire Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #14813 Differential Revision: https://phabricator.haskell.org/D5094
* Fix for recover with -fexternal-interpreter (#15418)Simon Marlow2018-09-278-22/+81
| | | | | | | | | | | | | | | | | | | | Summary: When using -fexternal-interpreter, recover was not treating a Q compuation that simply registered an error with addErrTc as failing. Test Plan: New unit tests: * T15418 is the repro from in the ticket * TH_recover_warns is a new test to ensure that we're keeping warnings when the body of recover succeeds. Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd Subscribers: rwbarton, carter GHC Trac Issues: #15418 Differential Revision: https://phabricator.haskell.org/D5185
* users' guide: document -freverse-errorsquasicomputational2018-09-271-0/+10
|
* Fix constant-folding for Integer shiftsSimon Peyton Jones2018-09-263-9/+44
| | | | | | | | | | | | | | | In this patch commit 869f69fd4a78371c221e6d9abd69a71440a4679a Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Wed Dec 11 18:19:34 2013 +0000 Guarding against silly shifts we deal with silly shifts like (Sll 1 9223372036854775807). But I only dealt with primops that Int# and Word#. Alas, the same problem affects shifts of Integer, as Trac #15673 showed. Fortunately, the problem is easy to fix.
* Fix Lint of unsaturated type familiesSimon Peyton Jones2018-09-263-24/+40
| | | | | | | | | | GHC allows types to have unsaturated type synonyms and type families, provided they /are/ saturated if you expand all type synonyms. TcValidity carefully checked this; see check_syn_tc_app. But Lint only did half the job, adn that led to Trac #15664. This patch just teaches Core Lint to be as clever as TcValidity.
* Expand the Note on let-bound skolemsSimon Peyton Jones2018-09-261-0/+25
|
* Add regression test for #15666Ryan Scott2018-09-252-0/+30
| | | | | | Commit 59f38587d44efd00b10a6d98f6a7a1b22e87f13a ended up fixing #15666. Let's add a regression test to ensure that it stays fixed.
* Don't show constraint tuples in errors (#14907)Alec Theriault2018-09-258-5/+59
| | | | | | | | | | | | | | | | | | | | | Summary: This means that 'GHC.Classes.(%,%)' is no longer mentioned in error messages for things like class (a,b,c) -- outside of 'GHC.Classes' class (a,Bool) Test Plan: make TEST=T14907a && make TEST=T14907b Reviewers: RyanGlScott, bgamari Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #14907 Differential Revision: https://phabricator.haskell.org/D5172
* aclocal.m4: fix shell comment syntax: '#', not '$'Sergei Trofimovich2018-09-251-1/+1
| | | | | | | | | | | | Summary: Reported-by: Evan Laforge Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewers: bgamari Subscribers: rwbarton, erikd, carter Differential Revision: https://phabricator.haskell.org/D5171
* Fix a MSG_BLACKHOLE sanity check, add some commentsÖmer Sinan Ağacan2018-09-242-3/+12
| | | | | | | | | | | | Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15508 Differential Revision: https://phabricator.haskell.org/D5178
* Add a recursivity check in nonVoidRyan Scott2018-09-234-53/+174
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously `nonVoid` outright refused to call itself recursively to avoid the risk of hitting infinite loops when checking recurisve types. But this is too conservative—we //can// call `nonVoid` recursively as long as we incorporate a way to detect the presence of recursive types, and bail out if we do detect one. Happily, such a mechanism already exists in the form of `checkRecTc`, so let's use it. Test Plan: make test TEST=T15584 Reviewers: simonpj, bgamari Reviewed By: simonpj Subscribers: rwbarton, carter GHC Trac Issues: #15584 Differential Revision: https://phabricator.haskell.org/D5116
* Fix get getIdFromTrivialExprSimon Peyton Jones2018-09-235-8/+53
| | | | | | | | | | | | | This bug, discovered by Trac #15325, has been lurking since commit 1c9fd3f1c5522372fcaf250c805b959e8090a62c Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu Dec 3 12:57:54 2015 +0000 Case-of-empty-alts is trivial (Trac #11155) I'd forgotttnen to modify getIdFromTrivialExpr when I modified exprIsTrivial. Easy to fix, though.
* Comments onlySimon Peyton Jones2018-09-231-1/+1
|
* Don't look up unnecessary return in LastStmtSimon Peyton Jones2018-09-235-22/+49
| | | | | | This fixes Trac #15607. The general pattern is well established (e.g. see the guard_op binding in rnStmt of BodyStme), but we weren't using it for LastStmt.
* Buglet in reporting out of scope errors in rulesSimon Peyton Jones2018-09-236-12/+31
| | | | | | | | Most out of scope errors get reported by the type checker these days, but not all. Example, the function on the LHS of a RULE. Trace #15659 pointed out that this less-heavily-used code path produce a "wacky" error message. Indeed so. Easily fixed.
* testsuite: Bump T9630 expected allocationsBen Gamari2018-09-221-1/+2
| | | | This failed on Darwin.
* testsuite: Bump expected allocations for T12707Ben Gamari2018-09-211-1/+2
|
* testsuite: Bump expected allocations of T9675Ben Gamari2018-09-211-2/+4
| | | | | | This inexplicably started with 989dca6cbd93, which appears to be a bump of the `text` submodule. This is very fishy so I've opened #15663 to ensure we investigate.
* testsuite: Fix readFail048 and readFail032 brokenness declarationsBen Gamari2018-09-211-2/+2
| | | | Whoops.
* testsuite: Mark readFail032 and readFail048 as broken on DarwinBen Gamari2018-09-211-2/+4
| | | | It looks like Clang's CPP implementation has an off-by-one error here.
* testsuite: Don't force run of llvm ways in T14251Ben Gamari2018-09-211-2/+1
| | | | This breaks if LLVM is not available.
* Remove redundant slop zeroingÖmer Sinan Ağacan2018-09-211-6/+0
| | | | OVERWRITE_INFO already does zero slopping by calling OVERWRITING_CLOSURE
* Fix slop zeroing for AP_STACK eager blackholes in debug buildÖmer Sinan Ağacan2018-09-213-29/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As #15571 reports, eager blackholing breaks sanity checks as we can't zero the payload when eagerly blackholing (because we'll be using the payload after blackholing), but by the time we blackhole a previously eagerly blackholed object (in `threadPaused()`) we don't have the correct size information for the object (because the object's type becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero the slop. This problem can be solved for AP_STACK eager blackholing (which unlike eager blackholing in general, is not optional) by zeroing the payload after entering the stack. This patch implements this idea. Fixes #15571. Test Plan: Previously concprog001 when compiled and run with sanity checks ghc-stage2 Mult.hs -debug -rtsopts ./Mult +RTS -DS was failing with Mult: internal error: checkClosure: stack frame (GHC version 8.7.20180821 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug thic patch fixes this panic. The test still panics, but it runs for a while before panicking (instead of directly panicking as before), and the new problem seems unrelated: Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296 (GHC version 8.7.20180919 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug The new problem will be fixed in another diff. I also tried slow validate (which requires D5164): this does not introduce any new failures. Reviewers: simonmar, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15571 Differential Revision: https://phabricator.haskell.org/D5165
* user-guide: Allow build with sphinx < 1.8Ben Gamari2018-09-201-2/+7
| | | | | Apparently the override argument to add_directive_to_domain was added in sphinx 1.8.
* users_guide: fix sphinx error caused by non-explicit overrideZejun Wu2018-09-201-12/+5
| | | | | | | | | | | | | | | | | | | | | Encouter following error when `make`: ``` Extension error: The 'ghc-flag' directive is already registered to domain std ``` as we register `ghc-flag` to `std` in `add_object_type` first and then overtride it in `add_directive_to_domain`. Test Plan: make -C utils/haddock/doc html SPHINX_BUILD=/usr/bin/sphinx-build Reviewers: austin, bgamari, patrickdoc Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5161
* users-guide: Fix build with sphinx 1.8Ben Gamari2018-09-201-2/+10
| | | | | | It seems that both add_object_type and add_directive_to_domain both register a directive. Previously sphinx didn't seem to mind this but as of Sphinx 1.8 it crashes with an exception.
* Revert "adds -latomic to. ghc-prim"Ben Gamari2018-09-206-38/+24
| | | | | | | This commit was never properly justified and relies on the existence of libatomic, which doesn't appear to exist on Darwin. This reverts commit ec9aacf3eb2975fd302609163aaef429962ecd87.
* Add testcase for #14251Ben Gamari2018-09-203-0/+34
|
* users guide: Fix a few issuesFrank Steffahn2018-09-202-6/+9
|
* Remove -Waggregate-return when building RTSÖmer Sinan Ağacan2018-09-201-1/+0
| | | | | | | | | | | This causes slow validate build to fail (in Profiling.c:countTickss), and there's nothing wrong with struct returns. Reviewers: simonmar, bgamari, erikd Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5164
* Use predefined known-key names when possibleChaitanya Koparkar2018-09-191-12/+13
| | | | | | | | | | | | | | | | | | Summary: For certain entities in 'PrelNames', we were creating new 'Name's instead of reusing the ones already defined. Easily fixed. Test Plan: ./validate Reviewers: dfeuer, RyanGlScott, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #13279 Differential Revision: https://phabricator.haskell.org/D5160
* docs: fix example codejohn2018-09-191-2/+2
| | | | PR: https://github.com/ghc/ghc/pull/197/
* Don't shortcut SRTs for static functions (#15544)Simon Marlow2018-09-181-22/+130
| | | | | | | | | | | | | | | | | | | | Shortcutting the SRT for a static function can lead to resurrecting a static object at runtime, which violates assumptions in the GC. See comments for details. Test Plan: - manual testing (in progress) - validate Reviewers: osa1, bgamari, erikd Reviewed By: bgamari Subscribers: rwbarton, carter GHC Trac Issues: #15544 Differential Revision: https://phabricator.haskell.org/D5145
* Bump deepseq submoduleBen Gamari2018-09-181-0/+0
| | | | (cherry picked from commit c4209ba8a448b501a11d66640d280fe1e194f847)
* Bump text submoduleBen Gamari2018-09-181-0/+0
| | | | (cherry picked from commit a512f1e32bd4d6079559e3172522591863321fe7)