summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* rts: Fix -hT option with profiling rtsDaniel Gröber2019-07-041-4/+1
| | | | | | | | | | | In dumpCensus we switch/case on doHeapProfile twice. The second switch tries to barf on unknown doHeapProfile modes but HEAP_BY_CLOSURE_TYPE is checked by the first switch and not included in the second. So when trying to pass -hT to the profiling rts it barfs. This commit simply merges the two switches into one which fixes this problem.
* Add a missing zonk (fixes #16902)Simon Peyton Jones2019-07-044-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the eager unifier, when unifying (tv1 ~ tv2), when we decide to swap them over, to unify (tv2 ~ tv1), I'd forgotten to ensure that tv1's kind was fully zonked, which is an invariant of uUnfilledTyVar2. That could lead us to build an infinite kind, or (in the case of #16902) update the same unification variable twice. Yikes. Now we get an error message rather than non-termination, which is much better. The error message is not great, but it's a very strange program, and I can't see an easy way to improve it, so for now I'm just committing this fix. Here's the decl data F (a :: k) :: (a ~~ k) => Type where MkF :: F a and the rather error message of which I am not proud T16902.hs:11:10: error: • Expected a type, but found something with kind ‘a1’ • In the type ‘F a’
* Produce all DerivInfo in tcTyAndClassDeclsVladislav Zavialov2019-07-049-547/+561
| | | | | | | | | | | | | | | Before this refactoring: * DerivInfo for data family instances was returned from tcTyAndClassDecls * DerivInfo for data declarations was generated with mkDerivInfos and added at a later stage of the pipeline in tcInstDeclsDeriv After this refactoring: * DerivInfo for both data family instances and data declarations is returned from tcTyAndClassDecls in a single list. This uniform treatment results in a more convenient arrangement to fix #16731.
* gitlab: Reduce size of template headingsBen Gamari2019-07-042-6/+6
|
* Make printer untag when chasing a pointer in a RET_FUN frameSiddharth Bhat2019-07-041-1/+1
| | | | | This is to mimic what `Scav.c` does. This should fix a crash in the printer.
* Bump parsec submodule to 3.1.14.0Ben Gamari2019-07-041-0/+0
|
* Bump template-haskell version to 2.16.0.0Ryan Scott2019-07-034-4/+4
| | | | | | | Commit cef80c0b9edca3d21b5c762f51dfbab4c5857d8a debuted a breaking change to `template-haskell`, so in order to guard against it properly with CPP, we need to bump the `template-haskell` version number accordingly.
* gitlab-ci: Fix doc-tarball jobBen Gamari2019-07-032-2/+4
| | | | | | | Previously we used the deb9-debug job which used the `validate` build flavour which disabled `BUILD_SPHINX_PDF`. Fix this. Fixes #16890.
* Add support for SIMD operations in the NCGAbhiroop Sarkar2019-07-0345-246/+1512
| | | | | | | This adds support for constructing vector types from Float#, Double# etc and performing arithmetic operations on them Cleaned-Up-By: Ben Gamari <ben@well-typed.com>
* Hadrian: disable cloud build cache for symlinks #16800David Eichmann2019-07-021-0/+4
| | | | | This is a temporary workaround shake not supporting symlinks when using cloud/cached builds.
* Fix stage 1 warningsÖmer Sinan Ağacan2019-07-022-2/+6
|
* Add test for #16575Eric Wolf2019-07-024-0/+54
| | | | | just use the test to show the defective behaviour, so we can see the difference, when it gets fixed
* Fix #15843 by extending Template Haskell AST for tuples to support sectionsnineonine2019-07-0213-40/+201
|
* Apply suggestion to rts/linker/Elf.cBen Gamari2019-07-021-0/+3
|
* Apply suggestion to rts/linker/elf_got.cBen Gamari2019-07-021-0/+1
|
* No atomics on arm32; this will just yield stubs.Moritz Angermann2019-07-021-0/+2
| | | | | | | | | | | | | | | As such the internal linker will fail for them. The alternative would be to implement them as stubs in the linker and have them barf when called. > Not all operations are supported by all target processors. If a particular operation cannot be implemented on the target processor, a warning is generated and a call an external function is generated. The external function carries the same name as the built-in version, with an additional suffix ‘_n’ where n is the size of the data type. (https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html)
* Lookup _GLOBAL_OFFSET_TABLE by symbol->addr when doing relocationsEdward Amsden2019-07-021-1/+1
|
* Add _GLOBAL_OFFSET_TABLE_ supportMoritz Angermann2019-07-022-5/+38
| | | | | | | This adds lookup logic for _GLOBAL_OFFSET_TABLE_ as well as relocation logic for R_ARM_BASE_PREL and R_ARM_GOT_BREL which the gnu toolchain (gas, gcc, ...) prefers to produce. Apparently recent llvm toolchains will produce those as well.
* rts: Assert that LDV profiling isn't used with parallel GCwip/memory-barriersBen Gamari2019-06-281-0/+3
| | | | | I'm not entirely sure we are careful about ensuring this; this is a last-ditch check.
* Correct closure observation, construction, and mutation on weak memory machines.Travis Whitaker2019-06-2831-56/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here the following changes are introduced: - A read barrier machine op is added to Cmm. - The order in which a closure's fields are read and written is changed. - Memory barriers are added to RTS code to ensure correctness on out-or-order machines with weak memory ordering. Cmm has a new CallishMachOp called MO_ReadBarrier. On weak memory machines, this is lowered to an instruction that ensures memory reads that occur after said instruction in program order are not performed before reads coming before said instruction in program order. On machines with strong memory ordering properties (e.g. X86, SPARC in TSO mode) no such instruction is necessary, so MO_ReadBarrier is simply erased. However, such an instruction is necessary on weakly ordered machines, e.g. ARM and PowerPC. Weam memory ordering has consequences for how closures are observed and mutated. For example, consider a closure that needs to be updated to an indirection. In order for the indirection to be safe for concurrent observers to enter, said observers must read the indirection's info table before they read the indirectee. Furthermore, the entering observer makes assumptions about the closure based on its info table contents, e.g. an INFO_TYPE of IND imples the closure has an indirectee pointer that is safe to follow. When a closure is updated with an indirection, both its info table and its indirectee must be written. With weak memory ordering, these two writes can be arbitrarily reordered, and perhaps even interleaved with other threads' reads and writes (in the absence of memory barrier instructions). Consider this example of a bad reordering: - An updater writes to a closure's info table (INFO_TYPE is now IND). - A concurrent observer branches upon reading the closure's INFO_TYPE as IND. - A concurrent observer reads the closure's indirectee and enters it. (!!!) - An updater writes the closure's indirectee. Here the update to the indirectee comes too late and the concurrent observer has jumped off into the abyss. Speculative execution can also cause us issues, consider: - An observer is about to case on a value in closure's info table. - The observer speculatively reads one or more of closure's fields. - An updater writes to closure's info table. - The observer takes a branch based on the new info table value, but with the old closure fields! - The updater writes to the closure's other fields, but its too late. Because of these effects, reads and writes to a closure's info table must be ordered carefully with respect to reads and writes to the closure's other fields, and memory barriers must be placed to ensure that reads and writes occur in program order. Specifically, updates to a closure must follow the following pattern: - Update the closure's (non-info table) fields. - Write barrier. - Update the closure's info table. Observing a closure's fields must follow the following pattern: - Read the closure's info pointer. - Read barrier. - Read the closure's (non-info table) fields. This patch updates RTS code to obey this pattern. This should fix long-standing SMP bugs on ARM (specifically newer aarch64 microarchitectures supporting out-of-order execution) and PowerPC. This fixes issue #15449. Co-Authored-By: Ben Gamari <ben@well-typed.com>
* typo in the docs for DynFlags.hsArtem Pelenitsyn2019-06-271-1/+1
|
* Fix GCC warnings with __clear_cache builtin (#16867)Sylvain Henry2019-06-271-6/+8
|
* testsuite: Add more type annotations to perf_notesBen Gamari2019-06-272-54/+100
|
* Fix #16805 by formatting warning messagenineonine2019-06-273-9/+13
|
* getExecutablePath: get path from sysctl on FreeBSDFraser Tweedale2019-06-271-0/+47
|
* Fix Happy deps for Stack (#16825)Sylvain Henry2019-06-271-10/+5
|
* configure: prefer cc over gccRoland Zumkeller2019-06-271-1/+1
| | | | Fixes #16857.
* Improve doc for :type-at. (#14780)Roland Senn2019-06-271-1/+8
|
* rts: Do not traverse nursery for dead closures in LDV profileMatthew Pickering2019-06-271-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | It is important that `heapCensus` and `LdvCensusForDead` traverse the same areas. `heapCensus` increases the `not_used` counter which tracks how many closures are live but haven't been used yet. `LdvCensusForDead` increases the `void_total` counter which tracks how many dead closures there are. The `LAG` is then calculated by substracting the `void_total` from `not_used` and so it is essential that `not_used >= void_total`. This fact is checked by quite a few assertions. However, if a program has low maximum residency but allocates a lot in the nursery then these assertions were failing (see #16753 and #15903) because `LdvCensusForDead` was observing dead closures from the nursery which totalled more than the `not_used`. The same closures were not counted by `heapCensus`. Therefore, it seems that the correct fix is to make `LdvCensusForDead` agree with `heapCensus` and not traverse the nursery for dead closures. Fixes #16100 #16753 #15903 #8982
* rts: Correct assertion in LDV_recordDeadMatthew Pickering2019-06-271-1/+1
| | | | | It is possible that void_total is exactly equal to not_used and the other assertions for this check for <= rather than <.
* rts: Correct handling of LARGE ARR_WORDS in LDV profilerMatthew Pickering2019-06-273-19/+20
| | | | | | | | | This implements the correct fix for #11627 by skipping over the slop (which is zeroed) rather than adding special case logic for LARGE ARR_WORDS which runs the risk of not performing a correct census by ignoring any subsequent blocks. This approach implements similar logic to that in Sanity.c
* testsuite: More type signatureswip/run-fragile-testsBen Gamari2019-06-262-9/+12
|
* testsuite: Run and report on fragile testsBen Gamari2019-06-263-9/+23
| | | | | | This allows us to run (but ignore the result of) fragile testcases. Hopefully this should allow us to more easily spot when a fragile test becomes un-fragile.
* testsuite: Mark T5611 and T5611a as fragileBen Gamari2019-06-261-2/+2
|
* testsuite: Add T5611aBen Gamari2019-06-265-4/+42
| | | | This is the same as T5611 but with an unsafe call to sleep.
* testsuite: Use safe FFI call in T5611Ben Gamari2019-06-261-3/+3
| | | | | The original issue, #5611, was concerned with safe calls. However, the test inexplicably used an unsafe call. Fix this.
* [skip ci] add a blurb about the purpose of Printer.cSiddharth Bhat2019-06-261-1/+2
|
* testsuite: Fix T16832Ben Gamari2019-06-262-5/+6
| | | | | The test seems to have been missing the name of its script and didn't build with HEAD. How it made it through CI is beyond me.
* Add -Wmissing-safe-haskell-mode warningOleg Grenrus2019-06-252-1/+27
|
* Add -Winferred-safe-imports warningOleg Grenrus2019-06-258-22/+79
| | | | | | | | | | | | | This commit partly reverts e69619e923e84ae61a6bb4357f06862264daa94b commit by reintroducing Sf_SafeInferred SafeHaskellMode. We preserve whether module was declared or inferred Safe. When declared-Safe module imports inferred-Safe, we warn. This inferred status is volatile, often enough it's a happy coincidence, something which cannot be relied upon. However, explicitly Safe or Trustworthy packages won't accidentally become Unsafe. Updates haddock submodule.
* Bump Cabal submodule to what will become 3.0.0.0Ben Gamari2019-06-252-0/+6
| | | | | Metric Increase: haddock.Cabal
* Bump containers submodule to v0.6.2.1Ben Gamari2019-06-2511-16/+23
|
* Remove unused UniqSupply functionsÖmer Sinan Ağacan2019-06-251-42/+1
|
* testsuite: Unbreak T16608 testsBen Gamari2019-06-252-2/+4
| | | | | Sleep to avoid non-determinism due to Darwin's poor mtime resolution. Fixes #16855.
* Don't eta-expand unsaturated primopsBen Gamari2019-06-2510-35/+134
| | | | | | | | | | | Previously, as described in Note [Primop wrappers], `hasNoBinding` would return False in the case of `PrimOpId`s. This would result in eta expansion of unsaturated primop applications during CorePrep. Not only did this expansion result in unnecessary allocations, but it also meant lead to rather nasty inconsistencies between the CAFfy-ness determinations made by TidyPgm and CorePrep. This fixes #16846.
* CoreToStg: Enable CAFfyness checking with -dstg-lintBen Gamari2019-06-251-2/+11
| | | | | The debugging involved in finding #16846 wouldn't have been necessary had the consistentCafInfo check been enabled. However, :wq
* testsuite: Add test for #16846Ben Gamari2019-06-253-0/+42
|
* [skip ci] Typo fix: b*ar*nches -> b*ra*nchesSiddharth Bhat2019-06-251-1/+1
|
* testsuite: Mark ghci058 as broken on WindowsBen Gamari2019-06-251-1/+2
| | | | Due to #16858.
* testsuite: Fix expected output for caf_crashBen Gamari2019-06-251-0/+1
|