Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: f2374966 by Adam Gundry at 2026-03-19T15:40:43-04:00 ghci: Mention active language edition in startup banner Per GHC proposal 632, this makes the GHCi startup banner include the active language edition, plus an indication of whether this was the default (as opposed to being explicitly selected via an option such as `-XGHC2024`). For example: ``` $ ghci GHCi, version 9.14.1: https://www.haskell.org/ghc/ :? for help Using default language edition: GHC2024 ghci> ``` Fixes #26037. - - - - - b0ea6b92 by sheaf at 2026-03-19T15:40:49-04:00 Improve incomplete record selector warnings This commit stops GHC from emitting spurious incomplete record selector warnings for bare selectors/projections such as .fld There are two places we currently emit incomplete record selector warnings: 1. In the desugarer, when we see a record selector or an occurrence of 'getField'. Here, we can use pattern matching information to ensure we don't give false positives. 2. In the typechecker, which might sometimes give false positives but can emit warnings in cases that the pattern match checker would otherwise miss. This is explained in Note [Detecting incomplete record selectors] in GHC.HsToCore.Pmc. Now, we obviously don't want to emit the same error twice, and generally we prefer (1), as those messages contain fewer false positives. So we suppress (2) when we are sure we are going to emit (1); the logic for doing so is in GHC.Tc.Instance.Class.warnIncompleteRecSel, and works by looking at the CtOrigin. Now, the issue was that this logic handled explicit record selectors as well as overloaded record field selectors such as "x.r" (which turns into a simple GetFieldOrigin CtOrigin), but it didn't properly handle record projectors like ".fld" or ".fld1.fld2" (which result in other CtOrigins such as 'RecordFieldProjectionOrigin'). To solve this problem, we re-use the 'isHasFieldOrigin' introduced in fbdc623a (slightly adjusted). On the way, we also had to update the desugarer with special handling for the 'ExpandedThingTc' case in 'ds_app', to make sure that 'ds_app_var' sees all the type arguments to 'getField' in order for it to indeed emit warnings like in (1). Fixes #26686 - - - - - 06cec669 by Cheng Shao at 2026-03-19T15:40:51-04:00 rts: opportunistically grow the MutableByteArray# in-place in resizeMutableByteArray# Following !15234, this patch improves `resizeMutableByteArray#` memory efficiency by growing the `MutableByteArray#` in-place if possible, addressing an old todo comment here. Also adds a new test case `resizeMutableByteArrayInPlace` that stresses this behavior. - - - - - a564f77c by Matthew Craven at 2026-03-19T15:40:56-04:00 Change representation of floating point literals This commit changes the representation of floating point literals throughough the compiler, in particular in Core and Cmm. The Rational type is deficient for this purpose, dealing poorly with NaN, +/-Infinity, and negative zero. Instead, the new module GHC.Types.Literal.Floating uses the host Float/Double type to represent NaNs, infinities and negative zero. It also contains a Rational constructor, for the benefit of -fexcess-precision. Other changes: - Remove Note [negative zero] and related code This also removes the restrictions on constant-folding of division by zero, and should make any problems with NaN/Infinity more obvious. - Use -0.0 as the additive identity for Core constant folding rules for floating-point addition, fixing #21227. - Manual worker-wrapper for GHC.Float.rationalToDouble. This is intended to prevent the compiler's WW on this function from interfering with constant-folding. This change means that we now avoid allocating a box for the result of a 'realToFrac' call in T10359. - Combine floatDecodeOp and doubleDecodeOp. This change also fixes a bug in doubleDecodeOp wherein it would incorrectly produce an Int# instead of an Int64# literal for the mantissa component with 64-bit targets. - Use Float/Double for assembly immediates, and update the X86 and PowerPC backends to properly handle special values such as NaN and infinity. - Allow 'rational_to' to handle zero denominators, fixing a TODO in GHC.Core.Opt.ConstantFold. Fixes #8364 #9811 #18897 #21227 Progress towards #26919 Metric Decrease: T10359 Co-authored-by: sheaf <sam.derbyshire@gmail.com> ------------------------- Metric Decrease: T1969 T5321FD ------------------------- - - - - - 60a9d8c0 by Zubin Duggal at 2026-03-19T15:40:58-04:00 compiler/ffi: Collapse void pointer chains in capi wrappers New gcc/clang treat -Wincompatible-pointer-types as an error by default. Since C only allows implicit conversion from void*, not void**, capi wrappers for functions taking e.g. abstract** would fail to compile when the Haskell type Ptr (Ptr Abstract) was naively translated to void**. Collapse nested void pointers to a single void* when the pointee type has no known C representation. Fixes #26852 - - - - - 6d64deec by Luite Stegeman at 2026-03-19T15:41:02-04:00 Move some functions related to pointer tagging to a separate module - - - - - b83f6ae2 by Luite Stegeman at 2026-03-19T15:41:02-04:00 Branchless unpacking for enumeration types Change unpacking for enumeration types to go to Word8#/Word16#/Word# directly instead of going through an intermediate unboxed sum. This allows us to do a branchless conversion using DataToTag and TagToEnum. Fixes #26970 - - - - - 0454b140 by Luite Stegeman at 2026-03-19T15:41:07-04:00 bytecode: Carefully SLIDE off the end of a stack chunk The SLIDE bytecode instruction was not checking for stack chunk boundaries and could corrupt the stack underflow frame, leading to crashes. We add a check to use safe writes if we cross the chunk boundary and also handle stack underflow if Sp is advanced past the underflow frame. fix #27001 - - - - - 68f15429 by Cheng Shao at 2026-03-19T15:41:08-04:00 ghci: serialize BCOByteArray buffer directly when possible This patch changes the `Binary` instances of `BCOByteArray` to directly serialize the underlying buffer when possible, while also taking into account the issue of host-dependent `Word` width. See added comments and amended `Note [BCOByteArray serialization]` for detailed explanation. Closes #27020. - - - - - cfdfde8d by Sylvain Henry at 2026-03-19T15:41:15-04:00 JS: replace BigInt with Number arithmetic for 32/64-bit quot/rem (#23597) Replace BigInt-based implementations of quotWord32, remWord32, quotRemWord32, quotRem2Word32, quotWord64, remWord64, quotInt64, and remInt64 with pure Number (double/integer) arithmetic to avoid the overhead of BigInt promotion. - - - - - fe2949c0 by Sylvain Henry at 2026-03-19T15:41:21-04:00 Core: add constant-folding rules for Addr# eq/ne (#18032) - - - - - eaaf9930 by Matthew Pickering at 2026-03-19T15:41:23-04:00 Use OsPath rather than FilePath in Downsweep cache This gets us one step closure to uniformly using `OsPath` in the compiler. - - - - - b5475f85 by Cheng Shao at 2026-03-19T15:41:24-04:00 hadrian: fix ghc-in-ghci flavour stage0 shared libraries This patch fixes missing stage0 shared libraries in hadrian ghc-in-ghci flavour, which was accidentally dropped in 669d09f950a6e88b903d9fd8a7571531774d4d5d and resulted in a regression in HLS support on linux/macos. Fixes #27057. - - - - - 9c39c6b4 by Cheng Shao at 2026-03-19T15:41:25-04:00 ghc-internal: fix unused imports again Fixes #27059. - - - - - a97dc10f by Sylvain Henry at 2026-03-19T15:41:31-04:00 JS: install rts/Types.h header file (#27033) It was an omission, making HsFFI.h not usable with GHC using the JS backend. - - - - - 178179d0 by Cheng Shao at 2026-03-19T15:41:32-04:00 hadrian: don't compile RTS with -Winline This patch removes `-Winline` from cflags when compiling the RTS, given that: 1. It generates a huge pile of spam and hurts developer experience 2. Whether inlining happens is highly dependent on toolchains, flavours, etc, and it's not really an issue to fix if inlining doesn't happen; it's a hint to the C compiler anyway. Fixes #27060. - - - - - e5cf0804 by Cheng Shao at 2026-03-19T15:41:33-04:00 hadrian: compile libffi-clib with -Wno-deprecated-declarations This patch adds `-Wno-deprecated-declarations` to cflags of `libffi-clib`, given that it produces noise at compile-time that aren't really our issue to fix anyway, it's from vendored libffi source code. - - - - - 103 changed files: - compiler/GHC/Builtin/Names.hs - compiler/GHC/ByteCode/Asm.hs - compiler/GHC/Cmm/CommonBlockElim.hs - compiler/GHC/Cmm/Expr.hs - compiler/GHC/Cmm/Opt.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Cmm/Type.hs - compiler/GHC/Cmm/Utils.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/AArch64/Regs.hs - compiler/GHC/CmmToAsm/LA64/CodeGen.hs - compiler/GHC/CmmToAsm/LA64/Ppr.hs - compiler/GHC/CmmToAsm/LA64/Regs.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - compiler/GHC/CmmToAsm/PPC/Regs.hs - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Ppr.hs - compiler/GHC/CmmToAsm/RV64/Regs.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToAsm/X86/Regs.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm/CodeGen.hs - compiler/GHC/CmmToLlvm/Data.hs - compiler/GHC/Core.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/ConstantFold.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Foreign/C.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - + compiler/GHC/Platform/Tag.hs - compiler/GHC/Stg/Unarise.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/StgToCmm/Closure.hs - compiler/GHC/StgToCmm/Expr.hs - compiler/GHC/StgToCmm/Lit.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/StgToJS/Literal.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Types/Id/Make.hs - compiler/GHC/Types/Literal.hs - + compiler/GHC/Types/Literal/Floating.hs - compiler/GHC/Types/RepType.hs - compiler/GHC/Utils/Binary.hs - compiler/ghc.cabal.in - docs/users_guide/9.16.1-notes.rst - ghc/GHCi/UI.hs - ghc/Main.hs - hadrian/src/Settings/Flavours/GhcInGhci.hs - hadrian/src/Settings/Packages.hs - libraries/ghc-internal/src/GHC/Internal/Conc/IO.hs - libraries/ghc-internal/src/GHC/Internal/Event/Control.hs - libraries/ghc-internal/src/GHC/Internal/Float.hs - libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc - libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc - libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs - libraries/ghc-internal/src/GHC/Internal/TopHandler.hs - libraries/ghci/GHCi/ResolvedBCO.hs - rts/Interpreter.c - rts/PrimOps.cmm - rts/js/arith.js - rts/rts.cabal - + testsuite/tests/bytecode/T27001.hs - + testsuite/tests/bytecode/T27001.stdout - testsuite/tests/bytecode/all.T - + testsuite/tests/codeGen/should_run/T21227.hs - + testsuite/tests/codeGen/should_run/T21227.stdout - + testsuite/tests/codeGen/should_run/T9811.hs - + testsuite/tests/codeGen/should_run/T9811.stdout - testsuite/tests/codeGen/should_run/all.T - testsuite/tests/count-deps/CountDepsAst.stdout - testsuite/tests/count-deps/CountDepsParser.stdout - + testsuite/tests/ffi/should_compile/T26852.h - + testsuite/tests/ffi/should_compile/T26852.hs - + testsuite/tests/ffi/should_compile/T26852.stderr - testsuite/tests/ffi/should_compile/all.T - testsuite/tests/ghci/should_run/BinaryArray.hs - + testsuite/tests/javascript/js-c-sources/T27033.hs - + testsuite/tests/javascript/js-c-sources/T27033.stdout - + testsuite/tests/javascript/js-c-sources/T27033_c.c - + testsuite/tests/javascript/js-c-sources/T27033_js.js - testsuite/tests/javascript/js-c-sources/all.T - testsuite/tests/numeric/should_run/T7014.hs - + testsuite/tests/overloadedrecflds/should_compile/T26686.hs - + testsuite/tests/overloadedrecflds/should_compile/T26686.stderr - testsuite/tests/overloadedrecflds/should_compile/all.T - testsuite/tests/rts/all.T - + testsuite/tests/rts/resizeMutableByteArrayInPlace.hs - + testsuite/tests/simplCore/should_compile/T18032.hs - + testsuite/tests/simplCore/should_compile/T18032.stderr - testsuite/tests/simplCore/should_compile/all.T - testsuite/tests/simplStg/should_run/all.T - + testsuite/tests/simplStg/should_run/unpack_enum.hs - + testsuite/tests/simplStg/should_run/unpack_enum.stdout The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f18ff78e6b177bb3220e37044ec131... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f18ff78e6b177bb3220e37044ec131... You're receiving this email because of your account on gitlab.haskell.org.