summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* PmCheck: Look up parent data family TyCon when populating `PossibleMatches`wip/T17207Sebastian Graf2019-10-073-24/+94
| | | | | | | | | | | | | The vanilla COMPLETE set is attached to the representation TyCon of a data family instance, whereas the user-defined COMPLETE sets are attached to the parent data family TyCon itself. Previously, we weren't trying particularly hard to get back to the representation TyCon to the parent data family TyCon, resulting in bugs like #17207. Now we should do much better. Fixes the original issue in #17207, but I found another related bug that isn't so easy to fix.
* rts: Fix CNF dirtying logicBen Gamari2019-10-051-3/+3
| | | | | | | | Previously due to a silly implementation bug CNFs would never have their dirty flag set, resulting in their being added again and again to the `mut_list`. Fix this. Fixes #17297.
* Clean up `#include`s in the compilerJohn Ericson2019-10-0516-26/+11
| | | | | | | | - Remove unneeded ones - Use <..> for inter-package. Besides general clean up, helps distinguish between the RTS we link against vs the RTS we compile for.
* Add musl systems to llvm-targetsMatthew Bauer2019-10-043-1/+27
| | | | | | This was done in Nixpkgs, but never upstreamed. Musl is pretty much the same as gnu, but with a different libc. I’ve used the same values for everything.
* New fix for #11647. Avoid side effects like #17171Roland Senn2019-10-048-6/+35
| | | | | If a main module doesn't contain a header, we omit the check whether the main module is exported. With this patch GHC, GHCi and runghc use the same code.
* [linker, macho] Don't map/allocate zero size sections and segmentsArtem Pyanykh2019-10-041-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zero size sections are common even during regular build on MacOS. For instance: ``` $ ar -xv libHSghc-prim-0.6.1.a longlong.o $ otool -l longlong.o longlong.o: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 0xfeedfacf 16777223 3 0x00 1 2 176 0x00002000 Load command 0 cmd LC_SEGMENT_64 cmdsize 152 segname vmaddr 0x0000000000000000 vmsize 0x0000000000000000 <-- segment size = 0 fileoff 208 filesize 0 maxprot 0x00000007 initprot 0x00000007 nsects 1 flags 0x0 Section sectname __text segname __TEXT addr 0x0000000000000000 size 0x0000000000000000 <-- section size = 0 offset 208 align 2^0 (1) reloff 0 nreloc 0 flags 0x80000000 reserved1 0 reserved2 0 cmd LC_BUILD_VERSION cmdsize 24 platform macos sdk 10.14 minos 10.14 ntools 0 ``` The issue of `mmap`ing 0 bytes was resolved in !1050, but the problem remained. These 0 size segments and sections were still allocated in object code, which lead to failed `ASSERT(size > 0)` in `addProddableBlock` further down the road. With this change zero size segments **and** sections are not mapped/allocated at all. Test plan: 1. Build statically linked GHC. 2. Run `ghc --interactive`. Observe that REPL loads successfully (which was not the case before). 3. Load several more compiled hs files into repl. No failures.
* Always enable the external interpreterJohn Ericson2019-10-0413-126/+46
| | | | | | You can always just not use or even build `iserv`. I don't think the maintenance cost of the CPP is worth...I can't even tell what the benefit is.
* Add tryFindTopDir to look for the top dir without blowing up if it isJohn Ericson2019-10-041-11/+17
| | | | not found.
* Pull out the settings file parsing code into it's own module.John Ericson2019-10-043-214/+262
| | | | | | | | | | | This has two benefits: 1. One less hunk of code dependent on DynFlags 2. Add a little bit of error granularity to distrinugish between missing data and bad data. This could someday be shared with ghc-pkg which aims to work even with a missing file. I also am about to to make --supported-extensions use this too.
* Factor out a smaller part of Platform for host fallbackJohn Ericson2019-10-0413-39/+115
|
* Deprecate -fwarn-hi-shadowing, because it was never implemented and isDaroc Alden2019-10-043-14/+6
| | | | | | not used. This fixes #10913.
* Remove {Build,Host}Platform_NAME from headerJohn Ericson2019-10-043-51/+57
| | | | They are only used in a file we construct directly, so just skip CPP.
* Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.hJohn Ericson2019-10-0430-388/+383
| | | | | | | | | | | | | | | | | | The generated headers are now generated per stage, which means we can skip hacks like `ghc_boot_platform.h` and just have that be the stage 0 header as proper. In general, stages are to be embraced: freely generate everything in each stage but then just build what you depend on, and everything is symmetrical and efficient. Trying to avoid stages because bootstrapping is a mind bender just creates tons of bespoke mini-mind-benders that add up to something far crazier. Hadrian was pretty close to this "stage-major" approach already, and so was fairly easy to fix. Make needed more work, however: it did know about stages so at least there was a scaffold, but few packages except for the compiler cared, and the compiler used its own counting system. That said, make and Hadrian now work more similarly, which is good for the transition to Hadrian. The merits of embracing stage aside, the change may be worthy for easing that transition alone.
* Add Monad instances to `(,,) a b` and `(,,,) a b c`Fumiaki Kinoshita2019-10-047-3/+36
|
* rules/haddock: Ensure that RTS stats directory existsBen Gamari2019-10-031-0/+2
| | | | | It may not exist if the source tarball was extracted yet not the testsuite tarball.
* Extend argument of createIOThread to word sizeStefan Schulze Frielinghaus2019-10-031-2/+2
| | | | | | | Function createIOThread expects its second argument to be of size word. The natural size of the second parameter is 32bits. Thus for some 64bit architectures, where a write of the lower half of a register does not clear the upper half, the value must be zero extended.
* Add new debug flag -DZTobias Guggenmos2019-10-0311-7/+24
| | | | Zeros heap memory after gc freed it.
* Improve documentation for runtime debugging flagsTobias Guggenmos2019-10-031-0/+22
|
* DynFlags: Only warn when split-sections is ignoredBen Gamari2019-10-031-2/+2
| | | | | Previously we would throw an error which seems a bit harsh. As reported in #17283.
* Exclude rts.cabal from source distributionsBen Gamari2019-10-032-0/+2
| | | | | | | This modifies both the Hadrian and make build systems to avoid included the rts.cabal generated by autoconf in the source distribution. Fixes #17265.
* testsuite: Mark print037 as fragile, not brokenBen Gamari2019-10-031-2/+2
| | | | See #16205.
* Make Haddock submodule remote point to gitlab mirrorJohn Ericson2019-10-031-1/+1
| | | | This makes it match the others
* Improve documentation around empty tuples/listsRichard Eisenberg2019-10-038-56/+132
| | | | | | | | | | | | | | This patch also changes the way we handle empty lists, simplifying them somewhat. See Note [Empty lists]. Previously, we had to special-case empty lists in the type-checker. Now no more! Finally, this patch improves some documentation around the ir_inst field used in the type-checker. This breaks a test case, but I really think the problem is #17251, not really related to this patch. Test case: typecheck/should_compile/T13680
* Add `module {-# SOURCE #-} Foo` syntax for hs-boot in bkpJohn Ericson2019-10-036-22/+63
| | | | This is a good convenience for testing.
* docs String, hyperlink to Data.ListJames Brock2019-10-031-0/+1
| | | | | | | | | | | Add a reference to the documentation for Data.List in the description for String. On the generated Haddock for Data.String, http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-String.html there is curently no hyperlink to Data.List, which is where a reader will find most of the useful functions which can operate on Strings. I imagine this has confused beginners who came to this page looking for String operations.
* Fix new compact block allocation in allocateForCompactÖmer Sinan Ağacan2019-10-033-2/+32
| | | | | | | | | | | | | allocateForCompact() is called when nursery of a compact region is full, to add new blocks to the compact. New blocks added to an existing region needs a StgCompactNFDataBlock header, not a StgCompactNFData. This fixes allocateForCompact() so that it now correctly allocates space for StgCompactNFDataBlock instead of StgCompactNFData as before. Fixes #17044. A regression test T17044 added.
* Note [Don't flatten tuples from HsSyn] in MkCoreRichard Eisenberg2019-10-037-21/+58
| | | | | | | | | | Previously, we would sometimes flatten 1-tuples and sometimes not. This didn't cause damage because there is no way to generate HsSyn with 1-tuples. But, with the upcoming fix to #16881, there will be. Without this patch, obscure lint errors would have resulted. No test case, as there is not yet a way to tickle this.
* Merge TcTypeableValidity into TcTypeable, document treatment of castsRyan Scott2019-10-038-71/+86
| | | | | | | | | | | | | | | This patch: * Implements a refactoring (suggested in https://gitlab.haskell.org/ghc/ghc/merge_requests/1199#note_207345) that moves all functions from `TcTypeableValidity` back to `TcTypeable`, as the former module doesn't really need to live on its own. * Adds `Note [Typeable instances for casted types]` to `TcTypeable` explaining why the `Typeable` solver currently does not support types containing casts. Resolves #16835.
* Typo in comment [ci skip]wip/ggreif-typoGabor Greif2019-10-031-1/+1
|
* Make small INLINE functions behave properlyÖmer Sinan Ağacan2019-10-012-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Simon writes: Currently we check for a type arg rather than isTyCoArg. This in turn makes INLINE things look bigger than they should be, and stops them being inlined into boring contexts when they perfectly well could be. E.g. f x = g <refl> x {-# INLINE g #-} ... (map (f x) xs) ... The context is boring, so don't inline unconditionally. But f's RHS is no bigger than its call, provided you realise that the coercion argument is ultimately cost-free. This happens in practice for $WHRefl. It's not a big deal: at most it means we have an extra function call overhead. But it's untidy, and actually worse than what happens without an INLINE pragma. Fixes #17182 This makes 0.0% change in nofib binary sizes.
* Hadrian: do not cache GHC configure ruleDavid Eichmann2019-10-011-0/+4
|
* Hadrian: Libffi rule now `produces` dynamic library files.David Eichmann2019-10-011-0/+4
|
* Refactor some cruft in TcDerivRyan Scott2019-10-011-79/+52
| | | | | | | | | | | | | | | | | | | | | | | * `mk_eqn_stock`, `mk_eqn_anyclass`, and `mk_eqn_no_mechanism` all took a continuation of type `DerivSpecMechanism -> DerivM EarlyDerivSpec` to represent its primary control flow. However, in practice this continuation was always instantiated with the `mk_originative_eqn` function, so there's not much point in making this be a continuation in the first place. This patch removes these continuations in favor of invoking `mk_originative_eqn` directly, which is simpler. * There were several parts of `TcDeriv` that took different code paths if compiling an `.hs-boot` file. But this is silly, because ever since 101a8c770b9d3abd57ff289bffea3d838cf25c80 we simply error eagerly whenever attempting to derive any instances in an `.hs-boot` file. This patch removes all of the unnecessary `.hs-boot` code paths, leaving only one (which errors out). * Remove various error continuation arguments from `mk_eqn_stock` and related functions.
* Add testcases inspired by Luke Maranget's pattern match serieswip/add-testcasesSebastian Graf2019-10-015-0/+247
| | | | | | | | | In his paper "Warnings for Pattern Matching", Luke Maranget describes three series in his appendix for which GHC's pattern match checker scaled very badly. We mostly avoid this now with !1752. This commit adds regression tests for each of the series. Fixes #17264.
* Add a bunch of testcases for the pattern match checkerSebastian Graf2019-10-0113-0/+230
| | | | | Adds regression tests for tickets #17207, #17208, #17215, #17216, #17218, #17219, #17248
* Bump process submoduleBen Gamari2019-09-301-0/+0
| | | | Marks process003 as fragile, as noted in #17245.
* testsuite: Mark T3389 as broken in hpc way on i386Ben Gamari2019-09-301-1/+1
| | | | See #17256.
* Do not rely on CUSKs in 'base'Vladislav Zavialov2019-09-302-3/+8
| | | | | Use standalone kind signatures instead of complete user-specified kinds in Data.Type.Equality and Data.Typeable
* testsuite: Add minimal test for :doc commandTakenobu Tani2019-09-304-0/+47
| | | | | | | | | | Currently, there are no testcases for GHCi `:doc` command. Perhaps because it was experimental. And it could be changed in the future. But `:doc` command is already useful, so I add a minimal regression test to keep current behavior. See also 85309a3cda for implementation of `:doc` command.
* Move pattern match checker modules to GHC.HsToCore.PmCheckSebastian Graf2019-09-3013-30/+30
|
* Add help message for GHCi :instances commandTakenobu Tani2019-09-301-0/+1
| | | | This commit updates GHCi's help message for GHC 8.10.
* Fix arguments for unbound binders in RULE applicationSimon Peyton Jones2019-09-301-64/+38
| | | | | | | | | | | We were failing to correctly implement Note [Unbound RULE binders] in Rules.hs. In particular, when cooking up a fake Refl, were were failing to apply the substitition. This patch fixes that problem, and simultaneously tidies up the impedence mis-match between RuleSubst and TCvSubst. Thanks to Sebastian!
* Refactor iface file generation:Ömer Sinan Ağacan2019-09-3018-387/+813
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors interface file generation to allow information from the later passed (NCG, STG) to be stored in interface files. We achieve this by splitting interface file generation into two parts: * Partial interfaces, built based on the result of the core pipeline * A fully instantiated interface, which also contains the final fingerprints and can optionally contain information produced by the backend. This change is required by !1304 and !1530. -dynamic-too handling is refactored too: previously when generating code we'd branch on -dynamic-too *before* code generation, but now we do it after. (Original code written by @AndreasK in !1530) Performance ~~~~~~~~~~~ Before this patch interface files where created and immediately flushed to disk which made space leaks impossible. With this change we instead use NFData to force all iface related data structures to avoid space leaks. In the process of refactoring it was discovered that the code in the ToIface Module allocated a lot of thunks which were immediately forced when writing/forcing the interface file. So we made this module more strict to avoid creating many of those thunks. Bottom line is that allocations go down by about ~0.1% compared to master. Residency is not meaningfully different after this patch. Runtime was not benchmarked. Co-Authored-By: Andreas Klebinger <klebinger.andreas@gmx.at> Co-Authored-By: Ömer Sinan Ağacan <omer@well-typed.com>
* `exprOkForSpeculation` for Note [IO hack in the demand analyser]Sebastian Graf2019-09-281-11/+11
| | | | | | | | | | | | | | | | | | In #14998 I realised that the notion of speculative execution *exactly matches* eager evaluation of expressions in a case alternative where the scrutinee is an IO action. Normally we have to `deferIO` any result from that single case alternative to prevent this speculative execution, so we had a special case in place in the demand analyser that would check if the scrutinee was a prim-op, in which case we assumed that it would be ok to do the eager evaluation. Now we just check if the scrutinee is `exprOkForSpeculation`, corresponding to the notion that we want to push evaluation of the scrutinee *after* eagerly evaluating stuff from the case alternative. This fixes #14988, because it resolves the last open Item 4 there.
* PmCheck: No ConLike instantiation in pmcheckSebastian Graf2019-09-285-302/+225
| | | | | | | | | | | | | | | | | | | | | | | `pmcheck` used to call `refineToAltCon` which would refine the knowledge we had about a variable by equating it to a `ConLike` application. Since we weren't particularly smart about this in the Check module, we simply freshened the constructors existential and term binders utimately through a call to `mkOneConFull`. But that instantiation is unnecessary for when we match against a concrete pattern! The pattern will already have fresh binders and field types. So we don't call `refineToAltCon` from `Check` anymore. Subsequently, we can simplify a couple of call sites and functions in `PmOracle`. Also implementing `computeCovered` becomes viable and we don't have to live with the hack that was `addVarPatVecCt` anymore. A side-effect of not indirectly calling `mkOneConFull` anymore is that we don't generate the proper strict argument field constraints anymore. Instead we now desugar ConPatOuts as if they had bangs on their strict fields. This implies that `PmVar` now carries a `HsImplBang` that we need to respect by a (somewhat ephemeral) non-void check. We fix #17234 in doing so.
* testsuite: Mark TH tests as fragile in LLVM built external-interpreterBen Gamari2019-09-271-9/+4
| | | | | Due to #16087. This drops the previous explicit list of broken tests and rather encompasses the entire set of tests since they all appear to be broken.
* testsuite: Mark T3389 as broken in profiled ways on i386Ben Gamari2019-09-271-1/+2
| | | | As noted in #17256.
* testsuite: Mark hs_try_putmvar003 as fragile in threaded1Ben Gamari2019-09-271-1/+2
| | | | | Due to #16361. Note that I'm leaving out threaded2 since it's not clear whether the single crash in that way was due to other causes.
* testsuite: Mark compact_gc as fragile in the ghci wayBen Gamari2019-09-271-1/+1
| | | | As noted in #17253.
* Raise minimum GHC version to 8.6Daniel Gröber2019-09-271-2/+2
| | | | | commit 795986aaf33e ("Remove unneeded CPP now that GHC 8.6 is the minimum") broke the 8.4 build.