# PSA: 9.2.1 AArch64 miscompilation

**URL:** <https://discourse.haskell.org/t/psa-9-2-1-aarch64-miscompilation/3638>\
**Category:** Uncategorized\
**Created:** [November 11, 2021, 9:39am UTC](https://discourse.haskell.org/t/psa-9-2-1-aarch64-miscompilation/3638 "2021-11-11T09:39:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![angerman](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/angerman/32/892_2.png) [@angerman](https://discourse.haskell.org/u/angerman)\
**Post date:** [November 11, 2021, 9:39am UTC](https://discourse.haskell.org/t/psa-9-2-1-aarch64-miscompilation/3638/1 "2021-11-11T09:39:27Z")

</div>

The slew of new changes in GHC 9.2.1, including all the work the lead to the lead to subword type info in Cmm to support the C Calling Convention on aarch64-darwin (Sidenote: you should use CApiFFI, and never CFFI if you use varargs, …), and subsequently led to subword primops, sadly also led to a set of low level miscompilations on the aarch64 backend.

This was tragically not caught by GHCs test-suite; a gaping coverage failure of GHC’s test suite. @bgamari has started building a quickcheck based tool [Ben Gamari / test-primops · GitLab](https://gitlab.haskell.org/bgamari/test-primops) to test these subword primops properly. GHC 9.2.2 should contain the following merge request, which should hopefully rectify all now _known_ bugs. [Draft: Various codegen fixes (!6934) · Merge requests · Glasgow Haskell Compiler / GHC · GitLab](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6934)

---

<div class="post-metadata">

**Author:** ![Bodigrim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/bodigrim/32/1457_2.png) [@Bodigrim](https://discourse.haskell.org/u/Bodigrim)\
**Post date:** [November 11, 2021, 6:57pm UTC](https://discourse.haskell.org/t/psa-9-2-1-aarch64-miscompilation/3638/2 "2021-11-11T18:57:15Z")

</div>

tl;dr Do not use GHC 9.2.1 on aarch64 (including Mac M1). A wide range of operations (e. g., anything dealing with Unicode) silently return incorrect results.

---

<div class="post-metadata">

**Author:** ![emilypi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/emilypi/32/5307_2.png) [@emilypi](https://discourse.haskell.org/u/emilypi)\
**Post date:** [November 11, 2021, 7:34pm UTC](https://discourse.haskell.org/t/psa-9-2-1-aarch64-miscompilation/3638/3 "2021-11-11T19:34:07Z")

</div>

Cheers thanks for the transparency Moritz. Things happen. Looking forward to the fix 👍
