.. _release-9-4-5:

Version 9.4.5
==============

The significant changes to the various parts of the compiler are listed in the
following sections.

The :ghc-flag:`LLVM backend <-fllvm>` of this release is to be used with LLVM
10, 11, 12, 13, or 14.

Significant Changes
~~~~~~~~~~~~~~~~~~~~

Issues fixed in this release include:

Compiler
--------

- Fix a compiler bug where programs using Template Haskell involving Constant
  Applicative forms could be garbage collected too early (:ghc-ticket:`22417`).

- Fix a shadowing related bug in the occurence analysis phase of the simplifier
  (:ghc-ticket:`22623`).

- Fix a regression in the typechecker where certain typeclass instances
  involving type and data familes would fail to resolve (:ghc-ticket:`22647`,
  :ghc-ticket:`23134`).

- Fix a regression in the constrain solver which resulted in a loop when trying
  to expand superclasses (:ghc-ticket:`22516`).

- Fix the linker warning about chained fixups on Darwin platforms for programs
  compiled with GHC (:ghc-ticket:`22429`).

- Fix a compiler panic in the demand analyser due to a bug involving shadowing
  (:ghc-ticket:`22718`).

- Fix a driver bug where certain non-fatal Safe Haskell related warnings were
  being marked as fatal (:ghc-ticket:`22728`).

- Fix a bug to do with missing parenthesis while printing splices with
  ``-ddump-splices`` (:ghc-ticket:`22784`).

- Fix a bug with the graph-colouring register allocater leading to compiler
  panics when compiling with ``-fregs-graph`` (:ghc-ticket:`22798`, 
 :ghc-ticket:`23002`).

- Fix a bug to do with code emitted on Darwin platforms using
  relocations not supported on the platform (:ghc-ticket:`21972`).

- Improve performance for code generated by the native code generator on
  x86 for programs involving atomic counters (:ghc-ticket:`22764`).

- Fix core lint errors arising from incorrect scoping of type variables
  within ``SPECIALISE`` pragmas occuring in ``instance`` definitions
  (:ghc-ticket:`22913`).

- Fix core lint errors arising from an incorrect type given to the
  ``decodeDouble_Int64`` rule (:ghc-ticket:`23019`).

- Improve code generation for bitmasks on AArch64 with the native code
  generator (:ghc-ticket:`23030`).

- Many improvements to recompilation checking with multiple home units
  (:ghc-ticket:`22675`, :ghc-ticket:`22677`, :ghc-ticket:`22669`, :ghc-ticket:`22678`,
   :ghc-ticket:`22679`, :ghc-ticket:`22680`).

- Fix a spurious warning with ``-Wmissing-home-modules`` (:ghc-ticket:`22676`).

- Fix a typechecker panic on certain programs involving representation polymorphism
  (:ghc-ticket:`22743`). 

- Fix bugs to do with GHCi and compiler loops pariticularly when using ``-dppr-debug``
  (:ghc-ticket:`22695`).

- Fix memory leak in the compiler and in GHCi, including a bug where old
  environments would persist on reloading (:ghc-ticket:`22530`, :ghc-ticket:`22833`).

- Fix a miscompilation due to a simplifier bug (:ghc-ticket:`23184`).

- Fix a miscompilation to do with unlifted bindings due to a bug in the specialiser
  (:ghc-ticket:`22998`).

- Fix a compiler panic during the "Float In" optimsation pass due to improper
  handling of shadowing (:ghc-ticket:`22662`).

- Fix a compiler panic when compiling certain programs involving representation
  polymoprhism with optimisation (:ghc-ticet:`22725`).

Runtime system
--------------

- Fix a GC bug where a race condition in the parallel GC could cause it to
  garbage collect live sparks (:ghc-ticket:`22528`).

- Truncate eventlog events with a large payload (:ghc-ticket:`20221`).

- Fix a bug with the alignment of RTS data structures that could result in
  segfaults when compiled with high optimisation settings on certain platforms
  (:ghc-ticket:`22975` , :ghc-ticket:`22965`).

- Take section alignment into account in the RTS linker (:ghc-ticket:`23066`).

- Fix a bug causing segfaults where certain sections of the RTS would assume
  that the number of capabilites was equal to the number passed via the command
  line, even though the number of capabilites can be dynamically changed
  (:ghc-ticket:`23088`).

- Fix a race with the nonmoving GC (:ghc-ticket:`23170`).

- A bug in the nonmoving garbage collector regarding the treatment of
  zero-length ``SmallArray#``\ s has been fixed (:ghc-ticket:`22264`).

- A number of bugs regarding the non-moving garbage collector's treatment of
  ``Weak#`` pointers have been fixed (:ghc-ticket:`22327`).

- A few race conditions between the non-moving collector and
  ``setNumCapabilities`` which could result in undefined behavior have been
  fixed (:ghc-ticket:`22926`, :ghc-ticket:`22927`).

