Andreas Klebinger pushed to branch wip/andreask/9.10.4-batch1 at Glasgow Haskell Compiler / GHC Commits: 85b00dc3 by Simon Peyton Jones at 2026-10-28T14:12:31+01:00 Fix a horrible shadowing bug in implicit parameters Fixes #26451. The change is in GHC.Tc.Solver.Monad.updInertDicts where we now do /not/ delete /Wanted/ implicit-parameeter constraints. This bug has been in GHC since 9.8! But it's quite hard to provoke; I contructed a tests in T26451, but it was hard to do so. (cherry picked from commit c052c724d2dfc994994b6548545836969aee8ed8) (cherry picked from commit 451c6a43809b0e300b9b09bbad1e8f1a4e2d378b) - - - - - 7af8d1b3 by sheaf at 2026-10-28T14:43:06+01:00 localRegistersConflict: account for assignment LHS This commit fixes a serious oversight in GHC.Cmm.Sink.conflicts, specifically the code that computes which local registers conflict between an assignment and a Cmm statement. If we have: assignment: <local_reg> = <expr> node: <local_reg> = <other_expr> then clearly the two conflict, because we cannot move one statement past the other, as they assign two different values to the same local register. (Recall that 'conflicts (local_reg,expr) node' is False if and only if the assignment 'local_reg = expr' can be safely commuted past the statement 'node'.) The fix is to update 'GHC.Cmm.Sink.localRegistersConflict' to take into account the following two situations: (1) 'node' defines the LHS local register of the assignment, (2) 'node' defines a local register used in the RHS of the assignment. The bug is precisely that we were previously missing condition (1). Fixes #26550 (cherry picked from commit 43fa8be89bdccbbe730daf0be7bdae8dde99ce44) - - - - - d397cf50 by ARATA Mizuki at 2026-10-28T14:44:34+01:00 Fix the order of spill/reload instructions The AArch64 NCG could emit multiple instructions for a single spill/reload, but their order was not consistent between the definition and a use. Fixes #26537 Co-authored-by: sheaf <sam.derbyshire@gmail.com> (cherry picked from commit aada5db93a2f0fd00c0715ad9ca4f666ffb3d9d8) - - - - - 10061b25 by Matthew Pickering at 2026-10-28T14:44:51+01:00 rts: Fix a deadlock with eventlog flush interval and RTS shutdown The ghc_ticker thread attempts to flush at the eventlog tick interval, this requires waiting to take all capabilities. At the same time, the main thread is shutting down, the schedule is stopped and then we wait for the ticker thread to finish. Therefore we are deadlocked. The solution is to use `newBoundTask/exitMyTask`, so that flushing can cooperate with the scheduler shutdown. Fixes #26573 (cherry picked from commit b7fe744598b4569cd0236268e4f6f5b9d27e12b7) - - - - - 978fca82 by Zubin Duggal at 2026-10-28T14:45:02+01:00 rts/linker/PEi386: Copy strings before they are inserted into LoadedDllCache. The original strings are temporary and might be freed at an arbitrary point. Fixes #26613 (cherry picked from commit 82db70420e546fba189ddc26cc69e57961e46ac0) - - - - - 5e7f7f63 by Ben Gamari at 2026-10-28T14:45:32+01:00 gitlab-ci: Run ghcup-metadata jobs on OpenCape runners This significantly reduces our egress traffic and makes the jobs significantly faster. (cherry picked from commit ff3f0d09bce1c261638b572af2bac1d87f1f6df7) - - - - - edbc8273 by Luite Stegeman at 2026-10-28T14:45:51+01:00 rts: Handle overflow of ELF section header string table If the section header string table is stored in a section greater than or equal to SHN_LORESERVE (0xff00), the 16-bit field e_shstrndx in the ELF header does not contain the section number, but rather an overflow value SHN_XINDEX (0xffff) indicating that we need to look elsewhere. This fixes the linker by not using e_shstrndx directly but calling elf_shstrndx, which correctly handles the SHN_XINDEX value. Fixes #26603 (cherry picked from commit c71faa7697f2d0bc8b92173aeb1f063ca8ed235a) - - - - - 676e3979 by Matthew Pickering at 2026-10-28T14:46:05+01:00 hadrian: Use a response file to invoke GHC for dep gathering. In some cases we construct an argument list too long for GHC to handle directly on windows. This happens when we generate the dependency file because the command line will contain references to a large number of .hs files. To avoid this we now invoke GHC using a response file when generating dependencies to sidestep length limitations. Note that we only pass the actual file names in the dependency file. Why? Because this side-steps #26560 (cherry picked from commit 9d371d23c526fd160d7e99bef2bc7da825cf3c0f) - - - - - 62bfca20 by Cheng Shao at 2026-10-28T14:47:51+01:00 testsuite: run numeric tests with optasm when available This patch adds the `optasm` extra way to nueric tests when NCG is available. Some numeric bugs only surface with optimization, omitting this can hide these bugs and even make them slip into release! (e.g. #26711) (cherry picked from commit ae1aeaabac1d49c98be2b48700dcbb4cc402ffe0) - - - - - 143f0cb0 by Matthew Pickering at 2026-10-28T14:48:19+01:00 rts: Use INFO_TABLE_CONSTR for stg_dummy_ret_closure Since the closure type is CONSTR_NOCAF, we need to use INFO_TABLE_CONSTR to populate the constructor description field (this crashes ghc-debug when decoding AP_STACK frames sometimes) Fixes #26745 (cherry picked from commit 322dd6726b11c7101c28ffb8aeb7cb4cee34ab56) - - - - - 6b666faa by Cheng Shao at 2026-10-28T14:51:33+01:00 compiler: change sectionProtection to take SectionType argument This commit changes `sectionProtection` to only take `SectionType` argument instead of whole `Section`, since it doesn't need the Cmm section content anyway, and it can then be called in parts of NCG where we only have a `SectionType` in scope. (cherry picked from commit 2433e91d41675d56f48f82d22430a8dee915e7a0) (cherry picked from commit dcf082dd569766ffda210b71137421954dc57ab4) - - - - - 49edb063 by Cheng Shao at 2026-10-28T14:51:33+01:00 compiler: change isInitOrFiniSection to take SectionType argument This commit changes `isInitOrFiniSection` to only take `SectionType` argument instead of whole `Section`, since it doesn't need the Cmm section content anyway, and it can then be called in parts of NCG where we only have a `SectionType` in scope. Also marks it as exported. (cherry picked from commit e5926fbebf341ee547227d41710d78471eecd09c) (cherry picked from commit 19b88fab3744946ae72152f03b55c5fca24d87de) - - - - - 870a7b2a by Cheng Shao at 2026-10-28T14:51:33+01:00 compiler: fix split sections on windows This patch fixes split sections on windows by emitting the right COMDAT section header in NCG, see added comment for more explanation. Fix #26696 #26494. ------------------------- Metric Decrease: LargeRecord T9675 size_hello_artifact size_hello_artifact_gzip size_hello_unicode size_hello_unicode_gzip Metric Increase: T13035 ------------------------- Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 244d57d79a555dcecc7590287bb14976d561291a) (cherry picked from commit b492c8471ef93aa2108b34560f2a1a4de6b7824c) - - - - - 04cb944c by fendor at 2026-10-28T14:52:03+01:00 Remove `traceId` from ghc-pkg executable (cherry picked from commit d0966e64880e9fa30ce07c0fa5ea28108c6e8ad9) - - - - - 653307ec by Andreas Klebinger at 2026-10-28T16:58:47+01:00 ncg: Give Format a Ord instance to help backports. - - - - - 79d46c38 by Peter Trommler at 2026-10-28T16:58:47+01:00 PPC NCG: Fix shift right MO code The shift amount in shift right [arithmetic] MOs is machine word width. Therefore remove unnecessary zero- or sign-extending of shift amount. It looks harmless to extend the shift amount argument because the shift right instruction uses only the seven lowest bits (i. e. mod 128). But now we have a conversion operation from a smaller type to word width around a memory load at word width. The types are not matching up but there is no check done in CodeGen. The necessary conversion from word width down to the smaller width would be translated into a no-op on PowerPC anyway. So all seems harmless if it was not for a small optimisation in getRegister'. In getRegister' a load instruction with the smaller width of the conversion operation was generated. This loaded the most significant bits of the word in memory on a big-endian platform. These bits were zero and hence shift right was used with shift amount zero and not one as required in test Sized. Fixes #26519 (cherry picked from commit c1fe009739da8b368e59b87b00d7c568ab571643) - - - - - 04a40ac1 by Cheng Shao at 2026-10-28T16:58:47+01:00 llvm: fix split sections for llvm backend This patch fixes split sections for llvm backend: - Pass missing `--data-sections`/`--function-sections` flags to llc/opt. - Use `@llvm.compiler.used` instead of `@llvm.used` to avoid sections being unnecessarily retained at link-time. Fixes #26770. ------------------------- Metric Decrease: libdir size_hello_artifact size_hello_unicode ------------------------- Co-authored-by: Codex <codex@openai.com> (cherry picked from commit b18b2c42c32488ad6d3480a56a1fcd753cad2023) - - - - - dc47b62d by Andreas Klebinger at 2026-10-28T16:58:47+01:00 Update ghc-experimental changelog - - - - - fbe5a108 by sterni at 2026-10-28T16:58:48+01:00 users_guide: fix runtime error during build with Sphinx 9.1.0 Appears that pathto is stricter about what it accepts now. Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch. Resolves #26810. Co-authored-by: Martin Weinelt <hexa@darmstadt.ccc.de> (cherry picked from commit e8f5a45de561ec80c88cd3da2c66502deb32d4c3) - - - - - 270c54ee by Jessica Clarke at 2026-10-28T16:58:48+01:00 PPC NCG: Use libcall for 64-bit cmpxchg on 32-bit PowerPC There is no native instruction for this, and even if there were a register pair version we could use, the implementation here is assuming the values fit in a single register, and we end up only using / defining the low halves of the registers. Fixes: b4d39adbb5 ("PrimOps: Add CAS op for all int sizes") Fixes: #23969 (cherry picked from commit ce2d62fba69d2ea0c74c46c50628feb8b81719d2) - - - - - cae1fcea by Michael Karcher at 2026-10-28T16:58:48+01:00 NCG for PPC: add pattern for CmmRegOff to iselExpr64 Closes #26828 (cherry picked from commit 43d977619de65c0cf87695fa5d86f1a3ff3176c3) - - - - - f79444d4 by Andreas Klebinger at 2026-10-28T16:58:48+01:00 testsuite: Explicitly use utf-8 encoding in rts-includes linter. Not doing so caused failures on windows, as python failed to pick a reasonable encoding even with locale set. Fixes #26850 (cherry picked from commit 01ecb61234b03b94d08ab649395e2da074a4f9d3) - - - - - dd8424a7 by Matthew Pickering at 2026-10-28T16:58:48+01:00 determinism: Use a stable sort in WithHsDocIdentifiers binary instance `WithHsDocIdentifiers` is defined as ``` 71 data WithHsDocIdentifiers a pass = WithHsDocIdentifiers 72 { hsDocString :: !a 73 , hsDocIdentifiers :: ![Located (IdP pass)] 74 } ``` This list of names is populated from `rnHsDocIdentifiers`, which calls `lookupGRE`, which calls `lookupOccEnv_AllNameSpaces`, which calls `nonDetEltsUFM` and returns the results in an order depending on uniques. Sorting the list with a stable sort before returning the interface makes the output deterministic and follows the approach taken by other fields in `Docs`. Fixes #26858 (cherry picked from commit 0020e38a021b5f0371c48fe73cddf8987acb1eb1) - - - - - 31066c18 by John Paul Adrian Glaubitz at 2026-10-28T16:58:48+01:00 rts: Switch prim to use modern atomic compiler builtins The __sync_*() atomic compiler builtins have been deprecated in GCC for a while now and also don't provide variants for 64-bit values such as __sync_fetch_and_add_8(). Thus, replace them with the modern __atomic_*() compiler builtins and while we're at it, also drop the helper macro CAS_NAND() which is now no longer needed since we stopped using the __sync_*() compiler builtins altogether. Co-authored-by: Ilias Tsitsimpis <iliastsi@debian.org> Fixes #26729 (cherry picked from commit 7c52c4f9bc8d6ae6404039ec02efe48fbf7a4778) - - - - - 0b4ad048 by sheaf at 2026-10-28T16:58:48+01:00 System.Info.fullCompilerVersion: add 'since' annot Fixes #26973 (cherry picked from commit fc8b8e27398b4d9d901fb65d15a7d8b23df428b8) - - - - - 7aac9d4b by Andreas Klebinger at 2026-10-28T16:58:49+01:00 Fix missing profiling header for origin_thunk frame. Fixes #27007 (cherry picked from commit 63ae8eb38c54eaba77949b048a3621a5f4ca76e3) - - - - - 4643c440 by Andreas Klebinger at 2026-10-28T16:58:49+01:00 Configure: Fix check for --target support in stage0 CC The check FP_PROG_CC_LINKER_TARGET used $CC unconditionally to check for --target support. However this fails for the stage0 config where the C compiler used is not $CC but $CC_STAGE0. Since we already pass the compiler under test into the macro I simply changed it to use that instead. Fixes #26999 (cherry picked from commit 43638643adbe999de8d2288a40bdd15c602f6481) - - - - - a94e5be9 by Zubin Duggal at 2026-10-28T16:58:49+01: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 (cherry picked from commit 80e2dd4f084eff9cc857b31daf9ea2e9e460c727) - - - - - 51 changed files: - .gitlab-ci.yml - compiler/GHC/Cmm.hs - compiler/GHC/Cmm/InitFini.hs - compiler/GHC/Cmm/Sink.hs - compiler/GHC/CmmToAsm/AArch64/Ppr.hs - compiler/GHC/CmmToAsm/Format.hs - compiler/GHC/CmmToAsm/PPC/CodeGen.hs - compiler/GHC/CmmToAsm/Ppr.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToC.hs - compiler/GHC/CmmToLlvm.hs - compiler/GHC/CmmToLlvm/Base.hs - compiler/GHC/CmmToLlvm/Data.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Hs/Doc.hs - compiler/GHC/HsToCore/Foreign/C.hs - compiler/GHC/Tc/Solver/Dict.hs - docs/users_guide/rtd-theme/layout.html - hadrian/src/Builder.hs - hadrian/src/Settings/Builders/Ghc.hs - libraries/base/src/System/Info.hs - libraries/ghc-experimental/CHANGELOG.md - m4/fp_prog_cc_linker_target.m4 - rts/StgMiscClosures.cmm - rts/eventlog/EventLog.c - rts/linker/Elf.c - rts/linker/PEi386.c - rts/prim/atomic.c - + testsuite/tests/codeGen/should_run/T26537.hs - + testsuite/tests/codeGen/should_run/T26537.stdout - testsuite/tests/codeGen/should_run/all.T - + 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/linters/regex-linters/check-rts-includes.py - testsuite/tests/numeric/should_run/all.T - testsuite/tests/rts/all.T - testsuite/tests/showIface/DocsInHiFile1.stdout - testsuite/tests/showIface/HaddockSpanIssueT24378.stdout - testsuite/tests/showIface/MagicHashInHaddocks.stdout - + testsuite/tests/typecheck/should_compile/T26451.hs - testsuite/tests/typecheck/should_compile/all.T - + testsuite/tests/unboxedsums/T26542.hs - + testsuite/tests/unboxedsums/T26550.hs - + testsuite/tests/unboxedsums/T26550.stdout - testsuite/tests/unboxedsums/all.T - utils/ghc-pkg/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5a2563087f12bb6534a27d32fbb5f7f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5a2563087f12bb6534a27d32fbb5f7f... 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