[Git][ghc/ghc][wip/T23576] Remove workarounds

Jaro Reinders (@Noughtmare) gitlab at gitlab.haskell.org
Fri Jul 7 07:23:02 UTC 2023



Jaro Reinders pushed to branch wip/T23576 at Glasgow Haskell Compiler / GHC


Commits:
007cb402 by Jaro Reinders at 2023-07-07T09:22:54+02:00
Remove workarounds

- - - - -


3 changed files:

- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Utils/Unique.hs
- testsuite/tests/cmm/should_run/all.T


Changes:

=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -1993,7 +1993,8 @@ condIntCode' platform cond x y = do
 condFltCode :: Cond -> CmmExpr -> CmmExpr -> NatM CondCode
 
 -- Larger-than-native (64-bit ops on 32-bit platforms)
-condFltCode cond x y = condFltCode_sse2
+condFltCode cond x y
+  =  condFltCode_sse2
   where
 
 


=====================================
compiler/GHC/Utils/Unique.hs
=====================================
@@ -2,12 +2,12 @@
 
 {- Work around #23537
 
-On 32 bit systems, GHC's codegen around 64 bit numbers is not quite
-complete. This led to panics mentioning missing cases in iselExpr64.
-Now that GHC uses Word64 for its uniques, these panics have started
-popping up whenever a unique is compared to many other uniques in one
-function. As a workaround we use these two functions which are not
-inlined on 32 bit systems, thus preventing the panics.
+On 32 bit systems, GHC's codegen around 64 bit numbers used to be incomplete
+before GHC 9.10. This led to panics mentioning missing cases in iselExpr64.
+Now that GHC uses Word64 for its uniques, these panics have started popping up
+whenever a unique is compared to many other uniques in one function. As a
+workaround we use these two functions which are not inlined, on 32 bit systems
+and if compiled with versions before GHC 9.9, thus preventing the panics.
 -}
 
 module GHC.Utils.Unique (sameUnique, anyOfUnique) where
@@ -18,7 +18,7 @@ import GHC.Prelude.Basic (Bool, Eq((==)), Foldable(elem))
 import GHC.Types.Unique (Unique, Uniquable (getUnique))
 
 
-#if WORD_SIZE_IN_BITS == 32
+#if WORD_SIZE_IN_BITS == 32 && !MIN_VERSION_GLASGOW_HASKELL(9,9,0,0)
 {-# NOINLINE sameUnique #-}
 #else
 {-# INLINE sameUnique #-}
@@ -26,7 +26,7 @@ import GHC.Types.Unique (Unique, Uniquable (getUnique))
 sameUnique :: Uniquable a => a -> a -> Bool
 sameUnique x y = getUnique x == getUnique y
 
-#if WORD_SIZE_IN_BITS == 32
+#if WORD_SIZE_IN_BITS == 32 && !MIN_VERSION_GLASGOW_HASKELL(9,9,0,0)
 {-# NOINLINE anyOfUnique #-}
 #else
 {-# INLINE anyOfUnique #-}


=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -27,7 +27,6 @@ test('ByteSwitch',
 test('T22871',
      [    extra_run_opts('"' + config.libdir + '"')
      ,    req_cmm
-     ,    when(arch('i386'), skip) # x86 NCG panics with "iselExpr64(i386)"
      ],
      multi_compile_and_run,
      ['T22871', [('T22871_cmm.cmm', '')], ''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/007cb402b1ee14a6857977aa7b46890f6a3f6c25

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/007cb402b1ee14a6857977aa7b46890f6a3f6c25
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230707/4589f032/attachment-0001.html>


More information about the ghc-commits mailing list