Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC Commits: 1aa2821e by Simon Hengel at 2026-07-15T17:13:14+05:30 Reference correct package in error messages for reexported modules (fixes #27417) (cherry picked from commit a805b2a25021606b30d250e084d4beecbfac0d0a) - - - - - 112110e6 by Luite Stegeman at 2026-07-15T17:13:14+05:30 rts: handle large AP closures in compacting GC The function update_fwd_large in the compacting GC could run into an unexpected object with the following error: internal error: update_fwd_large: unknown/strange object 24 Closure type 24 is the AP closure, which was not handled in upd_fwd_large. This patch adds handling them. fixes #27434 (cherry picked from commit cca0d58963f802a8b2e43aa2dbc58592f8ad07bb) - - - - - faf5f76d by Cheng Shao at 2026-07-15T17:13:14+05:30 compiler: fix missing handling of CmmUnsafeForeignCall node in LayoutStack This patch fixes missing handling of `CmmUnsafeForeignCall` middle node in the `LayoutStack` pass. Before proc-points splitting, this pass computes liveliness of local registers, and spills those alive across a Cmm native call onto the stack. It need to traverse all middle nodes in each block and check whether a local register is an assignee, if so then the previous mapping in `sm_regs` is invalidated and needs to be dropped. However, it didn't handle `CmmUnsafeForeignCall` node which may also assign to a local register. When proc-points splitting is enabled, this can produce an invalid basic block that doesn't properly backup the updated local register to the stack before doing a Cmm call, resulting in completely invalid runtime behavior. The patch also adds a `T27447` regression test. With no-TNTC or with LLVM backend, without the fix the test case would output a stale 0x1111111111111111 value, instead of the expected 0x2222222222222222 output. Fixes #27447. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 3f00f234d0d5b3b3b2a23a5dc70ce372eb9bbdb4) - - - - - 2b55b40a by Cheng Shao at 2026-07-15T17:13:14+05:30 ci: use treeless fetch for perf notes This patch improves the ci logic for fetching perf notes by using treeless fetch (https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-s...), to avoid downloading all blobs of the perf notes repo at once, and only fetch the actually required blobs on-demand when needed. This makes the initial `test-metrics.sh pull` operation much faster, and also more robust, since we are seeing an increasing rate of 504 errors in CI when fetching all perf notes at once, which is a major source of CI flakiness at this point. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 3c0013778b4459c1f8e56cd0dc2600f5bb3769d2) - - - - - fcc4231f by mangoiv at 2026-07-15T17:13:14+05:30 ci: retry fetching test metrics Retry fetching test metrics to make the CI not fail if the services is temporarily unavailable (cherry picked from commit b7e24044fde064cb3f0d44c36872a86d024cd7d4) - - - - - 03a35805 by Zubin Duggal at 2026-07-15T17:13:15+05:30 Bump semaphore-compat submodule to 2.0.1 This versions includes some cruicial fixes for darwin (cherry picked from commit 4180af3f71754472dbd49b85179b25fd29bd9998) - - - - - c1c0031f by Zubin Duggal at 2026-07-15T17:13:15+05:30 CorePrep: Don't speculatively evaluate bindings that we have already discovered to be absent In #25924, we segfault because speculation forces a projection out of a RUBBISH dictionary (which we generated because it absent). Solution: Don't speculate on bindings we already know are absent. Fixes 25924 (cherry picked from commit 9b714c4c833461c621f0a050680848d7248aa57e) - - - - - 6e514e1d by Zubin Duggal at 2026-07-15T17:13:15+05:30 Don't make absent fillers for terminating types In #25924 we discovered that we could speculatively evaluate an absent filler for a dictionary, and project a field (a superclass selector) out of it, resulting in segfaults. Solution: Never make an absent filler or rubbish literal for a terminating type like a dictionary. mkAbsentFiller returns Nothing for isTerminatingType, so worker/wrapper and the specialiser keep the real argument instead. Some small metric decreases because we do a little less work in the simplifier now. Metric Decrease: T9872a T9872b T9872c TcPlugin_RewritePerf (cherry picked from commit 4a59b3eece9b7106fcbe73d2d06a49755be4ea8f) - - - - - 30f20fff by Andreas Klebinger at 2026-07-15T17:13:15+05:30 Fix a profiling race condition resulting in segfaults. StgToCmm: Don't assume tagged FUN closures in closureCodeBody. When entering a closure the self/node pointer might not be tagged in some situations when a thunk is evaluated by multiple threads. So we most AND away the tag bits rather than subtracting an expected tag. Apply.cmm: Fix a race condition occuring when a thunk is mutated during GC. In stg_ap_0_fast when might need to run GC before entering a thunk. If this happens another thread or the GC itself might mutate the closure making entering it no longer valid. We now check for this. Add test and changelog for #27123 fixes. (cherry picked from commit ed09895d7de1ca116a561868c151fd825a16ad0c) - - - - - 9f78fae4 by Cheng Shao at 2026-07-15T17:13:15+05:30 ghc-heap: fix invalid srtlen returned by peekItbl when no-TNTC This patch fixes the no-TNTC code path of `peekItbl` so that it looks at the right memory address when reading the `srt` field from the `StgInfoTable_` struct. Also adds a `T27465` regression test that reproduces the bug on no-TNTC builds before the fix. Fixes #27465. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 67c03eb2c762fdfeb646eb8345341173dd4268b2) - - - - - 7165f6cc by Cheng Shao at 2026-07-15T17:13:15+05:30 compiler: fix miscompiled %load_relaxed, add missing %store_relaxed This patch fixes the %load_relaxed cmm primop compilation logic to correctly use relaxed memory ordering, and adds the missing %store_relaxed primop. Parsing logic of %load/%store with explicit ordering is covered in the AtomicFetch test case. Fixes #27483. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit eee8ec5b25ef0f83ba4822e7a0a941df7b0bec5f) - - - - - 6c0eb2c7 by Cheng Shao at 2026-07-15T17:13:15+05:30 rts: fix missing UNTAG in stg_readTVarIOzh This patch fixes missing UNTAG on the current value closure read from StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word aligned; it may be a tagged closure, and reading info table from the tagged address is an unaligned load which may cause issues on platforms with strict alignment requirements. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit d377e83e51d39a06e1f0bf2e35a923a3210b21a2) - - - - - 77298354 by Cheng Shao at 2026-07-15T17:13:15+05:30 rts: fix missing UNTAG in stg_control0zh_ll This patch fixes missing UNTAG on the cont closure returned by captureContinuationAndAbort. In case it's not NULL, captureContinuationAndAbort returns a tagged StgContinuation closure, in which case it must be untagged before accessing the apply_mask_frame field. In the past it worked out of luck: when apply_mask_frame was NULL then mask_frame_offset is also 0 so the control flow didn't diverge to a wrong path. Still, this is horribly wrong and will crash once StgContinuation struct is refactored and fields are shuffled around. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 8ed038421a20e3e4e681973b2f5098e5bd2144b5) - - - - - 883a75bd by Cheng Shao at 2026-07-15T17:13:15+05:30 compiler: fix redundant AP thunk codegen when not using -ticky-ap-thunk This patch fixes a double negation confusion in !7525 that results in some redundant AP thunk code generation when not using -ticky-ap-thunk. Now, we use `stgToCmmUseStdApThunk` to indicate whether precomputed AP thunks in the RTS should be used, which defaults to `True`, unless `-ticky-ap-thunk` is passed. `-finfo-table-map` now also implies `-ticky-ap-thunk`, since when doing IPE profiling we want the generated AP thunks to be unique. Fixes #27502. ------------------------- Metric Decrease: T3064 ------------------------- Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 5aa7000ae246ae6a706437799338295b5801a629) - - - - - 60 changed files: - .gitlab/test-metrics.sh - + changelog.d/T27123.md - + changelog.d/fix-absent-dict-projection - + changelog.d/fix-cmm-atomic-load-store - + changelog.d/fix-compacting-gc-ap-27434 - + changelog.d/fix-layout-stack-fcall - + changelog.d/fix-peekitbl-no-tntc - + changelog.d/fix-use-std-ap-thunk - + changelog.d/reexported-module-errors - changelog.d/semaphore-v2 - compiler/GHC/Cmm/LayoutStack.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Config/StgToCmm.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Iface/Errors.hs - compiler/GHC/Iface/Errors/Ppr.hs - compiler/GHC/Iface/Errors/Types.hs - compiler/GHC/StgToCmm/Bind.hs - compiler/GHC/StgToCmm/Config.hs - compiler/GHC/Types/Literal.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Unit/Finder/Types.hs - compiler/GHC/Unit/State.hs - ghc/GHCi/UI/Exception.hs - hadrian/src/Settings/Warnings.hs - + libraries/ghc-heap/tests/T27465.hs - + libraries/ghc-heap/tests/T27465.stdout - libraries/ghc-heap/tests/all.T - libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc - libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc - libraries/semaphore-compat - rts/Apply.cmm - rts/ContinuationOps.cmm - rts/PrimOps.cmm - rts/sm/Compact.c - testsuite/tests/cmm/should_run/AtomicFetch.hs - testsuite/tests/cmm/should_run/AtomicFetch_cmm.cmm - + testsuite/tests/cmm/should_run/T27447.hs - + testsuite/tests/cmm/should_run/T27447.stdout - + testsuite/tests/cmm/should_run/T27447_cmm.cmm - testsuite/tests/cmm/should_run/all.T - + testsuite/tests/core-to-stg/T25924/B.hs - + testsuite/tests/core-to-stg/T25924/Main.hs - + testsuite/tests/core-to-stg/T25924/all.T - + testsuite/tests/core-to-stg/T25924a.hs - + testsuite/tests/core-to-stg/T25924a.stdout - testsuite/tests/core-to-stg/all.T - testsuite/tests/dmdanal/should_compile/T18982.stderr - + testsuite/tests/package/ImportReexport.hs - + testsuite/tests/package/ImportReexport.stderr - testsuite/tests/package/all.T - + testsuite/tests/rts/T27123.hs - + testsuite/tests/rts/T27434.hs - + testsuite/tests/rts/T27434.stdout - testsuite/tests/rts/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0906c7dc9fad3de876ad3246eb02381... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0906c7dc9fad3de876ad3246eb02381... 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
participants (1)
-
Zubin (@wz1000)