Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 63c6b5ef by Rodrigo Mesquita at 2026-03-25T00:17:35-04:00 Bump default language edition to GHC2024 As per the accepted ghc-proposal#632 Fixes #26039 - - - - - 2208f729 by Sylvain Henry at 2026-03-25T00:17:55-04:00 Check that shift values are valid In GHC's codebase in non-DEBUG builds we silently substitute shiftL/R with unsafeShiftL/R for performance reasons. However we were not checking that the shift value was valid for unsafeShiftL/R, leading to wrong computations, but only in non-DEBUG builds. This patch adds the necessary checks and reports an error when a wrong shift value is passed. - - - - - 043bf41f by Sylvain Henry at 2026-03-25T00:17:55-04:00 Implement basic value range analysis (#25718) Perform basic value range analysis to try to determine at compile time the result of the application of some comparison primops (ltWord#, etc.). This subsumes the built-in rewrite rules used previously to check if one of the comparison argument was a bound (e.g. (x :: Word8) <= 255 is always True). Our analysis is more powerful and handles type conversions: e.g. word8ToWord x <= 255 is now detected as always True too. We also use value range analysis to filter unreachable alternatives in case-expressions. To support this, we had to allow case-expressions for primitive types to not have a DEFAULT alternative (as was assumed before and checked in Core lint). - - - - - 8580f5ea by ARATA Mizuki at 2026-03-25T00:18:06-04:00 rts: Align stack to 64-byte boundary in StgRun on x86 When LLVM spills AVX/AVX-512 vector registers to the stack, it requires 32-byte (__m256) or 64-byte (__m512) alignment. If the stack is not sufficiently aligned, LLVM inserts a realignment prologue that reserves %rbp as a frame pointer, conflicting with GHC's use of %rbp as an STG callee-saved register and breaking the tail-call-based calling convention. Previously, GHC worked around this by lying to LLVM about the stack alignment and rewriting aligned vector loads/stores (VMOVDQA, VMOVAPS) to unaligned ones (VMOVDQU, VMOVUPS) in the LLVM Mangler. This had two problems: - It did not extend to AVX-512, which requires 64-byte alignment. (#26595) - When Haskell calls a C function that takes __m256/__m512 arguments on the stack, the callee requires genuine alignment, which could cause a segfault. (#26822) This patch genuinely aligns the stack to 64 bytes in StgRun by saving the original stack pointer before alignment and restoring it in StgReturn. We now unconditionally advertise 64-byte stack alignment to LLVM for all x86 targets, making rewriteAVX in the LLVM Mangler unnecessary. STG_RUN_STACK_FRAME_SIZE is increased from 48 to 56 bytes on non-Windows x86-64 to store the saved stack pointer. Closes #26595 and #26822 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> - - - - - 9f00c3ff by Teo Camarasu at 2026-03-25T00:18:07-04:00 ghc-internal: Float Generics to near top of module graph We remove GHC.Internal.Generics from the critical path of the `ghc-internal` module graph. GHC.Internal.Generics used to be in the middle of the module graph, but now it is nearer the top (built later). This change thins out the module graph and allows us to get rid of the ByteOrder hs-boot file. We implement this by moving Generics instances from the module where the datatype is defined to the GHC.Internal.Generics module. This trades off increasing the compiled size of GHC.Internal.Generics with reducing the dependency footprint of datatype modules. Not all instances are moved to GHC.Internal.Generics. For instance, `GHC.Internal.Control.Monad.Fix` keeps its instance as it is one of the very last modules compiled in `ghc-internal` and so inverting the relationship here would risk adding GHC.Internal.Generics back onto the critical path. We also don't change modules that are re-exported from the `template-haskell` or `ghc-heap`. This is done to make it easy to eventually move `Generics` to `base` once something like #26657 is implemented. Resolves #26930 Metric Decrease: T21839c - - - - - b9e195a1 by sheaf at 2026-03-25T00:18:22-04:00 Avoid infinite loop in deep subsumption This commit ensures we only unify after we recur in the deep subsumption code in the FunTy vs non-FunTy case of GHC.Tc.Utils.Unify.tc_sub_type_deep, to avoid falling into an infinite loop. See the new Wrinkle [Avoiding a loop in tc_sub_type_deep] in Note [FunTy vs non-FunTy case in tc_sub_type_deep] in GHC.Tc.Utils.Unify. Fixes #26823 Co-authored-by: simonpj <simon.peytonjones@gmail.com> - - - - - 9fbf01f8 by Ian Duncan at 2026-03-25T00:18:29-04:00 AArch64: fix MOVK regUsageOfInstr to mark dst as both read and written MOVK (move with keep) modifies only a 16-bit slice of the destination register, so the destination is both read and written. The register allocator must know this to avoid clobbering live values. Update regUsageOfInstr to list the destination in both src and dst sets. No regression test: triggering the misallocation requires specific register pressure around a MOVK sequence, which is difficult to reliably provoke from Haskell source. - - - - - 6940371d by Matthew Pickering at 2026-03-25T00:18:30-04:00 rts: forward clone-stack messages after TSO migration MSG_CLONE_STACK assumed that the target TSO was still owned by the capability that received the message. This is not always true: the TSO can migrate before the inbox entry is handled. When that happened, handleCloneStackMessage could clone a live stack from the wrong capability and use the wrong capability for allocation and performTryPutMVar, leading to stack sanity failures such as checkStackFrame: weird activation record found on stack. Fix this by passing the current capability into handleCloneStackMessage, rechecking msg->tso->cap at handling time, and forwarding the message if the TSO has migrated. Once ownership matches, use the executing capability consistently for cloneStack, rts_apply, and performTryPutMVar. Fixes #27008 - - - - - 4bd7b87b by mangoiv at 2026-03-25T00:18:32-04:00 release tracking: adopt release tracking ticket from #16816 - - - - - 91b04679 by mangoiv at 2026-03-25T00:18:32-04:00 release tracking: add a release tracking ticket Brings the information in the release tracking ticket up to date with https://gitlab.haskell.org/ghc/ghc-hq/-/blob/main/release-management.mkd Resolves #26691 - - - - - 77db986b by Teo Camarasu at 2026-03-25T00:18:33-04:00 Revert "Set default eventlog-flush-interval to 5s" Flushing the eventlog forces a synchronisation of all the capabilities and there was a worry that this might lead to a performance cost for some highly parallel workloads. This reverts commit 66b96e2a591d8e3d60e74af3671344dfe4061cf2. - - - - - 7caf9497 by Cheng Shao at 2026-03-25T00:18:34-04:00 ghc-boot: move GHC.Data.SmallArray to ghc-boot This commit moves `GHC.Data.SmallArray` from the `ghc` library to `ghc-boot`, so that it can be used by `ghci` as well: - The `Binary` (from `ghc`) instance of `SmallArray` is moved to `GHC.Utils.Binary` - Util functions `replicateSmallArrayIO`, `mapSmallArrayIO`, `mapSmallArrayM_`, `imapSmallArrayM_` , `smallArrayFromList` and `smallArrayToList` are added - The `Show` instance is added - The `Binary` (from `binary`) instance is added - - - - - 0be40b65 by Cheng Shao at 2026-03-25T00:18:35-04:00 compiler: use `Binary` instance of `BCOByteArray` for bytecode objects This commit defines `Binary` (from `compiler`) instance of `BCOByteArray` which serializes the underlying buffer directly, and uses it directly in bytecode object serialization. Previously we reuse the `Binary` (from `binary`) instance, and this change allows us to avoid double-copying via an intermediate `ByteString` when using `put`/`get` in `binnary`. Also see added comment for explanation. - - - - - 700e2840 by Cheng Shao at 2026-03-25T00:18:35-04:00 ghci: use SmallArray directly in ResolvedBCO This patch makes ghci use `SmallArray` directly in `ResolvedBCO` when applicable, making the memory representation more compact and reducing marshaling overhead. Closes #27058. - - - - - 35900951 by Wen Kokke at 2026-03-25T00:18:38-04:00 Fix race condition between flushEventLog and start/endEventLogging. This commit changes `flushEventLog` to acquire/release the `state_change` mutex to prevent interleaving with `startEventLogging` and `endEventLogging`. In the current RTS, `flushEventLog` _does not_ acquire this mutex, which may lead to eventlog corruption on the following interleaving: - `startEventLogging` writes the new `EventLogWriter` to `event_log_writer`. - `flushEventLog` flushes some events to `event_log_writer`. - `startEventLogging` writes the eventlog header to `event_log_writer`. This causes the eventlog to be written out in an unreadable state, with one or more events preceding the eventlog header. This commit renames the old function to `flushEventLog_` and defines `flushEventLog` simply as: ```c void flushEventLog(Capability **cap USED_IF_THREADS) { ACQUIRE_LOCK(&state_change_mutex); flushEventLog_(cap); RELEASE_LOCK(&state_change_mutex); } ``` The old function is still needed internally within the compilation unit, where it is used in `endEventLogging` in a context where the `state_change` mutex has already been acquired. I've chosen to mark `flushEventLog_` as static and let other uses of `flushEventLog` within the RTS refer to the new version. There is one use in `hs_init_ghc` via `flushTrace`, where the new locking behaviour should be harmless, and one use in `handle_tick`, which I believe was likely vulnerable to the same race condition, so the new locking behaviour is desirable. I have not added a test. The behaviour is highly non-deterministic and requires a program that concurrently calls `flushEventLog` and `startEventLogging`/`endEventLogging`. I encountered the issue while developing `eventlog-socket` and within that context have verified that my patch likely addresses the issue: a test that used to fail within the first dozen or so runs now has been running on repeat for several hours. - - - - - 75c79c03 by Tobias Haslop at 2026-03-25T00:18:49-04:00 Fix broken Haddock link to Bifunctor class in description of Functor class - - - - - 204 changed files: - + .gitlab/issue_templates/release_tracking.md - compiler/GHC/ByteCode/Linker.hs - compiler/GHC/ByteCode/Serialize.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Config.hs - compiler/GHC/CmmToLlvm/Mangler.hs - compiler/GHC/Core.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Opt/ConstantFold.hs - + compiler/GHC/Core/Opt/Range.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Driver/Config/CmmToLlvm.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Prelude/Basic.hs - compiler/GHC/StgToCmm/Expr.hs - compiler/GHC/StgToCmm/Utils.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Utils/Binary.hs - compiler/ghc.cabal.in - docs/users_guide/9.16.1-notes.rst - docs/users_guide/exts/control.rst - compiler/GHC/Data/SmallArray.hs → libraries/ghc-boot/GHC/Data/SmallArray.hs - libraries/ghc-boot/ghc-boot.cabal.in - libraries/ghc-internal/src/GHC/Internal/Base.hs - libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs - − libraries/ghc-internal/src/GHC/Internal/ByteOrder.hs-boot - libraries/ghc-internal/src/GHC/Internal/Char.hs - libraries/ghc-internal/src/GHC/Internal/Data/Foldable.hs - libraries/ghc-internal/src/GHC/Internal/Data/Functor/Const.hs - libraries/ghc-internal/src/GHC/Internal/Data/Functor/Identity.hs - libraries/ghc-internal/src/GHC/Internal/Data/Monoid.hs - libraries/ghc-internal/src/GHC/Internal/Data/Semigroup/Internal.hs - libraries/ghc-internal/src/GHC/Internal/Data/Traversable.hs - libraries/ghc-internal/src/GHC/Internal/Data/Version.hs - libraries/ghc-internal/src/GHC/Internal/Event/Control.hs - libraries/ghc-internal/src/GHC/Internal/Functor/ZipList.hs - libraries/ghc-internal/src/GHC/Internal/Generics.hs - libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs - libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc - libraries/ghc-internal/src/GHC/Internal/Read.hs - libraries/ghc-internal/src/GHC/Internal/Unicode/Bits.hs - libraries/ghci/GHCi/CreateBCO.hs - libraries/ghci/GHCi/ResolvedBCO.hs - rts/CloneStack.c - rts/CloneStack.h - rts/Messages.c - rts/RtsFlags.c - rts/StgCRun.c - rts/eventlog/EventLog.c - rts/include/rts/Constants.h - testsuite/tests/ado/ado004.hs - testsuite/tests/annotations/should_fail/annfail02.hs - testsuite/tests/annotations/should_fail/annfail02.stderr - testsuite/tests/array/should_run/arr020.hs - testsuite/tests/core-to-stg/T19700.hs - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/deSugar/should_fail/DsStrictFail.hs - testsuite/tests/deriving/should_compile/T15798b.hs - testsuite/tests/deriving/should_compile/T15798c.hs - testsuite/tests/deriving/should_compile/T15798c.stderr - testsuite/tests/deriving/should_compile/T24955a.hs - testsuite/tests/deriving/should_compile/T24955a.stderr - testsuite/tests/deriving/should_compile/T24955b.hs - testsuite/tests/deriving/should_compile/T24955c.hs - testsuite/tests/deriving/should_fail/T10598_fail4.hs - testsuite/tests/deriving/should_fail/T10598_fail4.stderr - testsuite/tests/deriving/should_fail/T10598_fail5.hs - testsuite/tests/deriving/should_fail/T10598_fail5.stderr - testsuite/tests/dmdanal/sigs/T22241.hs - testsuite/tests/gadt/T20485.hs - testsuite/tests/ghci.debugger/scripts/all.T - testsuite/tests/ghci.debugger/scripts/break012.hs - testsuite/tests/ghci.debugger/scripts/break012.stdout - testsuite/tests/ghci/prog-mhu002/all.T - testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout - testsuite/tests/ghci/scripts/Makefile - testsuite/tests/ghci/scripts/T10963.stderr - testsuite/tests/ghci/scripts/ghci064.stdout - testsuite/tests/ghci/should_run/all.T - testsuite/tests/indexed-types/should_compile/T15322.hs - testsuite/tests/indexed-types/should_compile/T15322.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/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/linear/should_fail/T18888.hs - testsuite/tests/module/T20007.hs - testsuite/tests/module/T20007.stderr - testsuite/tests/module/mod90.hs - testsuite/tests/module/mod90.stderr - testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.hs - testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.hs - testsuite/tests/overloadedrecflds/should_fail/all.T - testsuite/tests/parser/should_fail/ParserNoLambdaCase.hs - testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr - testsuite/tests/parser/should_fail/T16270h.hs - testsuite/tests/parser/should_fail/T16270h.stderr - testsuite/tests/parser/should_fail/readFail001.hs - testsuite/tests/parser/should_fail/readFail001.stderr - testsuite/tests/partial-sigs/should_compile/SomethingShowable.hs - testsuite/tests/plugins/late-plugin/LatePlugin.hs - testsuite/tests/polykinds/T7151.hs - testsuite/tests/polykinds/T7151.stderr - testsuite/tests/polykinds/T7433.hs - testsuite/tests/polykinds/T7433.stderr - testsuite/tests/programs/andy_cherry/test.T - testsuite/tests/rename/should_fail/T10668.hs - testsuite/tests/rename/should_fail/T10668.stderr - testsuite/tests/rename/should_fail/T12681.hs - testsuite/tests/rename/should_fail/T12681.stderr - testsuite/tests/rename/should_fail/T13568.hs - testsuite/tests/rename/should_fail/T13568.stderr - testsuite/tests/rename/should_fail/T13644.hs - testsuite/tests/rename/should_fail/T13644.stderr - testsuite/tests/rename/should_fail/T13847.hs - testsuite/tests/rename/should_fail/T13847.stderr - testsuite/tests/rename/should_fail/T14032c.hs - testsuite/tests/rename/should_fail/T19843l.hs - testsuite/tests/rename/should_fail/T19843l.stderr - testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.stderr - testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.stderr - testsuite/tests/rename/should_fail/T5385.hs - testsuite/tests/rename/should_fail/T5385.stderr - testsuite/tests/roles/should_fail/Roles5.hs - testsuite/tests/roles/should_fail/Roles5.stderr - testsuite/tests/rts/all.T - + testsuite/tests/rts/cloneThreadStackMigrating.hs - testsuite/tests/showIface/DocsInHiFile.hs - testsuite/tests/showIface/DocsInHiFile1.stdout - testsuite/tests/showIface/DocsInHiFileTH.hs - testsuite/tests/showIface/DocsInHiFileTH.stdout - testsuite/tests/showIface/DocsInHiFileTHExternal.hs - testsuite/tests/showIface/HaddockIssue849.hs - testsuite/tests/showIface/HaddockIssue849.stdout - testsuite/tests/showIface/HaddockOpts.hs - testsuite/tests/showIface/HaddockOpts.stdout - testsuite/tests/showIface/HaddockSpanIssueT24378.hs - testsuite/tests/showIface/HaddockSpanIssueT24378.stdout - testsuite/tests/showIface/MagicHashInHaddocks.hs - testsuite/tests/showIface/MagicHashInHaddocks.stdout - testsuite/tests/showIface/Makefile - testsuite/tests/showIface/NoExportList.hs - testsuite/tests/showIface/NoExportList.stdout - testsuite/tests/showIface/PragmaDocs.stdout - testsuite/tests/showIface/ReExports.stdout - + testsuite/tests/simd/should_run/StackAlignment32.hs - + testsuite/tests/simd/should_run/StackAlignment32.stdout - + testsuite/tests/simd/should_run/StackAlignment32_main.c - + testsuite/tests/simd/should_run/StackAlignment64.hs - + testsuite/tests/simd/should_run/StackAlignment64.stdout - + testsuite/tests/simd/should_run/StackAlignment64_main.c - testsuite/tests/simd/should_run/all.T - testsuite/tests/simplCore/T9646/test.T - + testsuite/tests/simplCore/should_compile/T19166.hs - + testsuite/tests/simplCore/should_compile/T19166.stderr - testsuite/tests/simplCore/should_compile/T21960.hs - + testsuite/tests/simplCore/should_compile/T25718.hs - + testsuite/tests/simplCore/should_compile/T25718.stderr - + testsuite/tests/simplCore/should_compile/T25718a.hs - + testsuite/tests/simplCore/should_compile/T25718a.stderr - + testsuite/tests/simplCore/should_compile/T25718b.hs - + testsuite/tests/simplCore/should_compile/T25718b.stderr - + testsuite/tests/simplCore/should_compile/T25718c.hs - + testsuite/tests/simplCore/should_compile/T25718c.stderr-ws-32 - + testsuite/tests/simplCore/should_compile/T25718c.stderr-ws-64 - testsuite/tests/simplCore/should_compile/T26709.stderr - testsuite/tests/simplCore/should_compile/all.T - testsuite/tests/th/TH_Promoted1Tuple.hs - testsuite/tests/th/TH_Roles1.hs - testsuite/tests/typecheck/should_compile/MutRec.hs - testsuite/tests/typecheck/should_compile/T10770a.hs - testsuite/tests/typecheck/should_compile/T11339.hs - testsuite/tests/typecheck/should_compile/T11397.hs - testsuite/tests/typecheck/should_compile/T13526.hs - testsuite/tests/typecheck/should_compile/T18467.hs - testsuite/tests/typecheck/should_compile/T18467.stderr - testsuite/tests/typecheck/should_compile/T26225.hs - testsuite/tests/typecheck/should_compile/tc081.hs - testsuite/tests/typecheck/should_compile/tc141.hs - testsuite/tests/typecheck/should_fail/T23427.hs - + testsuite/tests/typecheck/should_fail/T26823.hs - + testsuite/tests/typecheck/should_fail/T26823.stderr - testsuite/tests/typecheck/should_fail/T6078.hs - testsuite/tests/typecheck/should_fail/T7453.hs - testsuite/tests/typecheck/should_fail/T7453.stderr - testsuite/tests/typecheck/should_fail/T8570.hs - testsuite/tests/typecheck/should_fail/T8570.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail083.hs - testsuite/tests/typecheck/should_fail/tcfail083.stderr - testsuite/tests/typecheck/should_fail/tcfail084.hs - testsuite/tests/typecheck/should_fail/tcfail084.stderr - testsuite/tests/typecheck/should_fail/tcfail094.hs - testsuite/tests/typecheck/should_fail/tcfail094.stderr - testsuite/tests/typecheck/should_run/T1735.hs - testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs - testsuite/tests/typecheck/should_run/T3731.hs - testsuite/tests/vdq-rta/should_fail/T24159_type_syntax_th_fail.script - testsuite/tests/warnings/should_fail/CaretDiagnostics1.hs - testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr - testsuite/tests/warnings/should_fail/T24396c.hs - testsuite/tests/warnings/should_fail/T24396c.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d1269952e6144c25c8560df6d4cbfbe... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d1269952e6144c25c8560df6d4cbfbe... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)