summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Add -fuse-ld flag to CFLAGS during configureBen Gamari2017-07-032-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The decisions made by configure later in the script may depend upon the linker used. Consequently, it is important that configure uses the same linker as GHC will eventually use. For instance, on Nix I found that a program requiring `libpthread` would link fine with only `-lrt` when linked with BFD ld. However, with gold we needed to explicitly provide the `-lpthread` dependency. Presumably the former would happily loaded any `NEEDED` libraries whereas the latter wants them explicitly given. Regardless, since `configure`'s `NEED_PTHREAD_LIB` check didn't use the `-fuse-ld` flag that GHC would eventually use, we inferred the wrong value, resulting in link errors later in the build. Test Plan: Validate Reviewers: austin, hvr Subscribers: rwbarton, thomie, erikd GHC Trac Issues: #13541 Differential Revision: https://phabricator.haskell.org/D3694
* rts: Fix isByteArrayPinned#'s treatment of large arraysBen Gamari2017-07-033-2/+22
| | | | | | | | | | | | | | | It should respond with True to both BF_PINNED and BF_LARGE byte arrays. However, previously it would only check the BF_PINNED flag. Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: winterland1989, rwbarton, thomie GHC Trac Issues: #13894 Differential Revision: https://phabricator.haskell.org/D3685
* configure: Remove --with-curses-includes flagBen Gamari2017-07-033-10/+0
| | | | | | | | | | | terminfo no longer needs to be able to find the ncurses headers. See https://github.com/judah/terminfo/pull/22. Reviewers: austin, hvr Subscribers: rwbarton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D3688
* ApplicativeDo: document behaviour with strict patterns (#13875)Simon Marlow2017-07-035-5/+107
| | | | | | | | | | | | Test Plan: unit tests, built docs Reviewers: dfeuer, bgamari, simonpj, austin, erikd Subscribers: rwbarton, thomie GHC Trac Issues: #13875, #13242 Differential Revision: https://phabricator.haskell.org/D3691
* rts: Fix uninitialised variable usesBen Gamari2017-07-032-2/+2
| | | | | | | | | | | | | | Strangely gcc 5.4 compiling on amd64 (nixos) complained about these. Both warnings look correct, so I'm not sure why we haven't been seeing these up until now. Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3693
* Bump array submodule to v0.5.2.0Ben Gamari2017-07-031-0/+0
|
* CmmParse: Emit source notes for assignmentsBen Gamari2017-07-031-2/+2
| | | | | | | Currently the line information for bare source C-- is rather spartan. These add notes for assignments, which tend to be useful to identify. Unfortunately, we had to settle for approximate source locations as none of the parsers in CmmParse return located things. However, I don't think it's worth changing this.
* Fix -fno-code for modules that use -XQuasiQuotesDouglas Wilson2017-07-036-11/+36
| | | | | | | | | | | | | | | | | | | | | | In commit 53c78be0aab76a3107c4dacbb1d177afacdd37fa object code is generated for modules depended on by modules that use -XTemplateHaskell. This turns the same logic on for modules that use -XQuasiQuotes. A test is added. Note that I've based this of D3646, as it has a function I want to use. Test Plan: ./validate Reviewers: austin, bgamari, alexbiehl Reviewed By: alexbiehl Subscribers: alexbiehl, rwbarton, thomie GHC Trac Issues: #13863 Differential Revision: https://phabricator.haskell.org/D3677
* Fix #13311 by using tcSplitNestedSigmaTys in the right placeRyan Scott2017-07-035-6/+72
| | | | | | | | | | | | | | | | | | | Previously, we we only using `tcSplitSigmaTy` when determining if a function had been applied to too few arguments, so it wouldn't work for functions with nested `forall`s. Thankfully, this is easily fixed with a dash of `tcSplitNestedSigmaTys`. Test Plan: make test TEST=T13311 Reviewers: austin, bgamari, simonpj Reviewed By: bgamari Subscribers: goldfire, simonpj, rwbarton, thomie GHC Trac Issues: #13311 Differential Revision: https://phabricator.haskell.org/D3678
* Tag the FUN before making a PAP (#13767)Simon Marlow2017-07-031-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointers to FUNs are not guaranteed to be tagged in general, because the compiler doesn't always know the arity of a FUN when it needs to reference it, e.g. with -O0 when the function is in another module. However, there's one case where we can put the correct tag on a FUN: when it is referenced by a PAP, because when building the PAP we know the arity and we can tag the pointer correctly. The AutoApply code does this, and the sanity checker checks it, but the interpreter did not respect this invariant. This patch fixes it. Test Plan: ``` (cd ghc && make 2 GhcDebugged=YES) ./inplace/bin/ghc-stage2 --interpreter +RTS -DS ``` Reviewers: niteria, bgamari, austin, erikd Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13767 Differential Revision: https://phabricator.haskell.org/D3680
* Implement recompilation checking for -fignore-assertsÖmer Sinan Ağacan2017-07-035-1/+44
| | | | | | | | | | | | | | Test Plan: Added a test which was previously failing Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #13914 Differential Revision: https://phabricator.haskell.org/D3698
* Allow per-argument documentation on pattern synonym signaturesalexbiehl2017-07-031-1/+1
| | | | | | | | | | | | | haddock-2.18 supports user defined pattern synonym signatures so this seems like a welcomed addition. Reviewers: austin, bgamari, mpickering Reviewed By: bgamari, mpickering Subscribers: rwbarton, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D3699
* users-guide: Wibbles in shared libraries discussionBen Gamari2017-07-031-11/+10
|
* rename tcInstBinder(s)X to tcInstBinder(s)Gabor Greif2017-07-033-14/+14
| | | | | | | | | | | | Summary: Simplify naming scheme of tcInstBinder(s)X Test Plan: Eyeball and compile Reviewers: austin, goldfire, bgamari Subscribers: goldfire, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3690
* Fix paper link in MVar docs [ci skip]Ömer Sinan Ağacan2017-07-021-1/+1
|
* Prevent ApplicativeDo from applying to strict pattern matches (#13875)Simon Marlow2017-06-295-6/+104
| | | | | | | | | | | | | | | | Test Plan: * New unit tests * validate Reviewers: dfeuer, simonpj, niteria, bgamari, austin, erikd Reviewed By: dfeuer Subscribers: rwbarton, thomie GHC Trac Issues: #13875 Differential Revision: https://phabricator.haskell.org/D3681
* rts/RetainerProfile: Const-correctness fixesBen Gamari2017-06-291-9/+9
| | | | | | | | | | | | | | | These were found while using Hadrian, which apparently uses slightly stricter warning flags than the make-based build system. Test Plan: Validate Reviewers: austin, erikd, simonmar Reviewed By: erikd Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3679
* configure: Coerce gcc to use $LD instead of system defaultBen Gamari2017-06-294-62/+82
| | | | | | | | | | | | | | | | | | | | | | | | The configure script will now try to coerce gcc to use the linker pointed to by $LD instead of the system default (typically bfd ld). Moreover, we now check for `ld.gold` and `ld.lld` before trying `ld`. The previous behavior can be reverted to by using the new --disable-ld-override flag. On my machine gold seems to trigger an apparent infelicity in constructor behavior, causing T5435_asm to fail. I've opened #13883 to record this issue and have accepted the questionable constructor ordering for the time being. Test Plan: Validate with `config_args='--enable-ld-override'` Reviewers: austin, hvr, simonmar Subscribers: duog, nh2, rwbarton, thomie, erikd, snowleopard GHC Trac Issues: #13541, #13810, #13883 Differential Revision: https://phabricator.haskell.org/D3449
* Allow optional instance keyword in associated type family instancesTibor Erdesz2017-06-294-7/+55
| | | | | | | | | | | | | | | Add the missing branch for parsing the optional 'instance' keyword in associated type family instance declarations. Fixes #13747 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: simonpj, RyanGlScott, rwbarton, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D3673
* configure: Check for binutils #17166Ben Gamari2017-06-291-0/+59
| | | | | | | | | | | | | | | | | | | This bug affects bfd ld on ARMv7, causing ld to incorrectly emit R_REL_COPY relocations, breaking tables-next-to-code. We've known about it for several years now and there is not yet a fix upstream. Previously we would simply force use of ld.gold on ARM. However, given the rework of linking configuration, I thought a more principled solution was in order. Test Plan: Validate on armv7 Reviewers: austin, hvr Subscribers: angerman, rwbarton, thomie, erikd GHC Trac Issues: #4210 Differential Revision: https://phabricator.haskell.org/D3676
* users-guide: Document FFI safety guaranteesBen Gamari2017-06-291-27/+39
| | | | | | | | | | | | Test Plan: Read it Reviewers: austin Subscribers: simonmar, rwbarton, thomie GHC Trac Issues: #13730, #8281 Differential Revision: https://phabricator.haskell.org/D3682
* Fix T13701 allocation for LinuxDavid Feuer2017-06-291-0/+1
| | | | | | | | | | | For some reason, this test seems to allocate rather more under Linux than under OSX or Windows. Reviewers: austin, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3684
* Typos in commentsRyan Scott2017-06-294-5/+5
| | | | [ci skip]
* Revert "Remove the Windows GCC driver."Simon Peyton Jones2017-06-295-30/+88
| | | | | | | | | | | | | | | | | | This reverts commit d6cecde585b0980ed8e0050c5a1d315789fb6356. The patch broke Simon PJ's Windows build, becuase he didn't have (and should not need) a separate msys2 gcc. Following an exchange on the ghc-devs list, Tamar wrote Oops, sorry, didn’t notice it because both mine and harbormaster’s msys2 have separate GCCs installed as well. I don’t see an easy fix that would also work for end user Configure based cabal installs. So I think I’ll have to go back to the drawing board for this one. You can just leave it reverted.
* Fix lexically-scoped type variablesSimon Peyton Jones2017-06-295-28/+78
| | | | | | | | | | Trac #13881 showed that our handling of lexically scoped type variables was way off when we bring into scope a name 'y' for a pre-existing type variable 'a', perhaps with an entirely different name. This patch fixes it; see TcHsType Note [Pattern signature binders]
* remove dead function 'tcInstBinders'Gabor Greif2017-06-291-6/+1
|
* Remove unneeded importGabor Greif2017-06-281-2/+2
| | | | | | | | | This fails in stage 2 when bootstrapping HEAD with HEAD due to -Werror. Turns out that tcInstBinders is now dead, and I'll remove it if nobody protests. I'd like to hear opinions whether tcInstBindersX then should be renamed to tcInstBinders.
* More typos in comments [ci skip]Gabor Greif2017-06-285-5/+5
|
* Typos in comments and manual [ci skip]Gabor Greif2017-06-287-8/+8
|
* Zap stable unfoldings in worker/wrapperSimon Peyton Jones2017-06-283-6/+13
| | | | This patch fixes the buglet described in Trac #13890.
* Fix constraint solving for forall-typesSimon Peyton Jones2017-06-285-73/+152
| | | | | | | | | | | | Trac #13879 showed that when we were trying to solve (forall z1 (y1::z1). ty1) ~ (forall z2 (y2:z2). ty2) we'd end up spitting out z1~z2 with no binding site for them. Those kind equalities need to be inside the implication. I ended up re-factoring the code for solving forall-equalities. It's quite nice now.
* Do zonking in tcLHsKindSigSimon Peyton Jones2017-06-282-11/+19
| | | | | | | Trac #13879 showed that there was a missing zonk in tcLHsKind. I also renamed it to tcLHsKindSig, for consistency with type signatures There's a commment to explain why the zonk is needed.
* Fix the in-scope set in TcHsType.instantiateTyNSimon Peyton Jones2017-06-281-1/+6
| | | | See Trac #13879
* Revert "Make module membership on ModuleGraph faster"Ben Gamari2017-06-2713-200/+75
| | | | | | I had not intended on merging this. This reverts commit b0708588e87554899c2efc80a2d3eba353dbe926.
* Make module membership on ModuleGraph fasterBartosz Nitka2017-06-2713-75/+200
| | | | | | | | | | | | | | | | | | | When loading/reloading with a large number of modules (>5000) the cost of linear lookups becomes significant. The changes here made `:reload` go from 6s to 1s on my test case. The bottlenecks were `needsLinker` in `DriverPipeline` and `getModLoop` in `GhcMake`. Test Plan: ./validate Reviewers: simonmar, austin, bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3646
* Treat banged bindings as FunBindsBen Gamari2017-06-2718-61/+172
| | | | | | | | | | | | | | | This is another attempt at resolving #13594 by treating strict variable binds as FunBinds instead of PatBinds (as suggested in comment:1). Test Plan: Validate Reviewers: austin, alanz Subscribers: rwbarton, thomie, mpickering GHC Trac Issues: #13594 Differential Revision: https://phabricator.haskell.org/D3670
* rts: Clarify whitehole logic in threadPausedBen Gamari2017-06-271-4/+3
| | | | | | | | | | | | | | | | | | | Previously we would look at the indirectee field of a WHITEHOLE object. However, WHITEHOLE isn't a sort of indirection and therefore has no indirectee field. I encountered this while investigating #13615, although it doesn't fix that bug. Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: rwbarton, thomie GHC Trac Issues: #13615 Differential Revision: https://phabricator.haskell.org/D3674
* typecheck: Consider types containing coercions non-TypeableBen Gamari2017-06-272-2/+2
| | | | | | | | | | | | | | | This was previously a panic and caused #13871. I believe just saying these types simply aren't Typeable should be correct. Test Plan: Validate, check `T13871` Reviewers: goldfire, austin Subscribers: rwbarton, thomie, RyanGlScott GHC Trac Issues: #13871 Differential Revision: https://phabricator.haskell.org/D3672
* testsuite: Add broken test for #13871Ben Gamari2017-06-272-0/+16
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: rwbarton, thomie, RyanGlScott GHC Trac Issues: #13871 Differential Revision: https://phabricator.haskell.org/D3671
* Allow bytecode interpreter to make unsafe foreign callsBen Gamari2017-06-279-13/+65
| | | | | | | | | | | | Reviewers: austin, hvr, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #8281, #13730. Differential Revision: https://phabricator.haskell.org/D3619
* Update docs to reflect changes to DeriveDataTypeableChris Martin2017-06-273-15/+13
|
* base/inputReady: Whitespace cleanupBen Gamari2017-06-271-84/+84
|
* users-guide/debug-info: Fix incorrect DWARF tagsBen Gamari2017-06-261-5/+5
| | | | | | | | Reviewers: austin Subscribers: rwbarton, thomie, niteria Differential Revision: https://phabricator.haskell.org/D3675
* rts: Always collect statsBen Gamari2017-06-262-59/+67
| | | | | | | | | | | | | | | | | | | | | | | It seems that 12ad4d417b89462ba8e19a3c7772a931b3a93f0e enabled collection by default as its needs stats.allocated_bytes to determine whether the program has exceeded its grace limit. However, enabling stats also enables some potentially expensive times checks. In general GC statistics should be cheap to compute (relative to the GC itself), so now we always compute them. This allows us to once again disable giveStats by default. Fixes #13864. Reviewers: simonmar, austin, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie GHC Trac Issues: #13864 Differential Revision: https://phabricator.haskell.org/D3669
* DWARF: Use .short to render half-machine-wordsBen Gamari2017-06-261-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The binutils documentation states that .short is a synonym for .word, which I assumed to mean "machine word", leading me to believe that we needed to use .hword to render half-machine-words. However, Darwin's toolchain doesn't understand .hword, so there we instead used .short. However, as it turns out the binutils documentation confusingly uses "word" to refer to a 16-bit word, so .short should work fine. Moreover, LLVM's internal assembler also doesn't understand .hword, so using .short consistently simplies things remarkably. Test Plan: Validate using binutils and LLVM internal assembler, validate on Darwin Reviewers: niteria, austin Reviewed By: niteria Subscribers: rwbarton, thomie GHC Trac Issues: #13866 Differential Revision: https://phabricator.haskell.org/D3667
* users guide: RephrasingBen Gamari2017-06-231-3/+3
|
* documentation: fix trac issue #12978Tibor Erdesz2017-06-231-4/+17
| | | | | | | | | | | | | | | Add reference to TypeApplications to the AllowAmbiguousType section of the user docs Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12978 Differential Revision: https://phabricator.haskell.org/D3668
* Hoopl: remove dependency on Hoopl packageMichal Terepeta2017-06-2355-94/+948
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This copies the subset of Hoopl's functionality needed by GHC to `cmm/Hoopl` and removes the dependency on the Hoopl package. The main motivation for this change is the confusing/noisy interface between GHC and Hoopl: - Hoopl has `Label` which is GHC's `BlockId` but different than GHC's `CLabel` - Hoopl has `Unique` which is different than GHC's `Unique` - Hoopl has `Unique{Map,Set}` which are different than GHC's `Uniq{FM,Set}` - GHC has its own specialized copy of `Dataflow`, so `cmm/Hoopl` is needed just to filter the exposed functions (filter out some of the Hoopl's and add the GHC ones) With this change, we'll be able to simplify this significantly. It'll also be much easier to do invasive changes (Hoopl is a public package on Hackage with users that depend on the current behavior) This should introduce no changes in functionality - it merely copies the relevant code. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: austin, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: simonpj, kavon, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3616
* Use actual universal tvs in check for naughty record selectorsMatthew Pickering2017-06-233-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The naughty record selector check means to limit selectors which would lead to existential tyvars escaping their scope. With record pattern synonyms, there are situations where universal tyvars don't appear in the result type, for example: ``` pattern ReadP :: Read a => a -> String pattern ReadP{readp} <- (read -> readp) ``` This is a similar issue to #11224 where we assumed that we can decide which variables are universal and which are existential by the syntactic check of seeing which appear in the result type. The fix is to use `univ_tvs` from `conLikeFullSig` rather than the previous approximation. But we must also remember to apply `EqSpec`s so we use the free variables from `inst_tys` which is precisely `univ_tvs` with `EqSpecs` applied. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3649
* Fix pretty-printing of zero-argument lambda expressionsRyan Scott2017-06-235-0/+15
| | | | | | | | | | | | | | | | | | Using Template Haskell, one can construct lambda expressions with no arguments. The pretty-printer isn't aware of this fact, however. This changes that. Test Plan: make test TEST=T13856 Reviewers: bgamari, austin, goldfire Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13856 Differential Revision: https://phabricator.haskell.org/D3664