summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Apply 2 suggestion(s) to 2 file(s)wip/duog/dtrace-on-linuxBen Gamari2021-12-132-1/+2
|
* docs: Add dtrace on linux to 9.4.1 release notesDouglas Wilson2021-12-131-0/+4
|
* tests: Add a test for dtrace probe pointsDouglas Wilson2021-12-135-0/+24
|
* configure: check for ld.gold bug 27775 and disable DTrace probes for linux in CIAdam Sandberg Ericsson2021-12-133-4/+68
|
* hadrian & make: support dtrace probes on linux via systemtapAdam Sandberg Ericsson2021-11-269-2/+47
|
* ci: enable dtrace for freebsd and osxAdam Sandberg Ericsson2021-11-261-3/+7
|
* hadrian: support building dtrace probes #18133Adam Sandberg Ericsson2021-11-267-9/+101
|
* Kill a use of %n format specifierGreg Steuck2021-11-253-15/+21
| | | | | | | | | | | | | | This format has been used as a security exploit vector for decades now. Some operating systems (OpenBSD, Android, MSVC). It is targeted for removal in C2X standard: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2834.htm This requires extending the debug message function to return the number of bytes written (like printf(3)), to permit %n format specifier in one in one invocation of statsPrintf() in report_summary(). Implemented by Matthias Kilian (kili<AT>outback.escape.de)
* Permit multiple values in config_args for validateGreg Steuck2021-11-251-1/+1
| | | | | The whitespace expansion should be permitted to pass multiple arguments to configure.
* Link against libatomic for 64-bit atomic operationsIlias Tsitsimpis2021-11-251-6/+37
| | | | | | | Some platforms (e.g., armel) require linking against libatomic for 64-bit atomic operations. Fixes #20549
* hadrian: Add `collect_stats` flavour transformerSebastian Graf2021-11-252-0/+20
| | | | | This is useful for later consumption with https://gitlab.haskell.org/bgamari/ghc-utils/-/blob/master/ghc_timings.py
* compiler: Mark GHC.Prelude as Haddock no-homeBen Gamari2021-11-251-0/+1
| | | | This significantly improves Haddock documentation generated by nix.
* Allow boring class declarations in hs-boot filessheaf2021-11-2514-4/+126
| | | | | | | | | | | | | | | | | | | | | | | There are two different ways of declaring a class in an hs-boot file: - a full declaration, where everything is written as it is in the .hs file, - an abstract declaration, where class methods and superclasses are left out. However, a declaration with no methods and a trivial superclass, such as: class () => C a was erroneously considered to be an abstract declaration, because the superclass is trivial. This is remedied by a one line fix in GHC.Tc.TyCl.tcClassDecl1. This patch also further clarifies the documentation around class declarations in hs-boot files. Fixes #20661, #20588.
* Add `llvmOptLevel` to `DynFlags` (#20500)Gergo ERDI2021-11-252-5/+7
|
* Add specific optimization flag for Cmm control flow analysis (#20500)Gergo ERDI2021-11-254-2/+15
|
* Add specific optimization flag for fast PAP calls (#6084, #20500)Gergo ERDI2021-11-254-1/+5
|
* Use `simplify` in non-optimizing build pipeline (#20500)Gergo ERDI2021-11-251-4/+2
|
* GHCi Debugger - Improve RTTIRoland Senn2021-11-253-10/+13
| | | | | | | When processing the heap, use also `APClosures` to create additional type constraints. This adds more equations and therefore improves the unification process to infer the correct type of values at breakpoints. (Fix the `incr` part of #19559)
* drop instance Semigroup InstalledModuleEnvPepe Iborra2021-11-251-1/+4
| | | | Instead, introduce plusInstalledModuleEnv
* Drop instance Semigroup ModuleEnvPepe Iborra2021-11-251-1/+0
| | | | There is more than one possible Semigroup and it is not needed since plusModuleEnv can be used directly
* Monoid instance for InstalledModuleEnvPepe Iborra2021-11-251-0/+3
|
* gitlab-ci: Add release jobs for Darwin targetsBen Gamari2021-11-251-13/+30
| | | | | | | | | As noted in #20707, the validate jobs which we previously used lacked profiling support. Also clean up some variable definitions. Fixes #20707.
* testsuite: debounce title updatesZubin Duggal2021-11-251-5/+20
|
* Disable warnings for unused goto labelsGreg Steuck2021-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Clang on OpenBSD aborts compilation with this diagnostics: ``` % "inplace/bin/ghc-stage1" -optc-Wno-error=unused-label -optc-Wall -optc-Werror -optc-Wall -optc-Wextra -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Wpointer-arith -optc-Wmissing-noreturn -optc-Wnested-externs -optc-Wredundant-decls -optc-Wno-aggregate-return -optc-fno-strict-aliasing -optc-fno-common -optc-Irts/dist-install/build/./autogen -optc-Irts/include/../dist-install/build/include -optc-Irts/include/. -optc-Irts/. -optc-DCOMPILING_RTS -optc-DFS_NAMESPACE=rts -optc-Wno-unknown-pragmas -optc-O2 -optc-fomit-frame-pointer -optc-g -optc-DRtsWay=\"rts_v\" -static -O0 -H64m -Wall -fllvm-fill-undef-with-garbage -Werror -this-unit-id rts -dcmm-lint -package-env - -i -irts -irts/dist-install/build -Irts/dist-install/build -irts/dist-install/build/./autogen -Irts/dist-install/build/./autogen -Irts/include/../dist-install/build/include -Irts/include/. -Irts/. -optP-DCOMPILING_RTS -optP-DFS_NAMESPACE=rts -O2 -Wcpp-undef -Wnoncanonical-monad-instances -c rts/linker/Elf.c -o rts/dist-install/build/linker/Elf.o rts/linker/Elf.c:2169:1: error: error: unused label 'dl_iterate_phdr_fail' [-Werror,-Wunused-label] | 2169 | dl_iterate_phdr_fail: | ^ dl_iterate_phdr_fail: ^~~~~~~~~~~~~~~~~~~~~ rts/linker/Elf.c:2172:1: error: error: unused label 'dlinfo_fail' [-Werror,-Wunused-label] | 2172 | dlinfo_fail: | ^ dlinfo_fail: ^~~~~~~~~~~~ 2 errors generated. ```
* Don't use implicit lifting when deriving LiftMatthew Pickering2021-11-254-10/+34
| | | | | | | | | | | | | | | | It isn't much more complicated to be more precise when deriving Lift so we now generate ``` data Foo = Foo Int Bool instance Lift Foo where lift (Foo a b) = [| Foo $(lift a) $(lift b) |] liftTyped (Foo a b) = [|| Foo $$(lift a) $$(lift b) |] ``` This fixes #20688 which complained about using implicit lifting in the derived code.
* Add Data.Bits changes to base 4.16 changelogsheaf2021-11-251-0/+16
| | | | | | | | | | Several additions since 4.15 had not been recorded in the changelog: - newtypes And, Ior, Xor and Iff, - oneBits - symbolic synonyms `.^.`, `.>>.`, `!>>.`, `.<<.` and `!<<.`. Fixes #20608.
* Apply 1 suggestion(s) to 1 file(s)John Ericson2021-11-251-1/+1
|
* Reorder `sed` arguments to work with BSD sedGreg Steuck2021-11-251-2/+3
| | | | | | The order was swapped in 490e8c750ea23ce8e2b7309e0d514b7d27f231bb causing the build on OpenBSD to fail with: `sed: 1: "mk/config.h": invalid command code m`
* Misc cleanupKrzysztof Gogolewski2021-11-2517-95/+35
| | | | | | | | | | | | | | | | | | | | | * Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603
* Enable UnboxedTuples in `genInst`, Fixes #20524CarrieMY2021-11-259-11/+32
|
* Compare types of recursive let-bindings in alpha-equivalenceChristiaan Baaij2021-11-256-146/+254
| | | | | | | | | | | | | This commit fixes #20641 by checking the types of recursive let-bindings when performing alpha-equality. The `Eq (DeBruijn CoreExpr)` instance now also compares `BreakPoint`s similarly to `GHC.Core.Utils.eqTickish`, taking bound variables into account. In addition, the `Eq (DeBruijn Type)` instance now correctly compares the kinds of the types when one of them contains a Cast: the instance is modeled after `nonDetCmpTypeX`.
* Ensure new Ct/evidence invariantChristiaan Baaij2021-11-254-31/+80
| | | | | | | | | | The `ctev_pred` field of a `CtEvidence` is a just a cache for the type of the evidence. More precisely: * For Givens, `ctev_pred` = `varType ctev_evar` * For Wanteds, `ctev_pred` = `evDestType ctev_dest` This new invariant is needed because evidence can become part of a type, via `Castty ty kco`.
* Use getExecutablePath in getBaseDir on OpenBSDGreg Steuck2021-11-251-2/+2
| | | | | | | | While OpenBSD doesn't have a general mechanism for determining the path of the executing program image, it is reasonable to rely on argv[0] which happens as a fallback in getExecutablePath. With this change on top of T18173 we can get a bit close to fixing #18173.
* Revert "Convert lookupIdSubst panic back to a warning (#20200)"Matthew Pickering2021-11-251-6/+4
| | | | This reverts commit df1d808f26544cbb77d85773d672137c65fd3cc7.
* Make T14075 more robustMatthew Pickering2021-11-251-0/+2
|
* Correct retypechecking in --make modeMatthew Pickering2021-11-2514-128/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note [Hydrating Modules] ~~~~~~~~~~~~~~~~~~~~~~~~ What is hydrating a module? * There are two versions of a module, the ModIface is the on-disk version and the ModDetails is a fleshed-out in-memory version. * We can **hydrate** a ModIface in order to obtain a ModDetails. Hydration happens in three different places * When an interface file is initially loaded from disk, it has to be hydrated. * When a module is finished compiling, we hydrate the ModIface in order to generate the version of ModDetails which exists in memory (see Note) * When dealing with boot files and module loops (see Note [Rehydrating Modules]) Note [Rehydrating Modules] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If a module has a boot file then it is critical to rehydrate the modules on the path between the two. Suppose we have ("R" for "recursive"): ``` R.hs-boot: module R where data T g :: T -> T A.hs: module A( f, T, g ) where import {-# SOURCE #-} R data S = MkS T f :: T -> S = ...g... R.hs: module R where data T = T1 | T2 S g = ...f... ``` After compiling A.hs we'll have a TypeEnv in which the Id for `f` has a type type uses the AbstractTyCon T; and a TyCon for `S` that also mentions that same AbstractTyCon. (Abstract because it came from R.hs-boot; we know nothing about it.) When compiling R.hs, we build a TyCon for `T`. But that TyCon mentions `S`, and it currently has an AbstractTyCon for `T` inside it. But we want to build a fully cyclic structure, in which `S` refers to `T` and `T` refers to `S`. Solution: **rehydration**. *Before compiling `R.hs`*, rehydrate all the ModIfaces below it that depend on R.hs-boot. To rehydrate a ModIface, call `typecheckIface` to convert it to a ModDetails. It's just a de-serialisation step, no type inference, just lookups. Now `S` will be bound to a thunk that, when forced, will "see" the final binding for `T`; see [Tying the knot](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/tying-the-knot). But note that this must be done *before* compiling R.hs. When compiling R.hs, the knot-tying stuff above will ensure that `f`'s unfolding mentions the `LocalId` for `g`. But when we finish R, we carefully ensure that all those `LocalIds` are turned into completed `GlobalIds`, replete with unfoldings etc. Alas, that will not apply to the occurrences of `g` in `f`'s unfolding. And if we leave matters like that, they will stay that way, and *all* subsequent modules that import A will see a crippled unfolding for `f`. Solution: rehydrate both R and A's ModIface together, right after completing R.hs. We only need rehydrate modules that are * Below R.hs * Above R.hs-boot There might be many unrelated modules (in the home package) that don't need to be rehydrated. This dark corner is the subject of #14092. Suppose we add to our example ``` X.hs module X where import A data XT = MkX T fx = ...g... ``` If in `--make` we compile R.hs-boot, then A.hs, then X.hs, we'll get a `ModDetails` for `X` that has an AbstractTyCon for `T` in the the argument type of `MkX`. So: * Either we should delay compiling X until after R has beeen compiled. * Or we should rehydrate X after compiling R -- because it transitively depends on R.hs-boot. Ticket #20200 has exposed some issues to do with the knot-tying logic in GHC.Make, in `--make` mode. this particular issue starts [here](https://gitlab.haskell.org/ghc/ghc/-/issues/20200#note_385758). The wiki page [Tying the knot](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/tying-the-knot) is helpful. Also closely related are * #14092 * #14103 Fixes tickets #20200 #20561
* Combine STG free variable traversals (#17978)nineonine2021-11-2313-319/+288
| | | | | | | | | | | | | | | | | | | | | Previously we would traverse the STG AST twice looking for free variables. * Once in `annTopBindingsDeps` which considers top level and imported ids free. Its output is used to put bindings in dependency order. The pass happens in STG pipeline. * Once in `annTopBindingsFreeVars` which only considers non-top level ids free. Its output is used by the code generator to compute offsets into closures. This happens in Cmm (CodeGen) pipeline. Now these two traversal operations are merged into one - `FVs.depSortWithAnnotStgPgm`. The pass happens right at the end of STG pipeline. Some type signatures had to be updated due to slight shifts of StgPass boundaries (for example, top-level CodeGen handler now directly works with CodeGen flavoured Stg AST instead of Vanilla). Due to changed order of bindings, a few debugger type reconstruction bugs have resurfaced again (see tests break018, break021) - work item #18004 tracks this investigation. authors: simonpj, nineonine
* gitlab-ci: Bump DOCKER_REVBen Gamari2021-11-231-1/+1
|
* Add a warning for GADT match + NoMonoLocalBinds (#20485)Krzysztof Gogolewski2021-11-2312-14/+109
| | | | | | | | | Previously, it was an error to pattern match on a GADT without GADTs or TypeFamilies. This is now allowed. Instead, we check the flag MonoLocalBinds; if it is not enabled, we issue a warning, controlled by -Wgadt-mono-local-binds. Also fixes #20485: pattern synonyms are now checked too.
* Don't include types in test outputAndreas Klebinger2021-11-234-45/+32
|
* CmmSink: Be more aggressive in removing no-op assignments.Andreas Klebinger2021-11-239-6/+897
| | | | | | | | | | No-op assignments like R1 = R1 are not only wasteful. They can also inhibit other optimizations like inlining assignments that read from R1. We now check for assignments being a no-op before and after we simplify the RHS in Cmm sink which should eliminate most of these no-ops.
* Hadrian: bump stackage LTS to 18.18 (GHC 8.10.7)Sylvain Henry2021-11-222-7/+7
|
* Make INLINE/NOINLINE pragmas a bgi less constrainingSimon Peyton Jones2021-11-226-53/+75
| | | | | | | | We can inline a bit earlier than the previous pragmas said. I think they dated from an era in which the InitialPhase did no inlining. I don't think this patch will have much effect, but it's a bit cleaner.
* Better wrapper activation calculationSimon Peyton Jones2021-11-222-34/+80
| | | | | | | | | | | | | As #20709 showed, GHC could prioritise a wrapper over a SPEC rule, which is potentially very bad. This patch fixes that problem. The fix is is described in Note [Wrapper activation], especially item 4, 4a, and Conclusion. For now, it has a temporary hack (replicating what was there before to make sure that wrappers inline no earlier than phase 2. But it should be temporary; see #19001.
* Include "not more specific" info in overlap msgsheaf2021-11-2048-232/+337
| | | | | | | | | When instances overlap, we now include additional information about why we weren't able to select an instance: perhaps one instance overlapped another but was not strictly more specific, so we aren't able to directly choose it. Fixes #20542
* Use 'NonEmpty' for the fields in an 'HsProjection' (#20389)Zubin Duggal2021-11-2016-20/+70
| | | | | | | | | | | | T12545 is very inconsistently affected by this change for some reason. There is a decrease in allocations on most configurations, but an increase on validate-x86_64-linux-deb9-unreg-hadrian. Accepting it as it seems unrelated to this patch. Metric Decrease: T12545 Metric Increase: T12545
* gitlab-ci: Set HOME to plausible but still non-existent locationBen Gamari2021-11-201-1/+3
| | | | | | | | | | | | | We have been seeing numerous CI failures on aarch64/Darwin of the form: CI_COMMIT_BRANCH: CI_PROJECT_PATH: ghc/ghc error: creating directory '/nonexistent': Read-only file system Clearly *something* is attempting to create `$HOME`. A bit of sleuthing by @int-e found that the culprit is likely `nix`, although it's not clear why. For now we avoid the issue by setting `HOME` to a fresh directory in the working tree.
* rts: Ensure that markCAFs marks object codeBen Gamari2021-11-201-4/+11
| | | | | | | | | | | | | Previously `markCAFs` would only evacuate CAFs' indirectees. This would allow reachable object code to be unloaded by the linker as `evacuate` may never be called on the CAF itself, despite it being reachable via the `{dyn,revertible}_caf_list`s. To fix this we teach `markCAFs` to explicit call `markObjectCode`, ensuring that the linker is aware of objects reachable via the CAF lists. Fixes #20649.
* More support for optional home-unitSylvain Henry2021-11-2018-141/+179
| | | | | | | | | This is a preliminary refactoring for #14335 (supporting plugins in cross-compilers). In many places the home-unit must be optional because there won't be one available in the plugin environment (we won't be compiling anything in this environment). Hence we replace "HomeUnit" with "Maybe HomeUnit" in a few places and we avoid the use of "hsc_home_unit" (which is partial) in some few others.
* Remove unused module import syntax from .bkp modeMatthew Pickering2021-11-203-27/+7
| | | | | | | | | | | | | | | .bkp mode had this unused feature where you could write module A and it would go looking for A.hs on the file system and use that rather than provide the definition inline. This isn't use anywhere in the testsuite and the code to find the module A looks dubious. Therefore to reduce .bkp complexity I propose to remove it. Fixes #20701