- The non-moving collector is now able to better schedule marking work during
  the post-mark synchronization phase of collection, significantly reducing
  pause times in some workloads (:ghc-ticket:`22929`).

- Various bugs in the non-moving collector's implementation of the selector
  optimisation have been fixed (:ghc-ticket:`22930`).

- Accounting for live bytes is now performed accurately when using the
  non-moving GC (:ghc-ticket:`17574`).

- Allow performing memory inventory with the non-moving GC (:ghc-ticket:`21840`).

Build system and packaging
--------------------------

- Bump ``gmp-tarballs`` to a version which doesn't use the reserved ``x18``
  register on AArch64/Darwin systems, and also has fixes for CVE-2021-43618
  (:ghc-ticket:`22497`, :ghc-ticket:`22789`).

- Remove quarantine attribute when installing binary distribution on MacOS
  (:ghc-ticket:`21506`, :ghc-ticket:`23009`).

- Fail in the binary distribution ``configure`` script if ``find`` is not
  available (:ghc-ticket:`22691`).

- Install manpages with the binary distribution (:ghc-ticket:`22371`).

- Fix a bug to do with merging of archives causing GHC to fail to bootstrap
  on Windows (:ghc-ticket:`21990`).

- Hadrian bug fixes to do with building a Windows cross compiler
  (:ghc-ticket:`20697`, :ghc-ticket:`22805`).

- Fix escaping of ``$tooldir`` in the ``configure`` script (:ghc-ticket:`22561`).

- Allow LLVM 14 and use it for the Windows toolchain (:ghc-ticket:`21964`).

Core libraries
--------------

- Bump ``base`` to 4.17.1.0

- base: Remove ``mingwex`` dependency on Windows (:ghc-ticket:`22166`).

- base: Fix inconsistency with decoding terminal input on Windows (:ghc-ticket:`21488`).

- Bump ``bytestring`` to 0.11.4.0

- Bump``parsec`` to 3.1.16.1

- Bump ``text`` to 2.0.2

- Bump ``containers`` to 0.6.7

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.

.. ghc-package-list::

    libraries/array/array.cabal:             Dependency of ``ghc`` library
    libraries/base/base.cabal:               Core library
    libraries/binary/binary.cabal:           Dependency of ``ghc`` library
    libraries/bytestring/bytestring.cabal:   Dependency of ``ghc`` library
    libraries/Cabal/Cabal/Cabal.cabal:       Dependency of ``ghc-pkg`` utility
    libraries/Cabal/Cabal-syntax/Cabal-syntax.cabal:  Dependency of ``ghc-pkg`` utility
    libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library
    libraries/deepseq/deepseq.cabal:         Dependency of ``ghc`` library
    libraries/directory/directory.cabal:     Dependency of ``ghc`` library
    libraries/exceptions/exceptions.cabal:   Dependency of ``ghc`` and ``haskeline`` library
    libraries/filepath/filepath.cabal:       Dependency of ``ghc`` library
    compiler/ghc.cabal:                      The compiler itself
    libraries/ghci/ghci.cabal:               The REPL interface
    libraries/ghc-boot/ghc-boot.cabal:       Internal compiler library
    libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library
    libraries/ghc-compact/ghc-compact.cabal: Core library
    libraries/ghc-heap/ghc-heap.cabal:       GHC heap-walking library
    libraries/ghc-prim/ghc-prim.cabal:       Core library
    libraries/haskeline/haskeline.cabal:     Dependency of ``ghci`` executable
    libraries/hpc/hpc.cabal:                 Dependency of ``hpc`` executable
    libraries/integer-gmp/integer-gmp.cabal: Core library
    libraries/libiserv/libiserv.cabal:       Internal compiler library
    libraries/mtl/mtl.cabal:                 Dependency of ``Cabal`` library
    libraries/parsec/parsec.cabal:           Dependency of ``Cabal`` library
    libraries/pretty/pretty.cabal:           Dependency of ``ghc`` library
    libraries/process/process.cabal:         Dependency of ``ghc`` library
    libraries/stm/stm.cabal:                 Dependency of ``haskeline`` library
    libraries/template-haskell/template-haskell.cabal: Core library
    libraries/terminfo/terminfo.cabal:       Dependency of ``haskeline`` library
    libraries/text/text.cabal:               Dependency of ``Cabal`` library
    libraries/time/time.cabal:               Dependency of ``ghc`` library
    libraries/transformers/transformers.cabal: Dependency of ``ghc`` library
    libraries/unix/unix.cabal:               Dependency of ``ghc`` library
    libraries/Win32/Win32.cabal:             Dependency of ``ghc`` library
    libraries/xhtml/xhtml.cabal:             Dependency of ``haddock`` executable

