[Git][ghc/ghc][wip/T27731] 22 commits: RTS: Update flag parsing/handling:
by Simon Peyton Jones (@simonpj) 09 Oct '26
by Simon Peyton Jones (@simonpj) 09 Oct '26
09 Oct '26
Simon Peyton Jones pushed to branch wip/T27731 at Glasgow Haskell Compiler / GHC
Commits:
c406135c by Andreas Klebinger at 2026-10-01T06:57:28-04:00
RTS: Update flag parsing/handling:
Using 0 as argument to any of these flags now resets the flags setting to default:
- ``-n0`` disables nursery chunking.
- ``-K0`` (or a bare ``-K``) removes the stack size limit.
- ``-M0`` removes the heap size limit.
- ``-H0`` resets the suggested heap size, including the nursery scaling set by ``-H``.
- ``-AL0`` makes the large object allocation limit follow ``-A`` again.
GC Generations are now limited to 64.
-n larger than -A now emits a warning and disables chunking.
Fixes #27830 #27829
- - - - -
984ee82b by Andreas Klebinger at 2026-10-01T06:58:10-04:00
Fix MultiLayerModules timeout multiplier.
We accidentally used the compile multiplier for ghci commands which
use the run timeout setting to set the timeout.
Fixes #26263 and #27796.
- - - - -
50a9cf26 by Andreas Klebinger at 2026-10-01T06:58:10-04:00
testsuite: Include runtime in JUnit report.
- - - - -
e358619f by Alan Zimmerman at 2026-10-01T06:59:01-04:00
EPA: Use EpaLocation in EpVirtualBraces
Haddock processing uses EpLayout.EpVirtualBraces to record the current
layout column, for allocating haddock comments correctly.
For exact printing, we need the line as well as the col, so we know
how many lines to skip when the indented code block starts.
This commit updates EpLayout.EpVirtualBraces so that it carries an
EpaLocation instead of just the Int column, to allow it to be used for
both purposes.
It is a simple mechanical change, with no other impact, but it allows
us to use EpLayout instead of AnnListLayout in AnnList, in the next
commit in this series.
- - - - -
1d2a26ee by Andrew Lelechenko at 2026-10-01T20:22:04-04:00
Remove bitSize from MINIMAL pragma of class Bits
Cf. https://github.com/haskell/core-libraries-committee/issues/441
The function is deprecated for 12 years and has a default implementation,
yet it was never removed from the MINIMAL pragma, putting library authors
in a very awkward position. Let's finally remove bitSize from MINIMAL.
- - - - -
3cc21e4c by Hannes Siebenhandl at 2026-10-01T20:22:59-04:00
Add regression test for #27641
- - - - -
c35096f5 by Hannes Siebenhandl at 2026-10-01T20:23:00-04:00
Don't `:add` modules the loader will reject
Only home modules can be actually added to the loader context, thus we
only accept the module if it belongs to a home unit.
- - - - -
a563cb27 by Simon Jakobi at 2026-10-02T17:37:36-04:00
ci: accept modified changelog.d entries in lint-changelog
The changelog guide says to extend an existing entry rather than add a
new one when the feature is already documented. lint_changelog only
counted added files, so such MRs failed before the validator ran.
Fixes #27779.
Assisted-by: Claude Fable 5.1
- - - - -
03082cd4 by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix warning flag name in the semaphore-v2 entry
The entry refers to -Wsemaphore-version-mismatch, which does not exist.
The warning GHC emits when it cannot use a -jsem semaphore, including
on a protocol version mismatch, is -Wsemaphore-open-failure.
Context: !15729, #25087
Assisted-by: Claude Fable 5.1
- - - - -
a93705ee by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix the CLC proposal link in the T27455 entry
The entry used the Sphinx :ref: role with a URL as its target. :ref:
resolves only internal labels, so the generated release notes would
show the proposal name without a link. Use the plain hyperlink form
like the other entries.
Context: !16274, #27455
Assisted-by: Claude Fable 5.1
- - - - -
54381079 by Hannes Siebenhandl at 2026-10-02T17:39:01-04:00
Extend the `TrustOverlay` for wired-in units
The TrustOverlay only contained the `UnitId` of all on-disk units.
However, wired-in units are referred to by their wired-in unit id, which
is not the same as the on-disk unit id.
Thus, trust checks for wired-in units failed because the lookup was
using the wired-in unit, which wasn't present in the `TrustOverlay`.
We fix #27834, by copying the trust info for wired-in unit ids.
- - - - -
f8cfb1a5 by Hécate Kleidukos at 2026-10-04T19:36:39+02:00
[CLC 341] Strict variants of mutable types
This commit is the implementation of CLC Proposal 341
https://github.com/haskell/core-libraries-committee/issues/341
- - - - -
575c4bc6 by Rodrigo Mesquita at 2026-10-05T12:32:02-04:00
ttg: HsModuleName in the AST, ModuleName in GHC
This commit makes the AST fully independent from GHC by parsing a
"module name" as an `HsModuleName (= HText)` rather than constructing an
`ModuleName (= FastString)` straight away.
In the GHC side, everything remains as a `ModuleName`. We turn AST
`HsModuleName`s into fast strings with the cheap `mkFastStringShortText`
when we process the AST for manipulation within the compiler.
There are no performance regressions introduced by this approach.
This is the final piece of #21592
Alternative plans were discussed in
gitlab.haskell.org/ghc/ghc/-/merge_requests/16546#note_694647,
but the Simon suggested one won in simplicity and performance when
compared against my attempt at implementing my original plan of having
a family `ModuleNameP`.
- - - - -
b3b89d32 by mangoiv at 2026-10-05T22:03:32-04:00
hadrian: Persist the used flavour name in the build root (#20650)
This executes the idea proposed in #20650, teaching Hadrian to persist
the flavour used to build a build root. This both makes use of multiple
build roots more ergonomic (as the user no longer needs to repeat
themselves) and avoids a tiresome foot-gun (forgetting to specify a
flavour, often wholly invalidating a build root).
Closes #20650.
Co-authored-by: Sylvain Henry <sylvain(a)haskus.fr>
- - - - -
f977837b by mangoiv at 2026-10-05T22:04:21-04:00
configure: fix sed script and subst tooldir script
Fixes #27672
Adds sanity checking for SUBST_TOOLDIR
Metric Decrease:
LinkableUsage01
MultiLayerModulesTH_OneShot
T10547
T12234
T12425
T13035
T13820
T18140
T18730
T18923
T9198
TcPlugin_RewritePerf
mhu-perf
- - - - -
f1cb08be by Hannes Siebenhandl at 2026-10-05T22:05:03-04:00
Prepend in-memory unit database for backpack
The packageDbFlags are stored in reverse order. Thus, prepending will
ensure that the in-memory unit database is the last item on the unit
database stack.
Further, the in-memory unit database needs to be able to shadow units
from earlier unit databases in the unit database stack.
Moreover, a `-clear-package-db` would remove the in-memory database if
it weren't the last item on the stack.
Closes #27835
- - - - -
8d49ed42 by Kazu Yamamoto at 2026-10-06T19:37:25-04:00
Do not leave standard file descriptors free at startup (#24450)
A process may be started with stdout closed -- `prog >&-` from a shell does
exactly that. Nothing then reserves descriptor 1, and open(), pipe() and
socket() hand out the lowest free descriptor, so the next descriptor the
runtime creates for itself takes it: the ticker's pipe, or a capability's IO
manager control pipe.
'GHC.Internal.IO.StdHandles.stdout' is a CAF, built the first time the program
writes to stdout, which is long after that has happened. It builds a 'Handle'
over descriptor 1, which now belongs to the runtime, and nothing reports an
error because the descriptor is perfectly good. The program then writes its
output into the runtime's own plumbing.
What that looks like from the outside is a hang. The descriptor the Handle has
taken over is the read end of a pipe, so poll() for POLLOUT on it never says
yes and epoll_ctl() accepts a registration for it; the thread waiting to write
blocks for ever. Closing the Handle at exit closes the runtime's descriptor,
which is worse: the ticker then fails on every tick.
'hs_init_ghc' now opens /dev/null onto whichever of descriptors 0, 1 and 2 are
closed, before the runtime creates any descriptor of its own. Each is opened
for the access that descriptor would normally have, read-only for 0 and
write-only for 1 and 2, so that writing to 'stdin' or reading from 'stdout'
still fails rather than quietly succeeding against /dev/null. See
Note [Standard file descriptors must be open].
Moving only the descriptors the runtime opens would not do: the first file the
program itself opened would land on the free number instead. The fix has to
leave no free number. A program run this way therefore finds stdout connected
to /dev/null rather than failing with EBADF on the first write, which is what
such a program would get from most other language runtimes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply(a)anthropic.com>
- - - - -
65bcf9e9 by Simon Jakobi at 2026-10-06T19:38:09-04:00
changelog: Repair the sentence describing #27477
The description read "programs using could crash", the object of
"using" having been lost. The synopsis already says which programs are
affected, so drop the dangling word.
Assisted-by: Claude Fable 5.1
- - - - -
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
2dc51234 by Simon Peyton Jones at 2026-10-09T12:10:31+01:00
Simplify the error-suppression mechanism in GHC.Tc.Errors
In `GHC.Tc.Errors.reportWanteds` we suppress some errors in favour of
others. But the mechanism had grown crufty, and #27331 exposed a bug.
This MR makes it simpler and more uniform, by doing everything via
the `ei_suppress` field of the ErrorItem.
Claude then found another closely-related bug (see the review linked
on !16564). That bug is immortalised in new test T18851d.
I'm still not happy with `ignoreConstraint` but we can worry about
that another day; I have not touched it.
Main changes
* Instead of /predicting/ when an error will be reported, we set
`cec_error_reported` when an error is /actually/ reported. (I renamed
it from `cec_suppress` to reflect this change.)
Now errors are suppressed only when a preceding error has actually been
reported. Simpler and more robust.
See `Note [cec_error_reported: suppressing less-serious errors]`
The big changes are in `reportWanteds` which looks very different.
* New `Note [ei_suppress: suppressing confusing errors]` describes the
(quite separate) `ei_suppress` mechanism for suppressing confusing
errors, mainly arising from non-empty rewriter sets
* In `tryTypeClassDefaulting`, instead of switching off type-class defaulting
if there is an insoluble /anywhere/, we just switch it off locally when
we find an insoluble sub-tree. See Note [When to do type-class defaulting]
and (W5) in Note [ApproximateWC]
* Greatly simplify `insolubleWantedCt`.
* I made type-class-defaulting be a bit more eager, only switched off when
a peer or ancestor (but not child) constraint is insoluble. See
Note [When to do type-class defaulting].
Small refactorings
* Rename `askNoErrs` to `askErrsFound` and flip its polarity
* The code for "check if ei_suppress is true of all items" code is
moved to `mkErrorItems` rather than in the large `reportWanteds`.
* Code for `has_gadt_match` moves to `mkGivenErrorReporter`, rather than
polluting the large `reportWanteds`.
* Many tests with `-fdefer-type-errors` get more warnings, especially
about ambiguous (Num a) constraints. This is by-design: see
Note [Always warn with -fdefer-type-errors]. Previously GHC was not
honouring this Note but now it is, hence the extra errors.
- - - - -
209 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/24450
- + changelog.d/27641
- + changelog.d/27845
- changelog.d/T27455
- + changelog.d/T27731
- + changelog.d/T27830-rts-flag-bounds
- + changelog.d/clc-341-strict-mutable-data-types
- changelog.d/fix-parallel-gc-selector-race-27477
- + changelog.d/hadrian-persist-flavour
- changelog.d/semaphore-v2
- changelog.d/unit-index
- compiler/GHC.hs
- compiler/GHC/Builtin/Modules.hs
- compiler/GHC/Builtin/WiredIn/Ids.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Show.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Pipeline.hs-boot
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Types/UnresolvedImport.hs
- compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Home.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Env.hs
- + compiler/GHC/Unit/Module/Name.hs
- compiler/GHC/Unit/Parser.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- compiler/Language/Haskell/Syntax/Text.hs
- compiler/ghc.cabal.in
- distrib/configure.ac.in
- docs/users_guide/runtime_control.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- hadrian/doc/flavours.md
- hadrian/src/Rules.hs
- hadrian/src/Settings.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent/Chan.hs
- + libraries/base/src/Control/Concurrent/Chan/Strict.hs
- libraries/base/src/Control/Concurrent/MVar.hs
- + libraries/base/src/Control/Concurrent/MVar/Strict.hs
- libraries/base/src/Data/IORef.hs
- + libraries/base/src/Data/IORef/Strict.hs
- libraries/ghc-internal/src/GHC/Internal/Bits.hs
- linters/lint-codes/LintCodes/Static.hs
- m4/subst_tooldir.m4
- rts/RtsFlags.c
- rts/RtsStartup.c
- rts/include/rts/Flags.h
- rts/include/rts/storage/GC.h
- rts/sm/GC.c
- rts/sm/Storage.c
- testsuite/driver/junit.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- + testsuite/tests/backpack/should_compile/T27835.bkp
- + testsuite/tests/backpack/should_compile/T27835.stderr
- testsuite/tests/backpack/should_compile/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- testsuite/tests/ghc-api/downsweep/IncrementalDownsweep.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/ghci/prog020/ghci.prog020a.stderr
- testsuite/tests/ghci/prog020/ghci.prog020b.stderr
- testsuite/tests/ghci/prog021/prog021a.stderr
- testsuite/tests/ghci/prog021/prog021b.stderr
- testsuite/tests/ghci/prog022/ghci.prog022a.stderr
- testsuite/tests/ghci/prog022/ghci.prog022b.stderr
- testsuite/tests/ghci/prog022/ghci.prog022c.stderr
- testsuite/tests/ghci/prog022/ghci.prog022d.stderr
- testsuite/tests/ghci/prog022/ghci.prog022e.stderr
- testsuite/tests/ghci/prog022/ghci.prog022f.stderr
- testsuite/tests/ghci/scripts/Defer02.stderr
- + testsuite/tests/ghci/scripts/T27641.script
- + testsuite/tests/ghci/scripts/T27641.stderr
- + testsuite/tests/ghci/scripts/T27641.stdout
- + testsuite/tests/ghci/scripts/T27834.hs
- + testsuite/tests/ghci/scripts/T27834.script
- + testsuite/tests/ghci/scripts/T27834.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/hiefile/should_run/T24544.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/module/mod130.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/overloadedstrings/should_fail/T25926.stderr
- testsuite/tests/overloadedstrings/should_fail/T27124.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- testsuite/tests/patsyn/should_fail/records-nofieldselectors.stderr
- testsuite/tests/perf/compiler/all.T
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T17697.stderr
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/profiling/should_run/caller-cc/CallerCcParser.hs
- testsuite/tests/rename/should_fail/T15607.stderr
- testsuite/tests/rename/should_fail/T19843b.stderr
- + testsuite/tests/rts/T24450.hs
- + testsuite/tests/rts/T24450.stderr
- testsuite/tests/rts/all.T
- testsuite/tests/rts/rtsflags001.stderr-ws-32
- testsuite/tests/rts/rtsflags001.stderr-ws-64
- testsuite/tests/safeHaskell/ghci/p4.stderr
- testsuite/tests/safeHaskell/ghci/p6.stderr
- testsuite/tests/typecheck/should_compile/T11254.stderr
- testsuite/tests/typecheck/should_compile/T15370.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- testsuite/tests/typecheck/should_fail/ClassOperator.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion2.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion3.stderr
- testsuite/tests/typecheck/should_fail/FunDepOrigin1b.hs
- testsuite/tests/typecheck/should_fail/T18851.stderr
- + testsuite/tests/typecheck/should_fail/T18851e.hs
- + testsuite/tests/typecheck/should_fail/T18851e.stderr
- + testsuite/tests/typecheck/should_fail/T18851f.hs
- + testsuite/tests/typecheck/should_fail/T18851f.stderr
- testsuite/tests/typecheck/should_fail/T22940.stderr
- testsuite/tests/typecheck/should_fail/T26823.stderr
- + testsuite/tests/typecheck/should_fail/T27731.hs
- + testsuite/tests/typecheck/should_fail/T27731.stderr
- testsuite/tests/typecheck/should_fail/T5691.stderr
- testsuite/tests/typecheck/should_fail/T7437.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/mc24.stderr
- testsuite/tests/typecheck/should_fail/tcfail019.stderr
- testsuite/tests/typecheck/should_fail/tcfail189.stderr
- utils/check-exact/ExactPrint.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/63f0687417b7e514d9b842b58e3832…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/63f0687417b7e514d9b842b58e3832…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/27323] 4 commits: ci: move hadrian/ghci into the lint category so it can be picked up by more runners
by Sasha Bogicevic (@Bogicevic) 09 Oct '26
by Sasha Bogicevic (@Bogicevic) 09 Oct '26
09 Oct '26
Sasha Bogicevic pushed to branch wip/27323 at Glasgow Haskell Compiler / GHC
Commits:
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
2605998f by Sasha Bogicevic at 2026-10-09T13:08:06+02:00
Don't report -XStrict-generated bangs under -Wredundant-bang-patterns
-Wredundant-bang-patterns could warn about bangs inserted by -XStrict,
including those on unlifted function arguments and local tuple
bindings, even though there is no user-written bang to remove.
Mark bangs inserted by decideBangHood with generatedSrcSpan and track
generated code in DsLclEnv through putSrcSpanDs. The pattern-match
checker emits these bangs without SrcInfo, suppressing redundant-bang
warnings while retaining divergence checks and inaccessible-RHS
warnings.
Update tidy1 and tidy_bang_pat to use the monadic context instead of
threading a Boolean. Push sub-pattern locations when descending, and
consult inGeneratedCodeDs when checking literal overflow.
Preserve located patterns through matchSinglePatVar, pmcPatBind and
desugarPatBind, using desugarLPat so pattern bindings retain their
generated-code information.
Add regression tests T27323 and T27323b and a changelog entry.
- - - - -
20 changed files:
- .gitlab-ci.yml
- + changelog.d/27845
- + changelog.d/T27323
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Types/Demand.hs
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- + testsuite/tests/pmcheck/should_compile/T27323.hs
- + testsuite/tests/pmcheck/should_compile/T27323b.hs
- testsuite/tests/pmcheck/should_compile/all.T
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -137,15 +137,37 @@ workflow:
.lint:
stage: tool-lint
tags:
- - lint
- before_script:
- # Allow Git to read from the runner-owned checkout. This is needed
- # for example by the lint-author job.
- - git config --global --add safe.directory "$CI_PROJECT_DIR"
+ - lint-anyarch
+ image: debian:13
rules:
- *drafts-can-fail-lint
- when: always
+.install-ghc-toolchain: &install-ghc-toolchain
+ - apt update
+ - apt install -qy build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 pkg-config python3 cmake git happy alex autoconf automake python3 libgmp-dev libnuma-dev libncurses-dev
+ - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
+ - source /root/.ghcup/env
+ - ghcup --no-verbose install ghc --set --install-targets 'install_bin install_lib update_package_db' '9.10'
+ - ghcup --no-verbose install cabal --set
+ - ghc --info
+ - cabal --version
+
+# linting but we need a boot toolchain
+.lint-ghc-toolchain:
+ extends: .lint
+ before_script:
+ - *install-ghc-toolchain
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
+
+# linting but we need python
+.lint-python:
+ extends: .lint
+ before_script:
+ - apt update
+ - apt install -qy python3 mypy shellcheck git
+ - git config --global --add safe.directory "$CI_PROJECT_DIR"
+
.nightly: &nightly
variables:
XZ_OPT: "-9"
@@ -217,11 +239,11 @@ not-interruptible:
stage: not-interruptible
script: "true"
interruptible: false
- image: "debian:13"
+ image: debian:13
variables:
GIT_STRATEGY: none
tags:
- - lint
+ - lint-anyarch
rules:
# - if: '$CI_COMMIT_BRANCH == "master"'
# when: always
@@ -242,7 +264,6 @@ include: '.gitlab/jobs.yaml'
ghc-linters:
stage: tool-lint
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
extends: .lint-params
variables:
BUILD_FLAVOUR: default
@@ -258,16 +279,11 @@ ghc-linters:
# Skipped if the MR has the ~"no-changelog" label.
lint-changelog:
stage: tool-lint
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint
+ extends: .lint-ghc-toolchain
variables:
CHANGELOG_EXPECT_MR: "$CI_MERGE_REQUEST_IID"
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
- before_script:
- - export PATH="/opt/toolchain/bin:$PATH"
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
script:
- .gitlab/ci.sh lint_changelog
dependencies: []
@@ -279,42 +295,30 @@ lint-changelog:
# Run mypy Python typechecker on linter scripts.
lint-linters:
- image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
- extends: .lint
+ extends: .lint-python
variables:
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
- before_script:
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
script:
- mypy testsuite/tests/linters/regex-linters/*.py
dependencies: []
# Check that .T files all parse by listing broken tests.
lint-testsuite:
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint
+ extends: .lint-ghc-toolchain
variables:
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
- before_script:
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
script:
- - make -Ctestsuite list_broken TEST_HC=$GHC
+ - make -Ctestsuite list_broken TEST_HC=$(which ghc)
dependencies: []
# Run mypy Python typechecker on testsuite driver
typecheck-testsuite:
- image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
- extends: .lint
+ extends: .lint-python
variables:
GIT_DEPTH: 1
GIT_SUBMODULE_STRATEGY: none
- before_script:
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
script:
- mypy testsuite/driver/runtests.py
dependencies: []
@@ -323,7 +327,6 @@ typecheck-testsuite:
# accommodate, e.g., haddock changes not yet upstream) but not on `master` or
# Marge jobs.
.lint-submods:
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
extends: .lint-params
variables:
BUILD_FLAVOUR: default
@@ -341,13 +344,9 @@ typecheck-testsuite:
# Check that commits in an MR were not authored with the identity that CI uses
# when it needs to create commits itself. This only needs Git history.
lint-author:
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- extends: .lint
+ extends: .lint-python
variables:
GIT_SUBMODULE_STRATEGY: none
- before_script:
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
script:
- git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
@@ -425,12 +424,9 @@ lint-submods-branch:
.lint-params:
needs: []
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
extends: .lint
before_script:
- - export PATH="/opt/toolchain/bin:$PATH"
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
+ - *install-ghc-toolchain
- .gitlab/ci.sh setup
after_script:
- .gitlab/ci.sh save_cache
@@ -448,18 +444,13 @@ lint-submods-branch:
hadrian-ghc-in-ghci:
stage: quick-build
+ extends: .lint-ghc-toolchain
needs:
- job: lint-linters
- job: lint-submods
optional: true
- image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV"
- before_script:
- # workaround for docker permissions
- - sudo chown ghc:ghc -R .
variables:
GHC_FLAGS: -Werror -Wwarn=unused-imports
- tags:
- - x86_64-linux
script:
- git clean -xdf && git submodule foreach git clean -xdf
- . .gitlab/ci.sh setup
@@ -544,6 +535,7 @@ stack-hadrian-build:
extends: hadrian-ghc-in-ghci
stage: quick-build
script:
+ - ghcup --no-verbose install stack --set
- . .gitlab/ci.sh setup
- . .gitlab/ci.sh configure
- hadrian/build-stack --version
=====================================
changelog.d/27845
=====================================
@@ -0,0 +1,5 @@
+section: compiler
+synopsis: Fix a bug where an argument used lazily only by a function's stable
+ unfolding could be treated as strict in its fields.
+mrs: !16746
+issues: #27845
=====================================
changelog.d/T27323
=====================================
@@ -0,0 +1,7 @@
+section: compiler
+synopsis: Don't report ``-XStrict``-generated bang patterns under ``-Wredundant-bang-patterns``
+description:
+ Bangs introduced by ``-XStrict`` are no longer reported as redundant under
+ ``-Wredundant-bang-patterns``, as they are not user-written.
+issues: #27323
+mrs: !16395
=====================================
compiler/GHC/HsToCore/Match.hs
=====================================
@@ -383,12 +383,14 @@ tidyEqnInfo :: MatchId -> EquationInfo
tidyEqnInfo _ eqn@(EqnDone {}) = return (idDsWrapper, eqn)
-tidyEqnInfo v eqn@(EqnMatch { eqn_pat = (L loc pat) }) = do
- (wrap, pat') <- tidy1 v (not . isGoodSrcSpan . locA $ loc) pat
+tidyEqnInfo v eqn@(EqnMatch { eqn_pat = p@(L loc _) }) = do
+ (wrap, pat') <- tidyLPat v p
return (wrap, eqn{eqn_pat = L loc pat' })
+tidyLPat :: MatchId -> LPat GhcTc -> DsM (DsWrapper, Pat GhcTc)
+tidyLPat v (L loc pat) = putSrcSpanDsA loc (tidy1 v pat)
+
tidy1 :: MatchId -- The scrutinee
- -> Bool -- `True` if the pattern was generated, `False` if it was user-written
-> Pat GhcTc -- The pattern against which it is to be matched
-> DsM (DsWrapper, -- Extra bindings to do before the match
Pat GhcTc) -- Equivalent pattern
@@ -399,21 +401,22 @@ tidy1 :: MatchId -- The scrutinee
-- It eliminates many pattern forms (as-patterns, variable patterns,
-- list patterns, etc) and returns any created bindings in the wrapper.
-tidy1 v g (ParPat _ pat) = tidy1 v g (unLoc pat)
-tidy1 v g (SigPat _ pat _) = tidy1 v g (unLoc pat)
-tidy1 _ _ (WildPat ty) = return (idDsWrapper, WildPat ty)
-tidy1 v g (BangPat _ (L l p)) = tidy_bang_pat v g l p
-tidy1 v g (ModifiedPat _ _ pat) = tidy1 v g (unLoc pat)
+tidy1 v (ParPat _ pat) = tidyLPat v pat
+tidy1 v (SigPat _ pat _) = tidyLPat v pat
+tidy1 _ (WildPat ty) = return (idDsWrapper, WildPat ty)
+tidy1 v (BangPat _ (L l p)) = putSrcSpanDsA l $ tidy_bang_pat v l p
+tidy1 v (ModifiedPat _ _ pat) = tidyLPat v pat
-- case v of { x -> mr[] }
-- = case v of { _ -> let x=v in mr[] }
-tidy1 v _ (VarPat _ (L _ var))
+tidy1 v (VarPat _ (L _ var))
= return (bindMatchId var v, WildPat (idType var))
-- case v of { x@p -> mr[] }
-- = case v of { p -> let x=v in mr[] }
-tidy1 v g (AsPat _ (L _ var) pat)
- = do { (wrap, pat') <- tidy1 v g (unLoc pat)
+tidy1 v (AsPat _ (L _ var) pat)
+
+ = do { (wrap, pat') <- tidyLPat v pat
; return (bindMatchId var v . wrap, pat') }
{- now, here we handle lazy patterns:
@@ -427,7 +430,7 @@ tidy1 v g (AsPat _ (L _ var) pat)
The case expr for v_i is just: match [v] [(p, [], \ x -> Var v_i)] any_expr
-}
-tidy1 v _ (LazyPat _ pat)
+tidy1 v (LazyPat _ pat)
-- This is a convenient place to check for unlifted types under a lazy pattern.
-- Doing this check during type-checking is unsatisfactory because we may
-- not fully know the zonked types yet. We sure do here.
@@ -441,14 +444,14 @@ tidy1 v _ (LazyPat _ pat)
; let sel_binds = [NonRec b rhs | (b,rhs) <- sel_prs]
; return (mkCoreLets sel_binds, WildPat (matchIdType v)) }
-tidy1 _ _ (ListPat ty pats)
+tidy1 _ (ListPat ty pats)
= return (idDsWrapper, unLoc list_ConPat)
where
list_ConPat = foldr (\ x y -> mkPrefixConPat consDataCon [x, y] [ty])
(mkNilPat ty)
pats
-tidy1 _ _ (TuplePat tys pats boxity)
+tidy1 _ (TuplePat tys pats boxity)
= return (idDsWrapper, unLoc tuple_ConPat)
where
arity = length pats
@@ -458,34 +461,37 @@ tidy1 _ _ (TuplePat tys pats boxity)
Boxed -> tys
-- See Note [Unboxed tuple RuntimeRep vars] in TyCon
-tidy1 _ _ (SumPat tys pat alt arity)
+tidy1 _ (SumPat tys pat alt arity)
= return (idDsWrapper, unLoc sum_ConPat)
where
sum_ConPat = mkPrefixConPat (sumDataCon alt arity) [pat] (map getRuntimeRep tys ++ tys)
-- See Note [Unboxed tuple RuntimeRep vars] in TyCon
-- LitPats: we *might* be able to replace these w/ a simpler form
-tidy1 _ g (LitPat _ lit)
- = do { unless g $
+tidy1 _ (LitPat _ lit)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $
warnAboutOverflowedLit lit
; return (idDsWrapper, tidyLitPat lit) }
-- NPats: we *might* be able to replace these w/ a simpler form
-tidy1 _ g (NPat ty (L _ lit@OverLit { ol_val = v }) mb_neg eq)
- = do { unless g $
+tidy1 _ (NPat ty (L _ lit@OverLit { ol_val = v }) mb_neg eq)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $
let lit' | Just _ <- mb_neg = lit{ ol_val = negateOverLitVal v }
| otherwise = lit
in warnAboutOverflowedOverLit lit'
; return (idDsWrapper, tidyNPat lit mb_neg eq ty) }
-- NPlusKPat: we may want to warn about the literals
-tidy1 _ g n@(NPlusKPat _ _ (L _ lit1) lit2 _ _)
- = do { unless g $ do
+tidy1 _ n@(NPlusKPat _ _ (L _ lit1) lit2 _ _)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $ do
warnAboutOverflowedOverLit lit1
warnAboutOverflowedOverLit lit2
; return (idDsWrapper, n) }
-tidy1 _ _ (OrPat ty lpats)
+tidy1 _ (OrPat ty lpats)
-- See Note [Implementation of OrPatterns]. We desugar
-- (1; 2; 3)
-- to
@@ -514,44 +520,44 @@ tidy1 _ _ (OrPat ty lpats)
single_grhs e = GRHSs emptyComments [noLocA $ GRHS noAnn [] e] (EmptyLocalBinds noExtField)
-- Everything else goes through unchanged...
-tidy1 _ _ non_interesting_pat
+tidy1 _ non_interesting_pat
= return (idDsWrapper, non_interesting_pat)
--------------------
-tidy_bang_pat :: MatchId -> Bool -> SrcSpanAnnA -> Pat GhcTc
+tidy_bang_pat :: MatchId -> SrcSpanAnnA -> Pat GhcTc
-> DsM (DsWrapper, Pat GhcTc)
-- Discard par/sig under a bang
-tidy_bang_pat v g _ (ParPat _ (L l p)) = tidy_bang_pat v g l p
-tidy_bang_pat v g _ (SigPat _ (L l p) _) = tidy_bang_pat v g l p
+tidy_bang_pat v _ (ParPat _ (L l p)) = putSrcSpanDsA l $ tidy_bang_pat v l p
+tidy_bang_pat v _ (SigPat _ (L l p) _) = putSrcSpanDsA l $ tidy_bang_pat v l p
-- Push the bang-pattern inwards, in the hope that
-- it may disappear next time
-tidy_bang_pat v g l (AsPat x v' p)
- = tidy1 v g (AsPat x v' (L l (BangPat noExtField p)))
-tidy_bang_pat v g l (XPat (CoPat w p t))
- = tidy1 v g (XPat $ CoPat w (BangPat noExtField (L l p)) t)
-tidy_bang_pat v g l (OrPat x (p:|ps)) -- push bang into first pat alt
- = tidy1 v g (OrPat x (L l (BangPat noExtField p) :| ps))
+tidy_bang_pat v l (AsPat x v' p)
+ = tidy1 v (AsPat x v' (L l (BangPat noExtField p)))
+tidy_bang_pat v l (XPat (CoPat w p t))
+ = tidy1 v (XPat $ CoPat w (BangPat noExtField (L l p)) t)
+tidy_bang_pat v l (OrPat x (p:|ps)) -- push bang into first pat alt
+ = tidy1 v (OrPat x (L l (BangPat noExtField p) :| ps))
-- Discard bang around strict pattern
-tidy_bang_pat v g _ p@(LitPat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(ListPat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(TuplePat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(SumPat {}) = tidy1 v g p
+tidy_bang_pat v _ p@(LitPat {}) = tidy1 v p
+tidy_bang_pat v _ p@(ListPat {}) = tidy1 v p
+tidy_bang_pat v _ p@(TuplePat {}) = tidy1 v p
+tidy_bang_pat v _ p@(SumPat {}) = tidy1 v p
-- Data/newtype constructors
-tidy_bang_pat v g l p@(ConPat { pat_con = L _ (RealDataCon dc)
- , pat_args = args
- , pat_con_ext = ConPatTc
- { cpt_arg_tys = arg_tys
- }
- })
+tidy_bang_pat v l p@(ConPat { pat_con = L _ (RealDataCon dc)
+ , pat_args = args
+ , pat_con_ext = ConPatTc
+ { cpt_arg_tys = arg_tys
+ }
+ })
-- Newtypes: push bang inwards (#9844)
=
if isNewTyCon (dataConTyCon dc)
- then tidy1 v g (p { pat_args = push_bang_into_newtype_arg l (scaledThing ty) args })
- else tidy1 v g p -- Data types: discard the bang
+ then tidy1 v (p { pat_args = push_bang_into_newtype_arg l (scaledThing ty) args })
+ else tidy1 v p -- Data types: discard the bang
where
(ty:_) = dataConInstArgTys dc arg_tys
@@ -570,7 +576,7 @@ tidy_bang_pat v g l p@(ConPat { pat_con = L _ (RealDataCon dc)
--
-- NB: SigPatIn, ConPatIn should not happen
-tidy_bang_pat _ _ l p = return (idDsWrapper, BangPat noExtField (L l p))
+tidy_bang_pat _ l p = return (idDsWrapper, BangPat noExtField (L l p))
-------------------
push_bang_into_newtype_arg :: SrcSpanAnnA
@@ -954,7 +960,7 @@ matchSinglePatVar var mb_scrut ctx pat ty match_result
; ldi_nablas <-
if isMatchContextPmChecked_SinglePat dflags FromSource ctx pat
then addCoreScrutTmCs (maybeToList mb_scrut) [var] $
- pmcPatBind (DsMatchContext ctx locn) var (unLoc pat)
+ pmcPatBind (DsMatchContext ctx locn) var pat
else getLdiNablas
; let eqn_info = EqnMatch { eqn_pat = decideBangHood dflags pat
=====================================
compiler/GHC/HsToCore/Monad.hs
=====================================
@@ -15,7 +15,7 @@ module GHC.HsToCore.Monad (
duplicateLocalDs, newSysLocalDs, newSysLocalsDs,
newSysLocalMDs, newSysLocalsMDs, newFailLocalMDs,
newUniqueId, newPredVarDs, newStaticId,
- getSrcSpanDs, putSrcSpanDs, putSrcSpanDsA,
+ getSrcSpanDs, inGeneratedCodeDs, putSrcSpanDs, putSrcSpanDsA,
mkNamePprCtxDs,
newUnique,
UniqSupply, newUniqueSupply,
@@ -584,6 +584,7 @@ mkDsEnvs unit_env mod rdr_env type_env fam_inst_env tcm_plugins ptc msg_var
, dsl_loc = real_span
, dsl_nablas = Ldi initNablas
, dsl_unspecables = Just emptyVarSet
+ , dsl_in_generated_code = False
}
in (gbl_env, lcl_env)
@@ -676,13 +677,17 @@ getSrcSpanDs :: DsM SrcSpan
getSrcSpanDs = do { env <- getLclEnv
; return (RealSrcSpan (dsl_loc env) Strict.Nothing) }
+-- | See 'dsl_in_generated_code'
+inGeneratedCodeDs :: DsM Bool
+inGeneratedCodeDs = dsl_in_generated_code <$> getLclEnv
+
putSrcSpanDs :: SrcSpan -> DsM a -> DsM a
putSrcSpanDs (RealSrcSpan real_span _) thing_inside
- = updLclEnv (\ env -> env {dsl_loc = real_span}) thing_inside
+ = updLclEnv (\ env -> env {dsl_loc = real_span, dsl_in_generated_code = False}) thing_inside
putSrcSpanDs UnhelpfulSpan{} thing_inside
= thing_inside
putSrcSpanDs GeneratedSrcSpan{} thing_inside
- = thing_inside
+ = updLclEnv (\ env -> env {dsl_in_generated_code = True}) thing_inside
putSrcSpanDsA :: EpAnn ann -> DsM a -> DsM a
putSrcSpanDsA loc = putSrcSpanDs (locA loc)
=====================================
compiler/GHC/HsToCore/Pmc.hs
=====================================
@@ -104,7 +104,7 @@ whenDoingPmc no_pmc thing_inside
Ldi nablas -> thing_inside nablas }
-- | Check a pattern binding (let, where) for exhaustiveness.
-pmcPatBind :: DsMatchContext -> Id -> Pat GhcTc -> DsM LdiNablas
+pmcPatBind :: DsMatchContext -> Id -> LPat GhcTc -> DsM LdiNablas
pmcPatBind ctxt@(DsMatchContext match_ctxt loc) var p
= whenDoingPmc NoPmc $ \ !missing ->
mb_discard_warnings $ do
=====================================
compiler/GHC/HsToCore/Pmc/Desugar.hs
=====================================
@@ -155,11 +155,15 @@ desugarPat x pat = case pat of
VarPat _ y -> pure (mkPmLetVar (unLoc y) x)
ParPat _ p -> desugarLPat x p
LazyPat _ _ -> pure GdEnd -- like a wildcard
- BangPat _ p@(L l p') ->
+ BangPat _ p@(L l p') -> do
-- Add the bang in front of the list, because it will happen before any
-- nested stuff.
+ in_gen <- inGeneratedCodeDs
+ -- A bang inserted by -XStrict (decideBangHood) has no SrcInfo: it is
+ -- divergence-checked but never reported as redundant (#27323).
+ let pm_loc | in_gen = Nothing
+ | otherwise = Just (SrcInfo (L (locA l) (ppr p')))
consGrdDag (PmBang x pm_loc) <$> desugarLPat x p
- where pm_loc = Just (SrcInfo (L (locA l) (ppr p')))
-- (x@pat) ==> Desugar pat with x as match var and handle impedance
-- mismatch with incoming match var
@@ -311,7 +315,7 @@ desugarPatV pat = do
pure (x, grds)
desugarLPat :: Id -> LPat GhcTc -> DsM GrdDag
-desugarLPat x = desugarPat x . unLoc
+desugarLPat x (L loc pat) = putSrcSpanDsA loc (desugarPat x pat)
-- | 'desugarLPat', but also select and return a new match var.
desugarLPatV :: LPat GhcTc -> DsM (Id, GrdDag)
@@ -374,11 +378,11 @@ desugarConPatOut x con univ_tys ex_tvs dicts = \case
-- tracePm "ConPatOut" (ppr x $$ ppr con $$ ppr arg_ids)
pure (con_grd `consGrdDag` arg_grds)
-desugarPatBind :: SrcSpan -> Id -> Pat GhcTc -> DsM (PmPatBind Pre)
+desugarPatBind :: SrcSpan -> Id -> LPat GhcTc -> DsM (PmPatBind Pre)
-- See 'GrdPatBind' for how this simply repurposes GrdGRHS.
-- See Note [Suppress warnings in PMC desugaring]
desugarPatBind loc var pat = discardWarningsDs $
- PmPatBind . flip PmGRHS (SrcInfo (L loc (ppr pat))) <$> desugarPat var pat
+ PmPatBind . flip PmGRHS (SrcInfo (L loc (ppr pat))) <$> desugarLPat var pat
desugarEmptyCase :: Id -> DsM PmEmptyCase
desugarEmptyCase var = pure PmEmptyCase { pe_var = var }
@@ -650,4 +654,19 @@ user *had* written a bang:
+ In an equation for ‘idV’: idV !v = ...
So we live with the duplication.
+
+Note that 'decideBangHood' places the bangs it inserts at a 'generatedSrcSpan'.
+When 'desugarLPat' enters such a span, 'putSrcSpanDs' (GHC.HsToCore.Monad)
+records in 'dsl_in_generated_code' that we are desugaring compiler-generated
+code. For a bang in generated code, 'desugarPat' emits a 'PmBang' with no
+'SrcInfo': the checker still performs the divergence check (so the
+inaccessible-RHS warning above survives), but -Wredundant-bang-patterns only
+ever reports bangs the user actually wrote (#27323). See
+Note [Dead bang patterns] in GHC.HsToCore.Pmc.Check.
+
+Eventually the bangs inserted by -XStrict should become expanded patterns,
+following Note [Handling overloaded and rebindable constructs] in
+GHC.Rename.Expr. That would let warnings always display the original
+user-written code, making the decideBangHood duplication described above
+unnecessary. This is tracked as #27677.
-}
=====================================
compiler/GHC/HsToCore/Types.hs
=====================================
@@ -11,7 +11,7 @@ module GHC.HsToCore.Types (
DsMetaEnv, DsMetaVal(..), CompleteMatches
) where
-import GHC.Prelude (Int)
+import GHC.Prelude (Bool, Int)
import Data.IORef
@@ -125,6 +125,7 @@ data DsLclEnv
-- ^ See Note [Desugaring non-canonical evidence]
-- This field collects all un-specialisable evidence variables in scope.
-- Nothing <=> don't collect this info (used for the LHS of Rules)
+ , dsl_in_generated_code :: Bool -- Desugaring compiler-generated or user-written code
}
-- Inside [| |] brackets, the desugarer looks
=====================================
compiler/GHC/HsToCore/Utils.hs
=====================================
@@ -1025,6 +1025,9 @@ Specifically:
-- | Use -XStrict to add a ! or remove a ~
+-- The bang we insert is compiler-generated, so we put it at a generatedSrcSpan.
+-- The pattern-match checker uses this (via dsl_in_generated_code) to avoid reporting
+-- such bangs under -Wredundant-bang-patterns (#27323).
-- See Note [decideBangHood]
decideBangHood :: DynFlags
-> LPat GhcTc -- ^ Original pattern
@@ -1040,7 +1043,7 @@ decideBangHood dflags lpat
ParPat x p -> L l (ParPat x (go p))
LazyPat _ lp' -> lp'
BangPat _ _ -> lp
- _ -> L l (BangPat noExtField lp)
+ _ -> L (noAnnSrcSpan generatedSrcSpan) (BangPat noExtField lp)
isTrueLHsExpr :: LHsExpr GhcTc -> Maybe (CoreExpr -> DsM CoreExpr)
=====================================
compiler/GHC/Types/Demand.hs
=====================================
@@ -924,6 +924,8 @@ maxCard (Card a) (Card b) = Card ((a .&. b .&. 0b001) .|. ((a .|. b) .&. 0b110))
maxDmd :: Demand -> Demand -> Demand
maxDmd BotDmd dmd2 = dmd2
maxDmd dmd1 BotDmd = dmd1
+maxDmd AbsDmd dmd2 = dmd2
+maxDmd dmd1 AbsDmd = dmd1
maxDmd (n1 :* sd1) (n2 :* sd2) =
maxCard n1 n2 :* maxSubDmd sd1 sd2
=====================================
testsuite/tests/dmdanal/should_run/T27845.hs
=====================================
@@ -0,0 +1,14 @@
+module Main where
+import T27845_Lib (f)
+import System.Environment (getArgs)
+
+{-# NOINLINE mkArg #-}
+mkArg :: Int -> Int
+mkArg n | n < 0 = n
+ | otherwise = error ("boom " ++ show n)
+
+main :: IO ()
+main = do
+ n <- length <$> getArgs
+ let x = mkArg n
+ print (length (f (x, x) n))
=====================================
testsuite/tests/dmdanal/should_run/T27845.stdout
=====================================
@@ -0,0 +1 @@
+0
=====================================
testsuite/tests/dmdanal/should_run/T27845_Lib.hs
=====================================
@@ -0,0 +1,11 @@
+module T27845_Lib where
+
+{-# INLINABLE [2] f #-}
+f :: a -> Int -> [a]
+f p x = lazyUse p x ++ lazyUse p (x + 1) ++ lazyUse p (x + 2)
+
+{-# NOINLINE lazyUse #-}
+lazyUse :: a -> Int -> [a]
+lazyUse p x = p `seq` replicate x p
+
+{-# RULES "lazyUse" [1] forall p x. lazyUse p x = [] #-}
=====================================
testsuite/tests/dmdanal/should_run/T27845b.hs
=====================================
@@ -0,0 +1,14 @@
+module Main where
+import T27845b_Lib (outer)
+import System.Environment (getArgs)
+
+{-# NOINLINE mkArg #-}
+mkArg :: Int -> Int
+mkArg n | n < 0 = n
+ | otherwise = error ("boom " ++ show n)
+
+main :: IO ()
+main = do
+ n <- length <$> getArgs
+ let x = mkArg n
+ print (length (outer (x, x) n))
=====================================
testsuite/tests/dmdanal/should_run/T27845b.stdout
=====================================
@@ -0,0 +1 @@
+0
=====================================
testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
=====================================
@@ -0,0 +1,14 @@
+module T27845b_Lib where
+
+outer :: a -> Int -> [a]
+outer a n =
+ let {-# INLINABLE [2] g #-}
+ g x = lazyUse a (x + 0) ++ lazyUse a (x + 1) ++ lazyUse a (x + 2)
+ in g n ++ g (n + 1) ++ g (n + 2)
+{-# NOINLINE outer #-}
+
+{-# NOINLINE lazyUse #-}
+lazyUse :: a -> Int -> [a]
+lazyUse p x = p `seq` replicate x p
+
+{-# RULES "lazyUse" [1] forall p x. lazyUse p x = [] #-}
=====================================
testsuite/tests/dmdanal/should_run/all.T
=====================================
@@ -37,3 +37,5 @@ test('T25439', normal, compile_and_run, [''])
test('T26748', normal, compile_and_run, [''])
test('T26416', [extra_files(['M1.hs'])], multimod_compile_and_run, ['T26416','M1.hs'])
test('T27626', [extra_files(['M2.hs'])], multimod_compile_and_run, ['T27626','M2.hs'])
+test('T27845', [extra_files(['T27845_Lib.hs'])], multimod_compile_and_run, ['T27845','T27845_Lib.hs'])
+test('T27845b', [extra_files(['T27845b_Lib.hs'])], multimod_compile_and_run, ['T27845b','T27845b_Lib.hs'])
=====================================
testsuite/tests/pmcheck/should_compile/T27323.hs
=====================================
@@ -0,0 +1,9 @@
+{-# LANGUAGE MagicHash, Strict #-}
+{-# OPTIONS_GHC -Wredundant-bang-patterns #-}
+
+import GHC.Prim (Int#)
+
+idInt# :: Int# -> Int#
+idInt# x = x
+
+main = pure ()
=====================================
testsuite/tests/pmcheck/should_compile/T27323b.hs
=====================================
@@ -0,0 +1,6 @@
+{-# LANGUAGE Strict, MonoLocalBinds #-}
+{-# OPTIONS_GHC -Wredundant-bang-patterns #-}
+module T27323b where
+
+f :: Int -> Int
+f x = let (a, b) = (x, x) in a + b
=====================================
testsuite/tests/pmcheck/should_compile/all.T
=====================================
@@ -190,4 +190,6 @@ test('T24845', [], compile, [overlapping_incomplete])
test('T22652', [], compile, [overlapping_incomplete])
test('T22652a', [], compile, [overlapping_incomplete])
test('T24867', [], compile_fail, [overlapping_incomplete])
+test('T27323', normal, compile, ['-Wredundant-bang-patterns'])
+test('T27323b', normal, compile, ['-Wredundant-bang-patterns'])
test('T27360', normal, compile, [overlapping_incomplete + '-g3'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fd8be410628df71b57532897f95f68…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/fd8be410628df71b57532897f95f68…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/davide/windows-dlls_sysm-test_master] Add golden test for rts/RtsSymbols.c
by David Eichmann (@DavidEichmann) 09 Oct '26
by David Eichmann (@DavidEichmann) 09 Oct '26
09 Oct '26
David Eichmann pushed to branch wip/davide/windows-dlls_sysm-test_master at Glasgow Haskell Compiler / GHC
Commits:
aca72a5a by David Eichmann at 2026-10-09T11:50:09+01:00
Add golden test for rts/RtsSymbols.c
The test compares declared symbols against symbols observed
in the rts DSO (dll/so) by the llvm-readobj tool.
- - - - -
7 changed files:
- testsuite/driver/runtests.py
- + testsuite/tests/rts/symbols/Main.hs
- + testsuite/tests/rts/symbols/Makefile
- + testsuite/tests/rts/symbols/all.T
- + testsuite/tests/rts/symbols/dumpDeclaredSymbols.c
- + testsuite/tests/rts/symbols/rts-check-symbols.sh
- + testsuite/tests/rts/symbols/rts-check-symbols.stdout
Changes:
=====================================
testsuite/driver/runtests.py
=====================================
@@ -284,32 +284,36 @@ def format_path(path):
# On Windows we need to set $PATH to include the paths to all the DLLs
# in order for the dynamic library tests to work.
if windows:
+ # Add mingw to PATH
+ topdir = config.libdir
+ mingw = os.path.abspath(os.path.join(topdir, '../mingw/bin'))
+ mingw = format_path(mingw)
+ ghc_env['PATH'] = os.pathsep.join([ghc_env.get("PATH", ""), mingw])
+
+ # Add ghc packages to PATH
try:
- pkginfo = getStdout([config.ghc_pkg, 'dump'])
+ pkgs = getStdout([config.ghc_pkg, '--simple-output', 'list'])
except FileNotFoundError as err:
# This can happen when we are only running tests which don't depend on ghc (ie linters)
# In that case we probably haven't built ghc-pkg yet so this query will fail.
print (err)
print ("Failed to call ghc-pkg for windows path modification... some tests might fail")
- pkginfo = ""
- topdir = config.libdir
- mingw = os.path.abspath(os.path.join(topdir, '../mingw/bin'))
- mingw = format_path(mingw)
- ghc_env['PATH'] = os.pathsep.join([ghc_env.get("PATH", ""), mingw])
- for line in pkginfo.split('\n'):
- if line.startswith('library-dirs:'):
- path = line.rstrip()
- path = str_removeprefix(path, 'library-dirs: ')
- # Use string.replace instead of re.sub, because re.sub
- # interprets backslashes in the replacement string as
- # escape sequences.
- path = path.replace('$topdir', topdir)
+ pkgs = ""
+
+ newPaths = set()
+ pkgs = pkgs.split(' ')
+ for pkg in pkgs:
+ for field in ['library-dirs', 'dynamic-library-dirs']:
+ path = getStdout([config.ghc_pkg, '--simple-output', 'field', pkg, field])
+ path = path.strip()
if path.startswith('"'):
path = re.sub('^"(.*)"$', '\\1', path)
path = re.sub('\\\\(.)', '\\1', path)
+ path = format_path(path)
+ newPaths.add(path)
- path = format_path(path)
- ghc_env['PATH'] = os.pathsep.join([path, ghc_env.get("PATH", "")])
+ for path in newPaths:
+ ghc_env['PATH'] = os.pathsep.join([path, ghc_env.get("PATH", "")])
testopts_ctx_var.set(TestOptions())
=====================================
testsuite/tests/rts/symbols/Main.hs
=====================================
@@ -0,0 +1,124 @@
+import qualified Data.Map.Lazy as M
+import qualified Data.Set as S
+import Data.List (isSuffixOf, stripPrefix)
+import Data.Maybe (mapMaybe)
+import System.Environment (getArgs)
+
+main :: IO ()
+main = do
+ args <- getArgs
+ case args of
+ ["dump"] -> dumpDeclaredSymbols
+ ["diff", objType, declaredSymbolsFile, observedSymbolsFile] -> do
+ parseObserved <- case objType of
+ "elf" -> return elfSymbols
+ "windows" -> return importLibSymbols
+ _ -> fail ("Unknown object type: " ++ objType)
+ diffStr <- diff
+ <$> (readCodeOrData <$$> linePairs <$> readFile declaredSymbolsFile)
+ <*> (parseObserved <$> readFile observedSymbolsFile)
+ -- writeFile "<ghc root>/testsuite/tests/rts/symbols/rts-check-symbols.stdout"
+ putStrLn diffStr
+ _ -> fail ("Unexpected arguments: " ++ show args)
+ where
+ (<$$>) = fmap . fmap
+
+foreign import ccall "dumpDeclaredSymbols"
+ dumpDeclaredSymbols :: IO ()
+
+data CodeOrData = Code | Data
+ deriving (Show, Eq)
+
+-- Compare observedSymbols (symbols observed in the DSO) to declaredSymbols
+-- (symbols declared in RtsSymbols.c)
+diff :: M.Map String CodeOrData -> M.Map String CodeOrData -> String
+diff declaredSymbols observedSymbols = unlines $
+ [ "Symbols declared in RtsSymbols.c but not observed in the DSO:" ]
+ ++ [ "Declared> " ++ k ++ " " ++ show v | (k, v) <- M.toList diffInDeclaredSymbols ]
+ ++ [ "" ]
+ ++ [ "Symbols observed in the DSO but not declared in RtsSymbols.c:" ]
+ ++ [ "Observed> " ++ k ++ " " ++ show v | (k, v) <- M.toList diffInObservedSymbols ]
+ ++ [ "" ]
+ ++ [ "Symbols observed in the DSO and declared in RtsSymbols.c but with conflicting type:" ]
+ ++ [ "WrongType> " ++ k ++ " (declared, observed): (" ++ show declared ++ ", " ++ show observed ++ ")"
+ | (k, (declared, observed)) <- M.toList diffOnType ]
+ where
+ -- Undeclared observed symbols
+ diffInObservedSymbols :: M.Map String CodeOrData
+ diffInObservedSymbols = observedSymbols M.\\ declaredSymbols
+
+ -- Declared unobserved symbols
+ diffInDeclaredSymbols :: M.Map String CodeOrData
+ diffInDeclaredSymbols = declaredSymbols M.\\ observedSymbols
+
+ -- Declared observed symbols with conflicting type
+ diffOnType :: M.Map String (CodeOrData, CodeOrData)
+ diffOnType = M.filter (\(a, b) -> a /= b) $ M.intersectionWith (,) declaredSymbols observedSymbols
+
+linePairs :: String -> M.Map String String
+linePairs = M.fromList . map (\str -> let [a,b] = words str in (a,b)) . filter (/= "") . lines
+
+readCodeOrData :: String -> CodeOrData
+readCodeOrData s = case s of
+ "code" -> Code
+ "data" -> Data
+ _ -> error ("Unknown symbol type: " ++ show s)
+
+-- | Parse the output of @readelf -W --dyn-syms@ of an ELF shared object.
+--
+-- Symbol lines look like:
+--
+-- > Num: Value Size Type Bind Vis Ndx Name
+-- > 2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND tcsetattr@GLIBC_2.2.5 (2)
+-- > 1149: 000000000006d020 190 OBJECT GLOBAL DEFAULT 12 stg_AP_info
+--
+-- Note that Vis may be followed by extra annotations on some platforms (e.g.
+-- @[<localentry>: 8]@ on ppc64le), so Ndx and Name are taken from the end of
+-- the line.
+elfSymbols :: String -> M.Map String CodeOrData
+elfSymbols = M.fromList . mapMaybe parseLine . lines
+ where
+ parseLine l = case words l of
+ (num : _value : _size : ty : bind : rest)
+ | ":" `isSuffixOf` num
+ , name : ndx : _ <- reverse (dropVersionIndex rest)
+ , bind == "GLOBAL"
+ , ndx /= "UND" -- Imports
+ -> (,) name <$> typeToCodeOrData ty
+ _ -> Nothing
+
+ -- Drop the trailing version index e.g. "(2)"
+ dropVersionIndex ws = case reverse ws of
+ ('(' : _) : ws' -> reverse ws'
+ _ -> ws
+
+ -- Returns Nothing if the symbol should be ignored
+ typeToCodeOrData :: String -> Maybe CodeOrData
+ typeToCodeOrData ty = case ty of
+ "FILE" -> Nothing
+ "NOTYPE" -> Nothing
+ "FUNC" -> Just Code
+ "OBJECT" -> Just Data
+ _ -> error ("Unknown symbol type: " ++ show ty)
+
+-- | Parse the output of @nm -P@ into (name, type letter) pairs. Lines that are
+-- not symbols (e.g. the archive member headers printed for import libraries)
+-- are ignored.
+parseNm :: String -> [(String, Char)]
+parseNm = mapMaybe parseLine . lines
+ where
+ parseLine l = case words l of
+ (name : [ty] : _) -> Just (name, ty)
+ _ -> Nothing
+
+-- | Interpret the symbols of a windows import library. Every export @foo@ has
+-- an import address table entry @__imp_foo@, but only code exports also have
+-- a @foo@ thunk.
+importLibSymbols :: String -> M.Map String CodeOrData
+importLibSymbols nmOutput = M.fromList
+ [ (name, if name `S.member` defined then Code else Data)
+ | name <- mapMaybe (stripPrefix "__imp_") (S.toList defined)
+ ]
+ where
+ defined :: S.Set String
+ defined = S.fromList [ name | (name, ty) <- parseNm nmOutput, ty /= 'U' ]
=====================================
testsuite/tests/rts/symbols/Makefile
=====================================
@@ -0,0 +1,9 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# This makefile rule only exists because TEST_HC is set in boilerplate.mk
+# and otherwise the TEST_HC variable wouldn't be set in the context of the bash script
+rts-check-symbols:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -package containers -dynamic dumpDeclaredSymbols.c Main.hs -o Main > /dev/null
+ GHC_PKG="$(GHC_PKG)" GHC="$(TEST_HC)" ./rts-check-symbols.sh
=====================================
testsuite/tests/rts/symbols/all.T
=====================================
@@ -0,0 +1,6 @@
+test('rts-check-symbols', [
+ unless(have_dynamic(), skip),
+ extra_files(['rts-check-symbols.sh', 'dumpDeclaredSymbols.c', 'Main.hs'])],
+ makefile_test,
+ []
+)
=====================================
testsuite/tests/rts/symbols/dumpDeclaredSymbols.c
=====================================
@@ -0,0 +1,26 @@
+
+#include "Rts.h"
+#include "rts/RtsSymbols.h"
+
+#include <stdio.h>
+
+void dumpDeclaredSymbols(void);
+
+void dumpDeclaredSymbols(void) {
+ const RtsSymbolVal * declaredSyms = getRtsSymbols();
+ for (const RtsSymbolVal * sym = &declaredSyms[0]; sym->lbl; sym++) {
+ // Ignore hidden
+ if (sym->type & SYM_TYPE_HIDDEN) continue;
+
+ char * type = NULL;
+ if (sym->type & SYM_TYPE_CODE) {
+ type = "code";
+ } else if (sym->type & (SYM_TYPE_DATA | SYM_TYPE_INDIRECT_DATA)) {
+ type = "data";
+ }
+
+ if (type) {
+ printf("%s %s\n", sym->lbl, type);
+ }
+ }
+}
=====================================
testsuite/tests/rts/symbols/rts-check-symbols.sh
=====================================
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+#
+# Check the diff between symbols exported from the RTS and those listed in RtsSymbols.c
+#
+
+DECLARED_SYMBOLS=declared_symbols.txt
+OBSERVED_SYMBOLS=observed_symbols.txt
+
+# Discover if we're on windows
+case "$OSTYPE" in
+ "cygwin")
+ TYPE="windows"
+ ;;
+
+ *)
+ TYPE="elf"
+ ;;
+esac
+
+# Get rts Symbols listed in RtsSymbols.c
+./Main dump | sort > $DECLARED_SYMBOLS
+
+# Get rts DLL exports from the DLL
+# Match e.g.:
+# libHSrts-1.0.3-ghc9.15.20260710.dll => /home/alice/s p a c e/myApp/bin/libHSrts-1.0.3-ghc9.15.20260710.dll (0x7ffebc9a0000)
+RTS_DYLIB_PATH=$(ldd Main | awk '/^[[:space:]]*libHSrts-.* => .+ \(.*\)$/ {
+ sub(/^[[:space:]]*libHSrts-.* => /, "")
+ sub(/ \([^(]*\)$/, "")
+ print
+}')
+
+# Dump the exported symbols. Main.hs is responsible for parsing the output.
+case "$TYPE" in
+ "elf")
+ # The dynamic symbol table of the shared object. We use readelf rather
+ # than nm as nm classifies symbols by section rather than by symbol
+ # type, and with tables next to code info tables (objects) live in the
+ # .text section.
+ readelf -W "$RTS_DYLIB_PATH" > $OBSERVED_SYMBOLS
+ ;;
+
+ "windows")
+ # On windows we inspect the import library (*.dll.a) instead of the dll directly. This is important to get the correct type of info table symbols.
+ # Dump the external symbols in POSIX format (one "name type [value [size]]" per line).
+ nm -g -P "${RTS_DYLIB_PATH}.a" > $OBSERVED_SYMBOLS
+ ;;
+
+ *)
+ echo "Unknown TYPE=$TYPE"
+ exit 1
+ ;;
+esac
+
+./Main diff "$TYPE" $DECLARED_SYMBOLS $OBSERVED_SYMBOLS
=====================================
testsuite/tests/rts/symbols/rts-check-symbols.stdout
=====================================
@@ -0,0 +1,762 @@
+Symbols declared in RtsSymbols.c but not observed in the DSO:
+Declared> StgReturn Code
+Declared> __udivti3 Code
+Declared> __umodti3 Code
+Declared> atomic_dec Code
+Declared> dirty_TVAR Code
+Declared> ffi_call Code
+Declared> ffi_prep_cif Code
+Declared> ffi_type_double Data
+Declared> ffi_type_float Data
+Declared> ffi_type_pointer Data
+Declared> ffi_type_sint16 Data
+Declared> ffi_type_sint32 Data
+Declared> ffi_type_sint64 Data
+Declared> ffi_type_sint8 Data
+Declared> ffi_type_uint16 Data
+Declared> ffi_type_uint32 Data
+Declared> ffi_type_uint64 Data
+Declared> ffi_type_uint8 Data
+Declared> ffi_type_void Data
+Declared> signal_handlers Code
+Declared> updateRemembSetPushThunk Code
+
+Symbols observed in the DSO but not declared in RtsSymbols.c:
+Observed> AP_STACK_sizeW Code
+Observed> AP_sizeW Code
+Observed> BLACKHOLE_sizeW Code
+Observed> Bdescr Code
+Observed> CHARLIKE_CLOSURE Code
+Observed> CONSTR_sizeW Code
+Observed> CONTINUATION_sizeW Code
+Observed> CON_INFO_PTR_TO_STRUCT Code
+Observed> FUN_INFO_PTR_TO_STRUCT Code
+Observed> FileEventLogWriter Data
+Observed> GET_CLOSURE_TAG Code
+Observed> GET_INFO Code
+Observed> GET_TAG Code
+Observed> INFO_PTR_TO_STRUCT Code
+Observed> INTLIKE_CLOSURE Code
+Observed> LOOKS_LIKE_CLOSURE_PTR Code
+Observed> LOOKS_LIKE_INFO_PTR Code
+Observed> LOOKS_LIKE_INFO_PTR_NOT_NULL Code
+Observed> LOOKS_LIKE_PTR Code
+Observed> NullEventLogWriter Data
+Observed> OS_TRY_ACQUIRE_LOCK Code
+Observed> PAP_sizeW Code
+Observed> RET_INFO_PTR_TO_STRUCT Code
+Observed> SET_INFO Code
+Observed> SET_INFO_RELAXED Code
+Observed> SET_INFO_RELEASE Code
+Observed> STATIC_LINK Code
+Observed> TAG_CLOSURE Code
+Observed> THUNK_INFO_PTR_TO_STRUCT Code
+Observed> THUNK_SELECTOR_sizeW Code
+Observed> UNTAG_CLOSURE Code
+Observed> UNTAG_CONST_CLOSURE Code
+Observed> UPD_BH_UPDATABLE_ctr Data
+Observed> __rts_fopen Code
+Observed> _warnFail Code
+Observed> addInitFini Code
+Observed> addProddableBlock Code
+Observed> allocAlignedGroupOnNode Code
+Observed> allocBlock Code
+Observed> allocBlockOnNode Code
+Observed> allocBlockOnNode_lock Code
+Observed> allocBlock_lock Code
+Observed> allocGroup Code
+Observed> allocGroupOnNode Code
+Observed> allocGroupOnNode_lock Code
+Observed> allocGroup_lock Code
+Observed> allocLimitKill Data
+Observed> allocLimitRunHook Data
+Observed> allocMBlockAlignedGroupOnNode Code
+Observed> allocateMightFail Code
+Observed> allocatePinned Code
+Observed> allocated_bytes_at_heapoverflow Data
+Observed> ap_sizeW Code
+Observed> ap_stack_sizeW Code
+Observed> arr_words_sizeW Code
+Observed> arr_words_words Code
+Observed> bco_sizeW Code
+Observed> broadcastCondition Code
+Observed> cas_word8 Code
+Observed> checkProddableBlock Code
+Observed> checkVectorSupport Code
+Observed> clearImportSymbol Code
+Observed> closeCondition Code
+Observed> closeMutex Code
+Observed> closure_sizeW Code
+Observed> collect_pointers Code
+Observed> compact_nfdata_full_sizeW Code
+Observed> complex_ccall_adjustor_template Data
+Observed> containsSpan Code
+Observed> continuation_sizeW Code
+Observed> createAttachedOSThread Code
+Observed> createGenThread Code
+Observed> createIOThread Code
+Observed> createOSThread Code
+Observed> createStrictIOThread Code
+Observed> createThread Code
+Observed> currentWorkerCount Data
+Observed> debugMsgFn Data
+Observed> dequeElements Code
+Observed> dirty_STACK Code
+Observed> dirty_TSO Code
+Observed> discardElements Code
+Observed> era Data
+Observed> errorMsgFn Data
+Observed> eventLogStatus Code
+Observed> eventTypes Data
+Observed> exitFn Data
+Observed> exitHeapOverflow Code
+Observed> exitHpc Code
+Observed> fatalInternalErrorFn Data
+Observed> fillGot Code
+Observed> findSymbol Code
+Observed> findSymbolTable Code
+Observed> flushExec Code
+Observed> formatClosureDescIpe Code
+Observed> freeAllMBlocks Code
+Observed> freeChain Code
+Observed> freeChain_lock Code
+Observed> freeGot Code
+Observed> freeGroup Code
+Observed> freeGroup_lock Code
+Observed> freeInitFiniList Code
+Observed> freeMBlocks Code
+Observed> freeProddableBlocks Code
+Observed> freeThreadingResources Code
+Observed> freeWSDeque Code
+Observed> full_prog_argc Data
+Observed> full_prog_argv Data
+Observed> generations Data
+Observed> getFirstMBlock Code
+Observed> getMBlock Code
+Observed> getMBlockOnNode Code
+Observed> getMBlocks Code
+Observed> getMBlocksOnNode Code
+Observed> getNextMBlock Code
+Observed> getObjectLoadStatus Code
+Observed> get_con_itbl Code
+Observed> get_fun_itbl Code
+Observed> get_itbl Code
+Observed> get_itbl_acquire Code
+Observed> get_ret_itbl Code
+Observed> get_thunk_itbl Code
+Observed> heap_view_closurePtrs Code
+Observed> heap_view_closureSize Code
+Observed> heap_view_closure_ptrs_in_pap_payload Code
+Observed> highMemDynamic Data
+Observed> hs_main Code
+Observed> initAdjustors Code
+Observed> initBlockAllocator Code
+Observed> initCondition Code
+Observed> initGenerationStats Code
+Observed> initMBlocks Code
+Observed> initMutex Code
+Observed> initProddableBlockSet Code
+Observed> interp_shutdown Code
+Observed> interp_startup Code
+Observed> interruptOSThread Code
+Observed> isSymbolImport Code
+Observed> isSymbolWeak Code
+Observed> itbl_to_con_itbl Code
+Observed> itbl_to_fun_itbl Code
+Observed> itbl_to_ret_itbl Code
+Observed> itbl_to_thunk_itbl Code
+Observed> joinOSThread Code
+Observed> kernelThreadId Code
+Observed> listAllBlocks Code
+Observed> listThreads Code
+Observed> looksEmptyWSDeque Code
+Observed> lookupIPEId Code
+Observed> m32_free_page_pool Data
+Observed> m32_free_page_pool_size Data
+Observed> makeGot Code
+Observed> mblock_address_space Data
+Observed> mblocks_allocated Data
+Observed> modules Data
+Observed> mpc_misses Data
+Observed> mutArrPtrsCard Code
+Observed> mutArrPtrsCardTableSize Code
+Observed> mutArrPtrsCards Code
+Observed> mut_arr_ptrs_sizeW Code
+Observed> n_alloc_blocks_by_node Data
+Observed> needGotSlot Code
+Observed> newCAF Code
+Observed> newGCdCAF Code
+Observed> newRetainedCAF Code
+Observed> newWSDeque Code
+Observed> next_nursery Data
+Observed> no_break_on_exception Data
+Observed> nonmovingAllocatorCensus Code
+Observed> nonmovingAllocatorCensusWithWords Code
+Observed> nonmovingPrintAllocatorCensus Code
+Observed> nonmovingSweep Code
+Observed> nonmovingSweepCompactObjects Code
+Observed> nonmovingSweepLargeObjects Code
+Observed> nonmovingSweepMutLists Code
+Observed> nonmovingSweepStableNameTable Code
+Observed> nonmovingTraceAllocatorCensus Code
+Observed> oldest_gen Data
+Observed> osThreadId Code
+Observed> osThreadIsAlive Code
+Observed> pap_sizeW Code
+Observed> pauseTokenCapability Code
+Observed> pbarf Code
+Observed> peak_mblocks_allocated Data
+Observed> poolFlush Code
+Observed> poolFree Code
+Observed> poolGetDesiredSize Code
+Observed> poolGetMaxSize Code
+Observed> poolInit Code
+Observed> poolRelease Code
+Observed> poolSetDesiredSize Code
+Observed> poolSetMaxSize Code
+Observed> poolTake Code
+Observed> poolTryTake Code
+Observed> popWSDeque Code
+Observed> printLoadedObjects Code
+Observed> prog_name Data
+Observed> pushWSDeque Code
+Observed> re_invalid Data
+Observed> re_realso Data
+Observed> releaseFreeMemory Code
+Observed> releaseThreadNode Code
+Observed> reportMemoryMap Code
+Observed> rtsDebugMsgFn Code
+Observed> rtsErrorMsgFn Code
+Observed> rtsFatalInternalErrorFn Code
+Observed> rtsSysErrorMsgFn Code
+Observed> rts_argc Data
+Observed> rts_argv Data
+Observed> rts_argv_size Data
+Observed> rts_done Code
+Observed> rts_evalLazyIO_ Code
+Observed> rts_getSchedStatus Code
+Observed> rts_isPaused Code
+Observed> rts_listMiscRoots Code
+Observed> rts_listThreads Code
+Observed> rts_pause Code
+Observed> rts_pinThreadToNumaNode Code
+Observed> rts_resume Code
+Observed> runFini Code
+Observed> runInit Code
+Observed> sbarf Code
+Observed> scheduleWaitThread Code
+Observed> setHighMemDynamic Code
+Observed> setImportSymbol Code
+Observed> setSymbolInfo Code
+Observed> setTSOLink Code
+Observed> setTSOPrev Code
+Observed> setThreadAffinity Code
+Observed> setThreadNode Code
+Observed> setVectorSupport Code
+Observed> setWeakSymbol Code
+Observed> shndx_table_uninit_label Data
+Observed> shouldCompact Code
+Observed> shutdownThread Code
+Observed> signalCondition Code
+Observed> simple_ccall_adjustor_template Data
+Observed> sizeW_fromITBL Code
+Observed> small_mut_arr_ptrs_sizeW Code
+Observed> ssbarf Code
+Observed> stack_frame_sizeW Code
+Observed> stack_sizeW Code
+Observed> state_change_mutex Data
+Observed> stealWSDeque Code
+Observed> stealWSDeque_ Code
+Observed> stg_AP_NOUPD_info Data
+Observed> stg_AP_STACK_NOUPD_info Data
+Observed> stg_AP_STACK_info Data
+Observed> stg_AP_info Data
+Observed> stg_ASYNCIOOP_info Data
+Observed> stg_ASYNCIO_LIVE0_closure Data
+Observed> stg_ASYNCIO_LIVE0_info Data
+Observed> stg_BCO_info Data
+Observed> stg_CLOSURE_TABLE_NULL_closure Data
+Observed> stg_CLOSURE_TABLE_NULL_info Data
+Observed> stg_COMPACT_NFDATA_CLEAN_info Data
+Observed> stg_COMPACT_NFDATA_DIRTY_info Data
+Observed> stg_CONTINUATION_apply Code
+Observed> stg_CONTINUATION_info Data
+Observed> stg_C_FINALIZER_LIST_info Data
+Observed> stg_DEAD_SLOT_closure Data
+Observed> stg_DEAD_SLOT_info Data
+Observed> stg_DEAD_WEAK_info Data
+Observed> stg_END_STM_CHUNK_LIST_closure Data
+Observed> stg_END_STM_CHUNK_LIST_info Data
+Observed> stg_END_STM_WATCH_QUEUE_closure Data
+Observed> stg_END_STM_WATCH_QUEUE_info Data
+Observed> stg_END_TSO_QUEUE_closure Data
+Observed> stg_END_TSO_QUEUE_info Data
+Observed> stg_GCD_CAF_info Data
+Observed> stg_IND_info Data
+Observed> stg_MSG_BLACKHOLE_info Data
+Observed> stg_MSG_CLONE_STACK_info Data
+Observed> stg_MSG_NULL_info Data
+Observed> stg_MSG_THROWTO_info Data
+Observed> stg_MSG_TRY_WAKEUP_info Data
+Observed> stg_MSG_UPD_TSO_FLAG_info Data
+Observed> stg_MUT_ARR_PTRS_CLEAN_info Data
+Observed> stg_MVAR_TSO_QUEUE_info Data
+Observed> stg_NO_FINALIZER_closure Data
+Observed> stg_NO_FINALIZER_info Data
+Observed> stg_NO_TREC_closure Data
+Observed> stg_NO_TREC_info Data
+Observed> stg_PAP_apply Code
+Observed> stg_PAP_info Data
+Observed> stg_PROMPT_TAG_info Data
+Observed> stg_SMALL_MUT_ARR_PTRS_CLEAN_info Data
+Observed> stg_STABLE_NAME_info Data
+Observed> stg_STACK_info Data
+Observed> stg_TIMEOUT_QUEUE_EMPTY_closure Data
+Observed> stg_TIMEOUT_QUEUE_EMPTY_info Data
+Observed> stg_TIMEOUT_QUEUE_info Data
+Observed> stg_TREC_CHUNK_info Data
+Observed> stg_TREC_HEADER_info Data
+Observed> stg_TSO_info Data
+Observed> stg_TVAR_WATCH_QUEUE_info Data
+Observed> stg_WHITEHOLE_info Data
+Observed> stg_abort Code
+Observed> stg_ann_frame_info Data
+Observed> stg_ap_0_ret_str Data
+Observed> stg_ap_stack_entries Data
+Observed> stg_ap_stk_ Code
+Observed> stg_ap_stk_d Code
+Observed> stg_ap_stk_f Code
+Observed> stg_ap_stk_l Code
+Observed> stg_ap_stk_n Code
+Observed> stg_ap_stk_nn Code
+Observed> stg_ap_stk_nnn Code
+Observed> stg_ap_stk_nnp Code
+Observed> stg_ap_stk_np Code
+Observed> stg_ap_stk_npn Code
+Observed> stg_ap_stk_npp Code
+Observed> stg_ap_stk_p Code
+Observed> stg_ap_stk_pn Code
+Observed> stg_ap_stk_pnn Code
+Observed> stg_ap_stk_pnp Code
+Observed> stg_ap_stk_pp Code
+Observed> stg_ap_stk_ppn Code
+Observed> stg_ap_stk_ppp Code
+Observed> stg_ap_stk_pppp Code
+Observed> stg_ap_stk_ppppp Code
+Observed> stg_ap_stk_pppppp Code
+Observed> stg_ap_stk_ppppppp Code
+Observed> stg_ap_stk_pppppppp Code
+Observed> stg_ap_stk_v16 Code
+Observed> stg_ap_stk_v32 Code
+Observed> stg_ap_stk_v64 Code
+Observed> stg_apply_interp_info Data
+Observed> stg_atomically_frame_info Data
+Observed> stg_atomically_info Data
+Observed> stg_atomically_waiting_frame_info Data
+Observed> stg_block_blackhole Code
+Observed> stg_block_io_int Code
+Observed> stg_block_io_int_info Data
+Observed> stg_block_io_unit Code
+Observed> stg_block_io_unit_info Data
+Observed> stg_block_putmvar_finally Code
+Observed> stg_block_putmvar_info Data
+Observed> stg_block_readmvar_finally Code
+Observed> stg_block_readmvar_info Data
+Observed> stg_block_stmwait Code
+Observed> stg_block_takemvar_finally Code
+Observed> stg_block_takemvar_info Data
+Observed> stg_block_throwto Code
+Observed> stg_block_throwto_finally Code
+Observed> stg_block_throwto_info Data
+Observed> stg_catch_frame_info Data
+Observed> stg_catch_retry_frame_info Data
+Observed> stg_catch_stm_frame_info Data
+Observed> stg_compactAddWorkerzh Code
+Observed> stg_control0zh_ll Code
+Observed> stg_ctoi_D1_info Data
+Observed> stg_ctoi_F1_info Data
+Observed> stg_ctoi_L1_info Data
+Observed> stg_ctoi_R1n_info Data
+Observed> stg_ctoi_R1p_info Data
+Observed> stg_ctoi_V_info Data
+Observed> stg_dead_thread_info Data
+Observed> stg_do_unpack_cstring Code
+Observed> stg_do_unpack_cstring_utf8 Code
+Observed> stg_dummy_ret_closure Data
+Observed> stg_dummy_ret_info Data
+Observed> stg_forceIO_info Data
+Observed> stg_gc_prim Code
+Observed> stg_gc_prim_p_ll Code
+Observed> stg_gc_prim_p_ll_info Data
+Observed> stg_gc_prim_pp_ll Code
+Observed> stg_gc_prim_pp_ll_info Data
+Observed> stg_handleIOSubmitResult Code
+Observed> stg_keepAlive_frame_info Data
+Observed> stg_killMyself Code
+Observed> stg_marked_upd_frame_info Data
+Observed> stg_maskAsyncExceptionszh_ret_info Data
+Observed> stg_maskUninterruptiblezh_ret_info Data
+Observed> stg_noDuplicate_info Data
+Observed> stg_overwritingClosure Code
+Observed> stg_overwritingClosureSize Code
+Observed> stg_prompt_frame_info Data
+Observed> stg_raise_info Data
+Observed> stg_raise_ret_info Data
+Observed> stg_restore_cccs_d_info Data
+Observed> stg_restore_cccs_eval_info Data
+Observed> stg_restore_cccs_v16_info Data
+Observed> stg_restore_cccs_v32_info Data
+Observed> stg_restore_cccs_v64_info Data
+Observed> stg_returnToSched Code
+Observed> stg_returnToSchedButFirst Code
+Observed> stg_returnToSchedNotPaused Code
+Observed> stg_returnToStackTop Code
+Observed> stg_stack_save_entries Data
+Observed> stg_stack_underflow_frame_d_info Data
+Observed> stg_stack_underflow_frame_v16_info Data
+Observed> stg_stack_underflow_frame_v32_info Data
+Observed> stg_stack_underflow_frame_v64_info Data
+Observed> stg_stk_save_ Code
+Observed> stg_stk_save_d Code
+Observed> stg_stk_save_f Code
+Observed> stg_stk_save_l Code
+Observed> stg_stk_save_n Code
+Observed> stg_stk_save_nn Code
+Observed> stg_stk_save_nnn Code
+Observed> stg_stk_save_nnp Code
+Observed> stg_stk_save_np Code
+Observed> stg_stk_save_npn Code
+Observed> stg_stk_save_npp Code
+Observed> stg_stk_save_p Code
+Observed> stg_stk_save_pn Code
+Observed> stg_stk_save_pnn Code
+Observed> stg_stk_save_pnp Code
+Observed> stg_stk_save_pp Code
+Observed> stg_stk_save_ppn Code
+Observed> stg_stk_save_ppp Code
+Observed> stg_stk_save_pppp Code
+Observed> stg_stk_save_ppppp Code
+Observed> stg_stk_save_pppppp Code
+Observed> stg_stk_save_ppppppp Code
+Observed> stg_stk_save_pppppppp Code
+Observed> stg_stk_save_v16 Code
+Observed> stg_stk_save_v32 Code
+Observed> stg_stk_save_v64 Code
+Observed> stg_stop_thread_info Data
+Observed> stg_threadFinished Code
+Observed> stg_unmaskAsyncExceptionszh_ret_info Data
+Observed> stg_writeSlopMarker Code
+Observed> sync_phase_marking_budget Data
+Observed> sysErrorMsgFn Data
+Observed> tagConstr Code
+Observed> thunk_sizeW_fromITBL Code
+Observed> timedWaitCondition Code
+Observed> totalArgumentSize Code
+Observed> total_ticks Data
+Observed> unloadNativeObj Code
+Observed> user_era Data
+Observed> validate_trec_optimistic Code
+Observed> vbarf Code
+Observed> vdebugBelch Code
+Observed> vectorSupportGlobalVar Data
+Observed> verifyGot Code
+Observed> verrorBelch Code
+Observed> vsysErrorBelch Code
+Observed> waitCondition Code
+Observed> warnMissingKBLibraryPaths Code
+Observed> yieldThread Code
+
+Symbols observed in the DSO and declared in RtsSymbols.c but with conflicting type:
+WrongType> ALLOC_BH_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_BH_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_BH_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_BH_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_CON_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_CON_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_CON_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_CON_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_FUN_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_FUN_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_FUN_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_FUN_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_HEAP_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_HEAP_tot (declared, observed): (Code, Data)
+WrongType> ALLOC_PAP_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_PAP_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_PAP_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_PAP_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_PRIM_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_PRIM_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_PRIM_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_PRIM_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_RTS_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_RTS_tot (declared, observed): (Code, Data)
+WrongType> ALLOC_SE_THK_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_STACK_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_STACK_tot (declared, observed): (Code, Data)
+WrongType> ALLOC_THK_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_THK_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_THK_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_TSO_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_TSO_tot (declared, observed): (Code, Data)
+WrongType> ALLOC_TUP_adm (declared, observed): (Code, Data)
+WrongType> ALLOC_TUP_ctr (declared, observed): (Code, Data)
+WrongType> ALLOC_TUP_gds (declared, observed): (Code, Data)
+WrongType> ALLOC_TUP_slp (declared, observed): (Code, Data)
+WrongType> ALLOC_UP_THK_ctr (declared, observed): (Code, Data)
+WrongType> CATCHF_PUSHED_ctr (declared, observed): (Code, Data)
+WrongType> ENT_AP_STACK_ctr (declared, observed): (Code, Data)
+WrongType> ENT_AP_ctr (declared, observed): (Code, Data)
+WrongType> ENT_BH_ctr (declared, observed): (Code, Data)
+WrongType> ENT_CONTINUATION_ctr (declared, observed): (Code, Data)
+WrongType> ENT_DYN_CON_ctr (declared, observed): (Code, Data)
+WrongType> ENT_DYN_FUN_DIRECT_ctr (declared, observed): (Code, Data)
+WrongType> ENT_DYN_IND_ctr (declared, observed): (Code, Data)
+WrongType> ENT_DYN_THK_MANY_ctr (declared, observed): (Code, Data)
+WrongType> ENT_DYN_THK_SINGLE_ctr (declared, observed): (Code, Data)
+WrongType> ENT_LNE_ctr (declared, observed): (Code, Data)
+WrongType> ENT_PAP_ctr (declared, observed): (Code, Data)
+WrongType> ENT_PERM_IND_ctr (declared, observed): (Code, Data)
+WrongType> ENT_STATIC_CON_ctr (declared, observed): (Code, Data)
+WrongType> ENT_STATIC_FUN_DIRECT_ctr (declared, observed): (Code, Data)
+WrongType> ENT_STATIC_IND_ctr (declared, observed): (Code, Data)
+WrongType> ENT_STATIC_THK_MANY_ctr (declared, observed): (Code, Data)
+WrongType> ENT_STATIC_THK_SINGLE_ctr (declared, observed): (Code, Data)
+WrongType> ENT_VIA_NODE_ctr (declared, observed): (Code, Data)
+WrongType> GC_FAILED_PROMOTION_ctr (declared, observed): (Code, Data)
+WrongType> GC_SEL_ABANDONED_ctr (declared, observed): (Code, Data)
+WrongType> GC_SEL_MAJOR_ctr (declared, observed): (Code, Data)
+WrongType> GC_SEL_MINOR_ctr (declared, observed): (Code, Data)
+WrongType> HEAP_CHK_ctr (declared, observed): (Code, Data)
+WrongType> KNOWN_CALL_EXTRA_ARGS_ctr (declared, observed): (Code, Data)
+WrongType> KNOWN_CALL_TOO_FEW_ARGS_ctr (declared, observed): (Code, Data)
+WrongType> KNOWN_CALL_ctr (declared, observed): (Code, Data)
+WrongType> MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr (declared, observed): (Code, Data)
+WrongType> MULTI_CHUNK_SLOW_CALL_ctr (declared, observed): (Code, Data)
+WrongType> MainCapability (declared, observed): (Code, Data)
+WrongType> RET_NEW_ctr (declared, observed): (Code, Data)
+WrongType> RET_NEW_hst (declared, observed): (Code, Data)
+WrongType> RET_OLD_ctr (declared, observed): (Code, Data)
+WrongType> RET_OLD_hst (declared, observed): (Code, Data)
+WrongType> RET_SEMI_loads_avoided (declared, observed): (Code, Data)
+WrongType> RET_UNBOXED_TUP_ctr (declared, observed): (Code, Data)
+WrongType> RET_UNBOXED_TUP_hst (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_FUN_CORRECT_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_FUN_TOO_FEW_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_FUN_TOO_MANY_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_PAP_CORRECT_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_PAP_TOO_FEW_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_PAP_TOO_MANY_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_UNEVALD_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_d_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_f_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_l_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_n_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_p_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_pp_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_ppp_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_pppp_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_ppppp_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_pppppp_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_pppv_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_ppv_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_pv_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_v16_ctr (declared, observed): (Code, Data)
+WrongType> SLOW_CALL_fast_v_ctr (declared, observed): (Code, Data)
+WrongType> STK_CHK_ctr (declared, observed): (Code, Data)
+WrongType> TAG_TAGGED_miss (declared, observed): (Code, Data)
+WrongType> TAG_TAGGED_pred (declared, observed): (Code, Data)
+WrongType> TAG_UNTAGGED_miss (declared, observed): (Code, Data)
+WrongType> TAG_UNTAGGED_pred (declared, observed): (Code, Data)
+WrongType> UNKNOWN_CALL_ctr (declared, observed): (Code, Data)
+WrongType> UPDF_OMITTED_ctr (declared, observed): (Code, Data)
+WrongType> UPDF_PUSHED_ctr (declared, observed): (Code, Data)
+WrongType> UPDF_RCC_OMITTED_ctr (declared, observed): (Code, Data)
+WrongType> UPDF_RCC_PUSHED_ctr (declared, observed): (Code, Data)
+WrongType> UPD_CAF_BH_SINGLE_ENTRY_ctr (declared, observed): (Code, Data)
+WrongType> UPD_CAF_BH_UPDATABLE_ctr (declared, observed): (Code, Data)
+WrongType> UPD_CON_IN_NEW_ctr (declared, observed): (Code, Data)
+WrongType> UPD_CON_IN_PLACE_ctr (declared, observed): (Code, Data)
+WrongType> UPD_NEW_IND_ctr (declared, observed): (Code, Data)
+WrongType> UPD_NEW_PERM_IND_ctr (declared, observed): (Code, Data)
+WrongType> UPD_OLD_IND_ctr (declared, observed): (Code, Data)
+WrongType> UPD_OLD_PERM_IND_ctr (declared, observed): (Code, Data)
+WrongType> UPD_PAP_IN_NEW_ctr (declared, observed): (Code, Data)
+WrongType> UPD_PAP_IN_PLACE_ctr (declared, observed): (Code, Data)
+WrongType> UPD_SQUEEZED_ctr (declared, observed): (Code, Data)
+WrongType> VERY_SLOW_CALL_ctr (declared, observed): (Code, Data)
+WrongType> __stg_gc_enter_1 (declared, observed): (Data, Code)
+WrongType> __stg_gc_fun (declared, observed): (Data, Code)
+WrongType> closure_flags (declared, observed): (Code, Data)
+WrongType> defaultRtsConfig (declared, observed): (Code, Data)
+WrongType> g0 (declared, observed): (Code, Data)
+WrongType> ghc_unique_counter64 (declared, observed): (Code, Data)
+WrongType> ghc_unique_inc (declared, observed): (Code, Data)
+WrongType> keepCAFs (declared, observed): (Code, Data)
+WrongType> large_alloc_lim (declared, observed): (Code, Data)
+WrongType> prog_argc (declared, observed): (Code, Data)
+WrongType> prog_argv (declared, observed): (Code, Data)
+WrongType> stable_name_table (declared, observed): (Code, Data)
+WrongType> stable_ptr_table (declared, observed): (Code, Data)
+WrongType> stg_CHARLIKE_closure (declared, observed): (Code, Data)
+WrongType> stg_INTLIKE_closure (declared, observed): (Code, Data)
+WrongType> stg_absentErrorzh (declared, observed): (Data, Code)
+WrongType> stg_annotateStackzh (declared, observed): (Data, Code)
+WrongType> stg_ap_0_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_d_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_f_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_l_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_n_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_p_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_pp_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_ppp_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_pppp_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_ppppp_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_pppppp_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_pppv_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_ppv_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_pv_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_v16_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_v32_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_v64_fast (declared, observed): (Data, Code)
+WrongType> stg_ap_v_fast (declared, observed): (Data, Code)
+WrongType> stg_atomicModifyMutVar2zh (declared, observed): (Data, Code)
+WrongType> stg_atomicModifyMutVarzuzh (declared, observed): (Data, Code)
+WrongType> stg_atomicallyzh (declared, observed): (Data, Code)
+WrongType> stg_block_noregs (declared, observed): (Data, Code)
+WrongType> stg_block_putmvar (declared, observed): (Data, Code)
+WrongType> stg_block_readmvar (declared, observed): (Data, Code)
+WrongType> stg_block_takemvar (declared, observed): (Data, Code)
+WrongType> stg_casArrayzh (declared, observed): (Data, Code)
+WrongType> stg_casInt16Arrayzh (declared, observed): (Data, Code)
+WrongType> stg_casInt32Arrayzh (declared, observed): (Data, Code)
+WrongType> stg_casInt64Arrayzh (declared, observed): (Data, Code)
+WrongType> stg_casInt8Arrayzh (declared, observed): (Data, Code)
+WrongType> stg_casIntArrayzh (declared, observed): (Data, Code)
+WrongType> stg_casMutVarzh (declared, observed): (Data, Code)
+WrongType> stg_casSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_castDoubleToWord64zh (declared, observed): (Data, Code)
+WrongType> stg_castFloatToWord32zh (declared, observed): (Data, Code)
+WrongType> stg_castWord32ToFloatzh (declared, observed): (Data, Code)
+WrongType> stg_castWord64ToDoublezh (declared, observed): (Data, Code)
+WrongType> stg_catchRetryzh (declared, observed): (Data, Code)
+WrongType> stg_catchSTMzh (declared, observed): (Data, Code)
+WrongType> stg_catchzh (declared, observed): (Data, Code)
+WrongType> stg_clearCCSzh (declared, observed): (Data, Code)
+WrongType> stg_cloneArrayzh (declared, observed): (Data, Code)
+WrongType> stg_cloneMutableArrayzh (declared, observed): (Data, Code)
+WrongType> stg_cloneSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_cloneSmallMutableArrayzh (declared, observed): (Data, Code)
+WrongType> stg_closureSizzezh (declared, observed): (Data, Code)
+WrongType> stg_compactAddWithSharingzh (declared, observed): (Data, Code)
+WrongType> stg_compactAddzh (declared, observed): (Data, Code)
+WrongType> stg_compactAllocateBlockzh (declared, observed): (Data, Code)
+WrongType> stg_compactContainsAnyzh (declared, observed): (Data, Code)
+WrongType> stg_compactContainszh (declared, observed): (Data, Code)
+WrongType> stg_compactFixupPointerszh (declared, observed): (Data, Code)
+WrongType> stg_compactGetFirstBlockzh (declared, observed): (Data, Code)
+WrongType> stg_compactGetNextBlockzh (declared, observed): (Data, Code)
+WrongType> stg_compactNewzh (declared, observed): (Data, Code)
+WrongType> stg_compactResizzezh (declared, observed): (Data, Code)
+WrongType> stg_compactSizzezh (declared, observed): (Data, Code)
+WrongType> stg_copyArray_barrier (declared, observed): (Data, Code)
+WrongType> stg_copyArrayzh (declared, observed): (Data, Code)
+WrongType> stg_copyMutableArrayzh (declared, observed): (Data, Code)
+WrongType> stg_copySmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_copySmallMutableArrayzh (declared, observed): (Data, Code)
+WrongType> stg_deRefStablePtrzh (declared, observed): (Data, Code)
+WrongType> stg_deRefWeakzh (declared, observed): (Data, Code)
+WrongType> stg_decodeDoublezu2Intzh (declared, observed): (Data, Code)
+WrongType> stg_decodeDoublezuInt64zh (declared, observed): (Data, Code)
+WrongType> stg_decodeFloatzuIntzh (declared, observed): (Data, Code)
+WrongType> stg_delayzh (declared, observed): (Data, Code)
+WrongType> stg_exit (declared, observed): (Data, Code)
+WrongType> stg_freezzeArrayzh (declared, observed): (Data, Code)
+WrongType> stg_freezzeSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_gc_bpp (declared, observed): (Data, Code)
+WrongType> stg_gc_d1 (declared, observed): (Data, Code)
+WrongType> stg_gc_f1 (declared, observed): (Data, Code)
+WrongType> stg_gc_ii (declared, observed): (Data, Code)
+WrongType> stg_gc_ip (declared, observed): (Data, Code)
+WrongType> stg_gc_l1 (declared, observed): (Data, Code)
+WrongType> stg_gc_noregs (declared, observed): (Data, Code)
+WrongType> stg_gc_pi (declared, observed): (Data, Code)
+WrongType> stg_gc_pp (declared, observed): (Data, Code)
+WrongType> stg_gc_ppp (declared, observed): (Data, Code)
+WrongType> stg_gc_pppp (declared, observed): (Data, Code)
+WrongType> stg_gc_ppppp (declared, observed): (Data, Code)
+WrongType> stg_gc_prim_n (declared, observed): (Data, Code)
+WrongType> stg_gc_prim_p (declared, observed): (Data, Code)
+WrongType> stg_gc_prim_pp (declared, observed): (Data, Code)
+WrongType> stg_gc_unbx_r1 (declared, observed): (Data, Code)
+WrongType> stg_gc_unpt_r1 (declared, observed): (Data, Code)
+WrongType> stg_getApStackValzh (declared, observed): (Data, Code)
+WrongType> stg_getMaskingStatezh (declared, observed): (Data, Code)
+WrongType> stg_getOtherThreadAllocationCounterzh (declared, observed): (Data, Code)
+WrongType> stg_getSparkzh (declared, observed): (Data, Code)
+WrongType> stg_getThreadAllocationCounterzh (declared, observed): (Data, Code)
+WrongType> stg_isByteArrayPinnedzh (declared, observed): (Data, Code)
+WrongType> stg_isByteArrayWeaklyPinnedzh (declared, observed): (Data, Code)
+WrongType> stg_isCurrentThreadBoundzh (declared, observed): (Data, Code)
+WrongType> stg_isEmptyMVarzh (declared, observed): (Data, Code)
+WrongType> stg_isMutableByteArrayPinnedzh (declared, observed): (Data, Code)
+WrongType> stg_isMutableByteArrayWeaklyPinnedzh (declared, observed): (Data, Code)
+WrongType> stg_keepAlivezh (declared, observed): (Data, Code)
+WrongType> stg_killThreadzh (declared, observed): (Data, Code)
+WrongType> stg_labelThreadzh (declared, observed): (Data, Code)
+WrongType> stg_listThreadszh (declared, observed): (Data, Code)
+WrongType> stg_makeStablePtrzh (declared, observed): (Data, Code)
+WrongType> stg_maskAsyncExceptionszh (declared, observed): (Data, Code)
+WrongType> stg_maskUninterruptiblezh (declared, observed): (Data, Code)
+WrongType> stg_mkApUpd0zh (declared, observed): (Data, Code)
+WrongType> stg_newAlignedPinnedByteArrayzh (declared, observed): (Data, Code)
+WrongType> stg_newArrayzh (declared, observed): (Data, Code)
+WrongType> stg_newBCOzh (declared, observed): (Data, Code)
+WrongType> stg_newByteArrayzh (declared, observed): (Data, Code)
+WrongType> stg_newConAppObjzh (declared, observed): (Data, Code)
+WrongType> stg_newMVarzh (declared, observed): (Data, Code)
+WrongType> stg_newMutVarzh (declared, observed): (Data, Code)
+WrongType> stg_newPinnedByteArrayzh (declared, observed): (Data, Code)
+WrongType> stg_newSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_newTVarzh (declared, observed): (Data, Code)
+WrongType> stg_noDuplicatezh (declared, observed): (Data, Code)
+WrongType> stg_numSparkszh (declared, observed): (Data, Code)
+WrongType> stg_paniczh (declared, observed): (Data, Code)
+WrongType> stg_putMVarzh (declared, observed): (Data, Code)
+WrongType> stg_raiseDivZZerozh (declared, observed): (Data, Code)
+WrongType> stg_raiseIOzh (declared, observed): (Data, Code)
+WrongType> stg_raiseOverflowzh (declared, observed): (Data, Code)
+WrongType> stg_raiseUnderflowzh (declared, observed): (Data, Code)
+WrongType> stg_raisezh (declared, observed): (Data, Code)
+WrongType> stg_readMVarzh (declared, observed): (Data, Code)
+WrongType> stg_readTVarIOzh (declared, observed): (Data, Code)
+WrongType> stg_readTVarzh (declared, observed): (Data, Code)
+WrongType> stg_resizzeMutableByteArrayzh (declared, observed): (Data, Code)
+WrongType> stg_retryzh (declared, observed): (Data, Code)
+WrongType> stg_setOtherThreadAllocationCounterzh (declared, observed): (Data, Code)
+WrongType> stg_setThreadAllocationCounterzh (declared, observed): (Data, Code)
+WrongType> stg_shrinkMutableByteArrayzh (declared, observed): (Data, Code)
+WrongType> stg_shrinkSmallMutableArrayzh (declared, observed): (Data, Code)
+WrongType> stg_takeMVarzh (declared, observed): (Data, Code)
+WrongType> stg_thawArrayzh (declared, observed): (Data, Code)
+WrongType> stg_thawSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_threadLabelzh (declared, observed): (Data, Code)
+WrongType> stg_threadStatuszh (declared, observed): (Data, Code)
+WrongType> stg_traceBinaryEventzh (declared, observed): (Data, Code)
+WrongType> stg_traceEventzh (declared, observed): (Data, Code)
+WrongType> stg_traceMarkerzh (declared, observed): (Data, Code)
+WrongType> stg_tryReadMVarzh (declared, observed): (Data, Code)
+WrongType> stg_tryTakeMVarzh (declared, observed): (Data, Code)
+WrongType> stg_unmaskAsyncExceptionszh (declared, observed): (Data, Code)
+WrongType> stg_unpackClosurezh (declared, observed): (Data, Code)
+WrongType> stg_unsafeThawArrayzh (declared, observed): (Data, Code)
+WrongType> stg_unsafeThawSmallArrayzh (declared, observed): (Data, Code)
+WrongType> stg_waitReadzh (declared, observed): (Data, Code)
+WrongType> stg_waitWritezh (declared, observed): (Data, Code)
+WrongType> stg_whereFromzh (declared, observed): (Data, Code)
+WrongType> stg_writeTVarzh (declared, observed): (Data, Code)
+WrongType> stg_yield_noregs (declared, observed): (Data, Code)
+WrongType> stg_yield_to_interpreter (declared, observed): (Data, Code)
+WrongType> stg_yieldzh (declared, observed): (Data, Code)
+WrongType> ticky_slow_call_unevald (declared, observed): (Code, Data)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aca72a5a2a9db6adc6ffbafca62163b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aca72a5a2a9db6adc6ffbafca62163b…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/sjakobi/T27804-findsplice-order] 4 commits: Rename: Take the group first in findSplice's add
by Simon Jakobi (@sjakobi) 09 Oct '26
by Simon Jakobi (@sjakobi) 09 Oct '26
09 Oct '26
Simon Jakobi pushed to branch wip/sjakobi/T27804-findsplice-order at Glasgow Haskell Compiler / GHC
Commits:
5df9ac56 by Simon Jakobi at 2026-10-08T23:51:51+02:00
Rename: Take the group first in findSplice's add
With the group as the first argument, the fold in findSplice no longer
needs flip, and each clause of add keeps the shape it had before the
previous commit.
Assisted-by: Claude Fable 5.1
- - - - -
2903418f by Simon Jakobi at 2026-10-09T12:19:49+02:00
hadrian: Silence -Wsimplifiable-class-constraints in parsec
Whether the instance context `Semigroup (ParsecT s u m a)` of parsec's
Monoid instance triggers the warning depends on the order in which GHC
typechecks the module's instances (#27913). With the instance order of
the preceding commits the warning fires, and the -Werror builds in CI
fail.
The constraint has been redundant since parsec started requiring
base >= 4.12. Once the submodule carries the upstream fix
(https://github.com/haskell/parsec/pull/202) the flag can go again.
Assisted-by: Claude Fable 5.1
- - - - -
3e46b599 by sheaf at 2026-10-09T12:22:35+02:00
Take into account ifKind in freeNamesIfDecl
Commit 3c2f4bb4 added the 'ifKind' field to various constructors
of 'IfaceDecl', which preserves the original kind (before type synonym
expansion) for better error messages.
However, that commit forgot to update 'freeNamesIfDecl' correspondingly.
This could result in a "urk! lookup local fingerpring" crash when e.g.
a type's kind uses a type synonym defined later, as we failed to add a
dependency on the type synonym during dependency analysis.
Fixes #27916
(cherry picked from commit 60fce2dac3f17a56d0191cfae5fe15f126ec314d)
- - - - -
c0a7e8af by Simon Jakobi at 2026-10-09T12:38:13+02:00
testsuite: Accept output changes from the findSplice reordering
With every HsGroup list in source order, 48 tests print the same
information in a different order or anchor an error at a different one
of several equally valid declarations: annotation, type family instance
and derived-instance dumps, `:info` listings, the renamed and
typechecked AST dumps, bytecode dumps, and the instance listing in the
base-exports stability files (all three platform variants, patched
with the CI diff since the test needs the dump-decls tool). annrun01's
getAnnotations now returns annotations in source order.
The non-order failures of the first CI run of !16781 are dealt with
separately: the "urk! lookup local fingerprint" panics by the
cherry-picked fix for #27916, parsec's warning by the hadrian flag.
Assisted-by: Claude Fable 5.1
- - - - -
53 changed files:
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Rename/Module.hs
- hadrian/src/Settings/Warnings.hs
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail05.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail07.stderr
- testsuite/tests/annotations/should_fail/annfail08.stderr
- testsuite/tests/annotations/should_fail/annfail10.stderr
- testsuite/tests/annotations/should_run/annrun01.stdout
- testsuite/tests/backpack/should_fail/bkpfail29.stderr
- testsuite/tests/default/default-fail03.stderr
- testsuite/tests/dependent/should_compile/T15743e.stderr
- testsuite/tests/deriving/should_compile/T17240.stderr
- testsuite/tests/deriving/should_compile/T17339.stderr
- testsuite/tests/deriving/should_compile/T20496.stderr
- testsuite/tests/deriving/should_compile/drv-empty-data.stderr
- testsuite/tests/dmdanal/should_compile/T16029.stdout
- testsuite/tests/ffi/should_compile/T26852.stderr
- testsuite/tests/generics/GenDerivOutput1_1.stderr
- testsuite/tests/generics/T10604/T10604_deriving.stderr
- testsuite/tests/ghci/prog-mhu001/prog-mhu001c.stdout
- testsuite/tests/ghci/scripts/T12550.stdout
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/ghci/scripts/T8674.stdout
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/indexed-types/should_fail/OverDirectThisMod.stderr
- testsuite/tests/indexed-types/should_fail/OverIndirectThisMod.stderr
- testsuite/tests/indexed-types/should_fail/T20466.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/parser/should_fail/OpaqueParseFail4.stderr
- testsuite/tests/partial-sigs/should_compile/Meltdown.stderr
- testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
- testsuite/tests/patsyn/should_fail/T12165.stderr
- testsuite/tests/plugins/test-defaulting-plugin.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig10.stderr
- testsuite/tests/pmcheck/complete_sigs/completesig11.stderr
- testsuite/tests/polykinds/PolyKinds07.stderr
- testsuite/tests/saks/should_fail/T16727a.stderr
- testsuite/tests/saks/should_fail/saks_fail002.stderr
- testsuite/tests/show-bytecode/show-bytecode-breakpoints.stdout
- testsuite/tests/show-bytecode/show-bytecode-hpc.stdout
- testsuite/tests/show-bytecode/show-bytecode-vanilla.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/Orphans.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/simplCore/should_compile/T12603.stdout
- + testsuite/tests/typecheck/should_compile/T27916.hs
- testsuite/tests/typecheck/should_compile/all.T
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed6b480aafed791a6d042f64d37403…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ed6b480aafed791a6d042f64d37403…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/T27724] 41 commits: Improvements to type/data family handling
by Simon Peyton Jones (@simonpj) 09 Oct '26
by Simon Peyton Jones (@simonpj) 09 Oct '26
09 Oct '26
Simon Peyton Jones pushed to branch wip/T27724 at Glasgow Haskell Compiler / GHC
Commits:
1b4a622f by sheaf at 2026-09-17T02:39:13-04:00
Improvements to type/data family handling
This commit makes several improvements to the treatment of type and data
families in GHC:
- We consistently use "type family" instead of "type synonym family"
to avoid a confusion with type synonyms. For example:
- OpenSynFamilyTyCon ==> OpenTypeFamilyTyCon
- ClosedSynFamilyTyCon => ClosedTypeFamilyTyCon
- Various functions that were specific to data families have been
renamed to make this clear. For example:
- tyConFamInst_maybe ==> tyConDataFamInst_maybe
- isFamInstTyCon ==> isDataFamInstTyCon
- 'FamTyConFlav' has been refactored so that all closed type families
share a single 'ClosedTypeFamilyTyCon' constructor.
The corresponding 'IfaceFamTyConFlav' type was updated similarly.
This is then used to tidy up the implementation of
GHC.Core.FamInstEnv.reduceTyFamApp_maybe.
- - - - -
c5aa9098 by sheaf at 2026-09-17T02:39:13-04:00
Small refactor of lookupFamInstEnv
This commit reworks the code for looking up family instances in
GHC.Core.FamInstEnv, reducing duplication a little bit.
No change in behaviour.
- - - - -
a3ad4588 by sheaf at 2026-09-17T02:39:14-04:00
Use a type family for boxing unboxed types
This commit overhauls the way in which unboxed types are boxed, as per
the updated Note [Boxing constructors] in GHC.Builtin.WiredIn.Types.Box.
The main change is to allow boxing to be parametrised by representation,
e.g. making 'Box ty' a valid type. We achieve this by implementing 'Box'
using a closed type family:
newtype Box (a :: TYPE r) = Box (BoxTF r)
type BoxTF :: RuntimeRep -> Type
type family BoxTF r where
BoxTF IntRep = BoxInt
BoxTF Int8Rep = BoxInt8
BoxTF WordRep = BoxWord
BoxTF LiftedRep = Any @Type
BoxTF (TupleRep [r1, r2]) = (BoxTF r1, BoxTF r2)
...
BoxTF (SumRep rs) = BoxSum rs
This new design solves the following problems:
- It allows boxing a type whose 'RuntimeRep' has not yet been
determined (e.g. because we only learn the 'RuntimeRep' after
constraint solving). That is, 'Box @r a' is a perfectly valid type
even if 'r' is an unfilled metavariable. This is a requirement
to fix #25065 (in which we need to box a type whose 'RuntimeRep'
is only filled in during constraint solving).
- It handles boxing of unboxed tuples and unboxed sums, via recursive
boxing. See Note [Boxing TupleRep and SumRep] in
GHC.Builtin.WiredIn.Types.Box.
'Box', 'BoxTF' and all of the boxing data constructors are defined in
a new 'ghc-internal' module, 'GHC.Internal.Box'. This module contains
nothing but wired-in declarations, and GHC never loads its interface on
account of a wired-in thing (GHC.Builtin.Modules.isWiredInOnlyModule);
see Note [Loading instances for wired-in things] in GHC.Iface.Load.
The individual boxing data constructors are deliberately left as an
internal implementation detail, and not exported. The intended API is
via the two new magic 'Id's:
box :: forall {r} (a :: TYPE r). a -> Box a
unbox :: forall {r} (a :: TYPE r). Box a -> a
exported from 'GHC.PrimOps' (in 'ghc-experimental'). The old boxing
data types (IntBox, WordBox, FloatBox, DoubleBox, DictBox) are no longer
exported from base (CLC proposal #421).
We use this new design to consistently desugar:
- parallel comprehensions (GHC.HsToCore.ListComp.{deListComp,dsMcStmt})
- then/group/using statements (GHC.HsToCore.ListComp.{dsTransStmt,dsMcStmt})
- recursive do blocks (mdo/rec) (GHC.HsToCore.Expr.dsDo)
- arrows (GHC.HsToCore.Arrows)
by consistently using 'box'/'unbox' to deal with unboxed types being put
into big tuples. We also adapt 'GHC.Tc.Gen.Match.{tcMcStmt,tcDoStmt}'
to create fresh /representation-polymorphic/ type variables for the
binders that we are going to put into a big tuple (previously, GHC only
allowed lifted types in that position).
These desugaring of box and unbox is explained in
Note [Desugaring box & unbox] in GHC.Core.Make.Box. Roughly speaking,
the desugaring looks like:
box @r @ty e ==> K e
unbox @r @ty e ==> case e of K x -> x
where 'K' is the boxing data constructor at RuntimeRep 'r'. It's
slightly more complicated than that in practice: we first need to
insert a cast (see Note [The canonical type of a RuntimeRep]) using the
new 'CanonicalProv' 'UnivCoProvenance', and unboxed tuples/sums need
recursive logic explained in Note [box/unbox for unboxed tuples and sums],
including a specific 'BoxSum' datatypes for unboxed sum (which also
needed a wired-in type-level list indexing type family (!!)).
The desugaring happens in two ways:
- Occurrences of 'box'/'unbox' emitted by the typechecker are
eliminated in the 'ds_app_var' case of GHC.HsToCore.Expr.
- Other code that needs to box/unbox emits the appropriate code inline.
This includes the big tuple machinery of GHC.Core.Make used by the
desugarer (GHC.HsToCore.{Utils,Binds,Arrows,ListComp}) as well as
the float-out pass (GHC.Core.Opt.SetLevels).
Core Lint checks that no occurrence of 'box'/'unbox' survives desugaring.
On the way, we overhaul the litany of big tuple functions by introducing
data BigTupleLayout = BoxedElements | BareElements
to distinguish the two kinds of "big tuples" that GHC routinely deals
with; for example 'mkBigCoreVarTupSolo' becomes 'mkBigCoreVarTup BareElements'.
All of this code is moved to the new module GHC.Core.Make.BigTuple.
Fixes #20864 #22336 #22473 #25065 #27331
-------------------------
Metric Decrease:
T9872a
-------------------------
- - - - -
4cf7628a by Evgeny Malyshev at 2026-09-17T02:39:56-04:00
Fix the CompactionFailed documentation link to compact
The old Haddock reference links into base instead of ghc-compact.
Use an explicit URL because ghc-compact depends on base, not vice versa.
Fixes #27558
Assisted-By: OpenAI Codex
- - - - -
098bba70 by Facundo Domínguez at 2026-09-17T14:57:41-04:00
Remove the call to hoistFlag from processCmdLineP
This call was undesirable because it was causing a reconstruction
of the list of flag processors.
Even relying on list fusion would not be sufficient because we want
to replace the list with a data structure with faster lookups to
address #25763.
The removal is done in two moves:
* We move CmdLineP to CmdLine.hs
* Then we move the effect of hoisting to processArgs via a new function
hoistEwM
- - - - -
e01799c7 by Facundo Domínguez at 2026-09-17T14:57:42-04:00
Do not create duplicate flag processors for the -W flag
This makes simpler implementing the command line parser with a trie map
holding flag processors. If we were to allow duplicate flag processors
for any flag, the trie map would need to be a multimap.
- - - - -
3875b257 by Facundo Domínguez at 2026-09-17T14:57:42-04:00
Replace the list of flag processors with a trie map in `processArgs`
Previously `GHC.Driver.CmdLine.findArg` was called for each
command-line argument, doing a linear search on the list of flag
processors each time. This was somewhat costly as the list of flag
processor has near 2000 elements.
A lookup with a trie map is faster in general, but the speed up is
only noticeable when calling `GHC.Driver.CmdLine.processArgs` sufficient
times, so the amount of lookups piles up. This could happen in large
projects with many units each having many dependencies. If only a
module needs to be recompiled, the user still needs to wait for all of
the flag parsing to complete.
The benchmark at testsuite/tests/perf/compiler/cmdline-parser shows a
10x speed up when using the trie.
The trie map is implemented in `GHC.Data.StringTrie`.
The design is explained in Note [Processing command line argument fast]
in GHC.Driver.Session.
The commit also:
* adds two property-based tests for trie map operations,
* adds a benchmark of the command line parser, and
* renames the predicate `arg_ok` to `valid_flag_suffix` to decide what
flag processor should be used when there are multiple matching
prefixes on a flag.
Fixes #25763.
- - - - -
5236634a by Andreas Klebinger at 2026-09-17T14:58:24-04:00
Compile Word64{Map,Set} with -O2 always.
This is the hottest code and even if we build GHC with -O0 otherwise -O2
pays off for these modules.
Fixes #27814.
- - - - -
545fd4fb by ARATA Mizuki at 2026-09-22T15:03:24-04:00
Change the C types of hs_{bitrev,bswap}{16,32} to match the Haskell types
bitReverse{16,32}# and byteSwap{16,32}# have the type
Word# -> Word#, but their C correspondents took and
returned StgWord{16,32}.
The mismatch on bitReverse16# led to the problem reported
in #27299. Although no similar issue is reported for
bitReverse32# and byteSwap{16,32}#, it seemed wise to
change them proactively.
This commit fixes the mismatch by changing the C type.
Fixes #27299
- - - - -
bf17f289 by fendor at 2026-09-22T15:04:05-04:00
Don't lose instances from shadowed imported modules with the same name
When we look for instances below the current module, we need to check
the unit id as well when we check for whether the module is the current
module, otherwise we ignore modules we import that have the same name as
the import module.
Adds regression test.
- - - - -
53eead15 by Wolfgang Jeltsch at 2026-09-24T20:12:03-04:00
Correct the documentation of `explicitUnits`
Resolves #27787.
- - - - -
35bf6f4b by Simon Jakobi at 2026-09-24T20:12:49-04:00
Remove stale specHeader bullet from Note [Don't make fillers for constraint types]
The Note said that Specialise.specHeader also calls mkAbsentFiller.
abfc224a27c removed that call: the specialiser no longer drops dead
arguments at all, see Note [Do not drop dead args from specialisations]
in GHC.Core.Opt.Specialise.
Assisted-by: Claude Fable 5.1
- - - - -
1abef1ef by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the `mhu-closure` makefile
- - - - -
a79a68ea by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Make `ghci-multi` hide all unneeded packages
- - - - -
d6e72450 by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Improve the definition of the home unit closure property
- - - - -
c9a2766d by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Re-implement the home unit closure check
Compared to the previous implementation, the new one has the following
advantages:
* It is correct.
- It distinguishes between units that have the same unit ID but
different ABI hashes.
- When `-hide-all-packages` is not used, it considers as home unit
dependencies also units that are made implicitly available
because they are in the package database.
* It seems to be faster in usual settings.
- In particular, it does not have a preparation phase in which it
merges the dependency information from all home units, so that
its running time does not grow linearly with the size of the
package database in normal Cabal scenarios.
* It is (hopefully) clearer.
* It is better documented.
- - - - -
fa96acf8 by Wolfgang Jeltsch at 2026-09-25T17:02:07-04:00
Remove erroneous GHC flag in `hadrian-multi`
The flag was `-Werror=-Wno-error=incomplete-record-selectors`. Its
purpose was to permit incomplete record selectors, but because of the
illegal combination of `-Werror=` and `-Wno-error` it was ignored,
without any negative consequences.
- - - - -
9f48a5b9 by Alan Zimmerman at 2026-09-25T17:02:50-04:00
EPA: Add specific layout field to AnnList
Up to now AnnList has effectively served to represent lists of things
having layout, regardless of whether they do or not.
In Haskell, layout is optional in many places, as there is also an
alternative syntax using braces and semi-colons, which is free-form.
This commit introduces AnnListLayout, a data structure capturing this
distinction.
It is deliberately set up similarly to EpLayout, so that these two can
be merged in time.
The transition is done mechanically, where AnnListBraces is not used
yet, the original Nothing case maps to AnnListNoLayout, and the Just
case to AnnListLayout.
Later commits will fine tune these against the actual parser layout.
- - - - -
234bab08 by Vladislav Zavialov at 2026-09-29T17:22:54-04:00
Add regression test for #7803
Commit 2effe18ab5, first shipped with GHC 8.2.1, fixed #7803 "Superclass
methods are left unspecialized".
This change turns the example from the ticket description into a regression
test, checking that foo1 is fully specialised at Double, with no calls to the
overloaded exp5Tail.
Closes #7803
Assisted-by: Claude Opus 5
- - - - -
c406135c by Andreas Klebinger at 2026-10-01T06:57:28-04:00
RTS: Update flag parsing/handling:
Using 0 as argument to any of these flags now resets the flags setting to default:
- ``-n0`` disables nursery chunking.
- ``-K0`` (or a bare ``-K``) removes the stack size limit.
- ``-M0`` removes the heap size limit.
- ``-H0`` resets the suggested heap size, including the nursery scaling set by ``-H``.
- ``-AL0`` makes the large object allocation limit follow ``-A`` again.
GC Generations are now limited to 64.
-n larger than -A now emits a warning and disables chunking.
Fixes #27830 #27829
- - - - -
984ee82b by Andreas Klebinger at 2026-10-01T06:58:10-04:00
Fix MultiLayerModules timeout multiplier.
We accidentally used the compile multiplier for ghci commands which
use the run timeout setting to set the timeout.
Fixes #26263 and #27796.
- - - - -
50a9cf26 by Andreas Klebinger at 2026-10-01T06:58:10-04:00
testsuite: Include runtime in JUnit report.
- - - - -
e358619f by Alan Zimmerman at 2026-10-01T06:59:01-04:00
EPA: Use EpaLocation in EpVirtualBraces
Haddock processing uses EpLayout.EpVirtualBraces to record the current
layout column, for allocating haddock comments correctly.
For exact printing, we need the line as well as the col, so we know
how many lines to skip when the indented code block starts.
This commit updates EpLayout.EpVirtualBraces so that it carries an
EpaLocation instead of just the Int column, to allow it to be used for
both purposes.
It is a simple mechanical change, with no other impact, but it allows
us to use EpLayout instead of AnnListLayout in AnnList, in the next
commit in this series.
- - - - -
1d2a26ee by Andrew Lelechenko at 2026-10-01T20:22:04-04:00
Remove bitSize from MINIMAL pragma of class Bits
Cf. https://github.com/haskell/core-libraries-committee/issues/441
The function is deprecated for 12 years and has a default implementation,
yet it was never removed from the MINIMAL pragma, putting library authors
in a very awkward position. Let's finally remove bitSize from MINIMAL.
- - - - -
3cc21e4c by Hannes Siebenhandl at 2026-10-01T20:22:59-04:00
Add regression test for #27641
- - - - -
c35096f5 by Hannes Siebenhandl at 2026-10-01T20:23:00-04:00
Don't `:add` modules the loader will reject
Only home modules can be actually added to the loader context, thus we
only accept the module if it belongs to a home unit.
- - - - -
a563cb27 by Simon Jakobi at 2026-10-02T17:37:36-04:00
ci: accept modified changelog.d entries in lint-changelog
The changelog guide says to extend an existing entry rather than add a
new one when the feature is already documented. lint_changelog only
counted added files, so such MRs failed before the validator ran.
Fixes #27779.
Assisted-by: Claude Fable 5.1
- - - - -
03082cd4 by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix warning flag name in the semaphore-v2 entry
The entry refers to -Wsemaphore-version-mismatch, which does not exist.
The warning GHC emits when it cannot use a -jsem semaphore, including
on a protocol version mismatch, is -Wsemaphore-open-failure.
Context: !15729, #25087
Assisted-by: Claude Fable 5.1
- - - - -
a93705ee by Simon Jakobi at 2026-10-02T17:38:17-04:00
changelog.d: Fix the CLC proposal link in the T27455 entry
The entry used the Sphinx :ref: role with a URL as its target. :ref:
resolves only internal labels, so the generated release notes would
show the proposal name without a link. Use the plain hyperlink form
like the other entries.
Context: !16274, #27455
Assisted-by: Claude Fable 5.1
- - - - -
54381079 by Hannes Siebenhandl at 2026-10-02T17:39:01-04:00
Extend the `TrustOverlay` for wired-in units
The TrustOverlay only contained the `UnitId` of all on-disk units.
However, wired-in units are referred to by their wired-in unit id, which
is not the same as the on-disk unit id.
Thus, trust checks for wired-in units failed because the lookup was
using the wired-in unit, which wasn't present in the `TrustOverlay`.
We fix #27834, by copying the trust info for wired-in unit ids.
- - - - -
f8cfb1a5 by Hécate Kleidukos at 2026-10-04T19:36:39+02:00
[CLC 341] Strict variants of mutable types
This commit is the implementation of CLC Proposal 341
https://github.com/haskell/core-libraries-committee/issues/341
- - - - -
575c4bc6 by Rodrigo Mesquita at 2026-10-05T12:32:02-04:00
ttg: HsModuleName in the AST, ModuleName in GHC
This commit makes the AST fully independent from GHC by parsing a
"module name" as an `HsModuleName (= HText)` rather than constructing an
`ModuleName (= FastString)` straight away.
In the GHC side, everything remains as a `ModuleName`. We turn AST
`HsModuleName`s into fast strings with the cheap `mkFastStringShortText`
when we process the AST for manipulation within the compiler.
There are no performance regressions introduced by this approach.
This is the final piece of #21592
Alternative plans were discussed in
gitlab.haskell.org/ghc/ghc/-/merge_requests/16546#note_694647,
but the Simon suggested one won in simplicity and performance when
compared against my attempt at implementing my original plan of having
a family `ModuleNameP`.
- - - - -
b3b89d32 by mangoiv at 2026-10-05T22:03:32-04:00
hadrian: Persist the used flavour name in the build root (#20650)
This executes the idea proposed in #20650, teaching Hadrian to persist
the flavour used to build a build root. This both makes use of multiple
build roots more ergonomic (as the user no longer needs to repeat
themselves) and avoids a tiresome foot-gun (forgetting to specify a
flavour, often wholly invalidating a build root).
Closes #20650.
Co-authored-by: Sylvain Henry <sylvain(a)haskus.fr>
- - - - -
f977837b by mangoiv at 2026-10-05T22:04:21-04:00
configure: fix sed script and subst tooldir script
Fixes #27672
Adds sanity checking for SUBST_TOOLDIR
Metric Decrease:
LinkableUsage01
MultiLayerModulesTH_OneShot
T10547
T12234
T12425
T13035
T13820
T18140
T18730
T18923
T9198
TcPlugin_RewritePerf
mhu-perf
- - - - -
f1cb08be by Hannes Siebenhandl at 2026-10-05T22:05:03-04:00
Prepend in-memory unit database for backpack
The packageDbFlags are stored in reverse order. Thus, prepending will
ensure that the in-memory unit database is the last item on the unit
database stack.
Further, the in-memory unit database needs to be able to shadow units
from earlier unit databases in the unit database stack.
Moreover, a `-clear-package-db` would remove the in-memory database if
it weren't the last item on the stack.
Closes #27835
- - - - -
8d49ed42 by Kazu Yamamoto at 2026-10-06T19:37:25-04:00
Do not leave standard file descriptors free at startup (#24450)
A process may be started with stdout closed -- `prog >&-` from a shell does
exactly that. Nothing then reserves descriptor 1, and open(), pipe() and
socket() hand out the lowest free descriptor, so the next descriptor the
runtime creates for itself takes it: the ticker's pipe, or a capability's IO
manager control pipe.
'GHC.Internal.IO.StdHandles.stdout' is a CAF, built the first time the program
writes to stdout, which is long after that has happened. It builds a 'Handle'
over descriptor 1, which now belongs to the runtime, and nothing reports an
error because the descriptor is perfectly good. The program then writes its
output into the runtime's own plumbing.
What that looks like from the outside is a hang. The descriptor the Handle has
taken over is the read end of a pipe, so poll() for POLLOUT on it never says
yes and epoll_ctl() accepts a registration for it; the thread waiting to write
blocks for ever. Closing the Handle at exit closes the runtime's descriptor,
which is worse: the ticker then fails on every tick.
'hs_init_ghc' now opens /dev/null onto whichever of descriptors 0, 1 and 2 are
closed, before the runtime creates any descriptor of its own. Each is opened
for the access that descriptor would normally have, read-only for 0 and
write-only for 1 and 2, so that writing to 'stdin' or reading from 'stdout'
still fails rather than quietly succeeding against /dev/null. See
Note [Standard file descriptors must be open].
Moving only the descriptors the runtime opens would not do: the first file the
program itself opened would land on the free number instead. The fix has to
leave no free number. A program run this way therefore finds stdout connected
to /dev/null rather than failing with EBADF on the first write, which is what
such a program would get from most other language runtimes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply(a)anthropic.com>
- - - - -
65bcf9e9 by Simon Jakobi at 2026-10-06T19:38:09-04:00
changelog: Repair the sentence describing #27477
The description read "programs using could crash", the object of
"using" having been lost. The synopsis already says which programs are
affected, so drop the dangling word.
Assisted-by: Claude Fable 5.1
- - - - -
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
0846506b by Simon Peyton Jones at 2026-10-09T10:48:20+01:00
Redesign the noinline magic
Main idea:
* When simplifying `noinline (f e1 e2)`, switch off inlining when simplifying `f`
* Mechanism: see `simplOutId`, the `noinlineIdKey` case
* If we see `noinline (f e1) e2`, the simplifier moves the `e2` inside; see the `splitContArgs` call.
This is important so you can write `noinliine f e1 e2` and have it mean the same as `noinline (f e1 e2)`.
* Now `f` sees all its arguments, henc:
* Fixes #27724
* Fixes #23911
* Also fixes #27803 where we were not respecting `noinline` if the RHS
was trivial
See Note [noinlineId magic] for lots of specifics. It's surprisingly tricky!
For some reason a couple of perf tests allocate 1.2% less at compile time,n
namely T29872 and T8095. Geom mean decease of 0.1%
Metric Decrease:
T9872d
- - - - -
318 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/24450
- + changelog.d/25763-cmdline-opt
- + changelog.d/26610
- + changelog.d/27641
- + changelog.d/27845
- changelog.d/T27455
- + changelog.d/T27724
- + changelog.d/T27830-rts-flag-bounds
- + changelog.d/boxing-family
- + changelog.d/clc-341-strict-mutable-data-types
- + changelog.d/clc-421
- changelog.d/fix-parallel-gc-selector-race-27477
- + changelog.d/hadrian-persist-flavour
- changelog.d/semaphore-v2
- changelog.d/unit-index
- compiler/GHC.hs
- compiler/GHC/Builtin.hs
- compiler/GHC/Builtin/KnownKeys.hs
- compiler/GHC/Builtin/Modules.hs
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Builtin/WiredIn/Ids.hs
- compiler/GHC/Builtin/WiredIn/Prim.hs
- compiler/GHC/Builtin/WiredIn/TypeLits.hs
- compiler/GHC/Builtin/WiredIn/Types.hs
- + compiler/GHC/Builtin/WiredIn/Types/Box.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Show.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Make.hs
- + compiler/GHC/Core/Make/BigTuple.hs
- + compiler/GHC/Core/Make/Box.hs
- compiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/CoreToStg/AddImplicitBinds.hs
- compiler/GHC/CoreToStg/Prep.hs
- + compiler/GHC/Data/StringTrie.hs
- compiler/GHC/Data/Word64Map/Internal.hs
- compiler/GHC/Data/Word64Map/Strict/Internal.hs
- compiler/GHC/Data/Word64Set/Internal.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CmdLine.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Pipeline.hs-boot
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/ListComp.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Utils.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/FunDeps.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/CompleteMatch.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/TyThing.hs
- compiler/GHC/Types/TyThing/Ppr.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Types/UnresolvedImport.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Home.hs
- compiler/GHC/Unit/Module.hs
- compiler/GHC/Unit/Module/Env.hs
- + compiler/GHC/Unit/Module/Name.hs
- compiler/GHC/Unit/Parser.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Unit/Types.hs-boot
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- compiler/Language/Haskell/Syntax/Text.hs
- compiler/ghc.cabal.in
- distrib/configure.ac.in
- docs/users_guide/runtime_control.rst
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- hadrian/doc/flavours.md
- hadrian/ghci-multi-cabal.in
- hadrian/src/Rules.hs
- hadrian/src/Settings.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent/Chan.hs
- + libraries/base/src/Control/Concurrent/Chan/Strict.hs
- libraries/base/src/Control/Concurrent/MVar.hs
- + libraries/base/src/Control/Concurrent/MVar/Strict.hs
- libraries/base/src/Data/IORef.hs
- + libraries/base/src/Data/IORef/Strict.hs
- libraries/base/src/GHC/Base.hs
- libraries/base/src/GHC/Exts.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/include/RtsIfaceSymbols.h
- libraries/ghc-internal/src/GHC/Internal/Bits.hs
- + libraries/ghc-internal/src/GHC/Internal/Box.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs
- libraries/ghc-internal/src/GHC/Internal/Magic.hs
- libraries/ghc-internal/src/GHC/Internal/TypeNats.hs
- libraries/ghc-internal/src/GHC/Internal/Types.hs
- linters/lint-codes/LintCodes/Static.hs
- m4/subst_tooldir.m4
- rts/Prelude.h
- rts/RtsFlags.c
- rts/RtsStartup.c
- rts/include/rts/Flags.h
- rts/include/rts/RtsToHsIface.h
- rts/include/rts/storage/GC.h
- rts/include/stg/Prim.h
- rts/prim/bitrev.c
- rts/prim/bswap.c
- rts/sm/Evac.c
- rts/sm/GC.c
- rts/sm/Storage.c
- testsuite/driver/junit.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/MiniQuickCheck.hs
- testsuite/tests/arrows/should_run/all.T
- + testsuite/tests/arrows/should_run/arrowrun005.hs
- + testsuite/tests/arrows/should_run/arrowrun005.stdout
- + testsuite/tests/backpack/should_compile/T27835.bkp
- + testsuite/tests/backpack/should_compile/T27835.stderr
- testsuite/tests/backpack/should_compile/all.T
- testsuite/tests/corelint/LintEtaExpand.hs
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/deSugar/should_compile/T25065a.hs
- testsuite/tests/deSugar/should_compile/all.T
- + testsuite/tests/deSugar/should_run/T20864.hs
- + testsuite/tests/deSugar/should_run/T20864.stdout
- + testsuite/tests/deSugar/should_run/T25065b.hs
- + testsuite/tests/deSugar/should_run/T25065b.stdout
- testsuite/tests/deSugar/should_run/all.T
- + testsuite/tests/dmdanal/should_compile/T23911.hs
- + testsuite/tests/dmdanal/should_compile/T23911.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- testsuite/tests/driver/all.T
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/Makefile
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stderr
- testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stdout
- + testsuite/tests/driver/stringtrie.hs
- + testsuite/tests/driver/stringtrie.stdout
- testsuite/tests/ghc-api/downsweep/IncrementalDownsweep.hs
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/Test20239.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- + testsuite/tests/ghci/prog-mhu008/Makefile
- + testsuite/tests/ghci/prog-mhu008/a/M.hs
- + testsuite/tests/ghci/prog-mhu008/all.T
- + testsuite/tests/ghci/prog-mhu008/b/M.hs
- + testsuite/tests/ghci/prog-mhu008/prog-mhu008.script
- + testsuite/tests/ghci/prog-mhu008/prog-mhu008.stdout
- + testsuite/tests/ghci/prog-mhu008/unitA
- + testsuite/tests/ghci/prog-mhu008/unitB
- + testsuite/tests/ghci/scripts/T27641.script
- + testsuite/tests/ghci/scripts/T27641.stderr
- + testsuite/tests/ghci/scripts/T27641.stdout
- + testsuite/tests/ghci/scripts/T27834.hs
- + testsuite/tests/ghci/scripts/T27834.script
- + testsuite/tests/ghci/scripts/T27834.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
- testsuite/tests/hiefile/should_run/T24544.hs
- + testsuite/tests/indexed-types/should_run/T27331.hs
- + testsuite/tests/indexed-types/should_run/T27331.stdout
- + testsuite/tests/indexed-types/should_run/T27331b.hs
- + testsuite/tests/indexed-types/should_run/T27331b.stdout
- + testsuite/tests/indexed-types/should_run/T27331b_Plugin.hs
- testsuite/tests/indexed-types/should_run/all.T
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/linters/notes.stdout
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T15323.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20718b.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/parser/should_compile/T23315/T23315.stderr
- + testsuite/tests/perf/compiler/T25763.stderr
- testsuite/tests/perf/compiler/all.T
- + testsuite/tests/primops/should_run/T27299.hs
- + testsuite/tests/primops/should_run/T27299.stdout
- testsuite/tests/primops/should_run/all.T
- testsuite/tests/printer/AnnotationNoListTuplePuns.stdout
- testsuite/tests/printer/T18791.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/profiling/should_run/caller-cc/CallerCcParser.hs
- + testsuite/tests/rts/T24450.hs
- + testsuite/tests/rts/T24450.stderr
- testsuite/tests/rts/all.T
- testsuite/tests/rts/rtsflags001.stderr-ws-32
- testsuite/tests/rts/rtsflags001.stderr-ws-64
- testsuite/tests/simplCore/should_compile/T18995.stderr
- + testsuite/tests/simplCore/should_compile/T27724a.hs
- + testsuite/tests/simplCore/should_compile/T27724a.stderr
- + testsuite/tests/simplCore/should_compile/T27803.hs
- + testsuite/tests/simplCore/should_compile/T27803.stderr
- + testsuite/tests/simplCore/should_compile/T7803.hs
- + testsuite/tests/simplCore/should_compile/T7803.stderr
- + testsuite/tests/simplCore/should_compile/T7803a.hs
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T17940.stderr
- + testsuite/tests/warnings/should_fail/WExpectedNoArgError.stderr
- testsuite/tests/warnings/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/genprimopcode/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3f34ef83aa8dd99ca2b8bf39cb0d6…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a3f34ef83aa8dd99ca2b8bf39cb0d6…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/27323] Don't report -XStrict-generated bangs under -Wredundant-bang-patterns
by Sasha Bogicevic (@Bogicevic) 09 Oct '26
by Sasha Bogicevic (@Bogicevic) 09 Oct '26
09 Oct '26
Sasha Bogicevic pushed to branch wip/27323 at Glasgow Haskell Compiler / GHC
Commits:
fd8be410 by Sasha Bogicevic at 2026-10-09T11:21:49+02:00
Don't report -XStrict-generated bangs under -Wredundant-bang-patterns
-Wredundant-bang-patterns could warn about bangs inserted by -XStrict,
including those on unlifted function arguments and local tuple
bindings, even though there is no user-written bang to remove.
Mark bangs inserted by decideBangHood with generatedSrcSpan and track
generated code in DsLclEnv through putSrcSpanDs. The pattern-match
checker emits these bangs without SrcInfo, suppressing redundant-bang
warnings while retaining divergence checks and inaccessible-RHS
warnings.
Update tidy1 and tidy_bang_pat to use the monadic context instead of
threading a Boolean. Push sub-pattern locations when descending, and
consult inGeneratedCodeDs when checking literal overflow.
Preserve located patterns through matchSinglePatVar, pmcPatBind and
desugarPatBind, using desugarLPat so pattern bindings retain their
generated-code information.
Add regression tests T27323 and T27323b and a changelog entry.
- - - - -
10 changed files:
- + changelog.d/T27323
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/HsToCore/Utils.hs
- + testsuite/tests/pmcheck/should_compile/T27323.hs
- + testsuite/tests/pmcheck/should_compile/T27323b.hs
- testsuite/tests/pmcheck/should_compile/all.T
Changes:
=====================================
changelog.d/T27323
=====================================
@@ -0,0 +1,7 @@
+section: compiler
+synopsis: Don't report ``-XStrict``-generated bang patterns under ``-Wredundant-bang-patterns``
+description:
+ Bangs introduced by ``-XStrict`` are no longer reported as redundant under
+ ``-Wredundant-bang-patterns``, as they are not user-written.
+issues: #27323
+mrs: !16395
=====================================
compiler/GHC/HsToCore/Match.hs
=====================================
@@ -383,12 +383,14 @@ tidyEqnInfo :: MatchId -> EquationInfo
tidyEqnInfo _ eqn@(EqnDone {}) = return (idDsWrapper, eqn)
-tidyEqnInfo v eqn@(EqnMatch { eqn_pat = (L loc pat) }) = do
- (wrap, pat') <- tidy1 v (not . isGoodSrcSpan . locA $ loc) pat
+tidyEqnInfo v eqn@(EqnMatch { eqn_pat = p@(L loc _) }) = do
+ (wrap, pat') <- tidyLPat v p
return (wrap, eqn{eqn_pat = L loc pat' })
+tidyLPat :: MatchId -> LPat GhcTc -> DsM (DsWrapper, Pat GhcTc)
+tidyLPat v (L loc pat) = putSrcSpanDsA loc (tidy1 v pat)
+
tidy1 :: MatchId -- The scrutinee
- -> Bool -- `True` if the pattern was generated, `False` if it was user-written
-> Pat GhcTc -- The pattern against which it is to be matched
-> DsM (DsWrapper, -- Extra bindings to do before the match
Pat GhcTc) -- Equivalent pattern
@@ -399,21 +401,22 @@ tidy1 :: MatchId -- The scrutinee
-- It eliminates many pattern forms (as-patterns, variable patterns,
-- list patterns, etc) and returns any created bindings in the wrapper.
-tidy1 v g (ParPat _ pat) = tidy1 v g (unLoc pat)
-tidy1 v g (SigPat _ pat _) = tidy1 v g (unLoc pat)
-tidy1 _ _ (WildPat ty) = return (idDsWrapper, WildPat ty)
-tidy1 v g (BangPat _ (L l p)) = tidy_bang_pat v g l p
-tidy1 v g (ModifiedPat _ _ pat) = tidy1 v g (unLoc pat)
+tidy1 v (ParPat _ pat) = tidyLPat v pat
+tidy1 v (SigPat _ pat _) = tidyLPat v pat
+tidy1 _ (WildPat ty) = return (idDsWrapper, WildPat ty)
+tidy1 v (BangPat _ (L l p)) = putSrcSpanDsA l $ tidy_bang_pat v l p
+tidy1 v (ModifiedPat _ _ pat) = tidyLPat v pat
-- case v of { x -> mr[] }
-- = case v of { _ -> let x=v in mr[] }
-tidy1 v _ (VarPat _ (L _ var))
+tidy1 v (VarPat _ (L _ var))
= return (bindMatchId var v, WildPat (idType var))
-- case v of { x@p -> mr[] }
-- = case v of { p -> let x=v in mr[] }
-tidy1 v g (AsPat _ (L _ var) pat)
- = do { (wrap, pat') <- tidy1 v g (unLoc pat)
+tidy1 v (AsPat _ (L _ var) pat)
+
+ = do { (wrap, pat') <- tidyLPat v pat
; return (bindMatchId var v . wrap, pat') }
{- now, here we handle lazy patterns:
@@ -427,7 +430,7 @@ tidy1 v g (AsPat _ (L _ var) pat)
The case expr for v_i is just: match [v] [(p, [], \ x -> Var v_i)] any_expr
-}
-tidy1 v _ (LazyPat _ pat)
+tidy1 v (LazyPat _ pat)
-- This is a convenient place to check for unlifted types under a lazy pattern.
-- Doing this check during type-checking is unsatisfactory because we may
-- not fully know the zonked types yet. We sure do here.
@@ -441,14 +444,14 @@ tidy1 v _ (LazyPat _ pat)
; let sel_binds = [NonRec b rhs | (b,rhs) <- sel_prs]
; return (mkCoreLets sel_binds, WildPat (matchIdType v)) }
-tidy1 _ _ (ListPat ty pats)
+tidy1 _ (ListPat ty pats)
= return (idDsWrapper, unLoc list_ConPat)
where
list_ConPat = foldr (\ x y -> mkPrefixConPat consDataCon [x, y] [ty])
(mkNilPat ty)
pats
-tidy1 _ _ (TuplePat tys pats boxity)
+tidy1 _ (TuplePat tys pats boxity)
= return (idDsWrapper, unLoc tuple_ConPat)
where
arity = length pats
@@ -458,34 +461,37 @@ tidy1 _ _ (TuplePat tys pats boxity)
Boxed -> tys
-- See Note [Unboxed tuple RuntimeRep vars] in TyCon
-tidy1 _ _ (SumPat tys pat alt arity)
+tidy1 _ (SumPat tys pat alt arity)
= return (idDsWrapper, unLoc sum_ConPat)
where
sum_ConPat = mkPrefixConPat (sumDataCon alt arity) [pat] (map getRuntimeRep tys ++ tys)
-- See Note [Unboxed tuple RuntimeRep vars] in TyCon
-- LitPats: we *might* be able to replace these w/ a simpler form
-tidy1 _ g (LitPat _ lit)
- = do { unless g $
+tidy1 _ (LitPat _ lit)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $
warnAboutOverflowedLit lit
; return (idDsWrapper, tidyLitPat lit) }
-- NPats: we *might* be able to replace these w/ a simpler form
-tidy1 _ g (NPat ty (L _ lit@OverLit { ol_val = v }) mb_neg eq)
- = do { unless g $
+tidy1 _ (NPat ty (L _ lit@OverLit { ol_val = v }) mb_neg eq)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $
let lit' | Just _ <- mb_neg = lit{ ol_val = negateOverLitVal v }
| otherwise = lit
in warnAboutOverflowedOverLit lit'
; return (idDsWrapper, tidyNPat lit mb_neg eq ty) }
-- NPlusKPat: we may want to warn about the literals
-tidy1 _ g n@(NPlusKPat _ _ (L _ lit1) lit2 _ _)
- = do { unless g $ do
+tidy1 _ n@(NPlusKPat _ _ (L _ lit1) lit2 _ _)
+ = do { in_gen <- inGeneratedCodeDs;
+ unless in_gen $ do
warnAboutOverflowedOverLit lit1
warnAboutOverflowedOverLit lit2
; return (idDsWrapper, n) }
-tidy1 _ _ (OrPat ty lpats)
+tidy1 _ (OrPat ty lpats)
-- See Note [Implementation of OrPatterns]. We desugar
-- (1; 2; 3)
-- to
@@ -514,44 +520,44 @@ tidy1 _ _ (OrPat ty lpats)
single_grhs e = GRHSs emptyComments [noLocA $ GRHS noAnn [] e] (EmptyLocalBinds noExtField)
-- Everything else goes through unchanged...
-tidy1 _ _ non_interesting_pat
+tidy1 _ non_interesting_pat
= return (idDsWrapper, non_interesting_pat)
--------------------
-tidy_bang_pat :: MatchId -> Bool -> SrcSpanAnnA -> Pat GhcTc
+tidy_bang_pat :: MatchId -> SrcSpanAnnA -> Pat GhcTc
-> DsM (DsWrapper, Pat GhcTc)
-- Discard par/sig under a bang
-tidy_bang_pat v g _ (ParPat _ (L l p)) = tidy_bang_pat v g l p
-tidy_bang_pat v g _ (SigPat _ (L l p) _) = tidy_bang_pat v g l p
+tidy_bang_pat v _ (ParPat _ (L l p)) = putSrcSpanDsA l $ tidy_bang_pat v l p
+tidy_bang_pat v _ (SigPat _ (L l p) _) = putSrcSpanDsA l $ tidy_bang_pat v l p
-- Push the bang-pattern inwards, in the hope that
-- it may disappear next time
-tidy_bang_pat v g l (AsPat x v' p)
- = tidy1 v g (AsPat x v' (L l (BangPat noExtField p)))
-tidy_bang_pat v g l (XPat (CoPat w p t))
- = tidy1 v g (XPat $ CoPat w (BangPat noExtField (L l p)) t)
-tidy_bang_pat v g l (OrPat x (p:|ps)) -- push bang into first pat alt
- = tidy1 v g (OrPat x (L l (BangPat noExtField p) :| ps))
+tidy_bang_pat v l (AsPat x v' p)
+ = tidy1 v (AsPat x v' (L l (BangPat noExtField p)))
+tidy_bang_pat v l (XPat (CoPat w p t))
+ = tidy1 v (XPat $ CoPat w (BangPat noExtField (L l p)) t)
+tidy_bang_pat v l (OrPat x (p:|ps)) -- push bang into first pat alt
+ = tidy1 v (OrPat x (L l (BangPat noExtField p) :| ps))
-- Discard bang around strict pattern
-tidy_bang_pat v g _ p@(LitPat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(ListPat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(TuplePat {}) = tidy1 v g p
-tidy_bang_pat v g _ p@(SumPat {}) = tidy1 v g p
+tidy_bang_pat v _ p@(LitPat {}) = tidy1 v p
+tidy_bang_pat v _ p@(ListPat {}) = tidy1 v p
+tidy_bang_pat v _ p@(TuplePat {}) = tidy1 v p
+tidy_bang_pat v _ p@(SumPat {}) = tidy1 v p
-- Data/newtype constructors
-tidy_bang_pat v g l p@(ConPat { pat_con = L _ (RealDataCon dc)
- , pat_args = args
- , pat_con_ext = ConPatTc
- { cpt_arg_tys = arg_tys
- }
- })
+tidy_bang_pat v l p@(ConPat { pat_con = L _ (RealDataCon dc)
+ , pat_args = args
+ , pat_con_ext = ConPatTc
+ { cpt_arg_tys = arg_tys
+ }
+ })
-- Newtypes: push bang inwards (#9844)
=
if isNewTyCon (dataConTyCon dc)
- then tidy1 v g (p { pat_args = push_bang_into_newtype_arg l (scaledThing ty) args })
- else tidy1 v g p -- Data types: discard the bang
+ then tidy1 v (p { pat_args = push_bang_into_newtype_arg l (scaledThing ty) args })
+ else tidy1 v p -- Data types: discard the bang
where
(ty:_) = dataConInstArgTys dc arg_tys
@@ -570,7 +576,7 @@ tidy_bang_pat v g l p@(ConPat { pat_con = L _ (RealDataCon dc)
--
-- NB: SigPatIn, ConPatIn should not happen
-tidy_bang_pat _ _ l p = return (idDsWrapper, BangPat noExtField (L l p))
+tidy_bang_pat _ l p = return (idDsWrapper, BangPat noExtField (L l p))
-------------------
push_bang_into_newtype_arg :: SrcSpanAnnA
@@ -954,7 +960,7 @@ matchSinglePatVar var mb_scrut ctx pat ty match_result
; ldi_nablas <-
if isMatchContextPmChecked_SinglePat dflags FromSource ctx pat
then addCoreScrutTmCs (maybeToList mb_scrut) [var] $
- pmcPatBind (DsMatchContext ctx locn) var (unLoc pat)
+ pmcPatBind (DsMatchContext ctx locn) var pat
else getLdiNablas
; let eqn_info = EqnMatch { eqn_pat = decideBangHood dflags pat
=====================================
compiler/GHC/HsToCore/Monad.hs
=====================================
@@ -15,7 +15,7 @@ module GHC.HsToCore.Monad (
duplicateLocalDs, newSysLocalDs, newSysLocalsDs,
newSysLocalMDs, newSysLocalsMDs, newFailLocalMDs,
newUniqueId, newPredVarDs, newStaticId,
- getSrcSpanDs, putSrcSpanDs, putSrcSpanDsA,
+ getSrcSpanDs, inGeneratedCodeDs, putSrcSpanDs, putSrcSpanDsA,
mkNamePprCtxDs,
newUnique,
UniqSupply, newUniqueSupply,
@@ -584,6 +584,7 @@ mkDsEnvs unit_env mod rdr_env type_env fam_inst_env tcm_plugins ptc msg_var
, dsl_loc = real_span
, dsl_nablas = Ldi initNablas
, dsl_unspecables = Just emptyVarSet
+ , dsl_in_generated_code = False
}
in (gbl_env, lcl_env)
@@ -676,13 +677,17 @@ getSrcSpanDs :: DsM SrcSpan
getSrcSpanDs = do { env <- getLclEnv
; return (RealSrcSpan (dsl_loc env) Strict.Nothing) }
+-- | See 'dsl_in_generated_code'
+inGeneratedCodeDs :: DsM Bool
+inGeneratedCodeDs = dsl_in_generated_code <$> getLclEnv
+
putSrcSpanDs :: SrcSpan -> DsM a -> DsM a
putSrcSpanDs (RealSrcSpan real_span _) thing_inside
- = updLclEnv (\ env -> env {dsl_loc = real_span}) thing_inside
+ = updLclEnv (\ env -> env {dsl_loc = real_span, dsl_in_generated_code = False}) thing_inside
putSrcSpanDs UnhelpfulSpan{} thing_inside
= thing_inside
putSrcSpanDs GeneratedSrcSpan{} thing_inside
- = thing_inside
+ = updLclEnv (\ env -> env {dsl_in_generated_code = True}) thing_inside
putSrcSpanDsA :: EpAnn ann -> DsM a -> DsM a
putSrcSpanDsA loc = putSrcSpanDs (locA loc)
=====================================
compiler/GHC/HsToCore/Pmc.hs
=====================================
@@ -104,7 +104,7 @@ whenDoingPmc no_pmc thing_inside
Ldi nablas -> thing_inside nablas }
-- | Check a pattern binding (let, where) for exhaustiveness.
-pmcPatBind :: DsMatchContext -> Id -> Pat GhcTc -> DsM LdiNablas
+pmcPatBind :: DsMatchContext -> Id -> LPat GhcTc -> DsM LdiNablas
pmcPatBind ctxt@(DsMatchContext match_ctxt loc) var p
= whenDoingPmc NoPmc $ \ !missing ->
mb_discard_warnings $ do
=====================================
compiler/GHC/HsToCore/Pmc/Desugar.hs
=====================================
@@ -155,11 +155,15 @@ desugarPat x pat = case pat of
VarPat _ y -> pure (mkPmLetVar (unLoc y) x)
ParPat _ p -> desugarLPat x p
LazyPat _ _ -> pure GdEnd -- like a wildcard
- BangPat _ p@(L l p') ->
+ BangPat _ p@(L l p') -> do
-- Add the bang in front of the list, because it will happen before any
-- nested stuff.
+ in_gen <- inGeneratedCodeDs
+ -- A bang inserted by -XStrict (decideBangHood) has no SrcInfo: it is
+ -- divergence-checked but never reported as redundant (#27323).
+ let pm_loc | in_gen = Nothing
+ | otherwise = Just (SrcInfo (L (locA l) (ppr p')))
consGrdDag (PmBang x pm_loc) <$> desugarLPat x p
- where pm_loc = Just (SrcInfo (L (locA l) (ppr p')))
-- (x@pat) ==> Desugar pat with x as match var and handle impedance
-- mismatch with incoming match var
@@ -311,7 +315,7 @@ desugarPatV pat = do
pure (x, grds)
desugarLPat :: Id -> LPat GhcTc -> DsM GrdDag
-desugarLPat x = desugarPat x . unLoc
+desugarLPat x (L loc pat) = putSrcSpanDsA loc (desugarPat x pat)
-- | 'desugarLPat', but also select and return a new match var.
desugarLPatV :: LPat GhcTc -> DsM (Id, GrdDag)
@@ -374,11 +378,11 @@ desugarConPatOut x con univ_tys ex_tvs dicts = \case
-- tracePm "ConPatOut" (ppr x $$ ppr con $$ ppr arg_ids)
pure (con_grd `consGrdDag` arg_grds)
-desugarPatBind :: SrcSpan -> Id -> Pat GhcTc -> DsM (PmPatBind Pre)
+desugarPatBind :: SrcSpan -> Id -> LPat GhcTc -> DsM (PmPatBind Pre)
-- See 'GrdPatBind' for how this simply repurposes GrdGRHS.
-- See Note [Suppress warnings in PMC desugaring]
desugarPatBind loc var pat = discardWarningsDs $
- PmPatBind . flip PmGRHS (SrcInfo (L loc (ppr pat))) <$> desugarPat var pat
+ PmPatBind . flip PmGRHS (SrcInfo (L loc (ppr pat))) <$> desugarLPat var pat
desugarEmptyCase :: Id -> DsM PmEmptyCase
desugarEmptyCase var = pure PmEmptyCase { pe_var = var }
@@ -650,4 +654,19 @@ user *had* written a bang:
+ In an equation for ‘idV’: idV !v = ...
So we live with the duplication.
+
+Note that 'decideBangHood' places the bangs it inserts at a 'generatedSrcSpan'.
+When 'desugarLPat' enters such a span, 'putSrcSpanDs' (GHC.HsToCore.Monad)
+records in 'dsl_in_generated_code' that we are desugaring compiler-generated
+code. For a bang in generated code, 'desugarPat' emits a 'PmBang' with no
+'SrcInfo': the checker still performs the divergence check (so the
+inaccessible-RHS warning above survives), but -Wredundant-bang-patterns only
+ever reports bangs the user actually wrote (#27323). See
+Note [Dead bang patterns] in GHC.HsToCore.Pmc.Check.
+
+Eventually the bangs inserted by -XStrict should become expanded patterns,
+following Note [Handling overloaded and rebindable constructs] in
+GHC.Rename.Expr. That would let warnings always display the original
+user-written code, making the decideBangHood duplication described above
+unnecessary. This is tracked as #27677.
-}
=====================================
compiler/GHC/HsToCore/Types.hs
=====================================
@@ -11,7 +11,7 @@ module GHC.HsToCore.Types (
DsMetaEnv, DsMetaVal(..), CompleteMatches
) where
-import GHC.Prelude (Int)
+import GHC.Prelude (Bool, Int)
import Data.IORef
@@ -125,6 +125,7 @@ data DsLclEnv
-- ^ See Note [Desugaring non-canonical evidence]
-- This field collects all un-specialisable evidence variables in scope.
-- Nothing <=> don't collect this info (used for the LHS of Rules)
+ , dsl_in_generated_code :: Bool -- Desugaring compiler-generated or user-written code
}
-- Inside [| |] brackets, the desugarer looks
=====================================
compiler/GHC/HsToCore/Utils.hs
=====================================
@@ -1025,6 +1025,9 @@ Specifically:
-- | Use -XStrict to add a ! or remove a ~
+-- The bang we insert is compiler-generated, so we put it at a generatedSrcSpan.
+-- The pattern-match checker uses this (via dsl_in_generated_code) to avoid reporting
+-- such bangs under -Wredundant-bang-patterns (#27323).
-- See Note [decideBangHood]
decideBangHood :: DynFlags
-> LPat GhcTc -- ^ Original pattern
@@ -1040,7 +1043,7 @@ decideBangHood dflags lpat
ParPat x p -> L l (ParPat x (go p))
LazyPat _ lp' -> lp'
BangPat _ _ -> lp
- _ -> L l (BangPat noExtField lp)
+ _ -> L (noAnnSrcSpan generatedSrcSpan) (BangPat noExtField lp)
isTrueLHsExpr :: LHsExpr GhcTc -> Maybe (CoreExpr -> DsM CoreExpr)
=====================================
testsuite/tests/pmcheck/should_compile/T27323.hs
=====================================
@@ -0,0 +1,9 @@
+{-# LANGUAGE MagicHash, Strict #-}
+{-# OPTIONS_GHC -Wredundant-bang-patterns #-}
+
+import GHC.Prim (Int#)
+
+idInt# :: Int# -> Int#
+idInt# x = x
+
+main = pure ()
=====================================
testsuite/tests/pmcheck/should_compile/T27323b.hs
=====================================
@@ -0,0 +1,6 @@
+{-# LANGUAGE Strict, MonoLocalBinds #-}
+{-# OPTIONS_GHC -Wredundant-bang-patterns #-}
+module T27323b where
+
+f :: Int -> Int
+f x = let (a, b) = (x, x) in a + b
=====================================
testsuite/tests/pmcheck/should_compile/all.T
=====================================
@@ -190,4 +190,6 @@ test('T24845', [], compile, [overlapping_incomplete])
test('T22652', [], compile, [overlapping_incomplete])
test('T22652a', [], compile, [overlapping_incomplete])
test('T24867', [], compile_fail, [overlapping_incomplete])
+test('T27323', normal, compile, ['-Wredundant-bang-patterns'])
+test('T27323b', normal, compile, ['-Wredundant-bang-patterns'])
test('T27360', normal, compile, [overlapping_incomplete + '-g3'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd8be410628df71b57532897f95f680…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fd8be410628df71b57532897f95f680…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/andrea/with-signal-handlers] add runGhcWithSignalHandlers and remove handling from runGhc[T]
by Andrea Vezzosi (@trac-Saizan) 09 Oct '26
by Andrea Vezzosi (@trac-Saizan) 09 Oct '26
09 Oct '26
Andrea Vezzosi pushed to branch wip/andrea/with-signal-handlers at Glasgow Haskell Compiler / GHC
Commits:
63815bd0 by Andrea Vezzosi at 2026-10-09T09:34:25+02:00
add runGhcWithSignalHandlers and remove handling from runGhc[T]
it only ever makes sense to call `withSignalHandlers` from `main`, otherwise
signals can be too easily swallowed without notification to the rest of your
process.
This commit takes withSignalHandlers out of `runGhc/runGhcT` and provides
`runGhcWithSignalHandlers` for the old behaviour.
- - - - -
11 changed files:
- + changelog.d/T4162
- compiler/GHC.hs
- compiler/GHC/Utils/Panic.hs
- ghc/Main.hs
- linters/lint-codes/LintCodes/Static.hs
- utils/check-exact/Parsers.hs
- utils/check-ppr/Main.hs
- utils/count-deps/Main.hs
- utils/dump-decls/Main.hs
- utils/haddock/haddock-api/src/Haddock.hs
- utils/haddock/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
Changes:
=====================================
changelog.d/T4162
=====================================
@@ -0,0 +1,17 @@
+section: compiler
+issues: #4162
+mrs: !16774
+synopsis:
+ `runGhc/runGhcT` no longer hijack process signals, old behaviour provided by
+ `runGhcWithSignalHandlers`.
+description:
+ Functions `runGhc/runGhcT` no longer go out of their way to redirect process
+ signals as exceptions to them.
+
+ The installed handlers make it so other threads are unaware of any signals,
+ which can cause the process to become unresponsive whenever a crash of the GHC
+ session(s) does not cascade into a shutdown of the process itself.
+
+ The old behaviour is available through `runGhcWithSignalHandlers` or by
+ calling `withSignalHandlers`. Only intended to be used from the main thread of
+ your process, see the documentation.
=====================================
compiler/GHC.hs
=====================================
@@ -23,6 +23,7 @@ module GHC (
-- * GHC Monad
Ghc, GhcT, GhcMonad(..), HscEnv,
runGhc, runGhcT, initGhcMonad,
+ runGhcWithSignalHandlers,
printException,
handleSourceError,
@@ -555,10 +556,26 @@ runGhc :: Maybe FilePath -- ^ See argument to 'initGhcMonad'.
runGhc mb_top_dir ghc = do
ref <- newIORef (panic "empty session")
let session = Session ref
- flip unGhc session $ withSignalHandlers $ do -- catch ^C
+ flip unGhc session $ do
initGhcMonad mb_top_dir
withCleanupSession ghc
+-- | Like 'runGhc' but uses 'withSignalHandlers' to redirect selected signals to
+-- this thread to trigger 'withCleanupSession', and so that interactive
+-- evaluation receives 'UserInterrupt' exceptions.
+--
+-- __WARNING__: Only intended to be called from the __main thread__ of your
+-- process, see 'withSignalHandlers' documentation for more details.
+--
+-- More complex multi-threaded programs are recommended to use 'runGhc' or
+-- 'runGhcT', and handle signals as appropriate for their control flow.
+
+runGhcWithSignalHandlers :: Maybe FilePath -- ^ See argument to 'initGhcMonad'.
+ -> Ghc a -- ^ The action to perform.
+ -> IO a
+runGhcWithSignalHandlers mb_top_dir ghc = runGhc mb_top_dir $
+ withSignalHandlers $ ghc
+
-- | Run function for 'GhcT' monad transformer.
--
-- It initialises the GHC session and warnings via 'initGhcMonad'. Each call
@@ -572,7 +589,7 @@ runGhcT :: ExceptionMonad m =>
runGhcT mb_top_dir ghct = do
ref <- liftIO $ newIORef (panic "empty session")
let session = Session ref
- flip unGhcT session $ withSignalHandlers $ do -- catch ^C
+ flip unGhcT session $ do
initGhcMonad mb_top_dir
withCleanupSession ghct
=====================================
compiler/GHC/Utils/Panic.hs
=====================================
@@ -234,8 +234,21 @@ signalHandlersRefCount :: MVar (Word, Maybe S.Handler)
signalHandlersRefCount = unsafePerformIO $ newMVar (0,Nothing)
--- | Temporarily install standard signal handlers for catching ^C, which just
--- throw an exception in the current thread.
+-- | Temporarily install signal handlers to redirect the following signals to
+-- the calling thread as async exceptions: @INT@, @QUIT@, @HUP@, @TERM@ on unix, and
+-- @CtrlC@, @Break@ on windows. The original signal handlers are restored when all
+-- concurrent calls of this function are exited.
+--
+-- @INT@, @QUIT@, @CtrlC@, and @Break@ are thrown as @'UserInterrupt'@.
+--
+-- @HUP@, and @TERM@ are thrown as @'Panic' <signal number>@.
+--
+-- __WARNING__: Only intended to be called from the __main thread__ of your
+-- process, as otherwise it can swallow signals the process should react to in
+-- other ways. Nested calls from a single thread are fine, but concurrent calls
+-- from different threads will have the exceptions delivered to only one of
+-- them. If that thread is not @main@, extra care is needed to e.g. actually
+-- terminate the process when it receives @TERM@.
withSignalHandlers :: ExceptionMonad m => m a -> m a
#if !defined(HAVE_SIGNAL_H)
-- No signal functionality exist on the host platform (e.g. on
=====================================
ghc/Main.hs
=====================================
@@ -141,7 +141,7 @@ main = do
ShowOptions isInteractive -> showOptions isInteractive
Right postStartupMode ->
-- start our GHC session
- GHC.runGhc mbMinusB $ do
+ GHC.runGhcWithSignalHandlers mbMinusB $ do
dflags <- GHC.getSessionDynFlags
=====================================
linters/lint-codes/LintCodes/Static.hs
=====================================
@@ -31,7 +31,7 @@ import GHC.Types.Error.Codes
-- ghc (API usage)
import GHC
- ( runGhc, parseDynamicFlags
+ ( runGhcWithSignalHandlers, parseDynamicFlags
, getSessionDynFlags, setSessionDynFlags
, getSession, getLogger
, noLoc
@@ -145,7 +145,7 @@ newtype LibDir = LibDir { libDir :: FilePath }
-- | Look up the 'GhcDiagnosticCode' type family using the GHC API.
ghcDiagnosticCodeTyCon :: Maybe LibDir -> IO TyCon
ghcDiagnosticCodeTyCon mb_libDir =
- runGhc (libDir <$> mb_libDir)
+ runGhcWithSignalHandlers (libDir <$> mb_libDir)
-- STEP 1: start a GHC API session with "-package ghc"
do { dflags1 <- getSessionDynFlags
=====================================
utils/check-exact/Parsers.hs
=====================================
@@ -231,7 +231,7 @@ parseModuleEpAnnsWithCpp libdir cppOptions file = ghcWrapper libdir $ do
ghcWrapper :: LibDir -> GHC.Ghc a -> IO a
ghcWrapper libdir a =
GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut
- $ GHC.runGhc (Just libdir) a
+ $ GHC.runGhcWithSignalHandlers (Just libdir) a
-- | Internal function. Exposed if you want to muck with DynFlags
-- before parsing.
=====================================
utils/check-ppr/Main.hs
=====================================
@@ -81,7 +81,7 @@ testOneFile libdir fileName = do
parseOneFile :: FilePath -> FilePath -> IO ParsedModule
parseOneFile libdir fileName = do
- runGhc (Just libdir) $ do
+ runGhcWithSignalHandlers (Just libdir) $ do
dflags <- getSessionDynFlags
let dflags2 = dflags `gopt_set` Opt_KeepRawTokenStream
_ <- setSessionDynFlags dflags2
=====================================
utils/count-deps/Main.hs
=====================================
@@ -51,7 +51,7 @@ printDeps libdir modName dot = do
calcDeps :: String -> FilePath -> IO (Map.Map ModuleName [ModuleName])
calcDeps modName libdir =
defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
- runGhc (Just libdir) $ do
+ runGhcWithSignalHandlers (Just libdir) $ do
df <- getSessionDynFlags
logger <- getLogger
(df, _, _) <- parseDynamicFlags logger df [noLoc "-package=ghc"]
=====================================
utils/dump-decls/Main.hs
=====================================
@@ -32,7 +32,7 @@ main = do
mapM_ (run ghcRoot) pkg_names
run :: FilePath -> String -> IO ()
-run root pkg_nm = runGhc (Just root) $ do
+run root pkg_nm = runGhcWithSignalHandlers (Just root) $ do
let args = map noLoc
[ "-package=" ++ pkg_nm
, "-dppr-cols=1000"
=====================================
utils/haddock/haddock-api/src/Haddock.hs
=====================================
@@ -196,7 +196,7 @@ handleGhcExceptions =
--
-- > main = getArgs >>= haddock
haddock :: [String] -> IO ()
-haddock args = haddockWithGhc withGhc args
+haddock args = withSignalHandlers $ haddockWithGhc withGhc args
haddockWithGhc :: (forall a. [Flag] -> Ghc a -> IO a) -> [String] -> IO ()
haddockWithGhc ghc args = handleTopExceptions $ do
=====================================
utils/haddock/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
=====================================
@@ -20,7 +20,7 @@ import Haddock.Backends.Hyperlinker.Types
withDynFlags :: (DynFlags -> IO ()) -> IO ()
withDynFlags cont = do
libDir <- fmap snd (getGhcDirs [])
- runGhc libDir $ do
+ runGhcWithSignalHandlers libDir $ do
dflags <- getSessionDynFlags
liftIO $ cont dflags
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63815bd06f019a18a4b0d4073a7b8bf…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/63815bd06f019a18a4b0d4073a7b8bf…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/substitution-via-mapper] 6 commits: ci: move hadrian/ghci into the lint category so it can be picked up by more runners
by Simon Peyton Jones (@simonpj) 09 Oct '26
by Simon Peyton Jones (@simonpj) 09 Oct '26
09 Oct '26
Simon Peyton Jones pushed to branch wip/substitution-via-mapper at Glasgow Haskell Compiler / GHC
Commits:
15ece296 by mangoiv at 2026-10-08T15:14:56-04:00
ci: move hadrian/ghci into the lint category so it can be picked up by more runners
Fixes #27817
- - - - -
c0823135 by mangoiv at 2026-10-08T15:14:56-04:00
ci: make lint-adjacent jobs into platform independent
- move lint jobs into lint-anyarch tag
- unify lint jobs under the same platform independent container
- - - - -
f76464cf by Zubin Duggal at 2026-10-08T15:15:39-04:00
DmdAnal: Make AbsDmd neutral in maxDmd
fixes #27845
- - - - -
0e63f2d0 by Simon Peyton Jones at 2026-10-09T08:09:35+01:00
Remove the Eq and Ord instances for ForAllTyFlag
In Note [Comparing visibility] in GHC.Core.TyCo.Compare we read that
"we always compare ForAllTyFlags with `eqForAllVis` or `cmpForAllVis`"
But alas there was an Eq and Ord instance for ForAllTyFlag, which made it
impossible to check this claim. So I made these changes:
* Move the definition of ForAllTyFlag and its related functions from
L.H.S.Specificity (where it did not belong, since L.H.S didn't use it)
into GHC.Types.Var.
* Remove the Eq and Ord instances for ForAllTyFlag
* Deal with the fallout, by using `eqForAllVis` or related functions.
* In interface files we use IfaceType as a key for a de-deduplication map
See Note [Deduplication during iface binary serialisation]
in GHC.Iface.Binary. For this we need /exact/ comparison, so we use a
newtype wrapper for IfaceForAllTyFlag, and give use `cmpForAllTyFlagExactly`
to implement its Ord instance. Tiresome but easy.
* Rename `toIfaceForAllBndrs` to `toIfaceForAllTyBndrs`
- - - - -
defcaee8 by Simon Peyton Jones at 2026-10-09T08:09:35+01:00
Refactor type and coercion substitution
This MR refactors type and coercion substitution so that they use
TyCoMapper, rather than hand-rolled code. Fundamentally it's a simple
idea, but I had to do quite a bit of refactoring to make it fly.
I got Claude to help me this this refactoring, but I paid careful
attention to every line of code.
Main changes:
* New module GHC.Core.TyCo.Make which defines TyCoMapper, and a bunch of other
simple "smart constructors" for types and coercions. See
GHC.Core.TyCo.Rep Note [The Type-related module hierarchy], esp (TRM1)
* The new TyCoMapper has new fields `tcm_tcapp_ty` and `tcm_tcapp_co` to handle
type-constructor applications. These replace `tcm_tycon`.
* Rewrite GHC.Core.TyCo.Subst to use TyCoMapper
* Rewrite GHC.Core.Type.expandTypeSynonyms to use TyCoMapper.
* Implement `seqType` and `seqCo` with TyCoFolder. To to this I had to add
a `tcf_lit` field to TyCoFolder.
* A new module GHC.Utils.StrictIdentity to define a strict identity monad,
which itself is used for
substTyCoMapper :: TyCoMapper Subst StrictIdentity
Refactoring `seq` functions
* In GHC.Core.Seq, redefine `seqOneShot`, `seqRuleInfo`, and friends to return
`SeqResult`, a new type defined in GHC.Types.Baseic, rather than `()`. We
can define a Monoid instance for `SeqResult` that does the right thing.
* This has knock-on effects across the compiler.
- - - - -
3f393697 by Simon Peyton Jones at 2026-10-09T08:09:35+01:00
Refactor TyCoMapper to take a single monad; add StrictReaderT
TyCoMapper used to be parameterised over both an environment and a
monad, with fields like
tcm_tyvar :: env -> TyVar -> m Type
Now it is parameterised over just the monad:
tcm_tyvar :: TyVar -> m Type
If the mapping needs an environment, `m` is a reader monad over that
environment. Many uses (e.g. zonkTcTypeMapper, swizzleMapper) need no
environment at all, and used to pass a dummy (). The binder field
becomes
tcm_tycobinder :: forall r. TyCoVar -> ForAllTyFlag
-> (TyCoVar -> m r) -> m r
and runs the continuation in the extended environment. mapTyCoX is gone;
only mapTyCo remains.
To make this efficient, the reader monad must use the one-shot trick and
be strict in the environment. So:
* New module GHC.Utils.Monad.StrictReader defines
newtype StrictReaderT r m a
with hand-written instances. The builder of the pattern synonym
`StrictReaderT` is a smart constructor that adds both `oneShot` and a
bang on the environment, so every StrictReaderT computation is strict
in the environment. See Note [Instances for StrictReaderT].
* ZonkT becomes type ZonkT = StrictReaderT ZonkEnv
ZonkM becomes type ZonkM = StrictReaderT ZonkGblEnv IO
replacing their own hand-written instances.
* Substitution uses
type SubstM = StrictReaderT Subst StrictIdentity
substTyCoMapper :: TyCoMapper SubstM
and similarly expandTypeSynonymMapper.
* zonk_tycomapper :: TyCoMapper (ZonkT TcM) is now much simpler.
* swizzleMapper uses StrictIdentity rather than Identity.
* Module renaming, so that the strict monads are all peers in GHC.Utils.Monad:
GHC.Utils.StrictIdentity ==> GHC.Utils.Monad.StrictIdentity
GHC.Utils.Monad.State.Strict ==> GHC.Utils.Monad.StrictState
alongside the new GHC.Utils.Monad.StrictReader.
Co-Authored-By: Claude Opus 5.5 <noreply(a)anthropic.com>
- - - - -
96 changed files:
- .gitlab-ci.yml
- + changelog.d/27845
- compiler/GHC/Builtin/WiredIn/Prim.hs
- compiler/GHC/Cmm/GenericOpt.hs
- compiler/GHC/Cmm/UniqueRenamer.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Linear/State.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CallerCC.hs
- compiler/GHC/Core/Opt/Exitify.hs
- compiler/GHC/Core/Reduction.hs
- compiler/GHC/Core/Seq.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/FVs.hs
- + compiler/GHC/Core/TyCo/Make.hs
- + compiler/GHC/Core/TyCo/Make.hs-boot
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Rep.hs-boot
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Type.hs-boot
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/CoreToIface.hs-boot
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Iface/Type.hs-boot
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Stg/BcPrep.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/Stg/EnforceEpt/Rewrite.hs
- compiler/GHC/Stg/EnforceEpt/TagSig.hs
- compiler/GHC/Stg/Subst.hs
- compiler/GHC/Tc/Deriv/Functor.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/Env.hs
- compiler/GHC/Tc/Zonk/Monad.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Arity.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Cpr.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Name/Env.hs
- compiler/GHC/Types/Name/Occurrence.hs
- compiler/GHC/Types/Unique/DSM.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Map.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Types/Unique/Supply.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Types/Var.hs-boot
- compiler/GHC/Types/Var/Set.hs
- compiler/GHC/Utils/Binary.hs
- + compiler/GHC/Utils/Monad/StrictIdentity.hs
- + compiler/GHC/Utils/Monad/StrictReader.hs
- compiler/GHC/Utils/Monad/State/Strict.hs → compiler/GHC/Utils/Monad/StrictState.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Specificity.hs
- compiler/ghc.cabal.in
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/dmdanal/should_run/T27845.hs
- + testsuite/tests/dmdanal/should_run/T27845.stdout
- + testsuite/tests/dmdanal/should_run/T27845_Lib.hs
- + testsuite/tests/dmdanal/should_run/T27845b.hs
- + testsuite/tests/dmdanal/should_run/T27845b.stdout
- + testsuite/tests/dmdanal/should_run/T27845b_Lib.hs
- testsuite/tests/dmdanal/should_run/all.T
- utils/check-exact/Utils.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bc48ff7fe3178894654e46000e750c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bc48ff7fe3178894654e46000e750c…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc][wip/rafl/meaningful-main-return] Implement MeaningfulMainReturn
by Florian Ragwitz (@rafl) 08 Oct '26
by Florian Ragwitz (@rafl) 08 Oct '26
08 Oct '26
Florian Ragwitz pushed to branch wip/rafl/meaningful-main-return at Glasgow Haskell Compiler / GHC
Commits:
dd3a23b6 by Florian Ragwitz at 2026-10-08T19:05:38-07:00
Implement MeaningfulMainReturn
As per ghc-proposal#631, with one small adjustment explained in the comments.
Fixes #24848.
- - - - -
31 changed files:
- + changelog.d/MeaningfulMainReturn
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Types/Error/Codes.hs
- + docs/users_guide/exts/meaningful_main_return.rst
- docs/users_guide/exts/misc.rst
- docs/users_guide/using-warnings.rst
- libraries/base/src/GHC/Essentials.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- testsuite/tests/driver/T4437.hs
- + testsuite/tests/meaningful-main-return/MainReturn_constrained_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_alias_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_bottom_enabled_run.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_code_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_exit_success_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_always_exit_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_invalid_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_family_stuck_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_int_enabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_disabled.stderr
- + testsuite/tests/meaningful-main-return/MainReturn_newtype_enabled.stderr
- + testsuite/tests/meaningful-main-return/MeaningfulMainReturn.hs
- + testsuite/tests/meaningful-main-return/all.T
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dd3a23b6e7627d1497c9c6d0fbf013a…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dd3a23b6e7627d1497c9c6d0fbf013a…
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0
[Git][ghc/ghc] Pushed new branch wip/rafl/meaningful-main-return
by Florian Ragwitz (@rafl) 08 Oct '26
by Florian Ragwitz (@rafl) 08 Oct '26
08 Oct '26
Florian Ragwitz pushed new branch wip/rafl/meaningful-main-return at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/rafl/meaningful-main-return
You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
1
0