10 Jun '26
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC
Commits:
380ba599 by Cheng Shao at 2026-06-11T01:31:40+05:30
ghci: fix unused imports
This commit fixes unused imports in `ghci` which should have been
caught by the `validate` flavour but was warnings in CI due to the
recent `+werror` regression. Fixes #26987 #27059.
(cherry picked from commit da946a16575a3b261206b75ce958b90b86a5e801)
- - - - -
2 changed files:
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Server.hs
Changes:
=====================================
libraries/ghci/GHCi/Message.hs
=====================================
@@ -70,7 +70,6 @@ import qualified GHC.Boot.TH.Syntax as TH
import System.Exit
import System.IO
import System.IO.Error
-import Data.Word (Word8)
-- -----------------------------------------------------------------------------
-- The RPC protocol between GHC and the interactive server
=====================================
libraries/ghci/GHCi/Server.hs
=====================================
@@ -26,7 +26,6 @@ import GHC.Wasm.Prim
#else
import GHCi.Utils
#endif
-import Data.Word (Word8)
import Control.DeepSeq
import Control.Exception
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/380ba599ef762082f7d9c4917ea0fec…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/380ba599ef762082f7d9c4917ea0fec…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/21176-integer-bits] Add explicit setBit/clearBit/complementBit for instance Bits Integer (#21176)
by Simon Jakobi (@sjakobi2) 10 Jun '26
by Simon Jakobi (@sjakobi2) 10 Jun '26
10 Jun '26
Simon Jakobi pushed to branch wip/sjakobi/21176-integer-bits at Glasgow Haskell Compiler / GHC
Commits:
3b1786b0 by Simon Jakobi at 2026-06-10T19:18:49+02:00
Add explicit setBit/clearBit/complementBit for instance Bits Integer (#21176)
The default setBit, clearBit, and complementBit methods allocate
intermediate Integers per call. Define them explicitly via the new
integerSetBit[#], integerClearBit[#] and integerComplementBit[#], built
on the BigNat# primitives, which avoid those allocations. Allocation is not
eliminated entirely -- the negative (IN) cases would need in-place mutation,
which is left as future work.
The default methods constant-folded on literal arguments via the
integerOr/integerAnd/integerXor rules, which fold literal Integers of any
size. The explicit functions have no such rule, so they (their Word-argument
wrappers, and the Bits Integer methods) are marked INLINE to expose the
underlying primops to the simplifier; see Note [INLINE for constant folding
of bit operations]. This restores folding only on the small-int (IS) path --
large literal Integers (IP/IN) are no longer constant-folded, a minor
regression for that case. T8832 covers the IS-path folding.
The new golden-output test T21176 checks all three operations against the
default implementations across the sign/size boundaries, recording each
result plus its integerCheck validity. The base and ghc-bignum interface-
stability export goldens gain the new functions.
The main changelog entry lives in changelog.d under a new ghc-internal
section (renamed from ghc-prim).
Co-Authored-By: Claude Opus 4.7 <noreply(a)anthropic.com>
- - - - -
11 changed files:
- + changelog.d/T21176
- changelog.d/config
- libraries/base/changelog.md
- libraries/ghc-internal/src/GHC/Internal/Bignum/Integer.hs
- libraries/ghc-internal/src/GHC/Internal/Bits.hs
- testsuite/tests/interface-stability/ghc-bignum-exports.stdout
- + testsuite/tests/numeric/should_run/T21176.hs
- + testsuite/tests/numeric/should_run/T21176.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/simplCore/should_compile/T8832.hs
- testsuite/tests/simplCore/should_compile/T8832.stdout
Changes:
=====================================
changelog.d/T21176
=====================================
@@ -0,0 +1,4 @@
+section: ghc-internal
+synopsis: Give ``setBit``, ``clearBit`` and ``complementBit`` explicit definitions in ``instance Bits Integer``, backed by new ``integerSetBit[#]``, ``integerClearBit[#]`` and ``integerComplementBit[#]`` functions. These avoid the intermediate ``Integer`` allocations of the previous default methods, although allocation is not eliminated entirely — notably the negative (``IN``) cases would require in-place mutation, which is left as future work. As a trade-off, constant folding of these operations now applies only to small (machine-word-sized) literal arguments; the previous default methods folded literal ``Integer`` arguments of any size via the ``integerOr``/``integerAnd``/``integerXor`` rules.
+issues: #21176
+mrs: !7772
=====================================
changelog.d/config
=====================================
@@ -27,7 +27,7 @@ sections: {
cmm Cmm
build-tools Build tools
base ``base`` library
- ghc-prim ``ghc-prim`` library
+ ghc-internal ``ghc-internal`` library
ghc-lib ``ghc`` library
ghc-heap ``ghc-heap`` library
ghc-experimental ``ghc-experimental`` library
=====================================
libraries/base/changelog.md
=====================================
@@ -1,6 +1,7 @@
# Changelog for [`base` package](http://hackage.haskell.org/package/base)
## 4.24.0.0 *TBA*
+ * Give `setBit`, `clearBit` and `complementBit` explicit definitions in `instance Bits Integer`, reducing intermediate allocations. ([GHC #21176](https://gitlab.haskell.org/ghc/ghc/-/issues/21176))
* Add `Bounded` instances for `Double`, `Float`, `CDouble` and `CFloat`. ([CLC proposal #402](https://github.com/haskell/core-libraries-committee/issues/402))
* Ensure that `Data.List.elem` and `notElem` can be specialized even when no list fusion happens. ([CLC proposal #412)(https://github.com/haskell/core-libraries-committee/issues/412))
=====================================
libraries/ghc-internal/src/GHC/Internal/Bignum/Integer.hs
=====================================
@@ -133,6 +133,12 @@ module GHC.Internal.Bignum.Integer
, integerBit
, integerTestBit#
, integerTestBit
+ , integerSetBit#
+ , integerSetBit
+ , integerClearBit#
+ , integerClearBit
+ , integerComplementBit#
+ , integerComplementBit
, integerShiftR#
, integerShiftR
, integerShiftL#
@@ -707,6 +713,113 @@ integerTestBit# (IN x) i
integerTestBit :: Integer -> Word -> Bool
integerTestBit !i (W# n) = isTrue# (integerTestBit# i n)
+{- Note [INLINE for constant folding of bit operations]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+While there are no dedicated constant-folding rules for
+integerSetBit#/integerClearBit#/integerComplementBit#, we do INLINE them (and
+their Word-argument wrappers and the corresponding Bits Integer methods) to make
+the underlying primops accessible for constant folding, e.g. so that
+`clearBit (bit 0) 0 :: Integer` folds to `IS 0#`. Test T8832 checks the folding
+for all three operations.
+-}
+
+-- | Set the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerSetBit# :: Integer -> Word# -> Integer
+{-# INLINE integerSetBit# #-} -- See Note [INLINE for constant folding of bit operations]
+integerSetBit# n@(IS x) i
+ | isTrue# (i `ltWord#` (WORD_SIZE_IN_BITS## `minusWord#` 1##))
+ = IS (x `orI#` uncheckedIShiftL# 1# (word2Int# i))
+ | isTrue# (x >=# 0#)
+ = IP (bigNatSetBit# (bigNatFromWord# (int2Word# x)) i)
+ | True
+ = n
+integerSetBit# (IP x) i = IP (bigNatSetBit# x i)
+integerSetBit# (IN x) i = integerFromBigNatNeg#
+ (bigNatAddWord#
+ (bigNatClearBit# (bigNatSubWordUnsafe# x 1##) i)
+ 1##)
+
+-- | Set the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerSetBit :: Integer -> Word -> Integer
+{-# INLINE integerSetBit #-} -- See Note [INLINE for constant folding of bit operations]
+integerSetBit !i (W# n) = integerSetBit# i n
+
+-- | Clear the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerClearBit# :: Integer -> Word# -> Integer
+{-# INLINE integerClearBit# #-} -- See Note [INLINE for constant folding of bit operations]
+integerClearBit# n@(IS x) i
+ | isTrue# (i `ltWord#` (WORD_SIZE_IN_BITS## `minusWord#` 1##))
+ = IS (x `andI#` notI# (uncheckedIShiftL# 1# (word2Int# i)))
+ | isTrue# (x >=# 0#)
+ = n
+ | True
+ = IN (bigNatAddWord#
+ (bigNatSetBit#
+ (bigNatFromWord#
+ (minusWord# (int2Word# (negateInt# x)) 1##))
+ i)
+ 1##)
+integerClearBit# (IP x) i = integerFromBigNat# (bigNatClearBit# x i)
+integerClearBit# (IN x) i = IN (bigNatAddWord#
+ (bigNatSetBit# (bigNatSubWordUnsafe# x 1##) i)
+ 1##)
+
+-- | Clear the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerClearBit :: Integer -> Word -> Integer
+{-# INLINE integerClearBit #-} -- See Note [INLINE for constant folding of bit operations]
+integerClearBit !i (W# n) = integerClearBit# i n
+
+-- | Reverse the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerComplementBit# :: Integer -> Word# -> Integer
+{-# INLINE integerComplementBit# #-} -- See Note [INLINE for constant folding of bit operations]
+integerComplementBit# (IS x) i
+ | isTrue# (i `ltWord#` (WORD_SIZE_IN_BITS## `minusWord#` 1##))
+ = IS (x `xorI#` uncheckedIShiftL# 1# (word2Int# i))
+ | isTrue# (x >=# 0#)
+ = IP (bigNatSetBit# (bigNatFromWord# (int2Word# x)) i)
+ | True
+ = IN (bigNatAddWord#
+ (bigNatSetBit#
+ (bigNatFromWord# (minusWord# (int2Word# (negateInt# x)) 1##))
+ i)
+ 1##)
+integerComplementBit# (IP x) i = integerFromBigNat# (bigNatComplementBit# x i)
+integerComplementBit# (IN x) i = integerFromBigNatNeg#
+ (bigNatAddWord#
+ (bigNatComplementBit#
+ (bigNatSubWordUnsafe# x 1##)
+ i)
+ 1##)
+
+-- | Reverse the /n/-th bit.
+--
+-- Fake 2's complement for negative values (might be slow)
+--
+-- @since 10.201.0
+integerComplementBit :: Integer -> Word -> Integer
+{-# INLINE integerComplementBit #-} -- See Note [INLINE for constant folding of bit operations]
+integerComplementBit !i (W# n) = integerComplementBit# i n
+
-- | Shift-right operation
--
-- Fake 2's complement for negative values (might be slow)
=====================================
libraries/ghc-internal/src/GHC/Internal/Bits.hs
=====================================
@@ -564,6 +564,15 @@ instance Bits Integer where
| otherwise = integerShiftR x (fromIntegral (negate i))
testBit x i = integerTestBit x (fromIntegral i)
zeroBits = integerZero
+ -- INLINE on setBit/clearBit/complementBit preserves constant folding;
+ -- see Note [INLINE for constant folding of bit operations] in
+ -- GHC.Internal.Bignum.Integer.
+ setBit x i = integerSetBit x (fromIntegral i)
+ {-# INLINE setBit #-}
+ clearBit x i = integerClearBit x (fromIntegral i)
+ {-# INLINE clearBit #-}
+ complementBit x i = integerComplementBit x (fromIntegral i)
+ {-# INLINE complementBit #-}
bit (I# i) = integerBit# (int2Word# i)
popCount x = I# (integerPopCount# x)
=====================================
testsuite/tests/interface-stability/ghc-bignum-exports.stdout
=====================================
@@ -201,8 +201,12 @@ module GHC.Num.Integer where
integerBit# :: GHC.Internal.Prim.Word# -> Integer
integerCheck :: Integer -> GHC.Internal.Types.Bool
integerCheck# :: Integer -> GHC.Internal.Bignum.Primitives.Bool#
+ integerClearBit :: Integer -> GHC.Internal.Types.Word -> Integer
+ integerClearBit# :: Integer -> GHC.Internal.Prim.Word# -> Integer
integerCompare :: Integer -> Integer -> GHC.Internal.Types.Ordering
integerComplement :: Integer -> Integer
+ integerComplementBit :: Integer -> GHC.Internal.Types.Word -> Integer
+ integerComplementBit# :: Integer -> GHC.Internal.Prim.Word# -> Integer
integerDecodeDouble# :: GHC.Internal.Prim.Double# -> (# Integer, GHC.Internal.Prim.Int# #)
integerDiv :: Integer -> Integer -> Integer
integerDivMod :: Integer -> Integer -> (Integer, Integer)
@@ -266,6 +270,8 @@ module GHC.Num.Integer where
integerQuotRem# :: Integer -> Integer -> (# Integer, Integer #)
integerRecipMod# :: Integer -> GHC.Internal.Bignum.Natural.Natural -> (# GHC.Internal.Bignum.Natural.Natural | () #)
integerRem :: Integer -> Integer -> Integer
+ integerSetBit :: Integer -> GHC.Internal.Types.Word -> Integer
+ integerSetBit# :: Integer -> GHC.Internal.Prim.Word# -> Integer
integerShiftL :: Integer -> GHC.Internal.Types.Word -> Integer
integerShiftL# :: Integer -> GHC.Internal.Prim.Word# -> Integer
integerShiftR :: Integer -> GHC.Internal.Types.Word -> Integer
=====================================
testsuite/tests/numeric/should_run/T21176.hs
=====================================
@@ -0,0 +1,37 @@
+module Main where
+
+import Data.Bits
+import Data.Int (Int32, Int64)
+import Data.Foldable (for_)
+import GHC.Num.Integer (integerCheck)
+
+integers :: [Integer]
+integers = concatMap neighbours [minInt64, minInt32, 0, maxInt32, maxInt64]
+ where
+ neighbours i = [i - 2, i - 1, i, i + 1, i + 2]
+ minInt64 = toInteger (minBound :: Int64)
+ minInt32 = toInteger (minBound :: Int32)
+ maxInt32 = toInteger (maxBound :: Int32)
+ maxInt64 = toInteger (maxBound :: Int64)
+
+bits :: [Int]
+bits = [0, 1, 62, 63, 64]
+
+testXBit :: String -> (Integer -> Int -> Integer) -> (Integer -> Int -> Integer) -> IO ()
+testXBit name f model = do
+ putStrLn name
+ for_ integers $ \i ->
+ for_ bits $ \b -> do
+ let actual = f i b
+ expected = model i b
+ valid = if integerCheck actual then "valid" else "invalid"
+ matches = if actual == expected then "matches" else "differs"
+ putStrLn $ " " ++ show i ++ " " ++ show b ++ " -> " ++ show actual
+ ++ " [" ++ valid ++ ", " ++ matches ++ "]"
+ putStrLn ""
+
+main :: IO ()
+main = do
+ testXBit "setBit" setBit (\i b -> i .|. bit b)
+ testXBit "clearBit" clearBit (\i b -> i .&. complement (bit b))
+ testXBit "complementBit" complementBit (\i b -> i `xor` bit b)
=====================================
testsuite/tests/numeric/should_run/T21176.stdout
=====================================
@@ -0,0 +1,381 @@
+setBit
+ -9223372036854775810 0 -> -9223372036854775809 [valid, matches]
+ -9223372036854775810 1 -> -9223372036854775810 [valid, matches]
+ -9223372036854775810 62 -> -9223372036854775810 [valid, matches]
+ -9223372036854775810 63 -> -2 [valid, matches]
+ -9223372036854775810 64 -> -9223372036854775810 [valid, matches]
+ -9223372036854775809 0 -> -9223372036854775809 [valid, matches]
+ -9223372036854775809 1 -> -9223372036854775809 [valid, matches]
+ -9223372036854775809 62 -> -9223372036854775809 [valid, matches]
+ -9223372036854775809 63 -> -1 [valid, matches]
+ -9223372036854775809 64 -> -9223372036854775809 [valid, matches]
+ -9223372036854775808 0 -> -9223372036854775807 [valid, matches]
+ -9223372036854775808 1 -> -9223372036854775806 [valid, matches]
+ -9223372036854775808 62 -> -4611686018427387904 [valid, matches]
+ -9223372036854775808 63 -> -9223372036854775808 [valid, matches]
+ -9223372036854775808 64 -> -9223372036854775808 [valid, matches]
+ -9223372036854775807 0 -> -9223372036854775807 [valid, matches]
+ -9223372036854775807 1 -> -9223372036854775805 [valid, matches]
+ -9223372036854775807 62 -> -4611686018427387903 [valid, matches]
+ -9223372036854775807 63 -> -9223372036854775807 [valid, matches]
+ -9223372036854775807 64 -> -9223372036854775807 [valid, matches]
+ -9223372036854775806 0 -> -9223372036854775805 [valid, matches]
+ -9223372036854775806 1 -> -9223372036854775806 [valid, matches]
+ -9223372036854775806 62 -> -4611686018427387902 [valid, matches]
+ -9223372036854775806 63 -> -9223372036854775806 [valid, matches]
+ -9223372036854775806 64 -> -9223372036854775806 [valid, matches]
+ -2147483650 0 -> -2147483649 [valid, matches]
+ -2147483650 1 -> -2147483650 [valid, matches]
+ -2147483650 62 -> -2147483650 [valid, matches]
+ -2147483650 63 -> -2147483650 [valid, matches]
+ -2147483650 64 -> -2147483650 [valid, matches]
+ -2147483649 0 -> -2147483649 [valid, matches]
+ -2147483649 1 -> -2147483649 [valid, matches]
+ -2147483649 62 -> -2147483649 [valid, matches]
+ -2147483649 63 -> -2147483649 [valid, matches]
+ -2147483649 64 -> -2147483649 [valid, matches]
+ -2147483648 0 -> -2147483647 [valid, matches]
+ -2147483648 1 -> -2147483646 [valid, matches]
+ -2147483648 62 -> -2147483648 [valid, matches]
+ -2147483648 63 -> -2147483648 [valid, matches]
+ -2147483648 64 -> -2147483648 [valid, matches]
+ -2147483647 0 -> -2147483647 [valid, matches]
+ -2147483647 1 -> -2147483645 [valid, matches]
+ -2147483647 62 -> -2147483647 [valid, matches]
+ -2147483647 63 -> -2147483647 [valid, matches]
+ -2147483647 64 -> -2147483647 [valid, matches]
+ -2147483646 0 -> -2147483645 [valid, matches]
+ -2147483646 1 -> -2147483646 [valid, matches]
+ -2147483646 62 -> -2147483646 [valid, matches]
+ -2147483646 63 -> -2147483646 [valid, matches]
+ -2147483646 64 -> -2147483646 [valid, matches]
+ -2 0 -> -1 [valid, matches]
+ -2 1 -> -2 [valid, matches]
+ -2 62 -> -2 [valid, matches]
+ -2 63 -> -2 [valid, matches]
+ -2 64 -> -2 [valid, matches]
+ -1 0 -> -1 [valid, matches]
+ -1 1 -> -1 [valid, matches]
+ -1 62 -> -1 [valid, matches]
+ -1 63 -> -1 [valid, matches]
+ -1 64 -> -1 [valid, matches]
+ 0 0 -> 1 [valid, matches]
+ 0 1 -> 2 [valid, matches]
+ 0 62 -> 4611686018427387904 [valid, matches]
+ 0 63 -> 9223372036854775808 [valid, matches]
+ 0 64 -> 18446744073709551616 [valid, matches]
+ 1 0 -> 1 [valid, matches]
+ 1 1 -> 3 [valid, matches]
+ 1 62 -> 4611686018427387905 [valid, matches]
+ 1 63 -> 9223372036854775809 [valid, matches]
+ 1 64 -> 18446744073709551617 [valid, matches]
+ 2 0 -> 3 [valid, matches]
+ 2 1 -> 2 [valid, matches]
+ 2 62 -> 4611686018427387906 [valid, matches]
+ 2 63 -> 9223372036854775810 [valid, matches]
+ 2 64 -> 18446744073709551618 [valid, matches]
+ 2147483645 0 -> 2147483645 [valid, matches]
+ 2147483645 1 -> 2147483647 [valid, matches]
+ 2147483645 62 -> 4611686020574871549 [valid, matches]
+ 2147483645 63 -> 9223372039002259453 [valid, matches]
+ 2147483645 64 -> 18446744075857035261 [valid, matches]
+ 2147483646 0 -> 2147483647 [valid, matches]
+ 2147483646 1 -> 2147483646 [valid, matches]
+ 2147483646 62 -> 4611686020574871550 [valid, matches]
+ 2147483646 63 -> 9223372039002259454 [valid, matches]
+ 2147483646 64 -> 18446744075857035262 [valid, matches]
+ 2147483647 0 -> 2147483647 [valid, matches]
+ 2147483647 1 -> 2147483647 [valid, matches]
+ 2147483647 62 -> 4611686020574871551 [valid, matches]
+ 2147483647 63 -> 9223372039002259455 [valid, matches]
+ 2147483647 64 -> 18446744075857035263 [valid, matches]
+ 2147483648 0 -> 2147483649 [valid, matches]
+ 2147483648 1 -> 2147483650 [valid, matches]
+ 2147483648 62 -> 4611686020574871552 [valid, matches]
+ 2147483648 63 -> 9223372039002259456 [valid, matches]
+ 2147483648 64 -> 18446744075857035264 [valid, matches]
+ 2147483649 0 -> 2147483649 [valid, matches]
+ 2147483649 1 -> 2147483651 [valid, matches]
+ 2147483649 62 -> 4611686020574871553 [valid, matches]
+ 2147483649 63 -> 9223372039002259457 [valid, matches]
+ 2147483649 64 -> 18446744075857035265 [valid, matches]
+ 9223372036854775805 0 -> 9223372036854775805 [valid, matches]
+ 9223372036854775805 1 -> 9223372036854775807 [valid, matches]
+ 9223372036854775805 62 -> 9223372036854775805 [valid, matches]
+ 9223372036854775805 63 -> 18446744073709551613 [valid, matches]
+ 9223372036854775805 64 -> 27670116110564327421 [valid, matches]
+ 9223372036854775806 0 -> 9223372036854775807 [valid, matches]
+ 9223372036854775806 1 -> 9223372036854775806 [valid, matches]
+ 9223372036854775806 62 -> 9223372036854775806 [valid, matches]
+ 9223372036854775806 63 -> 18446744073709551614 [valid, matches]
+ 9223372036854775806 64 -> 27670116110564327422 [valid, matches]
+ 9223372036854775807 0 -> 9223372036854775807 [valid, matches]
+ 9223372036854775807 1 -> 9223372036854775807 [valid, matches]
+ 9223372036854775807 62 -> 9223372036854775807 [valid, matches]
+ 9223372036854775807 63 -> 18446744073709551615 [valid, matches]
+ 9223372036854775807 64 -> 27670116110564327423 [valid, matches]
+ 9223372036854775808 0 -> 9223372036854775809 [valid, matches]
+ 9223372036854775808 1 -> 9223372036854775810 [valid, matches]
+ 9223372036854775808 62 -> 13835058055282163712 [valid, matches]
+ 9223372036854775808 63 -> 9223372036854775808 [valid, matches]
+ 9223372036854775808 64 -> 27670116110564327424 [valid, matches]
+ 9223372036854775809 0 -> 9223372036854775809 [valid, matches]
+ 9223372036854775809 1 -> 9223372036854775811 [valid, matches]
+ 9223372036854775809 62 -> 13835058055282163713 [valid, matches]
+ 9223372036854775809 63 -> 9223372036854775809 [valid, matches]
+ 9223372036854775809 64 -> 27670116110564327425 [valid, matches]
+
+clearBit
+ -9223372036854775810 0 -> -9223372036854775810 [valid, matches]
+ -9223372036854775810 1 -> -9223372036854775812 [valid, matches]
+ -9223372036854775810 62 -> -13835058055282163714 [valid, matches]
+ -9223372036854775810 63 -> -9223372036854775810 [valid, matches]
+ -9223372036854775810 64 -> -27670116110564327426 [valid, matches]
+ -9223372036854775809 0 -> -9223372036854775810 [valid, matches]
+ -9223372036854775809 1 -> -9223372036854775811 [valid, matches]
+ -9223372036854775809 62 -> -13835058055282163713 [valid, matches]
+ -9223372036854775809 63 -> -9223372036854775809 [valid, matches]
+ -9223372036854775809 64 -> -27670116110564327425 [valid, matches]
+ -9223372036854775808 0 -> -9223372036854775808 [valid, matches]
+ -9223372036854775808 1 -> -9223372036854775808 [valid, matches]
+ -9223372036854775808 62 -> -9223372036854775808 [valid, matches]
+ -9223372036854775808 63 -> -18446744073709551616 [valid, matches]
+ -9223372036854775808 64 -> -27670116110564327424 [valid, matches]
+ -9223372036854775807 0 -> -9223372036854775808 [valid, matches]
+ -9223372036854775807 1 -> -9223372036854775807 [valid, matches]
+ -9223372036854775807 62 -> -9223372036854775807 [valid, matches]
+ -9223372036854775807 63 -> -18446744073709551615 [valid, matches]
+ -9223372036854775807 64 -> -27670116110564327423 [valid, matches]
+ -9223372036854775806 0 -> -9223372036854775806 [valid, matches]
+ -9223372036854775806 1 -> -9223372036854775808 [valid, matches]
+ -9223372036854775806 62 -> -9223372036854775806 [valid, matches]
+ -9223372036854775806 63 -> -18446744073709551614 [valid, matches]
+ -9223372036854775806 64 -> -27670116110564327422 [valid, matches]
+ -2147483650 0 -> -2147483650 [valid, matches]
+ -2147483650 1 -> -2147483652 [valid, matches]
+ -2147483650 62 -> -4611686020574871554 [valid, matches]
+ -2147483650 63 -> -9223372039002259458 [valid, matches]
+ -2147483650 64 -> -18446744075857035266 [valid, matches]
+ -2147483649 0 -> -2147483650 [valid, matches]
+ -2147483649 1 -> -2147483651 [valid, matches]
+ -2147483649 62 -> -4611686020574871553 [valid, matches]
+ -2147483649 63 -> -9223372039002259457 [valid, matches]
+ -2147483649 64 -> -18446744075857035265 [valid, matches]
+ -2147483648 0 -> -2147483648 [valid, matches]
+ -2147483648 1 -> -2147483648 [valid, matches]
+ -2147483648 62 -> -4611686020574871552 [valid, matches]
+ -2147483648 63 -> -9223372039002259456 [valid, matches]
+ -2147483648 64 -> -18446744075857035264 [valid, matches]
+ -2147483647 0 -> -2147483648 [valid, matches]
+ -2147483647 1 -> -2147483647 [valid, matches]
+ -2147483647 62 -> -4611686020574871551 [valid, matches]
+ -2147483647 63 -> -9223372039002259455 [valid, matches]
+ -2147483647 64 -> -18446744075857035263 [valid, matches]
+ -2147483646 0 -> -2147483646 [valid, matches]
+ -2147483646 1 -> -2147483648 [valid, matches]
+ -2147483646 62 -> -4611686020574871550 [valid, matches]
+ -2147483646 63 -> -9223372039002259454 [valid, matches]
+ -2147483646 64 -> -18446744075857035262 [valid, matches]
+ -2 0 -> -2 [valid, matches]
+ -2 1 -> -4 [valid, matches]
+ -2 62 -> -4611686018427387906 [valid, matches]
+ -2 63 -> -9223372036854775810 [valid, matches]
+ -2 64 -> -18446744073709551618 [valid, matches]
+ -1 0 -> -2 [valid, matches]
+ -1 1 -> -3 [valid, matches]
+ -1 62 -> -4611686018427387905 [valid, matches]
+ -1 63 -> -9223372036854775809 [valid, matches]
+ -1 64 -> -18446744073709551617 [valid, matches]
+ 0 0 -> 0 [valid, matches]
+ 0 1 -> 0 [valid, matches]
+ 0 62 -> 0 [valid, matches]
+ 0 63 -> 0 [valid, matches]
+ 0 64 -> 0 [valid, matches]
+ 1 0 -> 0 [valid, matches]
+ 1 1 -> 1 [valid, matches]
+ 1 62 -> 1 [valid, matches]
+ 1 63 -> 1 [valid, matches]
+ 1 64 -> 1 [valid, matches]
+ 2 0 -> 2 [valid, matches]
+ 2 1 -> 0 [valid, matches]
+ 2 62 -> 2 [valid, matches]
+ 2 63 -> 2 [valid, matches]
+ 2 64 -> 2 [valid, matches]
+ 2147483645 0 -> 2147483644 [valid, matches]
+ 2147483645 1 -> 2147483645 [valid, matches]
+ 2147483645 62 -> 2147483645 [valid, matches]
+ 2147483645 63 -> 2147483645 [valid, matches]
+ 2147483645 64 -> 2147483645 [valid, matches]
+ 2147483646 0 -> 2147483646 [valid, matches]
+ 2147483646 1 -> 2147483644 [valid, matches]
+ 2147483646 62 -> 2147483646 [valid, matches]
+ 2147483646 63 -> 2147483646 [valid, matches]
+ 2147483646 64 -> 2147483646 [valid, matches]
+ 2147483647 0 -> 2147483646 [valid, matches]
+ 2147483647 1 -> 2147483645 [valid, matches]
+ 2147483647 62 -> 2147483647 [valid, matches]
+ 2147483647 63 -> 2147483647 [valid, matches]
+ 2147483647 64 -> 2147483647 [valid, matches]
+ 2147483648 0 -> 2147483648 [valid, matches]
+ 2147483648 1 -> 2147483648 [valid, matches]
+ 2147483648 62 -> 2147483648 [valid, matches]
+ 2147483648 63 -> 2147483648 [valid, matches]
+ 2147483648 64 -> 2147483648 [valid, matches]
+ 2147483649 0 -> 2147483648 [valid, matches]
+ 2147483649 1 -> 2147483649 [valid, matches]
+ 2147483649 62 -> 2147483649 [valid, matches]
+ 2147483649 63 -> 2147483649 [valid, matches]
+ 2147483649 64 -> 2147483649 [valid, matches]
+ 9223372036854775805 0 -> 9223372036854775804 [valid, matches]
+ 9223372036854775805 1 -> 9223372036854775805 [valid, matches]
+ 9223372036854775805 62 -> 4611686018427387901 [valid, matches]
+ 9223372036854775805 63 -> 9223372036854775805 [valid, matches]
+ 9223372036854775805 64 -> 9223372036854775805 [valid, matches]
+ 9223372036854775806 0 -> 9223372036854775806 [valid, matches]
+ 9223372036854775806 1 -> 9223372036854775804 [valid, matches]
+ 9223372036854775806 62 -> 4611686018427387902 [valid, matches]
+ 9223372036854775806 63 -> 9223372036854775806 [valid, matches]
+ 9223372036854775806 64 -> 9223372036854775806 [valid, matches]
+ 9223372036854775807 0 -> 9223372036854775806 [valid, matches]
+ 9223372036854775807 1 -> 9223372036854775805 [valid, matches]
+ 9223372036854775807 62 -> 4611686018427387903 [valid, matches]
+ 9223372036854775807 63 -> 9223372036854775807 [valid, matches]
+ 9223372036854775807 64 -> 9223372036854775807 [valid, matches]
+ 9223372036854775808 0 -> 9223372036854775808 [valid, matches]
+ 9223372036854775808 1 -> 9223372036854775808 [valid, matches]
+ 9223372036854775808 62 -> 9223372036854775808 [valid, matches]
+ 9223372036854775808 63 -> 0 [valid, matches]
+ 9223372036854775808 64 -> 9223372036854775808 [valid, matches]
+ 9223372036854775809 0 -> 9223372036854775808 [valid, matches]
+ 9223372036854775809 1 -> 9223372036854775809 [valid, matches]
+ 9223372036854775809 62 -> 9223372036854775809 [valid, matches]
+ 9223372036854775809 63 -> 1 [valid, matches]
+ 9223372036854775809 64 -> 9223372036854775809 [valid, matches]
+
+complementBit
+ -9223372036854775810 0 -> -9223372036854775809 [valid, matches]
+ -9223372036854775810 1 -> -9223372036854775812 [valid, matches]
+ -9223372036854775810 62 -> -13835058055282163714 [valid, matches]
+ -9223372036854775810 63 -> -2 [valid, matches]
+ -9223372036854775810 64 -> -27670116110564327426 [valid, matches]
+ -9223372036854775809 0 -> -9223372036854775810 [valid, matches]
+ -9223372036854775809 1 -> -9223372036854775811 [valid, matches]
+ -9223372036854775809 62 -> -13835058055282163713 [valid, matches]
+ -9223372036854775809 63 -> -1 [valid, matches]
+ -9223372036854775809 64 -> -27670116110564327425 [valid, matches]
+ -9223372036854775808 0 -> -9223372036854775807 [valid, matches]
+ -9223372036854775808 1 -> -9223372036854775806 [valid, matches]
+ -9223372036854775808 62 -> -4611686018427387904 [valid, matches]
+ -9223372036854775808 63 -> -18446744073709551616 [valid, matches]
+ -9223372036854775808 64 -> -27670116110564327424 [valid, matches]
+ -9223372036854775807 0 -> -9223372036854775808 [valid, matches]
+ -9223372036854775807 1 -> -9223372036854775805 [valid, matches]
+ -9223372036854775807 62 -> -4611686018427387903 [valid, matches]
+ -9223372036854775807 63 -> -18446744073709551615 [valid, matches]
+ -9223372036854775807 64 -> -27670116110564327423 [valid, matches]
+ -9223372036854775806 0 -> -9223372036854775805 [valid, matches]
+ -9223372036854775806 1 -> -9223372036854775808 [valid, matches]
+ -9223372036854775806 62 -> -4611686018427387902 [valid, matches]
+ -9223372036854775806 63 -> -18446744073709551614 [valid, matches]
+ -9223372036854775806 64 -> -27670116110564327422 [valid, matches]
+ -2147483650 0 -> -2147483649 [valid, matches]
+ -2147483650 1 -> -2147483652 [valid, matches]
+ -2147483650 62 -> -4611686020574871554 [valid, matches]
+ -2147483650 63 -> -9223372039002259458 [valid, matches]
+ -2147483650 64 -> -18446744075857035266 [valid, matches]
+ -2147483649 0 -> -2147483650 [valid, matches]
+ -2147483649 1 -> -2147483651 [valid, matches]
+ -2147483649 62 -> -4611686020574871553 [valid, matches]
+ -2147483649 63 -> -9223372039002259457 [valid, matches]
+ -2147483649 64 -> -18446744075857035265 [valid, matches]
+ -2147483648 0 -> -2147483647 [valid, matches]
+ -2147483648 1 -> -2147483646 [valid, matches]
+ -2147483648 62 -> -4611686020574871552 [valid, matches]
+ -2147483648 63 -> -9223372039002259456 [valid, matches]
+ -2147483648 64 -> -18446744075857035264 [valid, matches]
+ -2147483647 0 -> -2147483648 [valid, matches]
+ -2147483647 1 -> -2147483645 [valid, matches]
+ -2147483647 62 -> -4611686020574871551 [valid, matches]
+ -2147483647 63 -> -9223372039002259455 [valid, matches]
+ -2147483647 64 -> -18446744075857035263 [valid, matches]
+ -2147483646 0 -> -2147483645 [valid, matches]
+ -2147483646 1 -> -2147483648 [valid, matches]
+ -2147483646 62 -> -4611686020574871550 [valid, matches]
+ -2147483646 63 -> -9223372039002259454 [valid, matches]
+ -2147483646 64 -> -18446744075857035262 [valid, matches]
+ -2 0 -> -1 [valid, matches]
+ -2 1 -> -4 [valid, matches]
+ -2 62 -> -4611686018427387906 [valid, matches]
+ -2 63 -> -9223372036854775810 [valid, matches]
+ -2 64 -> -18446744073709551618 [valid, matches]
+ -1 0 -> -2 [valid, matches]
+ -1 1 -> -3 [valid, matches]
+ -1 62 -> -4611686018427387905 [valid, matches]
+ -1 63 -> -9223372036854775809 [valid, matches]
+ -1 64 -> -18446744073709551617 [valid, matches]
+ 0 0 -> 1 [valid, matches]
+ 0 1 -> 2 [valid, matches]
+ 0 62 -> 4611686018427387904 [valid, matches]
+ 0 63 -> 9223372036854775808 [valid, matches]
+ 0 64 -> 18446744073709551616 [valid, matches]
+ 1 0 -> 0 [valid, matches]
+ 1 1 -> 3 [valid, matches]
+ 1 62 -> 4611686018427387905 [valid, matches]
+ 1 63 -> 9223372036854775809 [valid, matches]
+ 1 64 -> 18446744073709551617 [valid, matches]
+ 2 0 -> 3 [valid, matches]
+ 2 1 -> 0 [valid, matches]
+ 2 62 -> 4611686018427387906 [valid, matches]
+ 2 63 -> 9223372036854775810 [valid, matches]
+ 2 64 -> 18446744073709551618 [valid, matches]
+ 2147483645 0 -> 2147483644 [valid, matches]
+ 2147483645 1 -> 2147483647 [valid, matches]
+ 2147483645 62 -> 4611686020574871549 [valid, matches]
+ 2147483645 63 -> 9223372039002259453 [valid, matches]
+ 2147483645 64 -> 18446744075857035261 [valid, matches]
+ 2147483646 0 -> 2147483647 [valid, matches]
+ 2147483646 1 -> 2147483644 [valid, matches]
+ 2147483646 62 -> 4611686020574871550 [valid, matches]
+ 2147483646 63 -> 9223372039002259454 [valid, matches]
+ 2147483646 64 -> 18446744075857035262 [valid, matches]
+ 2147483647 0 -> 2147483646 [valid, matches]
+ 2147483647 1 -> 2147483645 [valid, matches]
+ 2147483647 62 -> 4611686020574871551 [valid, matches]
+ 2147483647 63 -> 9223372039002259455 [valid, matches]
+ 2147483647 64 -> 18446744075857035263 [valid, matches]
+ 2147483648 0 -> 2147483649 [valid, matches]
+ 2147483648 1 -> 2147483650 [valid, matches]
+ 2147483648 62 -> 4611686020574871552 [valid, matches]
+ 2147483648 63 -> 9223372039002259456 [valid, matches]
+ 2147483648 64 -> 18446744075857035264 [valid, matches]
+ 2147483649 0 -> 2147483648 [valid, matches]
+ 2147483649 1 -> 2147483651 [valid, matches]
+ 2147483649 62 -> 4611686020574871553 [valid, matches]
+ 2147483649 63 -> 9223372039002259457 [valid, matches]
+ 2147483649 64 -> 18446744075857035265 [valid, matches]
+ 9223372036854775805 0 -> 9223372036854775804 [valid, matches]
+ 9223372036854775805 1 -> 9223372036854775807 [valid, matches]
+ 9223372036854775805 62 -> 4611686018427387901 [valid, matches]
+ 9223372036854775805 63 -> 18446744073709551613 [valid, matches]
+ 9223372036854775805 64 -> 27670116110564327421 [valid, matches]
+ 9223372036854775806 0 -> 9223372036854775807 [valid, matches]
+ 9223372036854775806 1 -> 9223372036854775804 [valid, matches]
+ 9223372036854775806 62 -> 4611686018427387902 [valid, matches]
+ 9223372036854775806 63 -> 18446744073709551614 [valid, matches]
+ 9223372036854775806 64 -> 27670116110564327422 [valid, matches]
+ 9223372036854775807 0 -> 9223372036854775806 [valid, matches]
+ 9223372036854775807 1 -> 9223372036854775805 [valid, matches]
+ 9223372036854775807 62 -> 4611686018427387903 [valid, matches]
+ 9223372036854775807 63 -> 18446744073709551615 [valid, matches]
+ 9223372036854775807 64 -> 27670116110564327423 [valid, matches]
+ 9223372036854775808 0 -> 9223372036854775809 [valid, matches]
+ 9223372036854775808 1 -> 9223372036854775810 [valid, matches]
+ 9223372036854775808 62 -> 13835058055282163712 [valid, matches]
+ 9223372036854775808 63 -> 0 [valid, matches]
+ 9223372036854775808 64 -> 27670116110564327424 [valid, matches]
+ 9223372036854775809 0 -> 9223372036854775808 [valid, matches]
+ 9223372036854775809 1 -> 9223372036854775811 [valid, matches]
+ 9223372036854775809 62 -> 13835058055282163713 [valid, matches]
+ 9223372036854775809 63 -> 1 [valid, matches]
+ 9223372036854775809 64 -> 27670116110564327425 [valid, matches]
+
=====================================
testsuite/tests/numeric/should_run/all.T
=====================================
@@ -101,3 +101,4 @@ test('T24245', normal, compile_and_run, [''])
test('T25653', normal, compile_and_run, [''])
test('T18619', exit_code(1), compile_and_run, [''])
test('T26230', normal, compile_and_run, [''])
+test('T21176', normal, compile_and_run, [''])
=====================================
testsuite/tests/simplCore/should_compile/T8832.hs
=====================================
@@ -23,3 +23,9 @@ T(w32,Word32)
T(w64,Word64)
T(z,Integer)
+
+zset :: Integer
+zset = setBit (bit 0) 0
+
+zcompl :: Integer
+zcompl = complementBit (bit 0) 0
=====================================
testsuite/tests/simplCore/should_compile/T8832.stdout
=====================================
@@ -8,4 +8,6 @@ w8 = GHC.Internal.Word.W8# 0#Word8
w16 = GHC.Internal.Word.W16# 0#Word16
w32 = GHC.Internal.Word.W32# 0#Word32
w64 = GHC.Internal.Word.W64# 0#Word64
-z = GHC.Internal.Bignum.Integer.IS 0#
+zcompl = GHC.Internal.Bignum.Integer.IS 0#
+zset = GHC.Internal.Bignum.Integer.IS 1#
+z = zcompl
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3b1786b0dcda26b3dd33daa1fe1fa31…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3b1786b0dcda26b3dd33daa1fe1fa31…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/9.14.2-backports] 132 commits: driver: don't expect nodes to exist when checking paths between them
by Zubin (@wz1000) 10 Jun '26
by Zubin (@wz1000) 10 Jun '26
10 Jun '26
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC
Commits:
e4b9fe3b by mangoiv at 2026-06-10T22:04:34+05:30
driver: don't expect nodes to exist when checking paths between them
In `mgQueryZero`, previously node lookups were expected to never fail,
i.e. it was expected that when calculating the path between two nodes in
a zero level import graph, both nodes would always exist. This is not
the case, e.g. in some situations involving exact names (see the
test-case). The fix is to first check whether the node is present in the
graph at all, instead of panicking, just to report that there is no
path.
Closes #26568
(cherry picked from commit c7061392bf0c1bf1e1a27820356627638f212a59)
- - - - -
6113c71f by Matthew Pickering at 2026-06-10T22:04:34+05:30
hadrian: Use a response file to invoke GHC for dep gathering.
In some cases we construct an argument list too long for GHC to
handle directly on windows. This happens when we generate
the dependency file because the command line will contain
references to a large number of .hs files.
To avoid this we now invoke GHC using a response file when
generating dependencies to sidestep length limitations.
Note that we only pass the actual file names in the dependency
file. Why? Because this side-steps #26560
(cherry picked from commit 9d371d23c526fd160d7e99bef2bc7da825cf3c0f)
- - - - -
ab8574d3 by Julian Ospald at 2026-06-10T22:04:34+05:30
rts: Fix object file format detection in loadArchive
Commit 76d1041dfa4b96108cfdd22b07f2b3feb424dcbe seems to
have introduced this bug, ultimately leading to failure of
test T11788. I can only theorize that this test isn't run
in upstream's CI, because they don't build a static GHC.
The culprit is that we go through the thin archive, trying
to follow the members on the filesystem, but don't
re-identify the new object format of the member. This pins
`object_fmt` to `NotObject` from the thin archive.
Thanks to @angerman for spotting this.
(cherry picked from commit fc958fc9eb6f6f4db473cdda23c381da8f32163d)
- - - - -
536cf49a by Rodrigo Mesquita at 2026-06-10T22:04:34+05:30
Stack.Decode: Don't error on bitmap size 0
A RET_BCO may have a bitmap with no payload.
In that case, the bitmap = 0.
One can observe this by using -ddump-bcos and interpreting
```
main = pure ()
```
Observe, for instance, that the BCO for this main function has size 0:
```
ProtoBCO Main.main#0:
\u []
break<main:Main,0>() GHC.Internal.Base.pure
GHC.Internal.Base.$fApplicativeIO GHC.Internal.Tuple.()
bitmap: 0 []
BRK_FUN <breakarray> main:Main 0 <cc>
PACK () 0
PUSH_G GHC.Internal.Base.$fApplicativeIO
PUSH_APPLY_PP
PUSH_G GHC.Internal.Base.pure
ENTER
```
Perhaps we never tried to decode a stack in which a BCO like this was
present. However, for the debugger, we want to decode stacks of threads
stopped at breakpoints, and these kind of BCOs do get on a stack under
e.g. `stg_apply_interp_info` frames.
See the accompanying test in the next commit for an example to trigger
the bug this commit fixes.
Fixes #26640
(cherry picked from commit 2ef1601a07b28b04ee6dbc9906ee4bceae3fcdeb)
- - - - -
dff1d802 by Rodrigo Mesquita at 2026-06-10T22:04:34+05:30
Add test for #26640
(cherry picked from commit 747153d20405cca9c3893bbb88ace6c96dbd8597)
- - - - -
dfd5dc69 by Recursion Ninja at 2026-06-10T22:04:34+05:30
Narrow before optimising MUL/DIV/REM into shifts
The MUL/DIV/REM operations can be optimised into shifts when one of the
operands is a constant power of 2. However, as literals in Cmm are
stored as 'Integer', for this to be correct we first need to narrow the
literal to the appropriate width before checking whether the literal is
a power of 2.
Fixes #25664
(cherry picked from commit fe2b79f4f21acf077738eb9ae9868c6b28afd1c4)
- - - - -
a364d6cc by Cheng Shao at 2026-06-10T22:04:34+05:30
configure: bump LlvmMaxVersion to 22
This commit bumps LlvmMaxVersion to 22; 21.x releases have been
available since Aug 26th, 2025 and there's no regressions with 21.x so
far. This bump is also required for updating fedora image to 43.
(cherry picked from commit 46c9746f19828fce4e7a6f3d078d631528a8f455)
- - - - -
fe624a9d by Peter Trommler at 2026-06-10T22:04:35+05:30
Cmm: remove restriction in MachOp folding
(cherry picked from commit 123a8d77ac93a6049e8554ede8dc814cf73e7a25)
- - - - -
ef154233 by sheaf at 2026-06-10T22:04:35+05:30
X86 CodeGen: fix assign_eax_sse_regs
We must set %al to the number of SSE2 registers that contain arguments
(in case we are dealing with a varargs function). The logic for counting
how many arguments reside in SSE2 registers was incorrect, as it used
'isFloatFormat', which incorrectly ignores vector registers.
We now instead do case analysis on the register class:
is_sse_reg r =
case targetClassOfReg platform r of
RcFloatOrVector -> True
RcInteger -> False
This change is necessary to prevent segfaults in T20030_test1j, because
subsequent commits change the format calculations, resulting in vector
formats more often.
(cherry picked from commit fca9cd7ce4abc4320c66f6a619063b2c66890504)
- - - - -
b0e2be09 by sheaf at 2026-06-10T22:04:35+05:30
X86 regUsageOfInstr: fix format for IMUL
When used with 8-bit operands, the IMUL instruction returns the result
in the lower 16 bits of %rax (also known as %ax). This is different
than for the other sizes, where an input at 16, 32 or 64 bits will
result in 16, 32 or 64 bits of output in both %rax and %rdx.
This doesn't affect the behaviour of the compiler, because we don't
allow partial writes at sub-word sizes. The rationale is explained
in Wrinkle [Don't allow scalar partial writes] in Note [Register formats in liveness analysis],
in GHC.CmmToAsm.Reg.Liveness.
(cherry picked from commit 53150617c8648635b0fbfc4144f04c53e7180a60)
- - - - -
dff528b5 by sheaf at 2026-06-10T22:04:35+05:30
Liveness analysis: consider register formats
This commit updates the register allocator to be a bit more careful in
situations in which a single register is used at multiple different
formats, e.g. when xmm1 is used both to store a Double# and a DoubleX2#.
This is done by introducing the 'Regs' newtype around 'UniqSet RegWithFormat',
for which the combining operations take the larger of the two formats
instead of overriding the format.
Operations on 'Regs' are defined in 'GHC.CmmToAsm.Reg.Regs'. There is
a modest compile-time cost for the additional overhead for tracking
register formats, which causes the metric increases of this commit.
The subtle aspects of the implementation are outlined in
Note [Register formats in liveness analysis] in GHC.CmmToAsm.Reg.Liveness.
Fixes #26411 #26611
-------------------------
Metric Increase:
T12707
T26425
T3294
-------------------------
(cherry picked from commit c7a56dd1ea2b8bd4cd9dc4a46e07c589db559383)
- - - - -
c82eb00d by sheaf at 2026-06-10T22:04:35+05:30
Register allocator: reload at same format as spill
This commit ensures that if we spill a register onto the stack at a
given format, we then always reload the register at this same format.
This ensures we don't end up in a situation where we spill F64x2 but end
up only reloading the lower F64. This first reload would make us believe
the whole data is in a register, thus silently losing the upper 64 bits
of the spilled register's contents.
Fixes #26526
(cherry picked from commit c2e83339593bc31a82a0fdb7f11fa693324f9804)
- - - - -
35b4fa07 by sheaf at 2026-06-10T22:04:35+05:30
Register allocation: writes redefine format
As explained in Note [Allocated register formats] in GHC.CmmToAsm.Reg.Linear,
we consider all writes to redefine the format of the register.
This ensures that in a situation such as
movsd .Ln6m(%rip),%v1
shufpd $0,%v1,%v1
we properly consider the broadcast operation to change the format of %v1
from F64 to F64x2.
This completes the fix to #26411 (test in T26411b).
(cherry picked from commit 55ab583b40ecdc1abc3307cea1d6a2c958a5ed29)
- - - - -
f0a87570 by Cheng Shao at 2026-06-10T22:04:35+05:30
compiler/rts: fix ABI mismatch in barf() invocations
This patch fixes a long-standing issue of ABI mismatch in `barf()`
invocations, both in compiler-emitted code and in hand written Cmm
code:
- In RTS, we have `barf()` which reports a fatal internal error
message and exits the program.
- `barf()` is a variadic C function! When used as a callee of a
foreign call with `ccall` calling convention instead of `capi`,
there is an ABI mismatch between the caller and the callee!
- Unfortunately, both the compiler and the Cmm sources contain many
places where we call `barf()` via `ccall` convention!! Like, when
you write `foreign "C" barf("foo object (%p) entered!", R1)`, it
totally doesn't do what you think it'll do at all!! The second
argument `R1` is not properly passed in `va_list`, and the behavior
is completely undefined!!
- Even more unfortunately, this issue has been sitting around long
enough because the ABI mismatch is subtle enough on normie platforms
like x64 and arm64.
- But there are platforms like wasm32 that are stricter about ABI, and
the broken `barf()` invocations already causes trouble for wasm
backend: we had to use ugly hacks like `barf(errmsg, NULL)` to make
`wasm-ld` happy, and even with this band-aid, compiler-generated
`barf()` invocations are still broken, resulting in regressions in
certain debug-related functionality, e.g. `-dtag-inference-checks`
is broken on wasm32 (#22882).
This patch properly fixes the issue:
- We add non-variadic `barf` wrappers in the RTS that can be used as
`ccall` callees
- Both the compiler `emitBarf` logic and the hand-written Cmm are
changed to call these wrappers
- `emitBarf` now also properly annotates the foreign call as
`CmmNeverReturns` to indicate it's a noreturn call to enable more
efficient code generation
`-dtag-inference-checks` now works on wasm. Closes #22882.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 1ca4b49a561447222072a44320fa9b0b5f6048e0)
- - - - -
d8af65ce by Cheng Shao at 2026-06-10T22:04:35+05:30
wasm: fix handling of ByteArray#/MutableByteArray# arguments in JSFFI imports
This patch fixes the handling of ByteArray#/MutableByteArray#
arguments in JSFFI imports, see the amended note and manual for
explanation. Also adds a test to witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit f69c5f1492b275da7d2947612574d5c520a69653)
- - - - -
7cf04b87 by Cheng Shao at 2026-06-10T22:04:35+05:30
rts: opportunistically reclaim slop space in shrinkMutableByteArray#
Previously, `shrinkMutableByteArray#` shrinks a `MutableByteArray#`
in-place by assigning the new size to it, and zeroing the extra slop
space. That slop space is not reclaimed and wasted. But it's often the
case that we allocate a `MutableByteArray#` upfront, then shrink it
shortly after, so the `MutableByteArray#` closure sits right at the
end of a nursery block; this patch identifies such chances, and also
shrink `bd->free` if possible, reducing heap space fragmentation.
Co-authored-by: Codex <codex(a)openai.com>
-------------------------
Metric Decrease:
T10678
-------------------------
(cherry picked from commit b26d134a666dcc2ca92d9cffc17cd38ab3af6590)
- - - - -
97592e74 by Aaron Allen at 2026-06-10T22:04:35+05:30
[#26183] Associated Type Iface Fix
When determining "extras" for class decl interface entries, axioms for
the associated types need to included so that dependent modules will be
recompiled if those axioms change.
resolves #26183
(cherry picked from commit 8a317b6f6d007b7cb5f2d661849383042892b3d8)
- - - - -
1b2775e9 by Cheng Shao at 2026-06-10T22:04:35+05:30
testsuite: run numeric tests with optasm when available
This patch adds the `optasm` extra way to nueric tests when NCG is
available. Some numeric bugs only surface with optimization, omitting
this can hide these bugs and even make them slip into release! (e.g. #26711)
(cherry picked from commit ae1aeaabac1d49c98be2b48700dcbb4cc402ffe0)
- - - - -
b01d6236 by Cheng Shao at 2026-06-10T22:04:35+05:30
compiler: fix LLVM backend pdep/pext handling for i386 target
This patch fixes LLVM backend's pdep/pext handling for i386 target,
and also removes non-existent 128/256/512 bit hs_pdep/hs_pext callees.
See amended note for more explanation. Fixes #26450.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 414d1fe1a51a9b0cfe88fe902cd4f5737d19da69)
- - - - -
ef8f5355 by Cheng Shao at 2026-06-10T22:04:35+05:30
ci: remove allow_failure flag for i386 alpine job
The LLVM codegen issue for i386 has been fixed, and the i386 alpine
job should pass now. This commit removes the allow_failure flag so
that other i386 regressions in the future are signaled more timely.
(cherry picked from commit c7f6fba3d0aea3b550441e10a54bb402b73dcd1f)
- - - - -
b49eb609 by Simon Peyton Jones at 2026-06-10T22:04:35+05:30
Add missing InVar->OutVar lookup in SetLevels
As #26681 showed, the SetLevels pass was failing to map an InVar to
an OutVar. Very silly! I'm amazed it hasn't broken before now.
I have improved the type singatures (to mention InVar and OutVar)
so it's more obvious what needs to happen.
(cherry picked from commit 52d00c05e1d803b36c93295399fe931c871166bf)
- - - - -
9325cdd8 by Aaron Allen at 2026-06-10T22:04:35+05:30
[26705] Include TyCl instances in data fam iface entry
Ensures dependent modules are recompiled when the class instances for a
data family instance change.
resolves #26705
(cherry picked from commit 8a3900a325a8f476d1e31a84deeab934b9161801)
- - - - -
2a3f2d83 by Simon Peyton Jones at 2026-06-10T22:04:35+05:30
Refactor srutOkForBinderSwap
This MR does a small refactor:
* Moves `scrutOkForBinderSwap` and `BinderSwapDecision`
to GHC.Core.Utils
* Inverts the sense of the coercion it returns, which makes
more sense
No effect on behaviour
(cherry picked from commit 393f9c51437364c959f1de39f91fac41eb6ddcdc)
- - - - -
52e0f1d0 by Simon Peyton Jones at 2026-06-10T22:04:35+05:30
Improve case merging
This small MR makes case merging happen a bit more often than
it otherwise could, by getting join points out of the way.
See #26709 and GHC.Core.Utils
Note [Floating join points out of DEFAULT alternatives]
(cherry picked from commit ad76fb0f493f3c7833cd6fd3e712579e6c77697a)
- - - - -
fb772021 by Matthew Pickering at 2026-06-10T22:04:35+05:30
rts: Use INFO_TABLE_CONSTR for stg_dummy_ret_closure
Since the closure type is CONSTR_NOCAF, we need to use INFO_TABLE_CONSTR
to populate the constructor description field (this crashes ghc-debug
when decoding AP_STACK frames sometimes)
Fixes #26745
(cherry picked from commit 322dd6726b11c7101c28ffb8aeb7cb4cee34ab56)
- - - - -
55f0de7c by Simon Peyton Jones at 2026-06-10T22:04:35+05:30
Fix scoping errors in specialisation
Using -fspecialise-aggressively in #26682 showed up a couple of
subtle errors in the type-class specialiser.
* dumpBindUDs failed to call `deleteCallsMentioning`, resulting in a
call that mentioned a dictionary that was not in scope. This call
has been missing since 2009!
commit c43c981705ec33da92a9ce91eb90f2ecf00be9fe
Author: Simon Peyton Jones <simonpj(a)microsoft.com>
Date: Fri Oct 23 16:15:51 2009 +0000
Fixed by re-combining `dumpBindUDs` and `dumpUDs`.
* I think there was another bug involving the quantified type
variables in polymorphic specialisation. In any case I refactored
`specHeader` and `spec_call` so that the former looks for the
extra quantified type variables rather than the latter. This
is quite a worthwhile simplification: less code, easier to grok.
Test case in simplCore/should_compile/T26682,
brilliantly minimised by @sheaf.
(cherry picked from commit 641ec3f01974dff9dfd756f3f0499796c8df1a8b)
- - - - -
277250dd by Cheng Shao at 2026-06-10T22:04:35+05:30
compiler: change sectionProtection to take SectionType argument
This commit changes `sectionProtection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope.
(cherry picked from commit 2433e91d41675d56f48f82d22430a8dee915e7a0)
- - - - -
9903f791 by Cheng Shao at 2026-06-10T22:04:35+05:30
compiler: change isInitOrFiniSection to take SectionType argument
This commit changes `isInitOrFiniSection` to only take `SectionType`
argument instead of whole `Section`, since it doesn't need the Cmm
section content anyway, and it can then be called in parts of NCG
where we only have a `SectionType` in scope. Also marks it as
exported.
(cherry picked from commit e5926fbebf341ee547227d41710d78471eecd09c)
- - - - -
e6229ce4 by Cheng Shao at 2026-06-10T22:04:35+05:30
compiler: fix split sections on windows
This patch fixes split sections on windows by emitting the right
COMDAT section header in NCG, see added comment for more explanation.
Fix #26696 #26494.
-------------------------
Metric Decrease:
LargeRecord
T9675
size_hello_artifact
size_hello_artifact_gzip
size_hello_unicode
size_hello_unicode_gzip
Metric Increase:
T13035
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 244d57d79a555dcecc7590287bb14976d561291a)
- - - - -
44af1ad6 by sheaf at 2026-06-10T22:04:35+05:30
Don't re-use stack slots for growing registers
This commit avoids re-using a stack slot for a register that has grown
but already had a stack slot.
For example, suppose we have stack slot assigments
%v1 :: FF64 |-> StackSlot 0
%v2 :: FF64 |-> StackSlot 1
Later, we start using %v1 at a larger format (e.g. F64x2) and we need
to spill it again. Then we **must not** use StackSlot 0, as a spill
at format F64x2 would clobber the data in StackSlot 1.
This can cause some fragmentation of the `StackMap`, but that's probably
OK.
Fixes #26668
(cherry picked from commit 023c301c51e7346af3d4d773c448277ad3645ad2)
- - - - -
2d465bef by fendor at 2026-06-10T22:04:35+05:30
Remove `traceId` from ghc-pkg executable
(cherry picked from commit d0966e64880e9fa30ce07c0fa5ea28108c6e8ad9)
- - - - -
36a901ec by Peter Trommler at 2026-06-10T22:04:35+05:30
PPC NCG: Fix shift right MO code
The shift amount in shift right [arithmetic] MOs is machine word
width. Therefore remove unnecessary zero- or sign-extending of
shift amount.
It looks harmless to extend the shift amount argument because the
shift right instruction uses only the seven lowest bits (i. e. mod 128).
But now we have a conversion operation from a smaller type to word width
around a memory load at word width. The types are not matching up but
there is no check done in CodeGen. The necessary conversion from word
width down to the smaller width would be translated into a no-op on
PowerPC anyway. So all seems harmless if it was not for a small
optimisation in getRegister'.
In getRegister' a load instruction with the smaller width of the
conversion operation was generated. This loaded the most significant
bits of the word in memory on a big-endian platform. These bits were
zero and hence shift right was used with shift amount zero and not one
as required in test Sized.
Fixes #26519
(cherry picked from commit c1fe009739da8b368e59b87b00d7c568ab571643)
- - - - -
66b3b7c5 by Cheng Shao at 2026-06-10T22:04:35+05:30
llvm: fix split sections for llvm backend
This patch fixes split sections for llvm backend:
- Pass missing `--data-sections`/`--function-sections` flags to
llc/opt.
- Use `(a)llvm.compiler.used` instead of `(a)llvm.used` to avoid sections
being unnecessarily retained at link-time.
Fixes #26770.
-------------------------
Metric Decrease:
libdir
size_hello_artifact
size_hello_unicode
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit b18b2c42c32488ad6d3480a56a1fcd753cad2023)
- - - - -
01890325 by Cheng Shao at 2026-06-10T22:04:35+05:30
libraries: bump haskeline submodule to 0.8.4.1
This patch bumps the haskeline submodule to 0.8.4.1 which includes an
important fix for an ANSI handling bug on Windows
(https://github.com/haskell/haskeline/pull/126)
(cherry picked from commit eea2036b7c367cc61cd5846379be10954ca75345)
- - - - -
a324fe9a by Cheng Shao at 2026-06-10T22:04:35+05:30
hadrian: remove the horrible i386 speedHack
When hadrian builds certain rts objects for i386, there's a horrible
speedHack that forces -fno-PIC even for dynamic ways of those objects.
This is not compatible with newer versions of gcc/binutils as well as
clang/lld, and this patch removes it. Fixes #26792.
(cherry picked from commit 41432d25b7a66fa36a0e3def429fd98d24e3c780)
- - - - -
f68eaa42 by Andreas Klebinger at 2026-06-10T22:04:35+05:30
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
(cherry picked from commit 9534b032ecc24fb01609ae6b9861101973ba2a72)
- - - - -
09b2d9d8 by Cheng Shao at 2026-06-10T22:04:35+05:30
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit ca79475f6b4dfba991e2c933bac9c22d54a4950d)
- - - - -
d7825f12 by Sylvain Henry at 2026-06-10T22:04:35+05:30
GC: don't use CAS without PARALLEL_GC on
If we're not using the parallel GC, there is no reason to do a costly
CAS. This was flagged as taking time in a perf profile.
(cherry picked from commit 0491f08a965df0d6448bd9cd940d2b86fca2db5d)
- - - - -
ad1b86a9 by Sylvain Henry at 2026-06-10T22:04:36+05:30
GC: suffix parallel GC with "par" instead of "thr"
Avoid some potential confusion (see discussion in !15351).
(cherry picked from commit 211a8f5633f0a5069c0689171f60b57719a242be)
- - - - -
7879b4e2 by Matthew Pickering at 2026-06-10T22:04:36+05:30
Fix ghc-experimental GHC.Exception.Backtrace.Experimental module
This module wasn't added to the cabal file so it was never compiled or
included in the library.
(cherry picked from commit ee937134aa0ddf35c1a9dc7334c0aec0de13b719)
- - - - -
1c36c0fc by Zubin Duggal at 2026-06-10T22:04:36+05:30
hadrian: Add ghc-{experimental,internal}.cabal to the list of dependencies of the doc target
We need these files to detect the version of these libraries
Fixes #26738
(cherry picked from commit 1b490f5a7bbdb1441948241e6089b31efba9db45)
- - - - -
92e7c4d3 by Peter Trommler at 2026-06-10T22:04:36+05:30
PPC NCG: Generate clear right insn at arch width
The clear right immediate (clrrxi) is only available in word and
doubleword width. Generate clrrxi instructions at architecture
width for all MachOp widths.
Fixes #24145
(cherry picked from commit 56db94f791c6aae32798d82b74670c9d6392b931)
- - - - -
1ccd07d8 by Matthew Pickering at 2026-06-10T22:05:16+05:30
Evaluate backtraces for "error" exceptions at the moment they are thrown
See Note [Capturing the backtrace in throw] and
Note [Hiding precise exception signature in throw] which explain the
implementation.
This commit makes `error` and `throw` behave the same with regard to
backtraces. Previously, exceptions raised by `error` would not contain
useful IPE backtraces.
I did try and implement `error` in terms of `throw` but it started to
involve putting diverging functions into hs-boot files, which seemed to
risky if the compiler wouldn't be able to see if applying a function
would diverge.
CLC proposal: https://github.com/haskell/core-libraries-committee/issues/383
Fixes #26751
(cherry picked from commit 94dcd15e54146abecf9b4f5e47d258ca3cd40f1b)
- - - - -
244c4852 by sterni at 2026-06-10T22:05:23+05:30
users_guide: fix runtime error during build with Sphinx 9.1.0
Appears that pathto is stricter about what it accepts now.
Tested Sphinx 8.2.3 and 9.1.0 on the ghc-9.10 branch.
Resolves #26810.
Co-authored-by: Martin Weinelt <hexa(a)darmstadt.ccc.de>
(cherry picked from commit e8f5a45de561ec80c88cd3da2c66502deb32d4c3)
- - - - -
63566924 by Jessica Clarke at 2026-06-10T22:05:23+05:30
PPC NCG: Use libcall for 64-bit cmpxchg on 32-bit PowerPC
There is no native instruction for this, and even if there were a
register pair version we could use, the implementation here is assuming
the values fit in a single register, and we end up only using / defining
the low halves of the registers.
Fixes: b4d39adbb5 ("PrimOps: Add CAS op for all int sizes")
Fixes: #23969
(cherry picked from commit ce2d62fba69d2ea0c74c46c50628feb8b81719d2)
- - - - -
12963d00 by Michael Karcher at 2026-06-10T22:05:23+05:30
NCG for PPC: add pattern for CmmRegOff to iselExpr64
Closes #26828
(cherry picked from commit 43d977619de65c0cf87695fa5d86f1a3ff3176c3)
- - - - -
d694c8c6 by Matthew Pickering at 2026-06-10T22:05:23+05:30
determinism: Use deterministic map for Strings in TyLitMap
When generating typeable evidence the types we need evidence for all
cached in a TypeMap, the order terms are retrieved from a type map
determines the order the bindings appear in the program.
A TypeMap is quite diligent to use deterministic maps, apart from in the
TyLitMap, which uses a UniqFM for storing strings, whose ordering
depends on the Unique of the FastString.
This can cause non-deterministic .hi and .o files.
An unexpected side-effect is the error message but RecordDotSyntaxFail8
changing. I looked into this with Sam and this change caused the
constraints to be solved in a different order which results in a
slightly different error message. I have accepted the new test, since
the output before was non-deterministic and the new output is consistent
with the other messages in that file.
Fixes #26846
(cherry picked from commit aeeb4a2034e80e26503eb88f5abde85e87a82f7b)
- - - - -
5719f06d by Andrew Lelechenko at 2026-06-10T22:05:23+05:30
Upgrade text submodule to 2.1.4
(cherry picked from commit 9e4d70c2764d117c5cf753127f93056d66e4f0d7)
- - - - -
a7a01f90 by Zubin Duggal at 2026-06-10T22:05:23+05:30
Bump transformers submodule to 0.6.3.0
Fixes #26790
(cherry picked from commit ea0d1317a630799a6b7bea12b24ef7e1ea6ed512)
- - - - -
9edd15f5 by Simon Peyton Jones at 2026-06-10T22:05:23+05:30
Fix subtle bug in GHC.Core.Utils.mkTick
This patch fixes a decade-old bug in `mkTick`, which
could generate type-incorrect code! See the diagnosis
in #26772.
The new code is simpler and easier to understand.
(As #26772 says, I think it could be improved further.)
(cherry picked from commit cbe4300ef586c8bee1800426624db12e0237c6b5)
- - - - -
ae37b360 by Simon Peyton Jones at 2026-06-10T22:05:23+05:30
Modify a debug-trace in the Simplifier
...just to show a bit more information.
(cherry picked from commit a193a8dabf280bf53a227f37af4465ef263f6e21)
- - - - -
5ba132ce by Simon Peyton Jones at 2026-06-10T22:05:23+05:30
Fix long-standing interaction between ticks and casts
The code for Note [Eliminate Identity Cases] was simply wrong when
ticks and casts interacted. This patch fixes the interaction.
It was shown up when validating #26772, although it's not the exactly
the bug that's reported by #26772. Nor is it easy to reproduce, hence
no regression test.
(cherry picked from commit b579dfdc614e288b0fd754ac69ae7ff723d808be)
- - - - -
68d9a823 by Cheng Shao at 2026-06-10T22:05:23+05:30
libraries: bump Cabal submodule to 3.16.1.0
(cherry picked from commit fac0de1e357caa96913e19d924aad711d3b390cc)
- - - - -
1f502e18 by Cheng Shao at 2026-06-10T22:05:23+05:30
libraries: bump deepseq submodule to 1.5.2.0
Also:
- Get rid of usage of deprecated `NFData` function instance in the
compiler
- `T21391` still relies on `NFData` function instance, add
`-Wno-deprecations` for the time being.
(cherry picked from commit 00589122f8e90e2caabdd190835ab248e67e729b)
- - - - -
953bd84b by Cheng Shao at 2026-06-10T22:05:23+05:30
libraries: bump directory submodule to 1.3.10.1
(cherry picked from commit 84474c711e3a819a2809c6d293d6d6dcf1d68d4b)
- - - - -
fed8a70b by Cheng Shao at 2026-06-10T22:05:23+05:30
libraries: bump exceptions submodule to 0.10.12
(cherry picked from commit 1a9f46621404e9d6b235b5359b4fea5dbb9f31cf)
- - - - -
d2ede9df by Matthew Pickering at 2026-06-10T22:05:23+05:30
determinism: Use a stable sort in WithHsDocIdentifiers binary instance
`WithHsDocIdentifiers` is defined as
```
71 data WithHsDocIdentifiers a pass = WithHsDocIdentifiers
72 { hsDocString :: !a
73 , hsDocIdentifiers :: ![Located (IdP pass)]
74 }
```
This list of names is populated from `rnHsDocIdentifiers`, which calls
`lookupGRE`, which calls `lookupOccEnv_AllNameSpaces`, which calls
`nonDetEltsUFM` and returns the results in an order depending on
uniques.
Sorting the list with a stable sort before returning the interface makes
the output deterministic and follows the approach taken by other fields
in `Docs`.
Fixes #26858
(cherry picked from commit 0020e38a021b5f0371c48fe73cddf8987acb1eb1)
- - - - -
9bbaed04 by John Paul Adrian Glaubitz at 2026-06-10T22:05:23+05:30
rts: Switch prim to use modern atomic compiler builtins
The __sync_*() atomic compiler builtins have been deprecated in GCC
for a while now and also don't provide variants for 64-bit values
such as __sync_fetch_and_add_8().
Thus, replace them with the modern __atomic_*() compiler builtins and
while we're at it, also drop the helper macro CAS_NAND() which is now
no longer needed since we stopped using the __sync_*() compiler builtins
altogether.
Co-authored-by: Ilias Tsitsimpis <iliastsi(a)debian.org>
Fixes #26729
(cherry picked from commit 7c52c4f9bc8d6ae6404039ec02efe48fbf7a4778)
- - - - -
a119b15e by Simon Peyton Jones at 2026-06-10T22:05:23+05:30
Fix subtle bug in cast worker/wrapper
See (CWw4) in Note [Cast worker/wrapper].
The true payload is in the change to the definition of
GHC.Types.Id.Info.hasInlineUnfolding
Everthing else is just documentation.
There is a 2% compile time decrease for T13056;
I'll take the win!
Metric Decrease:
T13056
(cherry picked from commit 99d8c146c12146e1e21b1f2d31809845d4afe9d4)
- - - - -
6dfdd1f7 by Cheng Shao at 2026-06-10T22:05:23+05:30
wasm: use import.meta.main for proper distinction of nodejs main modules
This patch uses `import.meta.main` for proper distinction of nodejs
main modules, especially when the main module might be installed as a
symlink. Fixes #26916.
(cherry picked from commit 039f19778e35b193af0de2a2c6ed89556038627a)
- - - - -
888b608f by Brian J. Cardiff at 2026-06-10T22:05:23+05:30
configure: Accept happy-2.2
In Jan 2026 happy-2.2 was released. The most sensible change is https://github.com/haskell/happy/issues/335 which didn't trigger in a fresh build
(cherry picked from commit 4f2840f2bb729ef1a6660f9f5c46906b7b838147)
- - - - -
480c0b7f by fendor at 2026-06-10T22:07:51+05:30
Add optional `SrcLoc` to `StackAnnotation` class
`StackAnnotation`s give access to an optional `SrcLoc` field that
user-added stack annotations can use to provide better backtraces in both error
messages and when decoding the callstack.
We update builtin stack annotations such as `StringAnnotation` and
`ShowAnnotation` to also capture the `SrcLoc` of the current `CallStack`
to improve backtraces by default (if stack annotations are used).
This change is backwards compatible with GHC 9.14.1.
(cherry picked from commit 4c40df3df7e806e6e21259fa51d872c4f3f9f726)
- - - - -
6c106393 by Vladislav Zavialov at 2026-06-10T22:07:51+05:30
Check for negative type literals in the type checker (#26861)
GHC disallows negative type literals (e.g., -1), as tested by T8306 and
T8412. This check is currently performed in the renamer:
rnHsTyLit tyLit@(HsNumTy x i) = do
when (i < 0) $
addErr $ TcRnNegativeNumTypeLiteral tyLit
However, this check can be bypassed using RequiredTypeArguments
(see the new test case T26861). Prior to this patch, such programs
caused the compiler to hang instead of reporting a proper error.
This patch addresses the issue by adding an equivalent check in
the type checker, namely in tcHsType.
The diff is deliberately minimal to facilitate backporting. A more
comprehensive rework of HsTyLit is planned for a separate commit.
(cherry picked from commit bd3eba86180083a3bd1633994b9e6cd3be501a1d)
- - - - -
820cbb88 by sheaf at 2026-06-10T22:07:51+05:30
Careful with ticked join points in mergeCaseAlts
This commit backports the fix to GHC.Core.Utils.mergeCaseAlts that was
carried out in f726fcc4fb0b59f8ad2e2fa80f1b03efdaf73c30.
That is, this commit addresses the regression that was introduced by
e026bdf275e287005f2c2e534d3ba034ebf11c01, which allowed mergeCaseAlts to
move ticks in between a join point and one of its jumps, which results
in disaster (see #26929 but also #26642, #26693).
See (MC6) in Note [Merge Nested Cases] for a detailed explanation.
(cherry picked from commit 08bc245be70d95801bc1138804ed1de9474fbdc0)
(cherry picked from commit 974586eb5b6a924e8ce3ea8c4b2180ea9c0f3801)
(cherry picked from commit 1cbf9aed2d1f1c766fba0b25986112051bf9a539)
- - - - -
86c8f230 by Sylvain Henry at 2026-06-10T22:07:51+05:30
Linker: implement support for COMMON symbols (#6107)
Add some support for COMMON symbols. We don't support common symbols
having different sizes where the larger one is allocated after the
smaller one. The linker will fail with an appropriate error message if
it happens.
(cherry picked from commit ad25af90bdbf1269ff9febbcbc9fffa804b11bda)
- - - - -
57ed944b by sheaf at 2026-06-10T22:07:51+05:30
System.Info.fullCompilerVersion: add 'since' annot
Fixes #26973
(cherry picked from commit fc8b8e27398b4d9d901fb65d15a7d8b23df428b8)
- - - - -
307bfbe1 by Luite Stegeman at 2026-06-10T22:07:51+05:30
Fix GHC.Internal.Prim haddock
Haddock used to parse Haskell source to generate documentation,
but switched to using interface files instead. This broke documentation
of the GHC.Internal.Prim module, since it's a wired-in interface that
didn't provide a document structure.
This patch adds the missing document structure and updates genprimopcode
to make the section headers and descriptions available.
fixes #26954
(cherry picked from commit 12f8b82912787e1eb964a9a56e388bd0ec8c741b)
- - - - -
d52e2e80 by Luite Stegeman at 2026-06-10T22:07:51+05:30
Remove obsolete --make-haskell-source from genprimopcode
Now that haddock uses the wired-in interface for GHC.Internal.Prim,
the generated Haskell source file is no longer needed. Remove the
--make-haskell-source code generator from genprimopcode and replace
the generated GHC/Internal/Prim.hs with a minimal static source file.
(cherry picked from commit f87e5e57dad499bf0d47ef2c074284e87a87dde3)
- - - - -
c2996f89 by Cheng Shao at 2026-06-10T22:07:52+05:30
compiler: implement string interning logic for BCONPtrFS
This patch adds a `FastStringEnv`-based cache of `MallocStrings`
requests to `Interp`, so that when we load bytecode with many
breakpoints that share the same module names & unit ids, we reuse the
allocated remote pointers instead of issuing duplicte `MallocStrings`
requests and bloating the C heap. Closes #26995.
(cherry picked from commit d054b4676298ea2189cd48fcf175676b97f559e7)
- - - - -
a4ea5689 by Matthew Pickering at 2026-06-10T22:07:52+05:30
testsuite: Add test for foreign import prim with unboxed tuple return
This commit just adds a test that foreign import prim works with unboxed
sums.
(cherry picked from commit d57f01a4dd8b3886a02731c8ca27ee758baa768a)
- - - - -
d6ad8408 by Matthew Pickering at 2026-06-10T22:07:52+05:30
Return a valid pointer in advanceStackFrameLocationzh
When there is no next stack chunk, `advanceStackFrameLocationzh` used to
return NULL in the pointer-typed StackSnapshot# result slot.
Even though the caller treats that case as "no next frame", the result is
still materialized in a GC-visible pointer slot. If a GC observes the raw
NULL there, stack decoding can crash.
Fix this by ensuring the dead pointer slot contains a valid closure
pointer. Also make the optional result explicit by returning an unboxed
sum instead of a tuple with a separate tag.
Fixes #27009
(cherry picked from commit 23d111ce0b2bef9bbf1fae2224359b2e1e79be65)
- - - - -
d9e34bd4 by Cheng Shao at 2026-06-10T22:07:52+05:30
hadrian: build profiled dynamic objects with -dynamic-too
This patch enables hadrian to build profiled dynamic objects with
`-dynamic-too`, addressing a build parallelism bottleneck in release
pipelines. Closes #27010.
(cherry picked from commit 4c58a3aecf8071bfcda6d0787652b89dec4a442f)
- - - - -
162955e0 by Zubin Duggal at 2026-06-10T22:07:52+05:30
DmdAnal: Take stable unfoldings into account when determining argument demands
Previously, demand analysis only looked at the RHS to compute argument demands.
If the optimised RHS discarded uses of an argument that the stable unfolding
still needed, it would be incorrectly marked absent. Worker/wrapper would then
replace it with LitRubbish, and inlining the stable unfolding would use the
rubbish value, causing a segfault.
To fix, we introduce addUnfoldingDemands which analyses the stable unfolding
with dmdAnal and combines its DmdType with the RHS's via the new `maxDmdType`
which combines the demands of the stable unfolding with the rhs, so we can avoid
any situation where we give an absent demand to something which is still used
by the stable unfolding.
Fixes #26416.
(cherry picked from commit 870243e4f2a24730539f01ee8e3f3949c42ff312)
- - - - -
1d96bafb by Brandon Simmons at 2026-06-10T22:07:52+05:30
Add a cumulative gc_sync_elapsed_ns counter to GHC.Internal.Stats
This makes it possible to get an accurate view of time spent in sync
phase when using prometheus-style sampling. Previously this was only
available for the most recent GC.
This intentionally leaves GHC.Stats API unchanged since it is marked as
deprecated, and API changes there require CLC approval.
Fixes #26944
(cherry picked from commit 02e68a86e438edb315ba8622c58733d830557574)
- - - - -
89ed5a05 by Andreas Klebinger at 2026-06-10T22:07:52+05:30
Fix missing profiling header for origin_thunk frame.
Fixes #27007
(cherry picked from commit 63ae8eb38c54eaba77949b048a3621a5f4ca76e3)
- - - - -
a6bb3f67 by Andreas Klebinger at 2026-06-10T22:07:52+05:30
Configure: Fix check for --target support in stage0 CC
The check FP_PROG_CC_LINKER_TARGET used $CC unconditionally to check for
--target support. However this fails for the stage0 config where the C
compiler used is not $CC but $CC_STAGE0.
Since we already pass the compiler under test into the macro I simply
changed it to use that instead.
Fixes #26999
(cherry picked from commit 43638643adbe999de8d2288a40bdd15c602f6481)
- - - - -
d13be221 by fendor at 2026-06-10T22:07:52+05:30
Introduce `-fimport-loaded-targets` GHCi flag
This new flag automatically adds all loaded targets to the GHCi session
by adding an `InteractiveImport` for the loaded targets.
By default, this flag is disabled, as it potentially increases memory-usage.
This interacts with the flag `-fno-load-initial-targets` as follows:
* If no module is loaded, no module is added as an interactive import.
* If a reload loads up to a module, all loaded modules are added as
interactive imports.
* Unloading modules removes them from the interactive context.
Fixes #26866 by rendering the use of a `-ghci-script` to achieve the
same thing redundant.
(cherry picked from commit 86bd9bfc1c0ea85ea7063af5f7d5495246be5094)
- - - - -
0e524b6b by Zubin Duggal at 2026-06-10T22:07:52+05:30
compiler/ffi: Collapse void pointer chains in capi wrappers
New gcc/clang treat -Wincompatible-pointer-types as an error by
default. Since C only allows implicit conversion from void*, not void**,
capi wrappers for functions taking e.g. abstract** would fail to compile
when the Haskell type Ptr (Ptr Abstract) was naively translated to void**.
Collapse nested void pointers to a single void* when the pointee type
has no known C representation.
Fixes #26852
(cherry picked from commit 80e2dd4f084eff9cc857b31daf9ea2e9e460c727)
- - - - -
f557ab85 by Luite Stegeman at 2026-06-10T22:07:52+05:30
bytecode: Carefully SLIDE off the end of a stack chunk
The SLIDE bytecode instruction was not checking for stack chunk
boundaries and could corrupt the stack underflow frame, leading
to crashes.
We add a check to use safe writes if we cross the chunk boundary
and also handle stack underflow if Sp is advanced past the underflow
frame.
fix #27001
(cherry picked from commit 72b20fc0ad4b6ad12c67f686af5cb42700656886)
- - - - -
cd26930a by Sylvain Henry at 2026-06-10T22:07:52+05:30
JS: install rts/Types.h header file (#27033)
It was an omission, making HsFFI.h not usable with GHC using the JS
backend.
(cherry picked from commit 5b1be555be4f0989d78c274991c5046d7ac6d25e)
- - - - -
801eb2cc by Rodrigo Mesquita at 2026-06-10T22:07:52+05:30
Expose decodeStackWithIpe from ghc-experimental
This decoding is useful to the debugger and it wasn't originally
exported as an oversight.
(cherry picked from commit 67c47771185d5540a9e732f5418ffeaecd4cac5f)
- - - - -
54960c48 by Matthew Pickering at 2026-06-10T22:07:52+05:30
Add support for custom external interpreter commands
It can be useful for GHC API clients to implement their own external
interpreter commands.
For example, the debugger may want an efficient way to inspect the
stacks of the running threads in the external interpreter.
(cherry picked from commit 1851336595243259a37eaac75aba174825aca028)
- - - - -
e71222d0 by ARATA Mizuki at 2026-06-10T22:07:52+05:30
rts: Align stack to 64-byte boundary in StgRun on x86
When LLVM spills AVX/AVX-512 vector registers to the stack, it requires
32-byte (__m256) or 64-byte (__m512) alignment. If the stack is not
sufficiently aligned, LLVM inserts a realignment prologue that reserves
%rbp as a frame pointer, conflicting with GHC's use of %rbp as an STG
callee-saved register and breaking the tail-call-based calling convention.
Previously, GHC worked around this by lying to LLVM about the stack
alignment and rewriting aligned vector loads/stores (VMOVDQA, VMOVAPS)
to unaligned ones (VMOVDQU, VMOVUPS) in the LLVM Mangler. This had two
problems:
- It did not extend to AVX-512, which requires 64-byte alignment. (#26595)
- When Haskell calls a C function that takes __m256/__m512 arguments on
the stack, the callee requires genuine alignment, which could cause a
segfault. (#26822)
This patch genuinely aligns the stack to 64 bytes in StgRun by saving
the original stack pointer before alignment and restoring it in
StgReturn. We now unconditionally advertise 64-byte stack alignment to
LLVM for all x86 targets, making rewriteAVX in the LLVM Mangler
unnecessary. STG_RUN_STACK_FRAME_SIZE is increased from 48 to 56 bytes
on non-Windows x86-64 to store the saved stack pointer.
Closes #26595 and #26822
Co-Authored-By: Claude Opus 4.5 <noreply(a)anthropic.com>
(cherry picked from commit a5ec467ee3d4e77c026437a545981269acde3434)
- - - - -
870b27d0 by sheaf at 2026-06-10T22:07:52+05:30
Avoid infinite loop in deep subsumption
This commit ensures we only unify after we recur in the deep subsumption
code in the FunTy vs non-FunTy case of GHC.Tc.Utils.Unify.tc_sub_type_deep,
to avoid falling into an infinite loop.
See the new Wrinkle [Avoiding a loop in tc_sub_type_deep] in
Note [FunTy vs non-FunTy case in tc_sub_type_deep] in GHC.Tc.Utils.Unify.
Fixes #26823
Co-authored-by: simonpj <simon.peytonjones(a)gmail.com>
(cherry picked from commit 45428f88f62896650156dc8222299744ae2a00e4)
- - - - -
7e39423e by Ian Duncan at 2026-06-10T22:07:52+05:30
AArch64: fix MOVK regUsageOfInstr to mark dst as both read and written
MOVK (move with keep) modifies only a 16-bit slice of the destination
register, so the destination is both read and written. The register
allocator must know this to avoid clobbering live values. Update
regUsageOfInstr to list the destination in both src and dst sets.
No regression test: triggering the misallocation requires specific
register pressure around a MOVK sequence, which is difficult to
reliably provoke from Haskell source.
(cherry picked from commit 2823b03966e495581f4695f07649c5885306b656)
- - - - -
5e9d2873 by Matthew Pickering at 2026-06-10T22:07:52+05:30
rts: forward clone-stack messages after TSO migration
MSG_CLONE_STACK assumed that the target TSO was still owned by the
capability that received the message. This is not always true: the TSO
can migrate before the inbox entry is handled.
When that happened, handleCloneStackMessage could clone a live stack from
the wrong capability and use the wrong capability for allocation and
performTryPutMVar, leading to stack sanity failures such as
checkStackFrame: weird activation record found on stack.
Fix this by passing the current capability into
handleCloneStackMessage, rechecking msg->tso->cap at handling time, and
forwarding the message if the TSO has migrated. Once ownership matches,
use the executing capability consistently for cloneStack, rts_apply, and
performTryPutMVar.
Fixes #27008
(cherry picked from commit 5b550754ca0153a705ec607407074fe5716c1f7e)
- - - - -
e74ca3c3 by Wen Kokke at 2026-06-10T22:07:52+05:30
Fix race condition between flushEventLog and start/endEventLogging.
This commit changes `flushEventLog` to acquire/release the `state_change` mutex to prevent interleaving with `startEventLogging` and `endEventLogging`. In the current RTS, `flushEventLog` _does not_ acquire this mutex, which may lead to eventlog corruption on the following interleaving:
- `startEventLogging` writes the new `EventLogWriter` to `event_log_writer`.
- `flushEventLog` flushes some events to `event_log_writer`.
- `startEventLogging` writes the eventlog header to `event_log_writer`.
This causes the eventlog to be written out in an unreadable state, with one or more events preceding the eventlog header.
This commit renames the old function to `flushEventLog_` and defines `flushEventLog` simply as:
```c
void flushEventLog(Capability **cap USED_IF_THREADS)
{
ACQUIRE_LOCK(&state_change_mutex);
flushEventLog_(cap);
RELEASE_LOCK(&state_change_mutex);
}
```
The old function is still needed internally within the compilation unit, where it is used in `endEventLogging` in a context where the `state_change` mutex has already been acquired. I've chosen to mark `flushEventLog_` as static and let other uses of `flushEventLog` within the RTS refer to the new version. There is one use in `hs_init_ghc` via `flushTrace`, where the new locking behaviour should be harmless, and one use in `handle_tick`, which I believe was likely vulnerable to the same race condition, so the new locking behaviour is desirable.
I have not added a test. The behaviour is highly non-deterministic and requires a program that concurrently calls `flushEventLog` and `startEventLogging`/`endEventLogging`. I encountered the issue while developing `eventlog-socket` and within that context have verified that my patch likely addresses the issue: a test that used to fail within the first dozen or so runs now has been running on repeat for several hours.
(cherry picked from commit 3d6492ce311611707e80b2594103ddbe93fc6c76)
- - - - -
8fc8235a by Luite Stegeman at 2026-06-10T22:07:52+05:30
Windows: remove StgAsyncIOResult and fix crash/leaks
In stg_block_async{_void}, a stack slot was reserved for
an StgAsyncIOResult. This slot would be filled by the IO
manager upon completion of the async call.
However, if the blocked thread was interrupted by an async
exception, we would end up in an invalid state:
- If the blocked computation was never re-entered, the
StgAsyncIOResult would never be freed.
- If the blocked computation was re-entered, the thread would
find an unitialized stack slot for the StgAsyncIOResult,
leading to a crash reading its fields, or freeing the pointer.
We fix this by removing the StgAsyncIOResult altogether and writing
the result directly to the stack.
Fixes #26341
(cherry picked from commit fcf092dda534cc38637d1f7920aa0dae58fe5273)
- - - - -
5974d0a0 by Luite Stegeman at 2026-06-10T22:07:52+05:30
Don't refine DEFAULT alt for unary typeclasses
A non-DEFAULT data alt for a unary typeclass dictionary would
interfere with Unary Class Magic, leading to segfaults.
fixes #27071
(cherry picked from commit 05094993774191ede5c96770d8c91e8235fb922d)
- - - - -
0958d635 by Zubin Duggal at 2026-06-10T22:07:52+05:30
driver: recognise .dyn_o as a valid object file to link if passed on the command line.
This allows plugins compiled with this suffix to run.
Fixes #24486
(cherry picked from commit bc4b44870d096d43e8cbc530da1fd613d9e4514f)
- - - - -
6b5165cc by Simon Peyton Jones at 2026-06-10T22:07:52+05:30
Make inlining a bit more eager for overloaded functions
If we have
f d = ... (class-op d x y) ...
we should be eager to inline `f`, because that may change the
higher order call (class-op d x y) into a call to a statically
known function.
See the discussion on #26831.
Even though this does a bit /more/ inlining, compile times
decrease by an average of 0.4%.
Compile time changes:
DsIncompleteRecSel3(normal) 431,786,104 -2.2%
ManyAlternatives(normal) 670,883,768 -1.6%
ManyConstructors(normal) 3,758,493,832 -2.6% GOOD
MultilineStringsPerf(normal) 29,900,576 -2.8%
T14052Type(ghci) 1,047,600,848 -1.2%
T17836(normal) 392,852,328 -5.2%
T18478(normal) 442,785,768 -1.4%
T21839c(normal) 341,536,992 -14.1% GOOD
T3064(normal) 174,086,152 +5.3% BAD
T5631(normal) 506,867,800 +1.0%
hard_hole_fits(normal) 209,530,736 -1.3%
info_table_map_perf(normal) 19,523,093,184 -1.2%
parsing001(normal) 377,810,528 -1.1%
pmcOrPats(normal) 60,075,264 -0.5%
geo. mean -0.4%
minimum -14.1%
maximum +5.3%
Runtime changes
haddock.Cabal(normal) 27,351,988,792 -0.7%
haddock.base(normal) 26,997,212,560 -0.6%
haddock.compiler(normal) 219,531,332,960 -1.0%
Metric Decrease:
LinkableUsage01
ManyConstructors
T17949
T21839c
T13035
TcPlugin_RewritePerf
hard_hole_fits
Metric Increase:
T3064
(cherry picked from commit 3eaac1f2b549a1e8788ab98c061391ce39ee18de)
- - - - -
39764f2c by Andreas Klebinger at 2026-06-10T22:07:52+05:30
Give the Data instance for ModuleName a non-bottom toConstr implementation.
I've also taken the liberty to add Note [Data.Data instances for GHC AST Types]
describing some of the uses of Data.Data I could find.
Fixes #27129
(cherry picked from commit 28ce1f8afb9dd74bc39148a36f5bf61f8bffdcc6)
- - - - -
c6b091d8 by Matthew Pickering at 2026-06-10T22:07:52+05:30
Make home unit dependencies stored as sets
Co-authored-by: Wolfgang Jeltsch <wolfgang(a)well-typed.com>
(cherry picked from commit d17d1435d1ac1f1e4f806181da944ec541e79d19)
- - - - -
6efed76c by Zubin Duggal at 2026-06-10T22:07:53+05:30
hadrian: Don't include the package hash in the haddock directory
Since GHC 9.8 and hash_unit_ids, haddock urls have looked like`ghc-9.10.3/doc/html/libraries/base-4.20.2.0-39f9/**/*.html`
The inclusion of the hash makes it hard for downstream non-boot packages to properly link to these files, as the hash is not
part of a standard cabal substitution.
Since we only build one version of each package, we don't need the hash to disambiguate anything, we can just remove it.
Fixes #26635
(cherry picked from commit 07267f79d91169f474cacc8bcd38d76a6e97887d)
- - - - -
46f93fbd by Simon Jakobi at 2026-06-10T22:07:53+05:30
Fix -dsuppress-uniques for free variables in demand signatures
Before: Str=b{sXyZ->S}
With this patch: Str=b{S}
T13143.stderr is updated accordingly.
Fixes #27106.
(cherry picked from commit 5b82080a3f3dd476e198130218d4da729fb5334a)
- - - - -
7ca13903 by sheaf at 2026-06-10T22:07:53+05:30
Deal with 'noSpec' in 'coreExprToPmLit'
This commit makes two separate changes relating to
'GHC.HsToCore.Pmc.Solver.Types.coreExprAsPmLit':
1. Commit 7124e4ad mistakenly marked deferred errors as non-canonical,
which led to the introduction of 'nospec' wrappers in the
generated Core. This reverts that accident by declaring deferred
errors as being canonical, avoiding spurious 'nospec' wrapping.
2. Look through magic identity-like Ids such as 'nospec', 'inline' and
'lazy' in 'coreExprAsPmLit', just like Core Prep does.
There might genuinely be incoherent evidence, but that shouldn't
obstruct the pattern match checker. See test T27124a.
Fixes #25926 #27124
-------------------------
Metric Decrease:
T3294
-------------------------
(cherry picked from commit e8a196c65cee32f06c3d99b74af33457511408c7)
- - - - -
f7ceb7fa by Rodrigo Mesquita at 2026-06-10T22:07:53+05:30
New rts Message to {set,unset} TSO flags
This commit introduces stg_MSG_SET_TSO_FLAG_info and
stg_MSG_UNSET_TSO_FLAG_info, which allows setting flags of a TSO other
than yourself.
This is especially useful/necessary to set breakpoints and toggle
breakpoints of different threads, which is needed to safely implement
features like pausing, toggling step-out, toggling step-in per thread,
etc.
Fixes #27131
-------------------------
Metric Decrease:
T3294
-------------------------
(cherry picked from commit 5bd6a96485ff9bfcbf06eaec69776bf8af61b563)
- - - - -
596c4ec8 by Rodrigo Mesquita at 2026-06-10T22:07:53+05:30
test: Add test setting another TSO's flags
Introduces a test that runs on two capabilities. The main thread running
on Capability 0 sets the flags on a TSO running on Capability 1.
The TSO from Capability 1 itself checks whether its flags were set and
reports that back.
This validates that the RTS messages for setting TSO flags work, even if
it doesn't test a harsher scenario with race conditions to exercise why
the message passing is necessary for safely setting another TSO's flags.
Part of #27131
(cherry picked from commit ce97fd3ed13028034ba27c34a6decdb3460aa4eb)
- - - - -
9835948b by Wolfgang Jeltsch at 2026-06-10T22:07:53+05:30
Introduce a cache of home module name providers
This contribution introduces to the module graph a cache that maps home
module names to sets of units providing them and changes the finder to
use that cache. This is a performance optimization, especially for
multi-home-unit builds.
The particular changes are as follows:
* In `GHC.Unit.Module.Graph`, `ModuleGraph` is extended with a new
field `mg_home_module_name_providers_map`, exposed as
`mgHomeModuleNameProvidersMap`. This is a cache that assigns to each
home module name the set of IDs of home units that define it.
Operations that construct module graphs are updated such that this
cache stays synchronized.
* In `GHC.Unit.Finder`, `findImportedModule` is changed to pull
`mgHomeModuleNameProvidersMap` from `hsc_mod_graph` and pass it to
`findImportedModuleNoHsc`, which now does not search home units in
arbitrary order but prioritizes those units that the cache mentions
as potential providers of the requested module.
In addition, this contribution adds variants of the two multi-component
compiler performance tests that use 100 units instead of 20, because
with just 20 units the benefits from caching of home module name
providers are still negligible.
The following table shows the total time needed for running both
multi-component tests before and after this contribution and with
different numbers of units:
| # of units | Before | After |
|-----------:|-------:|------:|
| 20 | 0:12 | 0:12 |
| 100 | 0:47 | 0:42 |
| 200 | 3:05 | 2:08 |
Note that there seems to be a general overhead of 12 seconds that is not
attributable to the actual tests, so that the real running times should
be 12 seconds smaller than shown above.
Resolves #27055.
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
Co-authored-by: Matthew Pickering <matthewtpickering(a)gmail.com>
Co-authored-by: Fendor <fendor(a)posteo.de>
(cherry picked from commit 5fab22387a66657e5e19f1ba490f09af1168eb06)
- - - - -
df410e5a by Cheng Shao at 2026-06-10T22:07:53+05:30
testsuite: mark T22159 as fragile
This patch marks T22159 as fragile on Windows for issue described in #27248.
Before we get to the bottom of those failures, this unblocks newer
Windows runners.
(cherry picked from commit 38b76b2f1d918f10d2f9d3e57bd0459dfe671d4f)
- - - - -
93811d82 by Ian Duncan at 2026-06-10T22:07:53+05:30
AArch64: use ASR not LSR for MO_U_Shr at W8/W16
The unsigned right shift (MO_U_Shr) for sub-word widths (W8, W16)
with a variable shift amount was emitting ASR (arithmetic/signed shift
right) after zero-extending with UXTB/UXTH. This should be LSR
(logical/unsigned shift right). After zero-extension the upper bits
happen to be 0 so ASR produces the same result, but it is semantically
wrong and would break if the zero-extension were ever optimized away.
Includes assembly output test (grep for lsr) and runtime test
verifying unsigned right shift of Word8 and Word16 values.
(cherry picked from commit 50188615342098345fc2822ea223ab23791bbf49)
- - - - -
f4afeba1 by fendor at 2026-06-10T22:07:53+05:30
Fix regression T27202: `:load` and `:add` work in GHCi
To fix the regression there are conceptually two major things that we
fix:
* We don't remove the `importDirs` from `interactive-session`
* When `:add`ing a module, we don't try to find them via PackageImports
* The PackageImport is wrong as we can't know the package-name at
this stage in ghc/UI.hs
What does it mean to not remove the `importDirs` from
`interactive-session`?
It means that, given some initial `DynFlags`, we will use those
`importDirs` in `interactive-session`.
The initial `DynFlags`, however, depend on how you initialise the GHC
session.
For a simple session, initialised by
ghc -isrc -this-unit-id main
It is simple, just use the `DynFlags` given on the cli.
Thus, `main` and `interactive-session` will have the same `DynFlags`,
except for the `homeUnitId` and `interactive-session` depends on `main`
by construction of the GHCi session.
What about a multiple home unit session, though?
ghc -unit @unit1 -unit @unit2
What are the `DynFlags` in this cli invocation? It shouldn't be either
`@unti1` nor `@unit2`, as the order shouldn't matter or any other
implicit condition.
For consistency, we decide that the initial `DynFlags` are the top
`DynFlags` on the cli, ignoring `-unit` flags.
Thus, in this example, there are no `importsDirs` regardless of what we
might find in `@unit1` and `@unit2`.
But in this invocation:
ghc -isrc -unit @unit1 -unit @unit2
The `interactive-session` will have the `importsDirs` `src`.
Note, `-isrc` will be inherited in `@unit1` and `@unit2`, so you need to
explicitly use `-i` to clear the `importsDirs`, in order to avoid
accidentally adding `src` as an import directory to all other home
units.
This fix has been made possible by the improvements introduced in
!15888, which avoids ambiguity when a home unit shares the `importsDirs`
with the `interactive-session`, on top of being much faster for multiple
home units.
Adds regression tests for T27202 for `:load`ing and `:add`ing modules
that are located in import directories.
(cherry picked from commit 286f1adff3e78d775ff325caff71d0cee25d710b)
- - - - -
18b5da32 by fendor at 2026-06-10T22:07:53+05:30
Use home unit package db stacks in GHCi prompt and session unit
In order to import modules from home unit dependencies (e.g., `Data.Map`),
the ghci prompt unit needs to populate its `UnitState`.
This is tricky to handle correctly, which `PackageDBFlag`s should we use
to populate the `UnitState`?
We decide, the most intuitive solution for users is to depend on all
`PackageDBFlag`s, so that any dependency can be imported in GHCi.
This assumes consistency in the `PackageDBFlag`s, so no two home units
specify `PackageDBFlag`s that are inconsistent with each other.
We could simply concat all the `PackageDBFlag`s of the existing home
units, but later `PackageDBFlag`s shadow earlier ones, leading to the
last processed home units' `PackageDBFlag`s to shadow the earlier ones.
This is hard to fix, we need to give users the capability to provide ghc
options for the ghci prompt home unit.
However, as this is considerably more work, we decided on an
approximation that should work out most of the time.
Package Db stacks in cabal and stack follow a certain structure:
-no-user-package-db > -package-db $cabal-store > -package-db $local-db
The first two arguments are always the same, namely the
`-no-user-package-db` and `-package-db`.
We compute the longest common prefix over all home units, and use that
as the start of the package db stack. Then, over the rest of the
`PackageDBFlag`s, we simply take the union and append them to our
initial stack.
We assume, that the rest of package dbs only defines very few, "local"
units that are usually not shadowing each other.
This allows us to get a relatively consistent package database stack for
the ghci prompt home unit.
Similar reasoning applies to the session unit in order to add modules to
the session and have dependencies available in the module.
We do something similar for `-package` flags, to make sure only the
correct units are actually visible in the ghci session.
This time, we simply take the union of all `PackageFlag`s, allowing us
to import modules from the home unit dependencies.
In the future, it would be beneficial to allow the user to provide the
exact ghc options to control the visibilities. For now, this will have
to do.
(cherry picked from commit 728662de2084069ef53bd5adf2c0e8b1e8814bc0)
- - - - -
f1d9b476 by fendor at 2026-06-10T22:07:53+05:30
Speed up 'closure' computation in `ghc-pkg`
Cache the set of already seen `UnitId`s and use `Set` operations to
speed up 'closure' computation.
Further simplify the implementation of 'closure' to account for the
actual usage.
As a consequence, we rename 'closure' to 'brokenPackages' to reflect its
purpose better after the simplification.
(cherry picked from commit 50e999cae0297be156d3cc6a683fc3c7634428f0)
- - - - -
632be513 by Cheng Shao at 2026-06-10T22:07:53+05:30
wasm: ensure post-linker output is synchronous ESM
This patch fixes wasm backend's post-linker output script to ensure
it's synchronous ESM and doesn't use top-level await, which doesn't
work in ServiceWorkers. Fixes #27257.
(cherry picked from commit cccf45da01988801b0c97f7e7ed0160191980226)
- - - - -
6636f01f by sheaf at 2026-06-10T22:07:53+05:30
Improve incomplete record selector warnings
This commit stops GHC from emitting spurious incomplete record selector
warnings for bare selectors/projections such as .fld
There are two places we currently emit incomplete record selector
warnings:
1. In the desugarer, when we see a record selector or an occurrence
of 'getField'. Here, we can use pattern matching information to
ensure we don't give false positives.
2. In the typechecker, which might sometimes give false positives but
can emit warnings in cases that the pattern match checker would
otherwise miss.
This is explained in Note [Detecting incomplete record selectors]
in GHC.HsToCore.Pmc.
Now, we obviously don't want to emit the same error twice, and generally
we prefer (1), as those messages contain fewer false positives. So we
suppress (2) when we are sure we are going to emit (1); the logic for
doing so is in GHC.Tc.Instance.Class.warnIncompleteRecSel,
and works by looking at the CtOrigin.
Now, the issue was that this logic handled explicit record selectors as
well as overloaded record field selectors such as "x.r" (which turns
into a simple GetFieldOrigin CtOrigin), but it didn't properly handle
record projectors like ".fld" or ".fld1.fld2" (which result in other
CtOrigins such as 'RecordFieldProjectionOrigin').
To solve this problem, we re-use the 'isHasFieldOrigin' introduced in
fbdc623a (slightly adjusted).
On the way, we also had to update the desugarer with special handling
for the 'ExpandedThingTc' case in 'ds_app', to make sure that
'ds_app_var' sees all the type arguments to 'getField' in order for it
to indeed emit warnings like in (1).
Fixes #26686
(cherry picked from commit 52c3e6ba9f03d19a4fa85aee6a4c417b538160f7)
- - - - -
b30f3ac1 by sheaf at 2026-06-10T22:07:53+05:30
Only use active rules when simplifying rule RHSs
When we are simplifying the RHS of a rule, we make sure to only apply
rewrites from rules that are active throughout the original rule's
range of active phases.
For example, if a rule is always active, we only fire rules that are
themselves always active when simplifying the RHS. Ditto for inline
activations.
This is achieved by setting the simplifier phase to a range of phases,
using the new SimplPhaseRange constructor. Then:
1. When simplifying the RHS of a rule, or of a stable unfolding,
we set the simplifier phase to a range of phases, computed from
the activation of the RULE/unfolding activation, using the
function 'phaseFromActivation'.
The details are explained in Note [What is active in the RHS of a RULE?]
in GHC.Core.Opt.Simplify.Utils.
2. The activation check for other rules and inlinings is then:
does the activation of the other rule/inlining cover the whole
phase range set in sm_phase? This continues to use the 'isActive'
function, which now accounts for phase ranges.
On the way, this commit also moves the exact-print SourceText annotation
from the Activation datatype to the ActivationAnn type. This keeps the
main Activation datatype free of any extra cruft.
Fixes #26323
(cherry picked from commit 2da84b7a83f723dc6531cdad5ef3c7e624fda2fe)
- - - - -
87dd2d36 by Simon Peyton Jones at 2026-06-10T22:07:53+05:30
Include current phase in the range for rule/unfoldings
This MR fixes a bad loop in the compiler: #26826.
The fix is to add (WAR2) to
Note [What is active in the RHS of a RULE or unfolding?]
in GHC.Core.Opt.Simplify.Utils
(cherry picked from commit 269c4087979ff9d675cd1a59076157211d1c555d)
- - - - -
687e7798 by Simon Peyton Jones at 2026-06-10T22:07:53+05:30
QuickLook's tcInstFun should make instantiation variables directly
tcInstFun must make "instantiation variables", not regular
unification variables, when instantiating function types. That was
previously implemented by a hack: set the /ambient/ level to QLInstTyVar.
But the hack finally bit me, when I was refactoring WhatUnifications.
And it was always wrong: see the now-expunged (TCAPP2) note.
This commit does it right, by making tcInstFun call its own
instantiation functions. That entails a small bit of duplication,
but the result is much, much cleaner.
(cherry picked from commit 231adc30be97ae51650aff7a40e00e05f4876af6)
- - - - -
8ed7a710 by Zubin Duggal at 2026-06-10T22:07:53+05:30
Revert "docs: note #26543 in known bugs"
This reverts commit ebc6d49bd309bb843bc58e8c712ade767818e9ac.
Obsolete now that the fix from MR 14474 (commit 231adc30) is backported.
- - - - -
ae07c290 by Luite Stegeman at 2026-06-10T22:07:53+05:30
Fix assert in Interpreter.c
If we skip exactly the number of words on the stack we end up on
the first word in the next chunk.
(cherry picked from commit 404b71c181bde4256565307d495cd2fa124d02f1)
- - - - -
a4070057 by Ben Gamari at 2026-06-10T22:07:53+05:30
rts/Interpreter: Factor out ctoi tuple info tables into data
Instead of a massive case let's put this into data which we can reuse
elsewhere.
(cherry picked from commit d2b89603425b6d08df199deb7b84cfdbd711869a)
- - - - -
7f0a32b8 by Luite Stegeman at 2026-06-10T22:07:53+05:30
Support arbitrary size unboxed tuples in bytecode
This stores the size (number of words on the stack) of the next
expected tuple in the TSO, ctoi_spill_size field, eliminating
the need of stg_ctoi_tN frames for each size.
Note: On 32 bit platform there is still a bytecode tuple size
limit of 255 words on the stack.
Fixes #26946
(cherry picked from commit a85bd503a480cfa31f5afa09eb38f56c85c237de)
- - - - -
8e8e3d32 by Luite Stegeman at 2026-06-10T22:07:53+05:30
Add specialized frames for small tuples
Small tuples are now returned more efficiently to the interpreter.
They use one less word of stack space and don't need manipulation
of the TSO anymore.
(cherry picked from commit e2209031734770a51f04883e5b538b562449cba1)
- - - - -
5648f3e2 by Luite Stegeman at 2026-06-10T22:07:53+05:30
rts: add a few missing i386 relocations in the rts linker
(cherry picked from commit 04d143c02e82e9ca03eb75849959d369d07fb81a)
- - - - -
4ec0815f by Luite Stegeman at 2026-06-10T22:07:53+05:30
CodeOutput: Fix finalizers on multiple platforms
- ELF platforms: emit .fini_array section
- wasm32/Darwin: emit initializer with __cxa_atexit call
- Windows: use -Wl,--whole-archive to prevent dropping finalizer symbols
- rts linker: fix crash/assertion failure unloading objects with finalizers
fixes #27072
(cherry picked from commit 014087e7a5753687161a24a1b2bc55c7bf7273fd)
- - - - -
14948642 by Ben Gamari at 2026-06-10T22:07:53+05:30
ghc-internal: Move STM utilities out of GHC.Internal.Conc.Sync
This is necessary to avoid an import cycle on Windows when importing
`GHC.Internal.Exception.Context` in `GHC.Internal.Conc.Sync`.
On the road to address #25365.
(cherry picked from commit 039bac4cf9590a6a09aa302b99fa2a0993cc0a32)
- - - - -
6d624f5f by Ben Gamari at 2026-06-10T22:07:53+05:30
base: Capture backtrace from throwSTM
Implements core-libraries-committee#297.
Fixes #25365.
(cherry picked from commit 8c389e8ce9a536da8e396a1df8c726583d0bcc14)
- - - - -
154a4b5b by Ben Gamari at 2026-06-10T22:07:54+05:30
base: Annotate rethrown exceptions in catchSTM with WhileHandling
Implements core-libraries-committee#298
(cherry picked from commit e1ce1fc3ad38d192cd3b6a38cb42051f4b115e95)
- - - - -
89483bdd by fendor at 2026-06-10T22:08:32+05:30
Hide implementation details from base exception stack traces
Ensure we hide the implementation details of the exception throwing mechanisms:
* `undefined`
* `throwSTM`
* `throw`
* `throwIO`
* `error`
The `HasCallStackBacktrace` should always have a length of exactly 1,
not showing internal implementation details in the stack trace, as these
are vastly distracting to end users.
CLC proposal [#387](https://github.com/haskell/core-libraries-committee/issues/387)
(cherry picked from commit 016f79d54d482de01dd396bd9bf79f958d7c4922)
- - - - -
f26cd3c9 by sheaf at 2026-06-10T22:08:32+05:30
Relax acceptance threshold for T10421
As seen in #27289, the 1% acceptance threshold for this text was
overly narrow, resulting in spurious test failures. This commit widens
the acceptance threshold to 2%. Fixes #27289.
(cherry picked from commit b0233814d63c2802a521dfc7dae08b1ecf494c50)
- - - - -
6228d886 by mangoiv at 2026-06-10T22:08:32+05:30
libraries/process: bump submodule to v1.6.29.0
This submodule bump resolves a segfault on macos 15.
Fixes #27144
(cherry picked from commit 277a3687c4b729e4d1ff4d4503a5673deba5eda7)
- - - - -
3e9c5f42 by mangoiv at 2026-06-10T22:08:32+05:30
libraries/unix: in submodule, don't pick branch 2.7
The 2.7 branch is outdated and the module has been advanced far beyond
it anyway, so remove that line.
(cherry picked from commit 6779bb0c2d2784182465337ba5e94b7cd8810f2b)
- - - - -
e55350a2 by Luite Stegeman at 2026-06-10T22:08:32+05:30
Fixes for black holes
- suspend duplicate work for eager black holes
- detect eager black holes in checkBlockingQueues
- don't overwrite existing black holes even if they're not
in an eager blackhole frame
- don't deadlock on self when thunk is already blackholed
Fixes #26936
(cherry picked from commit 63ce5770da1712f0da54665d8755772bf38ba51e)
- - - - -
0379d227 by Tom McLaughlin at 2026-06-10T22:08:32+05:30
Event/Windows.hsc: rethrow exceptions in overlapped IO
This prevents the WinIO manager from swallowing exceptions in overlapped IO. It
was added to make WinIO support possible in the `network` library. See
https://gitlab.haskell.org/ghc/ghc/-/issues/27283.
We also bump __IO_MANAGER_WINIO__ to 2 so libraries can gate on this using CPP.
(cherry picked from commit 037a80dc65d3975adf4a35d46876850e644bc80e)
- - - - -
42c101f1 by Zubin Duggal at 2026-06-10T22:08:32+05:30
Update to semaphore-compat 2.0.0 using v2 of the protocol
On Linux and other POSIX platforms, GHC's -jsem jobserver client now
speaks v2 of the semaphore-compat protocol, which uses Unix domain
sockets in place of POSIX named semaphores. This avoids the libc-ABI
issues that affected the old implementation. Windows is unaffected
and continues to use the v1 protocol (Win32 named semaphores); its
reported protocol version remains v1.
When GHC receives a -jsem name whose protocol version it does not
support, it emits a -Wsemaphore-version-mismatch warning and falls
back to -j<N> rather than crashing. ghc --info exposes the supported
version in a new "Semaphore version" entry so cabal-install can detect
a mismatch before invoking GHC.
Users on a cabal-install that predates the v2 update will continue to
build successfully on Linux/POSIX, but will lose the cross-process
-jsem coordination and fall back to -j<N> per GHC invocation. Users
must upgrade to a cabal-install that supports protocol v2 to recover
full parallelism.
Also fix a leak in cleanupSem (#27253): cleanupSem used to snapshot
heldTokens and release them before killing the loop, while the loop's
in-flight acquire/release children could still be mutating it.
Cleanup now runs inside the loop's own exit handler, after draining
the active child via a new activeChild TVar, so the snapshot has no
concurrent mutator.
See also:
- GHC proposal amendment: https://github.com/ghc-proposals/ghc-proposals/pull/673
- cabal-install patch: https://github.com/haskell/cabal/pull/11628
- semaphore-compat MR: https://gitlab.haskell.org/ghc/semaphore-compat/-/merge_requests/8
Bump semaphore-compat submodule to 2.0.0
Fixes #25087 and #27253
(cherry picked from commit 8db331a381ae47ad9ad5c8613f5d3e2588d5dd55)
- - - - -
3ea5cc50 by mangoiv at 2026-06-10T22:08:32+05:30
Trim the continuation in mkDupableContWithDmds
When there are no remaining argument demands, it means the application
is bottoming. In this case, we can trim the continuation to avoid the
panic that was observed in #27261.
See Note [Trimming the continuation for bottoming functions] in
GHC.Core.Opt.Simplify.Iteration.
This patch was rewritten to avoid pulling in a refactor.
The original patch is included in master as 4a645683
(cherry picked from commit 53f74985860b35a879bfd0dc642e7fcafffcf5e4)
- - - - -
ac7e92a0 by mangoiv at 2026-06-10T22:08:33+05:30
profiling: partial backport of 2dadf3b0 to fix #27121
This backports fix and test for #27121 from 2dadf3b0 since the entirety
of the patch is not backportable without also backporting two larger
refactorings.
(cherry picked from commit 0ccecfc5b5a118c2c850f876709c21162d35d972)
- - - - -
0dbc48f2 by Teo Camarasu at 2026-06-10T22:08:33+05:30
Add explicit export list to GHC.Num
Let's make clear what this module exports to allow us to easily deprecate and remove some of these in the future. Resolves https://gitlab.haskell.org/ghc/ghc/-/issues/26625
(cherry picked from commit b14bdd59202e0c32df8e5cc1923677f59c8f16e7)
- - - - -
a030a0ac by Teo Camarasu at 2026-06-10T22:08:33+05:30
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
(cherry picked from commit 75a9053d26183e71b48de4c603b04af2fa4a732d)
- - - - -
86eb3e2c by Simon Peyton Jones at 2026-06-10T22:08:33+05:30
Add a deprecation warning for static forms
The accepted
GHC proposal 732: Simplify static forms
https://github.com/ghc-proposals/ghc-proposals/pull/732
needs a deprecation warning added to GHC 9.14, to warn about static
forms that mention nested free variables; see #26718.
This MR adds that warning, with test T26718 to check it.
There is no flag to switch the warning off.
(cherry picked from commit 6b7d6287c6ff4fd1b0d3aa2abfdaf73d43c4a9a0)
- - - - -
a13cee5f by Cheng Shao at 2026-06-10T22:08:33+05:30
rts: fix -Wcompare-distinct-pointer-types errors
This commit fixes `-Wcompare-distinct-pointer-types` errors in the RTS
which should have been caught by the `validate` flavour but was
warnings in CI due to the recent `+werror` regression.
(cherry picked from commit de54e264c3c87c21e4243c2e9a402923ec7d9d6e)
- - - - -
599 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitmodules
- + changelog.d/T26979
- + changelog.d/T27124.md
- + changelog.d/T27131
- + changelog.d/T27202
- + changelog.d/bump-process
- + changelog.d/fix-blackhole-handling
- + changelog.d/fix-finalizers-27072
- + changelog.d/ghc-pkg-faster-closure
- + changelog.d/jobserver-leak-fix
- + changelog.d/more-efficient-home-unit-imports-finding
- + changelog.d/semaphore-v2
- + changelog.d/wasm-fix-serviceworker
- + changelog.d/windows-rethrow-overlapped-exception
- compiler/GHC.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/InitFini.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs
- compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/Base.hs
- compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs
- compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs
- compiler/GHC/CmmToAsm/Reg/Liveness.hs
- + compiler/GHC/CmmToAsm/Reg/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Config.hs
- compiler/GHC/CmmToLlvm/Data.hs
- compiler/GHC/CmmToLlvm/Mangler.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/Pipeline/Types.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Inline.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/CmmToLlvm.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Config/Core/Opt/Simplify.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Errors/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/MakeAction.hs
- compiler/GHC/Driver/MakeSem.hs
- compiler/GHC/Driver/Phases.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Static.hs
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Interpreter/Types.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Demand.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/ForeignStubs.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Unique/Set.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/ModIface.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Binary.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- compiler/ghc.cabal.in
- configure.ac
- docs/users_guide/bugs.rst
- docs/users_guide/ghci.rst
- docs/users_guide/rtd-theme/layout.html
- docs/users_guide/using-warnings.rst
- docs/users_guide/using.rst
- docs/users_guide/wasm.rst
- ghc/GHCi/UI.hs
- ghc/Main.hs
- hadrian/bindist/Makefile
- hadrian/src/Builder.hs
- hadrian/src/CommandLine.hs
- hadrian/src/Context.hs
- hadrian/src/Flavour.hs
- hadrian/src/Rules/Compile.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/Cabal.hs
- hadrian/src/Settings/Builders/GenPrimopCode.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Packages.hs
- hie.yaml
- libraries/Cabal
- libraries/base/src/GHC/Conc.hs
- libraries/base/src/GHC/Conc/Sync.hs
- libraries/base/src/GHC/Num.hs
- libraries/base/src/GHC/Stats.hs
- libraries/base/src/System/Info.hs
- libraries/deepseq
- libraries/directory
- libraries/exceptions
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/Exception/Backtrace/Experimental.hs
- libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- + libraries/ghc-experimental/src/GHC/Stack/Decode/Experimental.hs
- + libraries/ghc-experimental/tests/Makefile
- + libraries/ghc-experimental/tests/all.T
- + libraries/ghc-experimental/tests/backtraces/Makefile
- + libraries/ghc-experimental/tests/backtraces/T26806a.hs
- + libraries/ghc-experimental/tests/backtraces/T26806a.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806b.hs
- + libraries/ghc-experimental/tests/backtraces/T26806b.stderr
- + libraries/ghc-experimental/tests/backtraces/T26806c.hs
- + libraries/ghc-experimental/tests/backtraces/T26806c.stderr
- + libraries/ghc-experimental/tests/backtraces/all.T
- libraries/ghc-internal/CHANGELOG.md
- libraries/ghc-internal/cbits/Stack.cmm
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Conc/IO.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/POSIX.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs-boot
- libraries/ghc-internal/src/GHC/Internal/Conc/Windows.hs
- libraries/ghc-internal/src/GHC/Internal/Err.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Thread.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Windows/Thread.hs
- libraries/ghc-internal/src/GHC/Internal/Exception.hs
- + libraries/ghc-internal/src/GHC/Internal/Prim.hs
- + libraries/ghc-internal/src/GHC/Internal/STM.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/Stats.hsc
- + libraries/ghc-internal/tests/backtraces/T15395.hs
- + libraries/ghc-internal/tests/backtraces/T15395.stdout
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghc-internal/tests/stack-annotation/all.T
- libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame005.stdout
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/GHCi/Server.hs
- libraries/haskeline
- libraries/process
- libraries/semaphore-compat
- libraries/text
- libraries/transformers
- m4/fp_prog_cc_linker_target.m4
- m4/fptools_happy.m4
- rts/Apply.cmm
- rts/CloneStack.c
- rts/CloneStack.h
- rts/Compact.cmm
- rts/Continuation.c
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/HeapStackCheck.cmm
- rts/IOManager.c
- rts/Interpreter.c
- rts/Jumps.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/Messages.c
- rts/PrimOps.cmm
- rts/Printer.c
- rts/RaiseAsync.c
- rts/RtsMessages.c
- rts/RtsSymbols.c
- rts/Schedule.c
- rts/Stats.c
- rts/StgCRun.c
- rts/StgMiscClosures.cmm
- rts/StgStartup.cmm
- rts/ThreadPaused.c
- rts/Threads.c
- rts/Threads.h
- rts/Updates.h
- rts/eventlog/EventLog.c
- rts/include/RtsAPI.h
- rts/include/rts/Bytecodes.h
- rts/include/rts/Constants.h
- rts/include/rts/Messages.h
- rts/include/rts/storage/ClosureMacros.h
- rts/include/rts/storage/Closures.h
- rts/include/rts/storage/TSO.h
- rts/include/stg/MiscClosures.h
- rts/linker/Elf.c
- rts/linker/LoadArchive.c
- rts/linker/MachO.c
- rts/linker/PEi386.c
- rts/prim/atomic.c
- rts/rts.cabal
- rts/sm/Evac.c
- rts/sm/Evac_thr.c → rts/sm/Evac_par.c
- rts/sm/Scav_thr.c → rts/sm/Scav_par.c
- rts/win32/AsyncMIO.c
- rts/win32/AsyncMIO.h
- testsuite/driver/runtests.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/mk/boilerplate.mk
- testsuite/tests/arityanal/should_compile/Arity01.stderr
- testsuite/tests/arityanal/should_compile/Arity05.stderr
- testsuite/tests/arityanal/should_compile/Arity08.stderr
- testsuite/tests/arityanal/should_compile/Arity11.stderr
- testsuite/tests/arityanal/should_compile/Arity14.stderr
- testsuite/tests/arrows/should_compile/T21301.stderr
- + testsuite/tests/bytecode/T26640.hs
- + testsuite/tests/bytecode/T26640.script
- + testsuite/tests/bytecode/T26640.stdout
- + testsuite/tests/bytecode/T27001.hs
- + testsuite/tests/bytecode/T27001.stdout
- testsuite/tests/bytecode/all.T
- + testsuite/tests/bytecode/tuplestress/ByteCode.hs
- + testsuite/tests/bytecode/tuplestress/Common.hs-incl
- + testsuite/tests/bytecode/tuplestress/Obj.hs
- + testsuite/tests/bytecode/tuplestress/TupleStress.hs
- + testsuite/tests/bytecode/tuplestress/TupleStress.stdout
- + testsuite/tests/bytecode/tuplestress/all.T
- + testsuite/tests/cmm/opt/T25664.hs
- + testsuite/tests/cmm/opt/T25664.stdout
- testsuite/tests/cmm/opt/all.T
- + testsuite/tests/codeGen/should_gen_asm/aarch64-shl-subword.asm
- + testsuite/tests/codeGen/should_gen_asm/aarch64-shl-subword.hs
- + testsuite/tests/codeGen/should_gen_asm/aarch64-ushr-subword.asm
- + testsuite/tests/codeGen/should_gen_asm/aarch64-ushr-subword.hs
- testsuite/tests/codeGen/should_gen_asm/all.T
- testsuite/tests/codeGen/should_run/CgStaticPointers.hs
- testsuite/tests/codeGen/should_run/CgStaticPointersNoFullLazyness.hs
- + testsuite/tests/codeGen/should_run/T27072d.hs
- + testsuite/tests/codeGen/should_run/T27072d.stdout
- + testsuite/tests/codeGen/should_run/T27072d_c.c
- + testsuite/tests/codeGen/should_run/T27072d_check.c
- + testsuite/tests/codeGen/should_run/T27072w.hs
- + testsuite/tests/codeGen/should_run/T27072w.stdout
- + testsuite/tests/codeGen/should_run/T27072w_c.c
- + testsuite/tests/codeGen/should_run/aarch64-subword-ops.hs
- + testsuite/tests/codeGen/should_run/aarch64-subword-ops.stdout
- + testsuite/tests/codeGen/should_run/aarch64-ushr-subword-run.hs
- + testsuite/tests/codeGen/should_run/aarch64-ushr-subword-run.stdout
- testsuite/tests/codeGen/should_run/all.T
- + testsuite/tests/concurrent/should_run/T26341.hs
- + testsuite/tests/concurrent/should_run/T26341.stdout
- + testsuite/tests/concurrent/should_run/T26341a.hs
- + testsuite/tests/concurrent/should_run/T26341a.stdout
- + testsuite/tests/concurrent/should_run/T26341b.hs
- + testsuite/tests/concurrent/should_run/T26341b.stdout
- testsuite/tests/concurrent/should_run/all.T
- testsuite/tests/deSugar/should_fail/DsStrictFail.stderr
- testsuite/tests/deSugar/should_run/T20024.stderr
- testsuite/tests/deSugar/should_run/dsrun005.stderr
- testsuite/tests/deSugar/should_run/dsrun007.stderr
- testsuite/tests/deSugar/should_run/dsrun008.stderr
- testsuite/tests/default/default-fail05.stderr
- testsuite/tests/deriving/should_run/T9576.stderr
- testsuite/tests/diagnostic-codes/codes.stdout
- testsuite/tests/dmdanal/should_compile/T13143.stderr
- testsuite/tests/dmdanal/should_compile/T18894.stderr
- + testsuite/tests/dmdanal/should_compile/T27106.hs
- + testsuite/tests/dmdanal/should_compile/T27106.stderr
- testsuite/tests/dmdanal/should_compile/all.T
- + testsuite/tests/dmdanal/should_run/M1.hs
- + testsuite/tests/dmdanal/should_run/T26416.hs
- + testsuite/tests/dmdanal/should_run/T26416.stdout
- testsuite/tests/dmdanal/should_run/all.T
- testsuite/tests/dmdanal/sigs/T21081.stderr
- testsuite/tests/driver/fat-iface/fat014.stdout
- + testsuite/tests/driver/recomp26183/M.hs
- + testsuite/tests/driver/recomp26183/M2A.hs
- + testsuite/tests/driver/recomp26183/M2B.hs
- + testsuite/tests/driver/recomp26183/Makefile
- + testsuite/tests/driver/recomp26183/all.T
- + testsuite/tests/driver/recomp26183/recomp26183.stderr
- + testsuite/tests/driver/recomp26705/M.hs
- + testsuite/tests/driver/recomp26705/M2A.hs
- + testsuite/tests/driver/recomp26705/M2B.hs
- + testsuite/tests/driver/recomp26705/Makefile
- + testsuite/tests/driver/recomp26705/all.T
- + testsuite/tests/driver/recomp26705/recomp26705.stderr
- + testsuite/tests/ffi/should_compile/T26852.h
- + testsuite/tests/ffi/should_compile/T26852.hs
- + testsuite/tests/ffi/should_compile/T26852.stderr
- testsuite/tests/ffi/should_compile/all.T
- + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum.hs
- + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum.stdout
- + testsuite/tests/ffi/should_run/PrimFFIUnboxedSum_cmm.cmm
- testsuite/tests/ffi/should_run/all.T
- + testsuite/tests/ghc-api/TypeMapStringLiteral.hs
- testsuite/tests/ghc-api/all.T
- testsuite/tests/ghci.debugger/scripts/T26042b.stdout
- testsuite/tests/ghci.debugger/scripts/T26042c.stdout
- testsuite/tests/ghci.debugger/scripts/T26042d2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f2.stdout
- testsuite/tests/ghci.debugger/scripts/T8487.stdout
- testsuite/tests/ghci.debugger/scripts/break011.stdout
- testsuite/tests/ghci.debugger/scripts/break017.stdout
- testsuite/tests/ghci.debugger/scripts/break025.stdout
- + testsuite/tests/ghci/custom-external-interpreter-commands/Main.hs
- + testsuite/tests/ghci/custom-external-interpreter-commands/all.T
- + testsuite/tests/ghci/custom-external-interpreter-commands/custom-external-interpreter-commands.stdout
- testsuite/tests/ghci/prog-mhu005/Makefile
- testsuite/tests/ghci/prog-mhu005/all.T
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005b.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005b.stdout
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005c.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005c.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005c.stdout
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005d.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005d.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005d.stdout
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005e.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005e.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005e.stdout
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005f.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005f.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005f.stdout
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005g.script
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005g.stderr
- + testsuite/tests/ghci/prog-mhu005/prog-mhu005g.stdout
- + testsuite/tests/ghci/prog-mhu006/Makefile
- + testsuite/tests/ghci/prog-mhu006/a/A.hs
- + testsuite/tests/ghci/prog-mhu006/all.T
- + testsuite/tests/ghci/prog-mhu006/b/B.hs
- + testsuite/tests/ghci/prog-mhu006/prog-mhu006a.script
- + testsuite/tests/ghci/prog-mhu006/prog-mhu006a.stdout
- + testsuite/tests/ghci/prog-mhu006/unitA
- + testsuite/tests/ghci/prog-mhu006/unitB
- testsuite/tests/ghci/prog003/prog003.T
- testsuite/tests/ghci/prog018/prog018.stdout
- testsuite/tests/ghci/prog020/Makefile
- testsuite/tests/ghci/prog020/all.T
- testsuite/tests/ghci/prog020/ghci.prog020.script → testsuite/tests/ghci/prog020/ghci.prog020a.script
- testsuite/tests/ghci/prog020/ghci.prog020.stderr → testsuite/tests/ghci/prog020/ghci.prog020a.stderr
- testsuite/tests/ghci/prog020/ghci.prog020.stdout → testsuite/tests/ghci/prog020/ghci.prog020a.stdout
- + testsuite/tests/ghci/prog020/ghci.prog020b.script
- + testsuite/tests/ghci/prog020/ghci.prog020b.stderr
- + testsuite/tests/ghci/prog020/ghci.prog020b.stdout
- testsuite/tests/ghci/prog022/Makefile
- testsuite/tests/ghci/prog022/all.T
- + testsuite/tests/ghci/prog022/ghci.prog022c.script
- + testsuite/tests/ghci/prog022/ghci.prog022c.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022c.stdout
- + testsuite/tests/ghci/prog022/ghci.prog022d.script
- + testsuite/tests/ghci/prog022/ghci.prog022d.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022d.stdout
- + testsuite/tests/ghci/prog022/ghci.prog022e.script
- + testsuite/tests/ghci/prog022/ghci.prog022e.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022e.stdout
- + testsuite/tests/ghci/prog022/ghci.prog022f.script
- + testsuite/tests/ghci/prog022/ghci.prog022f.stderr
- + testsuite/tests/ghci/prog022/ghci.prog022f.stdout
- + testsuite/tests/ghci/prog023/Makefile
- + testsuite/tests/ghci/prog023/all.T
- + testsuite/tests/ghci/prog023/prog023a.script
- + testsuite/tests/ghci/prog023/prog023a.stdout
- + testsuite/tests/ghci/prog023/prog023b.script
- + testsuite/tests/ghci/prog023/prog023b.stdout
- + testsuite/tests/ghci/prog023/src/A.hs
- + testsuite/tests/ghci/prog024/Makefile
- + testsuite/tests/ghci/prog024/all.T
- + testsuite/tests/ghci/prog024/prog024a.script
- + testsuite/tests/ghci/prog024/prog024a.stdout
- + testsuite/tests/ghci/prog024/prog024b.script
- + testsuite/tests/ghci/prog024/prog024b.stdout
- + testsuite/tests/ghci/prog024/prog024c.script
- + testsuite/tests/ghci/prog024/prog024c.stderr
- + testsuite/tests/ghci/prog024/prog024c.stdout
- + testsuite/tests/ghci/prog024/prog024d.script
- + testsuite/tests/ghci/prog024/prog024d.stderr
- + testsuite/tests/ghci/prog024/prog024d.stdout
- + testsuite/tests/ghci/prog024/prog024e.script
- + testsuite/tests/ghci/prog024/prog024e.stdout
- + testsuite/tests/ghci/prog024/prog024f.script
- + testsuite/tests/ghci/prog024/prog024f.stdout
- + testsuite/tests/ghci/prog024/src/A.hs
- + testsuite/tests/ghci/prog024/src/B.hs
- + testsuite/tests/ghci/prog025/Makefile
- + testsuite/tests/ghci/prog025/a/A.hs
- + testsuite/tests/ghci/prog025/all.T
- + testsuite/tests/ghci/prog025/prog025a.script
- + testsuite/tests/ghci/prog025/prog025a.stdout
- + testsuite/tests/ghci/prog025/prog025b.script
- + testsuite/tests/ghci/prog025/prog025b.stdout
- + testsuite/tests/ghci/prog025/testpkg/Test.hs
- + testsuite/tests/ghci/prog025/testpkg/testpkg-0.1.0.0.pkg
- + testsuite/tests/ghci/prog025/testpkg/testpkg-0.2.0.0.pkg
- + testsuite/tests/ghci/prog025/unitA
- testsuite/tests/ghci/scripts/Defer02.stderr
- testsuite/tests/ghci/scripts/T13997.stdout
- testsuite/tests/ghci/scripts/T15325.stderr
- testsuite/tests/ghci/scripts/T1914.stdout
- testsuite/tests/ghci/scripts/T20217.stdout
- testsuite/tests/ghci/scripts/T8042.stdout
- testsuite/tests/ghci/scripts/T8042recomp.stdout
- testsuite/tests/ghci/should_run/T10920.stderr
- testsuite/tests/indexed-types/should_fail/T1897b.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- + testsuite/tests/javascript/js-c-sources/T27033.hs
- + testsuite/tests/javascript/js-c-sources/T27033.stdout
- + testsuite/tests/javascript/js-c-sources/T27033_c.c
- + testsuite/tests/javascript/js-c-sources/T27033_js.js
- testsuite/tests/javascript/js-c-sources/all.T
- testsuite/tests/jsffi/all.T
- + testsuite/tests/jsffi/bytearrayarg.hs
- + testsuite/tests/jsffi/bytearrayarg.mjs
- + testsuite/tests/jsffi/bytearrayarg.stdout
- testsuite/tests/numeric/should_run/all.T
- + testsuite/tests/overloadedrecflds/should_compile/T26686.hs
- + testsuite/tests/overloadedrecflds/should_compile/T26686.stderr
- testsuite/tests/overloadedrecflds/should_compile/all.T
- + testsuite/tests/overloadedstrings/should_fail/T25926.hs
- + testsuite/tests/overloadedstrings/should_fail/T25926.stderr
- + testsuite/tests/overloadedstrings/should_fail/T27124.hs
- + testsuite/tests/overloadedstrings/should_fail/T27124.stderr
- + testsuite/tests/overloadedstrings/should_fail/all.T
- + testsuite/tests/overloadedstrings/should_run/T27124a.hs
- testsuite/tests/overloadedstrings/should_run/all.T
- testsuite/tests/patsyn/should_run/ghci.stderr
- testsuite/tests/perf/compiler/Makefile
- testsuite/tests/perf/compiler/T4007.stdout
- testsuite/tests/perf/compiler/all.T
- testsuite/tests/perf/compiler/genMultiComp.py
- testsuite/tests/perf/should_run/all.T
- testsuite/tests/plugins/Makefile
- + testsuite/tests/plugins/T24486-plugin/Makefile
- + testsuite/tests/plugins/T24486-plugin/Setup.hs
- + testsuite/tests/plugins/T24486-plugin/T24486-plugin.cabal
- + testsuite/tests/plugins/T24486-plugin/T24486_Plugin.hs
- + testsuite/tests/plugins/T24486.hs
- + testsuite/tests/plugins/T24486_Helper.hs
- testsuite/tests/plugins/all.T
- testsuite/tests/pmcheck/should_compile/T11303.hs
- + testsuite/tests/profiling/should_compile/T27121.hs
- + testsuite/tests/profiling/should_compile/T27121_aux.hs
- testsuite/tests/profiling/should_compile/all.T
- testsuite/tests/quotes/LiftErrMsgDefer.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail01.stderr
- testsuite/tests/rename/should_fail/RnStaticPointersFail03.stderr
- testsuite/tests/rep-poly/RepPolyRightSection.stderr
- + testsuite/tests/rts/T27131.hs
- + testsuite/tests/rts/T27131.stdout
- + testsuite/tests/rts/T27131_c.c
- testsuite/tests/rts/all.T
- + testsuite/tests/rts/cloneThreadStackMigrating.hs
- testsuite/tests/rts/linker/Makefile
- + testsuite/tests/rts/linker/T27072/Lib.c
- + testsuite/tests/rts/linker/T27072/Makefile
- + testsuite/tests/rts/linker/T27072/T27072.stdout
- + testsuite/tests/rts/linker/T27072/all.T
- + testsuite/tests/rts/linker/T27072/main.c
- + testsuite/tests/rts/linker/T6107.hs
- + testsuite/tests/rts/linker/T6107.stdout
- + testsuite/tests/rts/linker/T6107_sym1.s
- + testsuite/tests/rts/linker/T6107_sym2.s
- testsuite/tests/rts/linker/all.T
- testsuite/tests/safeHaskell/safeLanguage/SafeLang15.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- + testsuite/tests/simd/should_run/StackAlignment32.hs
- + testsuite/tests/simd/should_run/StackAlignment32.stdout
- + testsuite/tests/simd/should_run/StackAlignment32_main.c
- + testsuite/tests/simd/should_run/StackAlignment64.hs
- + testsuite/tests/simd/should_run/StackAlignment64.stdout
- + testsuite/tests/simd/should_run/StackAlignment64_main.c
- + testsuite/tests/simd/should_run/T26411.hs
- + testsuite/tests/simd/should_run/T26411.stdout
- + testsuite/tests/simd/should_run/T26411b.hs
- + testsuite/tests/simd/should_run/T26411b.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simplCore/should_compile/T15056.stderr
- testsuite/tests/simplCore/should_compile/T15205.stderr
- testsuite/tests/simplCore/should_compile/T15445.stderr
- testsuite/tests/simplCore/should_compile/T21391.hs
- + testsuite/tests/simplCore/should_compile/T26323b.hs
- + testsuite/tests/simplCore/should_compile/T26642.hs
- + testsuite/tests/simplCore/should_compile/T26681.hs
- + testsuite/tests/simplCore/should_compile/T26682.hs
- + testsuite/tests/simplCore/should_compile/T26682a.hs
- + testsuite/tests/simplCore/should_compile/T26709.hs
- + testsuite/tests/simplCore/should_compile/T26709.stderr
- + testsuite/tests/simplCore/should_compile/T26826.hs
- + testsuite/tests/simplCore/should_compile/T26903.hs
- + testsuite/tests/simplCore/should_compile/T26903.stderr
- + testsuite/tests/simplCore/should_compile/T27261.hs
- + testsuite/tests/simplCore/should_compile/T27261_aux.hs
- testsuite/tests/simplCore/should_compile/all.T
- + testsuite/tests/simplCore/should_run/T26323.hs
- + testsuite/tests/simplCore/should_run/T26323.stdout
- + testsuite/tests/simplCore/should_run/T27071.hs
- + testsuite/tests/simplCore/should_run/T27071.stdout
- testsuite/tests/simplCore/should_run/all.T
- testsuite/tests/simplStg/should_compile/all.T
- + testsuite/tests/th/T26568.hs
- + testsuite/tests/th/T26568.stderr
- testsuite/tests/th/all.T
- testsuite/tests/type-data/should_run/T22332a.stderr
- testsuite/tests/typecheck/should_compile/T26225.hs
- + testsuite/tests/typecheck/should_compile/T26718.hs
- + testsuite/tests/typecheck/should_compile/T26718.stderr
- testsuite/tests/typecheck/should_compile/all.T
- + testsuite/tests/typecheck/should_fail/T26823.hs
- + testsuite/tests/typecheck/should_fail/T26823.stderr
- + testsuite/tests/typecheck/should_fail/T26861.hs
- + testsuite/tests/typecheck/should_fail/T26861.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T10284.stderr
- testsuite/tests/typecheck/should_run/T13838.stderr
- testsuite/tests/typecheck/should_run/T9497a-run.stderr
- testsuite/tests/typecheck/should_run/T9497b-run.stderr
- testsuite/tests/typecheck/should_run/T9497c-run.stderr
- testsuite/tests/unsatisfiable/T23816.stderr
- testsuite/tests/unsatisfiable/UnsatDefer.stderr
- utils/check-exact/ExactPrint.hs
- utils/deriveConstants/Main.hs
- utils/genapply/Main.hs
- utils/genprimopcode/Main.hs
- utils/ghc-pkg/Main.hs
- utils/jsffi/post-link.mjs
- utils/jsffi/prelude.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7ea1e2a460cbf9f17d2795824630e8…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7ea1e2a460cbf9f17d2795824630e8…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/testsuite-validate-regparm] rts: fix validate build with gcc 16. `__attribute__((regparm(1)))` is ignored on x86_64 and now
by Zubin (@wz1000) 10 Jun '26
by Zubin (@wz1000) 10 Jun '26
10 Jun '26
Zubin pushed to branch wip/testsuite-validate-regparm at Glasgow Haskell Compiler / GHC
Commits:
4ccb6634 by Zubin Duggal at 2026-06-10T21:54:27+05:30
rts: fix validate build with gcc 16. `__attribute__((regparm(1)))` is ignored on x86_64 and now
gcc warns that it is ignored:
rts/sm/Evac.h:35:1: error:
error: ‘regparm’ attribute ignored [-Werror=attributes]
See https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ccead81bbc39668376eb5cf47066a…
Fixes #27366
- - - - -
1 changed file:
- rts/sm/Evac.h
Changes:
=====================================
rts/sm/Evac.h
=====================================
@@ -25,7 +25,9 @@
// registers EAX, EDX, and ECX instead of on the stack. Functions that
// take a variable number of arguments will continue to be passed all of
// their arguments on the stack.
-#if defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH)
+// On x86-64 the attribute has no effect (the first argument is already
+// passed in a register) and GCC 16 warns that it is ignored.
+#if defined(i386_HOST_ARCH)
#define REGPARM1 __attribute__((regparm(1)))
#else
#define REGPARM1
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ccb6634c53cfdeb34a2b045a4b68fe…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4ccb6634c53cfdeb34a2b045a4b68fe…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
10 Jun '26
Zubin pushed new branch wip/testsuite-validate-regparm at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/testsuite-validate-regparm
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/multi-caret] 2 commits: Add support for related locations in Diagnostic
by Simon Jakobi (@sjakobi2) 10 Jun '26
by Simon Jakobi (@sjakobi2) 10 Jun '26
10 Jun '26
Simon Jakobi pushed to branch wip/sjakobi/multi-caret at Glasgow Haskell Compiler / GHC
Commits:
b72ac939 by Simon Jakobi at 2026-06-10T17:52:09+02:00
Add support for related locations in Diagnostic
Diagnostics can now carry "related locations" -- additional source spans
beyond the primary error span. See the new Note [The source span model for
diagnostics] for the model and its correspondence to the LSP Diagnostic /
relatedInformation interfaces. This prepares the ground for #22637; the
diagnosticRelatedLocations name is inspired by #23414.
Implementation:
* Related spans are carried through the MCDiagnostic message class, the
single source of truth; decorateDiagnostic reads them from there.
* getCaretDiagnostics takes the show-caret flag and returns the real spans
that got no caret, splitting each span into 'Either SDoc RealSrcSpan' via
partitionEithers; decorateDiagnostic lists those under the "At:" heading.
The single-span getCaretDiagnostic lost its only caller and is removed
along with its exports and .hs-boot declaration.
* The renderer neither sorts nor deduplicates: locations are shown exactly
in the order the message author gives them, primary span first. Ordering
related spans deterministically (and not repeating the primary among
them) is the author's responsibility; the construction-site
leftmost_smallest sort is the sole authority on order.
JSON output:
* Emit related spans as a new "relatedSpans" field and bump the JSON schema
version 1.2 -> 1.3 (additive, backwards compatible). A changelog.d entry
records the GHC API changes.
Diagnostics converted:
* TcRnBindingNameConflict, TcRnDuplicateDecls, TcRnDuplicateExport and
TcRnDuplicateNamedDefaultExport carry related locations. The now-redundant
location prose is removed from TcRnBindingNameConflict ("Bound at:") and
TcRnDuplicateDecls ("Declared at:"), and TcRnDuplicateNamedDefaultExport
is reworded (its two export items are always identical). check_occs threads
LIE GhcPs so export items carry their source spans. TcRnConflictingExports
and TcRnDuplicateFieldExport were tried but reverted: their export items
and name provenance already appear in the message text, so carets only
duplicated the primary span.
* To keep multi-location output in source order, addDupDeclErr reports at
the first declaration; the next commit settles on the opposite
(rightmost-primary) convention.
Tests:
* Enable -fdiagnostics-show-caret in several tests to show multi-caret
output, and add MultiCaretFallback exercising a diagnostic whose related
locations are split between carets and the "At:" fallback.
Co-Authored-By: Claude Opus 4.8 <noreply(a)anthropic.com>
- - - - -
4f01ec3c by Simon Jakobi at 2026-06-10T17:52:32+02:00
Diagnostics: adopt a rightmost-primary convention for duplicate diagnostics
When a diagnostic reports the same entity occurring at several sites
(TcRnDuplicateDecls, TcRnBindingNameConflict, TcRnDuplicateExport,
TcRnDuplicateNamedDefaultExport), make the primary span the last
occurrence in source order, with the earlier occurrences as related
locations in ascending order. Duplicates usually arise because the later
occurrence was just added, so the primary span -- the location the user
is sent to, and the one an editor marks -- is the occurrence they most
likely need to act on. This matches other compilers (clang's
"redefinition of 'x' / note: previous definition is here", and similarly
rustc and TypeScript), and it gives the unlabelled carets a reading: the
first caret is the site to fix, the following ones are the prior sites
in source order.
Concretely:
* addDupDeclErr reports at NE.last again (as on master), and dupNamesErr
now reports at the last occurrence rather than the first; the related
locations for both become NE.init. The sortedness invariant is
documented on the TcRnDuplicateDecls and TcRnBindingNameConflict
constructors, since diagnosticRelatedLocations silently relies on it.
* The duplicate-export warnings already comply: they are raised at the
second occurrence with the first as the related location.
* The author-facing guidance -- pick one real location rather than a
synthetic combined span, order related spans deterministically, and
the rightmost-primary convention itself, including a remark on how
rustc-style file-order display could be reintroduced once per-span
labels (#23414) exist -- is split out of Note [The source span model
for diagnostics] into a new Note [Choosing the primary and related
spans]. The emission sites and the diagnosticRelatedLocations
constructor list (now sorted alphabetically to reduce merge conflicts)
reference it.
* A changelog.d entry records the user-facing changes: related
locations, the JSON schema bump, and this convention.
* MultiCaretFallback's phantom file is renamed so that it sorts before
the real file, keeping the phantom span a related location and the
test exercising the "At:" fallback. The expected outputs of the
duplicate tests are updated; the "At:" lists are now in author order
(primary first).
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
88 changed files:
- + changelog.d/diagnostic-related-locations
- + changelog.d/ghc-api-diagnostic-related-locations
- compiler/GHC/Core/Opt/Monad.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error.hs-boot
- compiler/GHC/Utils/Error.hs
- compiler/GHC/Utils/Logger.hs
- + docs/users_guide/diagnostics-as-json-schema-1_3.json
- docs/users_guide/using.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- testsuite/tests/default/T25857.stderr
- testsuite/tests/default/all.T
- testsuite/tests/driver/T16167.stdout
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json2.stderr
- testsuite/tests/driver/json_dump.stderr
- testsuite/tests/driver/json_warn.stderr
- testsuite/tests/ghci/scripts/T4127a.stderr
- testsuite/tests/ghci/scripts/ghci048.stderr
- testsuite/tests/haddock/haddock_examples/haddock.Test.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
- testsuite/tests/indexed-types/should_fail/T16110_Fail1.stderr
- testsuite/tests/mdo/should_fail/mdofail002.stderr
- testsuite/tests/mdo/should_fail/mdofail003.stderr
- testsuite/tests/module/mod128.stderr
- testsuite/tests/module/mod18.stderr
- testsuite/tests/module/mod19.stderr
- testsuite/tests/module/mod20.stderr
- testsuite/tests/module/mod21.stderr
- testsuite/tests/module/mod22.stderr
- testsuite/tests/module/mod23.stderr
- testsuite/tests/module/mod24.stderr
- testsuite/tests/module/mod38.stderr
- testsuite/tests/module/mod66.stderr
- testsuite/tests/overloadedrecflds/should_fail/DuplicateExports.stderr
- testsuite/tests/overloadedrecflds/should_fail/FieldSelectors.stderr
- testsuite/tests/overloadedrecflds/should_fail/NFSDuplicate.stderr
- testsuite/tests/overloadedrecflds/should_fail/T17965.stderr
- testsuite/tests/overloadedrecflds/should_fail/all.T
- testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail03.stderr
- testsuite/tests/patsyn/should_compile/T11959.stderr
- testsuite/tests/patsyn/should_compile/T9975a.stderr
- testsuite/tests/patsyn/should_fail/T14114.stderr
- testsuite/tests/patsyn/should_fail/all.T
- testsuite/tests/quasiquotation/qq006/qq006.stderr
- testsuite/tests/rename/should_compile/ExportWarnings6.stderr
- testsuite/tests/rename/should_compile/T23318.stderr
- + testsuite/tests/rename/should_fail/MultiCaretFallback.hs
- + testsuite/tests/rename/should_fail/MultiCaretFallback.stderr
- testsuite/tests/rename/should_fail/T22478b.stderr
- testsuite/tests/rename/should_fail/T7164.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/rename/should_fail/rn_dup.stderr
- testsuite/tests/rename/should_fail/rnfail001.stderr
- testsuite/tests/rename/should_fail/rnfail002.stderr
- testsuite/tests/rename/should_fail/rnfail003.stderr
- testsuite/tests/rename/should_fail/rnfail004.stderr
- testsuite/tests/rename/should_fail/rnfail009.stderr
- testsuite/tests/rename/should_fail/rnfail010.stderr
- testsuite/tests/rename/should_fail/rnfail011.stderr
- testsuite/tests/rename/should_fail/rnfail012.stderr
- testsuite/tests/rename/should_fail/rnfail013.stderr
- testsuite/tests/rename/should_fail/rnfail015.stderr
- testsuite/tests/rename/should_fail/rnfail043.stderr
- testsuite/tests/th/T8932.stderr
- testsuite/tests/th/TH_dupdecl.stderr
- testsuite/tests/th/TH_spliceD1.stderr
- testsuite/tests/type-data/should_fail/TDMultiple01.stderr
- testsuite/tests/type-data/should_fail/TDMultiple02.stderr
- testsuite/tests/type-data/should_fail/TDPunning.stderr
- testsuite/tests/typecheck/should_fail/T22560_fail_c.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiAppPat.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiPat.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearSinglePat.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_fail/tcfail038.stderr
- testsuite/tests/vdq-rta/should_fail/T22326_fail_nonlinear.stderr
- testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_3.stderr
- testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_4.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/672e43e1aa8161d3ad203cf8a2fa32…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/672e43e1aa8161d3ad203cf8a2fa32…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26661] hadrian: Remove old package.conf files when generating new ones
by Zubin (@wz1000) 10 Jun '26
by Zubin (@wz1000) 10 Jun '26
10 Jun '26
Zubin pushed to branch wip/26661 at Glasgow Haskell Compiler / GHC
Commits:
5ac9ce7d by Zubin Duggal at 2026-06-10T21:26:32+05:30
hadrian: Remove old package.conf files when generating new ones
Old package.conf files might exists with different hashes, causing issues like #26661
Fixes #26661
- - - - -
2 changed files:
- + changelog.d/hadrian-stale-package-confs-26661
- hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
Changes:
=====================================
changelog.d/hadrian-stale-package-confs-26661
=====================================
@@ -0,0 +1,6 @@
+section: packaging
+synopsis: Hadrian no longer leaves stale `.conf` files in its package databases
+ when rebuilding in the same build root with different settings (e.g. another
+ flavour, or when hashes change with +hash-unit-ids).
+issues: #26661
+mrs: !15186
=====================================
hadrian/src/Hadrian/Haskell/Cabal/Parse.hs
=====================================
@@ -15,6 +15,7 @@ module Hadrian.Haskell.Cabal.Parse (
) where
import Data.Bifunctor
+import Data.Char (isDigit)
import Data.List.Extra
import Development.Shake
import qualified Distribution.Compat.Graph as Graph
@@ -55,6 +56,8 @@ import Builder
import Context
import Settings
import Distribution.Simple.LocalBuildInfo
+import Distribution.Types.LocalBuildInfo (allTargetsInBuildOrder')
+import Distribution.Types.TargetInfo (TargetInfo (..))
import qualified Distribution.Simple.Register as C
import System.Directory (getCurrentDirectory)
import qualified Distribution.InstalledPackageInfo as CP
@@ -394,35 +397,48 @@ registerPackage rs context = do
-- Note: the @cPath@ is ignored. The path that's used is the 'buildDir' path
-- from the local build info @lbi@.
lbi <- liftIO $ C.getPersistBuildConfig Nothing (C.makeSymbolicPath cPath)
- liftIO $ register db_path pid pd lbi
+ -- This runs `ghc --abi-hash`, so do it outside the critical section below.
+ installedPkgInfo <- liftIO $ generateRegistrationInfo pd lbi
+
+ let pkg_name = pkgName (package context)
+ -- Is this a pkg.conf for a previous build?
+ -- we want to match "ghc-9.15.1-abcd.conf" but not "ghc-boot-9.15.1.conf"
+ isPkgConf f = case stripPrefix (pkg_name ++ "-") (takeBaseName f) of
+ Just (c:_) -> isDigit c
+ _ -> takeBaseName f == pkg_name
+
+ -- Unlike `ghc-pkg update/register` (used to populate the inplace and stage0
+ -- databases), writing the .conf file directly doesn't remove units this
+ -- package was previously registered under. Stale .conf files from earlier
+ -- builds make this package's modules ambiguous (#26661), so delete them
+ -- before writing the new .conf file.
+ withResources rs $ do
+ confs <- liftIO $ getDirectoryFilesIO db_path ["*.conf"]
+ mapM_ (removeFile . (db_path </>))
+ [ f | f <- confs, isPkgConf f, takeBaseName f /= pid ]
+ liftIO $ writeUTF8File (db_path </> pid <.> "conf")
+ (CP.showInstalledPackageInfo installedPkgInfo)
-- Then after the register, which just writes the .conf file, do the recache step.
buildWithResources rs $
target context (GhcPkg Recache (stage context)) [] []
-- This is copied and simplified from Cabal, because we want to install the package
-- into a different package database to the one it was configured against.
-register :: FilePath
- -> String -- ^ Package Identifier
- -> C.PackageDescription
- -> LocalBuildInfo
- -> IO ()
-register pkg_db pid pd lbi
- = withLibLBI pd lbi $ \lib clbi -> do
-
- when reloc $ error "register does not support reloc"
- installedPkgInfo <- generateRegistrationInfo pd lbi lib clbi
- writeRegistrationFile installedPkgInfo
-
- where
- regFile = pkg_db </> pid <.> "conf"
- reloc = relocatable lbi
-
- generateRegistrationInfo pkg lbi lib clbi = do
- abi_hash <- C.mkAbiHash <$> GHC.libAbiHash C.silent pkg lbi lib clbi
- return (C.absoluteInstalledPackageInfo pkg abi_hash lib lbi clbi)
-
- writeRegistrationFile installedPkgInfo = do
- writeUTF8File regFile (CP.showInstalledPackageInfo installedPkgInfo)
+-- See generateRegistrationInfo in Distribution.Simple.Register. we can't use it
+-- directly because it computes the abi-hash using Cabal's internal package
+-- database, which hadrian never creates.
+generateRegistrationInfo :: C.PackageDescription
+ -> LocalBuildInfo
+ -> IO Installed.InstalledPackageInfo
+generateRegistrationInfo pd lbi = do
+ when (relocatable lbi) $ error "register does not support reloc"
+ case [ (lib, targetCLBI tgt) | tgt <- allTargetsInBuildOrder' pd lbi
+ , CLib lib <- [targetComponent tgt] ] of
+ [(lib, clbi)] -> do
+ abi_hash <- C.mkAbiHash <$> GHC.libAbiHash C.silent pd lbi lib clbi
+ return (C.absoluteInstalledPackageInfo pd abi_hash lib lbi clbi)
+ libs -> error $ "generateRegistrationInfo: expected exactly one library for "
+ ++ C.display (C.package pd) ++ ", got " ++ show (length libs)
-- | Build autogenerated files @autogen/cabal_macros.h@ and @autogen/Paths_*.hs@.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5ac9ce7d3821c75e2d2cc17fae00b9e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5ac9ce7d3821c75e2d2cc17fae00b9e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/9.14.2-backports] rts: fix -Wcompare-distinct-pointer-types errors
by Zubin (@wz1000) 10 Jun '26
by Zubin (@wz1000) 10 Jun '26
10 Jun '26
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC
Commits:
7ea1e2a4 by Cheng Shao at 2026-06-10T21:19:26+05:30
rts: fix -Wcompare-distinct-pointer-types errors
This commit fixes `-Wcompare-distinct-pointer-types` errors in the RTS
which should have been caught by the `validate` flavour but was
warnings in CI due to the recent `+werror` regression.
(cherry picked from commit de54e264c3c87c21e4243c2e9a402923ec7d9d6e)
- - - - -
1 changed file:
- rts/Interpreter.c
Changes:
=====================================
rts/Interpreter.c
=====================================
@@ -672,7 +672,7 @@ slow_spw(void *Sp, StgStack *cur_stack, StgWord offset_words){
}
// 2b. Access the element if there is no underflow frame, it must be right
// at the top of the stack.
- else if(Sp_plusW(offset_words) < (StgPtr)(cur_stack->stack + cur_stack->stack_size)) {
+ else if(Sp_plusW(offset_words) < (void*)(cur_stack->stack + cur_stack->stack_size)) {
// Still inside the stack chunk
return Sp_plusW(offset_words);
} else {
@@ -2468,7 +2468,7 @@ run_BCO:
threadStackUnderflow(cap, cap->r.rCurrentTSO);
LOAD_STACK_POINTERS;
by -= sp_to_uf;
- } else if (Sp_plusW(by) < (StgPtr)(stk->stack + stk->stack_size)) {
+ } else if (Sp_plusW(by) < (void*)(stk->stack + stk->stack_size)) {
// we're within the first stack chunk, this chunk has
// no underflow frame
break;
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7ea1e2a460cbf9f17d2795824630e81…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7ea1e2a460cbf9f17d2795824630e81…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/9.14.2-backports] rts: cast Sp_plusW to StgPtr to appease gcc
by Zubin (@wz1000) 10 Jun '26
by Zubin (@wz1000) 10 Jun '26
10 Jun '26
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC
Commits:
98af0af8 by mangoiv at 2026-06-10T20:41:58+05:30
rts: cast Sp_plusW to StgPtr to appease gcc
(cherry picked from commit d99bb8e16376263d367e7cbfae595665d375854b)
- - - - -
1 changed file:
- rts/Interpreter.c
Changes:
=====================================
rts/Interpreter.c
=====================================
@@ -672,7 +672,7 @@ slow_spw(void *Sp, StgStack *cur_stack, StgWord offset_words){
}
// 2b. Access the element if there is no underflow frame, it must be right
// at the top of the stack.
- else if(Sp_plusW(offset_words) < (StgPtr)(cur_stack->stack + cur_stack->stack_size)) {
+ else if((StgPtr)Sp_plusW(offset_words) < (StgPtr)(cur_stack->stack + cur_stack->stack_size)) {
// Still inside the stack chunk
return Sp_plusW(offset_words);
} else {
@@ -2468,7 +2468,7 @@ run_BCO:
threadStackUnderflow(cap, cap->r.rCurrentTSO);
LOAD_STACK_POINTERS;
by -= sp_to_uf;
- } else if (Sp_plusW(by) < (StgPtr)(stk->stack + stk->stack_size)) {
+ } else if ((StgPtr)Sp_plusW(by) < (StgPtr)(stk->stack + stk->stack_size)) {
// we're within the first stack chunk, this chunk has
// no underflow frame
break;
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/98af0af896eace2dd12eddebc71784b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/98af0af896eace2dd12eddebc71784b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sjakobi/multi-caret] 4 commits: Diagnostics: adopt a rightmost-primary convention for duplicate diagnostics
by Simon Jakobi (@sjakobi2) 10 Jun '26
by Simon Jakobi (@sjakobi2) 10 Jun '26
10 Jun '26
Simon Jakobi pushed to branch wip/sjakobi/multi-caret at Glasgow Haskell Compiler / GHC
Commits:
f36bb9d0 by Simon Jakobi at 2026-06-10T15:46:09+02:00
Diagnostics: adopt a rightmost-primary convention for duplicate diagnostics
When a diagnostic reports the same entity occurring at several sites
(TcRnDuplicateDecls, TcRnBindingNameConflict, TcRnDuplicateExport,
TcRnDuplicateNamedDefaultExport), make the primary span the last
occurrence in source order, with the earlier occurrences as related
locations in ascending order. Duplicates usually arise because the later
occurrence was just added, so the primary span -- the location the user
is sent to, and the one an editor marks -- is the occurrence they most
likely need to act on. This matches other compilers (clang's
"redefinition of 'x' / note: previous definition is here", and similarly
rustc and TypeScript), and it gives the unlabelled carets a reading: the
first caret is the site to fix, the following ones are the prior sites
in source order. The convention is documented in
Note [The source span model for diagnostics], including a remark on how
rustc-style file-order display could be reintroduced once per-span
labels (#23414) exist.
Concretely:
* addDupDeclErr reports at NE.last again (as on master), and
dupNamesErr now reports at the last occurrence rather than the first;
the related locations for both become NE.init.
* The duplicate-export warnings already comply: they are raised at the
second occurrence with the first as the related location.
* The expected outputs of the duplicate-export tests (ExportWarnings6,
haddock.Test, mod128, T11959, T23318, T25901_exp_dup_wc_3/4) had
become stale when the renderer stopped sorting the "At:" list; their
"At:" entries are now in author order (primary first).
* MultiCaretFallback's phantom file is renamed so that it sorts before
the real file, keeping the phantom span a related location and the
test exercising the "At:" fallback.
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
45554a02 by Simon Jakobi at 2026-06-10T15:52:00+02:00
Split Note [The source span model for diagnostics]
The Note had grown to cover two audiences at once: what the primary/related
span model is and how the rendering layer treats it, versus how a message
author should pick and order the spans. Move the author-facing guidance
(pick one real location rather than a synthetic combined span, order related
spans deterministically, the rightmost-primary convention for duplicate
diagnostics) into a new Note [Choosing the primary and related spans], and
retarget the references at the emission sites accordingly.
No content changes beyond the reorganisation and a slight tightening of the
ordering bullet.
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
a858aea9 by Simon Jakobi at 2026-06-10T16:21:58+02:00
Note [Choosing the primary and related spans]: trim constructor list
Give two examples of duplicate diagnostics rather than enumerating all
four, so the Note does not need updating whenever one is added.
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
672e43e1 by Simon Jakobi at 2026-06-10T16:25:48+02:00
Tighten the diagnostic span notes
In Note [Choosing the primary and related spans], fold the three
paragraphs of the duplicate-diagnostics convention into one: the
squiggle/jump-target explanation restated the model note, and the
two rustc passages said the same thing twice. Also compress the LSP
correspondence and the "At:" fallback bullet in
Note [The source span model for diagnostics].
Co-Authored-By: Claude Fable 5 <noreply(a)anthropic.com>
- - - - -
59 changed files:
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Types/Error.hs
- testsuite/tests/ghci/scripts/T4127a.stderr
- testsuite/tests/ghci/scripts/ghci048.stderr
- testsuite/tests/haddock/haddock_examples/haddock.Test.stderr
- testsuite/tests/indexed-types/should_fail/SimpleFail6.stderr
- testsuite/tests/indexed-types/should_fail/T16110_Fail1.stderr
- testsuite/tests/mdo/should_fail/mdofail002.stderr
- testsuite/tests/mdo/should_fail/mdofail003.stderr
- testsuite/tests/module/mod128.stderr
- testsuite/tests/module/mod18.stderr
- testsuite/tests/module/mod19.stderr
- testsuite/tests/module/mod20.stderr
- testsuite/tests/module/mod21.stderr
- testsuite/tests/module/mod22.stderr
- testsuite/tests/module/mod23.stderr
- testsuite/tests/module/mod24.stderr
- testsuite/tests/module/mod38.stderr
- testsuite/tests/module/mod66.stderr
- testsuite/tests/overloadedrecflds/should_fail/FieldSelectors.stderr
- testsuite/tests/overloadedrecflds/should_fail/NFSDuplicate.stderr
- testsuite/tests/overloadedrecflds/should_fail/T17965.stderr
- testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail03.stderr
- testsuite/tests/patsyn/should_compile/T11959.stderr
- testsuite/tests/patsyn/should_compile/T9975a.stderr
- testsuite/tests/patsyn/should_fail/T14114.stderr
- testsuite/tests/rename/should_compile/ExportWarnings6.stderr
- testsuite/tests/rename/should_compile/T23318.stderr
- testsuite/tests/rename/should_fail/MultiCaretFallback.hs
- testsuite/tests/rename/should_fail/MultiCaretFallback.stderr
- testsuite/tests/rename/should_fail/T22478b.stderr
- testsuite/tests/rename/should_fail/T7164.stderr
- testsuite/tests/rename/should_fail/rn_dup.stderr
- testsuite/tests/rename/should_fail/rnfail001.stderr
- testsuite/tests/rename/should_fail/rnfail002.stderr
- testsuite/tests/rename/should_fail/rnfail003.stderr
- testsuite/tests/rename/should_fail/rnfail004.stderr
- testsuite/tests/rename/should_fail/rnfail009.stderr
- testsuite/tests/rename/should_fail/rnfail010.stderr
- testsuite/tests/rename/should_fail/rnfail011.stderr
- testsuite/tests/rename/should_fail/rnfail012.stderr
- testsuite/tests/rename/should_fail/rnfail013.stderr
- testsuite/tests/rename/should_fail/rnfail015.stderr
- testsuite/tests/rename/should_fail/rnfail043.stderr
- testsuite/tests/th/T8932.stderr
- testsuite/tests/th/TH_dupdecl.stderr
- testsuite/tests/type-data/should_fail/TDMultiple01.stderr
- testsuite/tests/type-data/should_fail/TDMultiple02.stderr
- testsuite/tests/type-data/should_fail/TDPunning.stderr
- testsuite/tests/typecheck/should_fail/T22560_fail_c.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiAppPat.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearMultiPat.stderr
- testsuite/tests/typecheck/should_fail/TyAppPat_NonlinearSinglePat.stderr
- testsuite/tests/typecheck/should_fail/tcfail038.stderr
- testsuite/tests/vdq-rta/should_fail/T22326_fail_nonlinear.stderr
- testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_3.stderr
- testsuite/tests/warnings/should_compile/T25901_exp_dup_wc_4.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4d9842a48c4b8fcf942ef6a1a2eb4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b4d9842a48c4b8fcf942ef6a1a2eb4…
You're receiving this email because of your account on gitlab.haskell.org.
1
0