summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* users guide: Document -hpcdir flagwip/hpc-docsBen Gamari2021-08-022-1/+12
| | | | Previously this was undocumented.
* Improve preprocessor error messageShayne Fletcher2021-07-291-1/+1
|
* Reject pattern synonyms with linear types (#18806)Krzysztof Gogolewski2021-07-298-5/+36
|
* Add test for #18567Matthew Pickering2021-07-298-0/+68
| | | | Closes #18567
* UNREG: implement 64-bit mach ops for 32-bit targetsSergei Trofimovich2021-07-292-30/+63
| | | | | | | | | | | | | | | Noticed build failures like ``` ghc-stage1: panic! (the 'impossible' happened) GHC version 9.3.20210721: pprCallishMachOp_for_C: MO_x64_Ne not supported! ``` on `--tagget=hppa2.0-unknown-linux-gnu`. The change does not fix all 32-bit unreg target problems, but at least allows linking final ghc binaries. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* compiler: Name generated locals more descriptivelyBen Gamari2021-07-294-17/+25
| | | | | | Previously `GHC.Types.Id.Make.newLocal` would name all locals `dt`, making it unnecessarily difficult to determine their origin. Noticed while looking at #19557.
* Add configure flag to enable ASSERTs in all waysDaniel Gröber2021-07-298-15/+42
| | | | | | | | Running the test suite with asserts enabled is somewhat tricky at the moment as running it with a GHC compiled the DEBUG way has some hundred failures from the start. These seem to be unrelated to assertions though. So this provides a toggle to make it easier to debug failing assertions using the test suite.
* rts: Allow building with ASSERTs on in non-DEBUG wayDaniel Gröber2021-07-293-8/+2
| | | | | | | | | | We have a couple of places where the conditions in asserts depend on code ifdefed out when DEBUG is off. I'd like to allow compiling assertions into non-DEBUG RTSen so that won't do. Currently if we remove the conditional around the definition of ASSERT() the build will not actually work due to a deadlock caused by initMutex not initializing mutexes with PTHREAD_MUTEX_ERRORCHECK because DEBUG is off.
* Delete ToDo about incorrect optimisation [skip ci]Peter Trommler2021-07-291-4/+0
| | | | | On big-endian systems a narrow after a load cannot be replaced with a narrow load.
* Port more DriverUnknownMessage into richer DriverMessage constructorsAlfredo Di Napoli2021-07-2813-74/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order: * Introduce the `PsErrUnknownOptionsPragma` diagnostic message This commit changes the diagnostic emitted inside `GHC.Parser.Header.checkProcessArgsResult` from an (erroneous) and unstructured `DriverUnknownMessage` to a `PsErrUnknownOPtionsPragma`, i.e. a new data constructor of a `PsHeaderMessage`. * Add the `DriverUserDefinedRuleIgnored` diagnostic message * Add `DriverUserDefinedRuleIgnored` data constructor This commit adds (and use) a new data constructor to the `DriverMessage` type, replacing a `DriverUnknownMessage` with it. * Add and use `DriverCannotLoadInterfaceFile` constructor This commit introduces the DriverCannotLoadInterfaceFile constructor for the `DriverMessage` type and it uses it to replace and occurrence of `DriverUnknownMessage`. * Add and use the `DriverInferredSafeImport` constructor This commit adds a new `DriverInferredSafeImport` constructor to the `DriverMessage` type, and uses it in `GHC.Driver.Main` to replace one occurrence of `DriverUnknownMessage`. * Add and use `DriverCannotImportUnsafeModule` constructor This commit adds the `DriverCannotImportUnsafeModule` constructor to the `DriverMessage` type, and later using it to replace one usage of `DriverUnknownMessage` in the `GHC.Driver.Main` module. * Add and use `DriverMissingSafeHaskellMode` constructor * Add and use `DriverPackageNotTrusted` constructor * Introduce and use `DriverInferredSafeModule` constructor * Add and use `DriverMarkedTrustworthyButInferredSafe` constructor * Add and use `DriverCannotImportFromUntrustedPackage`
* Update expected stderr for affected tests, which are not under Tc directoryCarrieMY2021-07-282-4/+4
|
* Fix type check error message grammar (fixes #20122)CarrieMY2021-07-2810-55/+100
| | | | Remove trailing spaces
* Fix a subtle scoping error in simplLazyBindSimon Peyton Jones2021-07-281-10/+15
| | | | | | | | | | | | | | | | | | In the call to prepareBinding (in simplLazyBind), I had failed to extend the in-scope set with the binders from body_floats1. As as result, when eta-expanding deep inside prepareBinding we made up an eta-binder that shadowed a variable free in body1. Yikes. It's hard to trigger this bug. It showed up when I was working on !5658, and I started using the in-scope set for eta-expansion, rather than taking free variables afresh. But even then it only showed up when compiling a module in Haddock utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs Sadly Haddock is compiled without Core Lint, so we ultimately got a seg-fault. Lint nailed it fast once I realised that it was off. There is some other tiny refactoring in this patch.
* Improve performance of eta expansionSimon Peyton Jones2021-07-284-73/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eta expansion was taking ages on T18223. This patch * Aggressively squash reflexive casts in etaInfoApp. See Note [Check for reflexive casts in eta expansion] These changes decreased compile-time allocation by 80%! * Passes the Simplifier's in-scope set to etaExpandAT, so we don't need to recompute it. (This alone saved 10% of compile time.) Annoyingly several functions in the Simplifier (namely makeTrivialBinding and friends) need to get SimplEnv, rather than SimplMode, but that is no big deal. Lots of small changes in compile-time allocation, less than 1% and in both directions. A couple of bigger changes, including the rather delicate T18223 T12425(optasm) ghc/alloc 98448216.0 97121224.0 -1.3% GOOD T18223(normal) ghc/alloc 5454689676.0 1138238008.0 -79.1% GOOD Metric Decrease: T12425 T18223
* Simplify and improve the eta expansion mechanismSimon Peyton Jones2021-07-284-154/+150
| | | | | | | | | | | Previously the eta-expansion would return lambdas interspersed with casts; now the cast is just pushed to the outside: #20153. This actually simplifies the code. I also improved mkNthCo to account for SymCo, so that mkNthCo n (SymCo (TyConAppCo tc cos)) would work well.
* Inline less logging codeSimon Peyton Jones2021-07-282-26/+47
| | | | | | | | | | | | When eyeballing calls of GHC.Core.Opt.Simplify.Monad.traceSmpl, I saw that lots of cold-path logging code was getting inlined into the main Simplifier module. So in GHC.Utils.Logger I added a NOINLINE on logDumpFile'. For logging, the "hot" path, up to and including the conditional, should be inlined, but after that we should inline as little as possible, to reduce code size in the caller.
* Make the occurrence analyser a bit stricterSimon Peyton Jones2021-07-281-29/+31
| | | | | | | | | | | | occAnalArgs and occAnalApp are very heavily used functions, so it pays to make them rather strict: fewer thunks constructed. All these thunks are ultimately evaluated anyway. This patch gives a welcome reduction compile time allocation of around 0.5% across the board. For T9961 it's a 2.2% reduction. Metric Decrease: T9961
* White space, spelling, and a tiny refactorSimon Peyton Jones2021-07-282-6/+9
| | | | No change in behaviour
* Extend the in-scope set to silence substExpr warningsSimon Peyton Jones2021-07-281-2/+12
| | | | | | substExpr warns if it finds a LocalId that isn't in the in-scope set. This patch extends the in-scope set to silence the warnings. (It has no effect on behaviour.)
* Improve postInlineUnconditionallySimon Peyton Jones2021-07-281-14/+29
| | | | | | | | | | | See Note [Use occ-anald RHS in postInlineUnconditionally]. This explains how to eliminate an extra round of simplification, which can happen if postInlineUnconditionally uses a RHS that is no occurrence-analysed. This opportunity has been there for ages; I discovered it when looking at a compile-time perf regression that happened because the opportunity wasn't exploited.
* Print out module name in "bailing out" messageSimon Peyton Jones2021-07-281-2/+2
|
* Fix smallEnoughToInlineSimon Peyton Jones2021-07-281-2/+5
| | | | | I noticed that smallEnoughToInline said "no" to UnfWhen guidance, which seems quite wrong -- those functions are particularly small.
* Functor docs: link to free theorem explanation (#19300)Krzysztof Gogolewski2021-07-281-0/+3
|
* Improve docs of bang patterns (#19068)Krzysztof Gogolewski2021-07-281-43/+62
|
* Document DerivingVia unsafety (#19786)Krzysztof Gogolewski2021-07-281-2/+3
|
* Docs: use :default: and :ghc-ticket:Krzysztof Gogolewski2021-07-288-56/+62
|
* rts: Don't rely on configuration when CLEANING=YESBen Gamari2021-07-281-0/+4
| | | | | | | | The make build system doesn't source config.mk when CLEANING=YES, consequently we previously failed to identify an appropriate adjustor implementation to use during cleaning. Fixes #20166.
* Hadrian: disable profiled RTS with no_profiled_libs flavour transformerSylvain Henry2021-07-281-1/+3
| | | | | | | Hadrian uses the RTS ways to determine which iserv programs to embed into bindist. But profiled iserv program (and any other code) can't be built without profiling libs and Hadrian fails. So we disable the profiling RTS way with the no_profiled_libs flavour transformer.
* PIC: test for cross-module referencesSylvain Henry2021-07-271-7/+4
|
* Don't abort on representation polymorphism checkKrzysztof Gogolewski2021-07-271-1/+1
| | | | | | | | | This is reverting a change introduced in linear types commit 40fa237e1da. Previously, we had to abort early, but thanks to later changes, this is no longer needed. There's no test, but the behavior should be better. The plan is to remove levity polymorphism checking in the desugarer anyway.
* Add a regression test for #17697Krzysztof Gogolewski2021-07-273-0/+15
|
* Remove some unused namesKrzysztof Gogolewski2021-07-272-23/+8
| | | | The comment about 'parError' was obsolete.
* Simplify FFI codeKrzysztof Gogolewski2021-07-271-15/+7
| | | | Remains of the dotnet FFI, see a7d8f43718 and 1fede4bc95
* Re #18087 !6238 Empty line in front of :since:Andreas Abel2021-07-271-0/+3
| | | | Ack. @monoidal
* Issue #18087: :since: for warnings of ghc 6/7/8Andreas Abel2021-07-271-0/+113
| | | | | | | | | | | Added :since: fields to users_guide on warning, for warnings introduced starting GHC 6.0. The data was extracted from the HTML docs on warnings, see https://gitlab.haskell.org/ghc/ghc/-/issues/18087 and partially verified by consulting the change logs.
* Doc: warnings: since: remove minor version number for uniformityAndreas Abel2021-07-271-5/+5
| | | | | New warnings are only released in major versions, it seems. One way or the other, a .1 minor version can always be dropped.
* Doc: tabs to spacesAndreas Abel2021-07-271-2/+2
|
* Parser: suggest TemplateHaskell on $$(...) (#20157)Krzysztof Gogolewski2021-07-276-0/+23
|
* Eliminate unnecessary unsafeEqualityProofSimon Peyton Jones2021-07-274-50/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch addresses #20143, which wants to discard unused calls to unsafeEqualityProof. There are two parts: * In exprOkForSideEffects, we want to know that unsafeEqualityProof indeed terminates, without any exceptions etc * But we can only discard the case if we know that the coercion variable is not used, which means we have to gather accurate occurrence info for CoVars. Previously OccurAnal only did a half hearted job of doing so; this patch finishes the job. See Note [Gather occurrences of coercion variables] in OccurAnal. Because the occurrence analyser does more work, there is a small compile-time cost but it's pretty small. The compiler perf tests are usually 0.0% but occasionally up to 0.3% increase. I'm just going to accept this -- gathering accurate occurrence information really seems like the Right Thing to do. There is an increase in `compile_time/peak_megabytes_allocated`, for T11545, or around 14%; but I can't reproduce it on my machine (it's the same before and after), and the peak-usage stats are vulnerable to when exactly the GC takes place, so I'm just going to accept it. Metric Increase: T11545
* Eta expand through CallStacksSimon Peyton Jones2021-07-276-24/+217
| | | | | | | This patch fixes #20103, by treating HasCallStack constraints as cheap when eta-expanding. See Note [Eta expanding through CallStacks] in GHC.Core.Opt.Arity
* Make CallStacks work better with RebindableSyntaxSimon Peyton Jones2021-07-2713-43/+222
| | | | | | | | | | | | | | | | | | | | As #19918 pointed out, the CallStack mechanism didn't work well with RebindableSyntax. This patch improves matters. See GHC.Tc.Types.Evidence Note [Overview of implicit CallStacks] * New predicate isPushCallStackOrigin distinguishes when a CallStack constraint should be solved "directly" or by pushing an item on the stack. * The constructor EvCsPushCall now has a FastString, which can describe not only a function call site, but also things like "the literal 42" or "an if-then-else expression". * I also fixed #20126 thus: exprCtOrigin (HsIf {}) = IfThenElseOrigin (Previously it was "can't happen".)
* testsuite: Add more debug output on failure to call ghc-pkgMatthew Pickering2021-07-271-1/+1
|
* hadrian: Call ghc-pkg recache after copying package database into bindistMatthew Pickering2021-07-271-0/+5
| | | | | | | | | | | The package.cache needs to have a later mod-time than all of the .conf files. This invariant can be destroyed by `cp -r` and so we run `ghc-pkg recache` to ensure the package database which is distributed is consistent. If you are installing a relocatable bindist, for example, on windows, you should preserve mtimes by using cp -a or run ghc-pkg recache after installing.
* hadrian: Add exe suffix to executables in testsuiteMatthew Pickering2021-07-271-4/+4
|
* hadrian: Install windows bindist by copying in test_hadrianMatthew Pickering2021-07-271-3/+12
|
* packaging: Don't include configure scripts in windows bindistMatthew Pickering2021-07-271-11/+13
| | | | Fixes #19868
* packaging: Add note about wrappersMatthew Pickering2021-07-271-3/+27
|
* packaging: Create both versioned and unversioned executablesMatthew Pickering2021-07-273-6/+67
| | | | | | | | | Before we would just copy the unversioned executable into the bindist. Now the actual executable is copied into the bindist and a version suffix is added. Then a wrapper or symlink is added which points to the versioned executable. Fixes #20074
* hadrian: Remove special haddock copying ruleMatthew Pickering2021-07-271-12/+0
|
* hadrian: Update hsc2hs wrapper to match current masterMatthew Pickering2021-07-271-19/+5
|