Version 9.10.2

The significant changes to the various parts of the compiler are listed in the following sections. See the migration guide on the GHC Wiki for specific guidance on migrating programs to this release.

Language

Compiler

  • Optimized lowering of BigNat# literals. ((#23942), !12179)

  • Fixed a bug where the jump shortcutting optimization could lead to unsoundness in pattern matching. ((#24507))

  • Look for haskell symbols only in relevant libraries. ((#23415))

    When dynamically loading a Haskell symbol (typical when running a splice or GHCi expression), before this change we would search for the symbol in all dynamic libraries that were loaded. However, this could be very inefficient when too many packages are loaded (which can happen if there are many package dependencies) because the time to lookup the would be linear in the number of packages loaded.

    In one measurement, this improved performance for executing a GHCi expression from ~38 seconds down to ~2s.

  • Fixed a bug that could cause a linker error when TypeData and StrictData where used in combination. ((#24620))

  • The flag -fprof-late when combined with -prof will no longer prevent top level constructors from being statically allocated.

    It used to be the case that we would add a cost centre for bindings like foo = Just bar. This turned the binding into a caf that would allocate the constructor on first evaluation.

    However without the cost centre foo can be allocated at compile time. This reduces code-bloat and reduces overhead for short-running applications.

    The tradeoff is that calling whoCreated on top level value definitions like foo will be less informative.

  • IPE profiling - optimize the representation of some internal representations. Leading to smaller executables. ((#24504))

  • Fixed an issue where -Wmissing-home-modules caused quadratic compile time increases. ((#24778))

  • Fixed a crash when using -prof with -forig-thunk-info. ((#24809))

  • Better type inference in certain situations. ((#24810))

  • Fixed a bug where the magic inline function sometimes failed to inline functions if there were coercions involved. ((#24808))

  • Fixed a bug where the simplifier sometimes destroyed join points during float out. ((#24768))

  • PPC NCG: Fix sign hints in C calls. This bug caused segfaults when using FFI under some circumstances. ((#23034))

  • Fixed a bug that caused GHC to panic when using the aarch64 ncg and -fregs-graph on certain programs. ((#24941))

  • The flag -fkeep-auto-rules that forces GHC to keep auto generated specialization rules was added. It was actually added ghc-9.10.1 already but mistakenly not mentioned in the 9.10.1 changelog.

  • Fixed re-exports of MkSolo (#25182)

  • Fixed the behavior of Language.Haskell.TH.mkName "FUN" (#25174)

  • Various code generation improvements to the ARM backend.

  • Fixed a bug that could case segfaults in GHCi when -fworker-wrapper-cbv was enabled. ((#24870))

  • Fixed a correctness issues for Int64/Word64 on 32bit backends ((#24893))

  • Various rts linker improvements: - R_X86_64_PC64 relocation support on windows - Use m32 allocator for sections when NEED_PLT - works around ((#24432)) - AArch64 - Skip NONE relocations

  • AArch64 ncg: Multiway branches are now lowered to jump tables for better performance. ((#19912))

  • Fixes related to better use of sse4 when using the llvm backend: - Use +sse4.2 rather than +sse42, fixing ((#25019)), - make SSE4.2 imply +popcnt, fixing ((#25353)).

  • Fixed a bug where the use of throw caused a loss of strictness ((#25066)).

  • Fixed incorrect behaviour that could occur when using control0#/prompt# ((#25439)) by making prompt# lazy.

  • Fixed a bug where ghc paniced during type checking. ((#25325))

  • Fix linearity for strict unit patterns in a local let bindings. ((#25428))

  • Improve the performance of type family consistency checks. ((#25554))

  • Fixed a bug where type checking failed to terminate. ((#25597))

  • Fixed a bug where __GLASGOW_HASKELL_LLVM__ was not defined even if -fllvm was set. ((#25606))

  • Added flags to control speculative evaluation: -fspec-eval and -fspec-eval-dictfun. This allows users to work around cases where recent changes to speculative evaluation caused performance regressions. ((#25606))

JavaScript backend

  • Changes for better support of the Google Closure Compiler ((#24602), !12330)

  • JS Backend: support rubbish static literals

  • Fix h$withCStringOnHeap helper ((#25288))

WebAssembly backend

  • wasm: use scheduler.postTask() for context switch when available

  • The in tree gmp library now is configured to produce faster and smaller code given the current constraints of the wasm backend. (!12592)

GHCi

  • When using XDG directories .ghci_history now uses the $XDG_DATA_HOME variable as expected. ((#24266))

  • Replaced some uses of lists with Arrays for better performance during bytecode compilation.

  • GHCi: support cross-module inlining of breakpoints. Fixing (#24712)

  • Fix a bug where GHCi would not start alongside a local file called Prelude.hs or Prelude.lhs (#10920).

  • Fixed a panic in the ghci debugger when using breakpoints around field selectors. ((#25109))

  • Fixed a bug (#25150) where ghc would not consider -working-dir when looking for foreign files.

Runtime system

  • Memory return logic now uses live bytes rather than live blocks to measure the size of the heap. This primarily affects the non-moving GC, which should now be more willing to return memory to the OS. Users who have fine-tuned the -F ⟨factor⟩, -Fd ⟨factor⟩, or -O ⟨size⟩ flags, and use the non-moving GC, should see if adjustments are needed in light of this change.

  • Reduce fragmentation incurred by the nonmoving GC’s segment allocator. In one application this reduced resident set size by 26%. See #24150.

  • Emit warning when -M < -H.

  • Fix a bug ((#24672)) causing programms on FreeBSD to occasionally terminate with the error: internal error: Ticker: read(timerfd) failed with Operation not supported and returned -1

  • Fixed a bug ((#25503)) that sometimes caused the rts to terminate with internal error: alloc_adjustor_chunk: failed to allocate on windows. This primarily affect programs making use of the foreign import "wrapper" functionality.

  • Fixed a bug in compacting gc that could result in program termination with update_fwd_large: unknown/strange object  38 ((#24791)).

  • Fixed a bug where calling setNumCapabilities with a argument larger than 256 caused crashes. (#25560)

Build system and packaging

  • Escape argument strings when storing them in the settings file. Fixes (#24265)

  • Updated autoconf scripts to commit 948ae97ca5703224bd3eada06b7a69f40dd15a02 (dated 2024-01-01). (From https://git.savannah.gnu.org/cgit/config.git/)

  • GHC now distinguishes more between the Cmm and C preprocessor. The new flags -pgmCmmP and -optCmmP can be used to control the Cmm preprocessor. C preprocessor flags will still be passed to the Cmm preprocessor, expect for -g flags which have special handling. Fixes (#24474)

  • Bindists: Fixed a bug in the Makefile which caused windows installs to duplicate files. ((#24800))

  • The packages ghc-internal and ghc-experimental are now versioned based on the GHC version they are shipped with.

  • Fixed a bug where running Xelatex concurrently failed. (#25564)

  • Fixed a bug where building ghc from source using ghc-9.8.4 failed with an error mentioning ghc_unique_counter64. (#25576)

base library

ghc-prim library

ghc library

  • Added some utility functions to GHC.Data.SmallArray

ghc-heap library

  • Fix typo in ghc-heap cbits that caused compilation errors when assertions were enabled.

ghc-experimental library

  • Primops and other ghc extensions are now exported via GHC.PrimOps

  • The library is now versioned according to the ghc version it shipped with.

template-haskell library

Included libraries

The package database provided with this distribution also contains a number of packages other than GHC itself. See the changelogs provided with these packages for further change information.