summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Type-level comparison expands to equalitywip/type_level_leqChristiaan Baaij2022-07-243-6/+8
| | | | | | | | This avoids class instances such as: > instance (b <= a) => F a b where from needing -XUndecidableInstances to compile.
* Make withDict opaque to the specialisersheaf2022-07-218-46/+193
| | | | | | | | | | | | | | | | | As pointed out in #21575, it is not sufficient to set withDict to inline after the typeclass specialiser, because we might inline withDict in one module and then import it in another, and we run into the same problem. This means we could still end up with incorrect runtime results because the typeclass specialiser would assume that distinct typeclass evidence terms at the same type are equal, when this is not necessarily the case when using withDict. Instead, this patch introduces a new magicId, 'nospec', which is only inlined in CorePrep. We make use of it in the definition of withDict to ensure that the typeclass specialiser does not common up distinct typeclass evidence terms. Fixes #21575
* rts/ProfHeap: Ensure new Censuses are zeroedBen Gamari2022-07-191-0/+1
| | | | | | | | When growing the Census array ProfHeap previously neglected to zero the new part of the array. Consequently `freeEra` would attempt to free random words that often looked suspiciously like pointers. Fixes #21880.
* driver: Fix implementation of -SMatthew Pickering2022-07-194-14/+27
| | | | | | | We were failing to stop before running the assembler so the object file was also created. Fixes #21869
* configure: Use AC_PATH_TOOL to detect toolsBen Gamari2022-07-191-12/+9
| | | | | | | | Previously we used AC_PATH_PROG which, as noted by #21601, does not look for tools with a target prefix, breaking cross-compilation. Fixes #21601.
* Add mapAccumM, forAccumM to Data.TraversableBoris Lykah2022-07-193-5/+80
| | | | | Approved by Core Libraries Committee in https://github.com/haskell/core-libraries-committee/issues/65#issuecomment-1186275433
* gitignore: don't ignore all aclocal.m4 filesBen Gamari2022-07-181-1/+2
| | | | | | | | | While GHC's own aclocal.m4 is generated by the aclocal tool, other packages' aclocal.m4 are committed in the repository. Previously `.gitignore` included an entry which covered *any* file named `aclocal.m4`, which lead to quite some confusion (e.g. see #21740). Fix this by modifying GHC's `.gitignore` to only cover GHC's own `aclocal.m4`.
* Allow running memInventory when the concurrent nonmoving gc is enabledTeo Camarasu2022-07-182-5/+14
| | | | | | | | If the nonmoving gc is enabled and we are using a threaded RTS, we now try to grab the collector mutex to avoid memInventory and the collection racing. Before memInventory was disabled.
* Refactor wantToUnboxArg a bitSimon Peyton Jones2022-07-184-174/+217
| | | | | | | | | | | | | | | | | | | * Rename GHC.Core.Opt.WorkWrap.Utils.wantToUnboxArg to canUnboxArg and similarly wantToUnboxResult to canUnboxResult. * Add GHC.Core.Opt.DmdAnal.wantToUnboxArg as a wrapper for the (new) GHC.Core.Opt.WorkWrap.Utils.canUnboxArg, avoiding some yukky duplication. I decided it was clearer to give it a new data type for its return type, because I nedeed the FD_RecBox case which was not otherwise readiliy expressible. * Add dcpc_args to WorkWrap.Utils.DataConPatContext for the payload * Get rid of the Unlift constructor of UnboxingDecision, eliminate two panics, and two arguments to canUnboxArg (new name). Much nicer now.
* Make SetLevels honour floatConstsSimon Peyton Jones2022-07-181-4/+4
| | | | | | | | This fix, in the definition of profitableFloat, is just for consistency. `floatConsts` should do what it says! I don't think it'll affect anything much, though.
* Inline mapAccumLMSimon Peyton Jones2022-07-181-0/+5
| | | | | | | | | This function is called in inner loops in the compiler, and it's overloaded and higher order. Best just to inline it. This popped up when I was looking at something else. I think perhaps GHC is delicately balanced on the cusp of inlining this automatically.
* Make transferPolyIdInfo work for CPRSimon Peyton Jones2022-07-182-5/+14
| | | | I don't know why this hasn't bitten us before, but it was plain wrong.
* White space only in FamInstEnvSimon Peyton Jones2022-07-181-30/+34
|
* Rule matching: Don't compute the FVs if we don't look at them.Andreas Klebinger2022-07-182-3/+17
|
* Refactor SpecConstr to use treat bindings uniformlySimon Peyton Jones2022-07-181-264/+260
| | | | | | | | | | | | | | | | | | | | | | This patch, provoked by #21457, simplifies SpecConstr by treating top-level and nested bindings uniformly (see the new scBind). * Eliminates the mysterious scTopBindEnv * Refactors scBind to handle top-level and nested definitions uniformly. * But, for now at least, continues the status quo of not doing SpecConstr for top-level non-recursive bindings. (In contrast we do specialise nested non-recursive bindings, although the original paper did not; see Note [Local let bindings].) I tried the effect of specialising top-level non-recursive bindings (which is now dead easy to switch on, unlike before) but found some regressions, so I backed off. See !8135. It's a pure refactoring. I think it'll do a better job in a few cases, but there is no regression test.
* typosEric Lindblad2022-07-1827-35/+35
|
* changelog typoEric Lindblad2022-07-181-1/+1
|
* hadrian: Add multi:<pkg> and multi targets for starting a multi-replMatthew Pickering2022-07-188-30/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to hadrian for starting a multi-repl containing all the packages which stage0 can build. In particular, there is the new user-facing command: ``` ./hadrian/ghci-multi ``` which when executed will start a multi-repl containing the `ghc` package and all it's dependencies. This is implemented by two new hadrian targets: ``` ./hadrian/build multi:<pkg> ``` Construct the arguments for a multi-repl session where the top-level package is <pkg>. For example, `./hadrian/ghci-multi` is implemented using `multi:ghc` target. There is also the `multi` command which constructs a repl for everything in stage0 which we can build.
* Fix incorrect proof of applyWhen’s propertiesAnselm Schüler2022-07-171-1/+1
|
* hadrian: Rename documentation directories for consistency with makeBen Gamari2022-07-176-16/+11
| | | | | | | * Rename `docs` to `doc` * Place pdf documentation in `doc/` instead of `doc/pdfs/` Fixes #21164.
* testsuite: Fix T11829 on Centos 7Ben Gamari2022-07-161-1/+1
| | | | | | It appears that Centos 7 has a more strict C++ compiler than most distributions since std::runtime_error is defined in <stdexcept> rather than <exception>. In T11829 we mistakenly imported the latter.
* rts/linker: Ensure that __cxa_finalize is called on code unloadBen Gamari2022-07-162-0/+25
|
* rts/linker: Clean up section kindsBen Gamari2022-07-161-2/+5
|
* rts/linker: Fix resolution of __dso_handle on DarwinBen Gamari2022-07-161-1/+1
| | | | Darwin expects a leading underscore.
* testsuite: Mark T13366Cxx as unbroken on DarwinBen Gamari2022-07-161-3/+1
|
* rts/linker/Elf: Work around GCC 6 init/fini behaviorBen Gamari2022-07-161-3/+19
| | | | | | | It appears that GCC 6t (at least on i386) fails to give init_array/fini_array sections the correct SHT_INIT_ARRAY/SHT_FINI_ARRAY section types, instead marking them as SHT_PROGBITS. This caused T20494 to fail on Debian.
* testsuite: Use system-cxx-std-lib instead of config.stdcxx_implBen Gamari2022-07-168-26/+11
|
* rts/linker/MachO: Introduce finalizer supportBen Gamari2022-07-163-0/+32
|
* rts/linker/MachO: Use section flags to identify initializersBen Gamari2022-07-161-20/+11
|
* rts/linker/MachO: Drop dead codeBen Gamari2022-07-161-1/+0
|
* rts/linker/PEi386: Fix exception unwind unregistrationBen Gamari2022-07-163-10/+9
| | | | | | | RtlDeleteFunctionTable expects a pointer to the .pdata section yet we passed it the .xdata section. Happily, this fixes #21354.
* testsuite: Add test for #21618 and #21847Ben Gamari2022-07-165-0/+51
|
* rts/linker/PEi386: Respect dtor/ctor priorityBen Gamari2022-07-162-2/+45
| | | | | | | Previously we would run constructors and destructors in arbitrary order despite explicit priorities. Fixes #21847.
* rts/linker/PEi386: Ensure that all .ctors/.dtors sections are runBen Gamari2022-07-162-21/+63
| | | | | | | | It turns out that PE objects may have multiple `.ctors`/`.dtors` sections but the RTS linker had assumed that there was only one. Fix this. Fixes #21618.
* Statically-link against libc++ on WindowsBen Gamari2022-07-161-0/+7
| | | | | | | | | | | Unfortunately on Windows we have no RPATH-like facility, making dynamic linking extremely fragile. Since we cannot assume that the user will add their GHC installation to `$PATH` (and therefore their DLL search path) we cannot assume that the loader will be able to locate our `libc++.dll`. To avoid this, we instead statically link against `libc++.a` on Windows. Fixes #21435.
* Loader: Implement gnu-style -l:$path syntaxBen Gamari2022-07-161-11/+31
| | | | | | Gnu ld allows `-l` to be passed an absolute file path, signalled by a `:` prefix. Implement this in the GHC's loader search logic.
* rts/linker/PEi386: Add finalization supportBen Gamari2022-07-164-6/+51
| | | | | | This implements #20494 for the PEi386 linker. Happily, this also appears to fix `T9405`, resolving #21361.
* rts/linker/PEi386: Refactor handling of oc->infoBen Gamari2022-07-162-4/+10
| | | | | | | | | | | Previously we would free oc->info after running initializers. However, we can't do this is we want to also run finalizers. Moreover, freeing oc->info so early was wrong for another reason: we will need it in order to unregister the exception tables (see the call to `RtlDeleteFunctionTable`). In service of #20494.
* rts/linker/PEi386: Rename finit field to finiBen Gamari2022-07-163-5/+5
| | | | fini is short for "finalizer", which does not contain a "t".
* testsuite: Add T20494Ben Gamari2022-07-165-0/+92
|
* rts/linker/Elf: Introduce support for invoking finalizers on unloadBen Gamari2022-07-164-3/+90
| | | | Addresses #20494.
* rts/linker/Elf: Check that there are no NULL ctorsBen Gamari2022-07-161-0/+1
|
* configure: Don't override Windows CXXFLAGSBen Gamari2022-07-161-1/+1
| | | | | | | | | | | | | | At some point we used the clang distribution from msys2's `MINGW64` environment for our Windows toolchain. This defaulted to using libgcc and libstdc++ for its runtime library. However, we found for a variety of reasons that compiler-rt, libunwind, and libc++ were more reliable, consequently we explicitly overrode the CXXFLAGS to use these. However, since then we have switched to use the `CLANG64` packaging, which default to these already. Consequently we can drop these arguments, silencing some redundant argument warnings from clang. Fixes #21669.
* compiler: Add haddock sections to GHC.Utils.PanicBen Gamari2022-07-161-6/+12
|
* cmm: Move toBlockList to GHC.CmmBen Gamari2022-07-166-8/+5
|
* cmm: Eliminate orphan Outputable instancesBen Gamari2022-07-1631-1134/+999
| | | | | | | Here we reorganize `GHC.Cmm` to eliminate the orphan `Outputable` and `OutputableP` instances for the Cmm AST. This makes it significantly easier to use the Cmm pretty-printers in tracing output without incurring module import cycles.
* rts: forkOn context switches the target capabilityDouglas Wilson2022-07-164-8/+14
| | | | Fixes #21824
* Align the behaviour of `dopt` and `log_dopt`Dominik Peteler2022-07-164-32/+45
| | | | | | | | | | | | | | Before the behaviour of `dopt` and `logHasDumpFlag` (and the underlying function `log_dopt`) were different as the latter did not take the verbosity level into account. This led to problems during the refactoring as we cannot simply replace calls to `dopt` with calls to `logHasDumpFlag`. In addition to that a subtle bug in the GHC module was fixed: `setSessionDynFlags` did not update the logger and as a consequence the verbosity value of the logger was not set appropriately. Fixes #21861
* rel-notes: Drop mention of #21745 fixBen Gamari2022-07-161-6/+0
| | | | Since we have backported the fix to 9.4.1.
* Suppress extra output from configure check for c++ librariesGreg Steuck2022-07-161-2/+2
|