02 Oct '25
Ben Gamari pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
2b16d5be by Ben Gamari at 2025-10-02T17:49:27-04:00
rts: Drop redundant declarations
- - - - -
1 changed file:
- rts/prim/atomic.c
Changes:
=====================================
rts/prim/atomic.c
=====================================
@@ -12,90 +12,66 @@
// FetchAddByteArrayOp_Int
-extern StgWord hs_atomic_add8(StgWord x, StgWord val);
-StgWord
-hs_atomic_add8(StgWord x, StgWord val)
+StgWord hs_atomic_add8(StgWord x, StgWord val)
{
return __sync_fetch_and_add((volatile StgWord8 *) x, (StgWord8) val);
}
-extern StgWord hs_atomic_add16(StgWord x, StgWord val);
-StgWord
-hs_atomic_add16(StgWord x, StgWord val)
+StgWord hs_atomic_add16(StgWord x, StgWord val)
{
return __sync_fetch_and_add((volatile StgWord16 *) x, (StgWord16) val);
}
-extern StgWord hs_atomic_add32(StgWord x, StgWord val);
-StgWord
-hs_atomic_add32(StgWord x, StgWord val)
+StgWord hs_atomic_add32(StgWord x, StgWord val)
{
return __sync_fetch_and_add((volatile StgWord32 *) x, (StgWord32) val);
}
-extern StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_add64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_add64(StgWord x, StgWord64 val)
{
return __sync_fetch_and_add((volatile StgWord64 *) x, val);
}
// FetchSubByteArrayOp_Int
-extern StgWord hs_atomic_sub8(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub8(StgWord x, StgWord val)
+StgWord hs_atomic_sub8(StgWord x, StgWord val)
{
return __sync_fetch_and_sub((volatile StgWord8 *) x, (StgWord8) val);
}
-extern StgWord hs_atomic_sub16(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub16(StgWord x, StgWord val)
+StgWord hs_atomic_sub16(StgWord x, StgWord val)
{
return __sync_fetch_and_sub((volatile StgWord16 *) x, (StgWord16) val);
}
-extern StgWord hs_atomic_sub32(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub32(StgWord x, StgWord val)
+StgWord hs_atomic_sub32(StgWord x, StgWord val)
{
return __sync_fetch_and_sub((volatile StgWord32 *) x, (StgWord32) val);
}
-extern StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_sub64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val)
{
return __sync_fetch_and_sub((volatile StgWord64 *) x, val);
}
// FetchAndByteArrayOp_Int
-extern StgWord hs_atomic_and8(StgWord x, StgWord val);
-StgWord
-hs_atomic_and8(StgWord x, StgWord val)
+StgWord hs_atomic_and8(StgWord x, StgWord val)
{
return __sync_fetch_and_and((volatile StgWord8 *) x, (StgWord8) val);
}
-extern StgWord hs_atomic_and16(StgWord x, StgWord val);
-StgWord
-hs_atomic_and16(StgWord x, StgWord val)
+StgWord hs_atomic_and16(StgWord x, StgWord val)
{
return __sync_fetch_and_and((volatile StgWord16 *) x, (StgWord16) val);
}
-extern StgWord hs_atomic_and32(StgWord x, StgWord val);
-StgWord
-hs_atomic_and32(StgWord x, StgWord val)
+StgWord hs_atomic_and32(StgWord x, StgWord val)
{
return __sync_fetch_and_and((volatile StgWord32 *) x, (StgWord32) val);
}
-extern StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_and64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_and64(StgWord x, StgWord64 val)
{
return __sync_fetch_and_and((volatile StgWord64 *) x, val);
}
@@ -167,9 +143,7 @@ hs_atomic_and64(StgWord x, StgWord64 val)
#pragma GCC diagnostic ignored "-Wsync-nand"
#endif
-extern StgWord hs_atomic_nand8(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand8(StgWord x, StgWord val)
+StgWord hs_atomic_nand8(StgWord x, StgWord val)
{
#if USE_SYNC_FETCH_AND_NAND
return __sync_fetch_and_nand((volatile StgWord8 *) x, (StgWord8) val);
@@ -178,9 +152,7 @@ hs_atomic_nand8(StgWord x, StgWord val)
#endif
}
-extern StgWord hs_atomic_nand16(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand16(StgWord x, StgWord val)
+StgWord hs_atomic_nand16(StgWord x, StgWord val)
{
#if USE_SYNC_FETCH_AND_NAND
return __sync_fetch_and_nand((volatile StgWord16 *) x, (StgWord16) val);
@@ -189,9 +161,7 @@ hs_atomic_nand16(StgWord x, StgWord val)
#endif
}
-extern StgWord hs_atomic_nand32(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand32(StgWord x, StgWord val)
+StgWord hs_atomic_nand32(StgWord x, StgWord val)
{
#if USE_SYNC_FETCH_AND_NAND
return __sync_fetch_and_nand((volatile StgWord32 *) x, (StgWord32) val);
@@ -200,9 +170,7 @@ hs_atomic_nand32(StgWord x, StgWord val)
#endif
}
-extern StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_nand64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val)
{
#if USE_SYNC_FETCH_AND_NAND
return __sync_fetch_and_nand((volatile StgWord64 *) x, val);
@@ -215,96 +183,72 @@ hs_atomic_nand64(StgWord x, StgWord64 val)
// FetchOrByteArrayOp_Int
-extern StgWord hs_atomic_or8(StgWord x, StgWord val);
-StgWord
-hs_atomic_or8(StgWord x, StgWord val)
+StgWord hs_atomic_or8(StgWord x, StgWord val)
{
return __sync_fetch_and_or((volatile StgWord8 *) x, (StgWord8) val);
}
-extern StgWord hs_atomic_or16(StgWord x, StgWord val);
-StgWord
-hs_atomic_or16(StgWord x, StgWord val)
+StgWord hs_atomic_or16(StgWord x, StgWord val)
{
return __sync_fetch_and_or((volatile StgWord16 *) x, (StgWord16) val);
}
-extern StgWord hs_atomic_or32(StgWord x, StgWord val);
-StgWord
-hs_atomic_or32(StgWord x, StgWord val)
+StgWord hs_atomic_or32(StgWord x, StgWord val)
{
return __sync_fetch_and_or((volatile StgWord32 *) x, (StgWord32) val);
}
-extern StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_or64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_or64(StgWord x, StgWord64 val)
{
return __sync_fetch_and_or((volatile StgWord64 *) x, val);
}
// FetchXorByteArrayOp_Int
-extern StgWord hs_atomic_xor8(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor8(StgWord x, StgWord val)
+StgWord hs_atomic_xor8(StgWord x, StgWord val)
{
return __sync_fetch_and_xor((volatile StgWord8 *) x, (StgWord8) val);
}
-extern StgWord hs_atomic_xor16(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor16(StgWord x, StgWord val)
+StgWord hs_atomic_xor16(StgWord x, StgWord val)
{
return __sync_fetch_and_xor((volatile StgWord16 *) x, (StgWord16) val);
}
-extern StgWord hs_atomic_xor32(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor32(StgWord x, StgWord val)
+StgWord hs_atomic_xor32(StgWord x, StgWord val)
{
return __sync_fetch_and_xor((volatile StgWord32 *) x, (StgWord32) val);
}
-extern StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_xor64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val)
{
return __sync_fetch_and_xor((volatile StgWord64 *) x, val);
}
// CasByteArrayOp_Int
-extern StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
{
StgWord8 expected = (StgWord8) old;
__atomic_compare_exchange_n((StgWord8 *) x, &expected, (StgWord8) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return expected;
}
-extern StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
{
StgWord16 expected = (StgWord16) old;
__atomic_compare_exchange_n((StgWord16 *) x, &expected, (StgWord16) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return expected;
}
-extern StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
{
StgWord32 expected = (StgWord32) old;
__atomic_compare_exchange_n((StgWord32 *) x, &expected, (StgWord32) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return expected;
}
-extern StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
-StgWord64
-hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
+StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
{
StgWord64 expected = (StgWord64) old;
__atomic_compare_exchange_n((StgWord64 *) x, &expected, (StgWord64) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
@@ -313,31 +257,23 @@ hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
// Atomic exchange operations
-extern StgWord hs_xchg8(StgWord x, StgWord val);
-StgWord
-hs_xchg8(StgWord x, StgWord val)
+StgWord hs_xchg8(StgWord x, StgWord val)
{
return (StgWord) __atomic_exchange_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
}
-extern StgWord hs_xchg16(StgWord x, StgWord val);
-StgWord
-hs_xchg16(StgWord x, StgWord val)
+StgWord hs_xchg16(StgWord x, StgWord val)
{
return (StgWord) __atomic_exchange_n((StgWord16 *)x, (StgWord16) val, __ATOMIC_SEQ_CST);
}
-extern StgWord hs_xchg32(StgWord x, StgWord val);
-StgWord
-hs_xchg32(StgWord x, StgWord val)
+StgWord hs_xchg32(StgWord x, StgWord val)
{
return (StgWord) __atomic_exchange_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
}
//GCC provides this even on 32bit, but StgWord is still 32 bits.
-extern StgWord64 hs_xchg64(StgWord x, StgWord64 val);
-StgWord64
-hs_xchg64(StgWord x, StgWord64 val)
+StgWord64 hs_xchg64(StgWord x, StgWord64 val)
{
return (StgWord64) __atomic_exchange_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
}
@@ -352,30 +288,22 @@ hs_xchg64(StgWord x, StgWord64 val)
// primitives which the GCC documentation claims "usually" implies a full
// barrier.
-extern StgWord hs_atomicread8(StgWord x);
-StgWord
-hs_atomicread8(StgWord x)
+StgWord hs_atomicread8(StgWord x)
{
return __atomic_load_n((StgWord8 *) x, __ATOMIC_SEQ_CST);
}
-extern StgWord hs_atomicread16(StgWord x);
-StgWord
-hs_atomicread16(StgWord x)
+StgWord hs_atomicread16(StgWord x)
{
return __atomic_load_n((StgWord16 *) x, __ATOMIC_SEQ_CST);
}
-extern StgWord hs_atomicread32(StgWord x);
-StgWord
-hs_atomicread32(StgWord x)
+StgWord hs_atomicread32(StgWord x)
{
return __atomic_load_n((StgWord32 *) x, __ATOMIC_SEQ_CST);
}
-extern StgWord64 hs_atomicread64(StgWord x);
-StgWord64
-hs_atomicread64(StgWord x)
+StgWord64 hs_atomicread64(StgWord x)
{
return __atomic_load_n((StgWord64 *) x, __ATOMIC_SEQ_CST);
}
@@ -384,30 +312,22 @@ hs_atomicread64(StgWord x)
// Implies a full memory barrier (see compiler/GHC/Builtin/primops.txt.pp)
// __ATOMIC_SEQ_CST: Full barrier (see hs_atomicread8 above).
-extern void hs_atomicwrite8(StgWord x, StgWord val);
-void
-hs_atomicwrite8(StgWord x, StgWord val)
+void hs_atomicwrite8(StgWord x, StgWord val)
{
__atomic_store_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
}
-extern void hs_atomicwrite16(StgWord x, StgWord val);
-void
-hs_atomicwrite16(StgWord x, StgWord val)
+void hs_atomicwrite16(StgWord x, StgWord val)
{
__atomic_store_n((StgWord16 *) x, (StgWord16) val, __ATOMIC_SEQ_CST);
}
-extern void hs_atomicwrite32(StgWord x, StgWord val);
-void
-hs_atomicwrite32(StgWord x, StgWord val)
+void hs_atomicwrite32(StgWord x, StgWord val)
{
__atomic_store_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
}
-extern void hs_atomicwrite64(StgWord x, StgWord64 val);
-void
-hs_atomicwrite64(StgWord x, StgWord64 val)
+void hs_atomicwrite64(StgWord x, StgWord64 val)
{
__atomic_store_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b16d5be235cbcdbbd50947a01edfff…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2b16d5be235cbcdbbd50947a01edfff…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26166] 5 commits: Drop all undefined dynamic_lookup hacks
by Ben Gamari (@bgamari) 02 Oct '25
by Ben Gamari (@bgamari) 02 Oct '25
02 Oct '25
Ben Gamari pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
64190cee by Rodrigo Mesquita at 2025-10-02T16:58:48-04:00
Drop all undefined dynamic_lookup hacks
- - - - -
bf3bdd66 by Rodrigo Mesquita at 2025-10-02T16:58:52-04:00
Fix remaining direct references to ghczminternal
- - - - -
5535681d by Rodrigo Mesquita at 2025-10-02T16:58:57-04:00
Move atomic.c from ghc-internal to rts
- - - - -
89b7628c by Rodrigo Mesquita at 2025-10-02T16:59:35-04:00
Fix link failure in Cabal check assertion due to -u[_]init_ghc_hs_iface bc lack of definition and because -u<sym> -U<sym> does not work to allow the symbol to be undefined. brilliant...
- - - - -
8155efe9 by Rodrigo Mesquita at 2025-10-02T16:59:47-04:00
It would still fail to compile .hsc files because of the ld-options... But you can just include the RTS stub in all of those too.... :(
- - - - -
32 changed files:
- compiler/GHC/Linker/Dynamic.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceStub.h
- libraries/ghc-internal/include/RtsIfaceSymbols.h
- libraries/ghc-internal/src/GHC/Internal/Clock.hsc
- libraries/ghc-internal/src/GHC/Internal/ConsoleHandler.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/EPoll.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/KQueue.hsc
- libraries/ghc-internal/src/GHC/Internal/Event/Poll.hsc
- libraries/ghc-internal/src/GHC/Internal/ExecutionStack/Internal.hsc
- libraries/ghc-internal/src/GHC/Internal/Heap/Constants.hsc
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable/Types.hsc
- libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Flock.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/LinuxOFD.hsc
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock/Windows.hsc
- libraries/ghc-internal/src/GHC/Internal/InfoProv/Types.hsc
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags.hsc
- libraries/ghc-internal/src/GHC/Internal/RTS/Flags/Test.hsc
- libraries/ghc-internal/src/GHC/Internal/Stack/CCS.hsc
- libraries/ghc-internal/src/GHC/Internal/Stack/Constants.hsc
- libraries/ghc-internal/src/GHC/Internal/Stats.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/Blank.hsc
- libraries/ghc-internal/src/GHC/Internal/System/Environment/ExecutablePath.hsc
- rts/CloneStack.h
- rts/PrimOps.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52bb1eaf088d4bc6d255621ba1481a…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/52bb1eaf088d4bc6d255621ba1481a…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26166] 2 commits: testsuite: Don't rely on non-PIC objects in shared objects
by Ben Gamari (@bgamari) 02 Oct '25
by Ben Gamari (@bgamari) 02 Oct '25
02 Oct '25
Ben Gamari pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
bf8401bb by Ben Gamari at 2025-10-02T15:51:04-04:00
testsuite: Don't rely on non-PIC objects in shared objects
When producing shared objects with `-shared` most platforms will require
position-independent code. For this reason we need to build with
`-dynamic` since otherwise we will link against, e.g., the static
`ghc-internal` object, which is not built with `-fPIC`.
- - - - -
52bb1eaf by Ben Gamari at 2025-10-02T16:20:31-04:00
testsuite: Explicitly flush in T10955dyn
This shouldn't in principle be necessary but it appears that we fail to
invoke the stdout finalizer when dynamically linking.
- - - - -
2 changed files:
- testsuite/tests/ghci/linking/dyn/Makefile
- testsuite/tests/ghci/linking/dyn/T10955dyn.hs
Changes:
=====================================
testsuite/tests/ghci/linking/dyn/Makefile
=====================================
@@ -50,7 +50,7 @@ MY_TEST_HC_OPTS = $(TEST_HC_OPTS) $(CFLAGS)
load_short_name:
rm -rf bin_short
mkdir bin_short
- '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_short" -shared A.c -o "bin_short/$(call DLL,A)"
+ '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_short" -dynamic -shared A.c -o "bin_short/$(call DLL,A)"
rm -f bin_short/*.a
echo ":q" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) -L"./bin_short" -lA
@@ -58,14 +58,14 @@ load_short_name:
compile_libT1407:
rm -rf T1407dir
mkdir T1407dir
- '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T1407dir" -shared A.c -o "T1407dir/$(call DLL,AS)"
+ '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T1407dir" -dynamic -shared A.c -o "T1407dir/$(call DLL,AS)"
rm -f T1407dir/libAS*.a
.PHONY: compile_libT10458
compile_libT10458:
rm -rf T10458dir
mkdir T10458dir
- '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T10458dir" -shared A.c -o "T10458dir/$(call DLL,AS)"
+ '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T10458dir" -dynamic -shared A.c -o "T10458dir/$(call DLL,AS)"
rm -f T10458dir/libAS*.a
.PHONY: compile_libAB_dep
@@ -80,8 +80,8 @@ compile_libAB_dep:
compile_libAB_dyn:
rm -rf bin_dyn
mkdir bin_dyn
- '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -shared A.c -o "bin_dyn/$(call DLL,A)" $(call DEF,A)
- '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -shared B.c -o "bin_dyn/$(call DLL,B)" $(call DEF,B) -lA -L"./bin_dyn"
+ '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -dynamic -shared A.c -o "bin_dyn/$(call DLL,A)" $(call DEF,A)
+ '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_dyn" -dynamic -shared B.c -o "bin_dyn/$(call DLL,B)" $(call DEF,B) -lA -L"./bin_dyn"
rm -f bin_dyn/*.a
'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -v0 -o "bin_dyn/$(call EXE,T10955dyn)" -L./bin_dyn -lB -lA T10955dyn.hs -v0
DYLD_LIBRARY_PATH=./bin_dyn LD_LIBRARY_PATH=./bin_dyn ./bin_dyn/$(call EXE,T10955dyn)
=====================================
testsuite/tests/ghci/linking/dyn/T10955dyn.hs
=====================================
@@ -2,6 +2,12 @@ module Main where
import Foreign
import Foreign.C.Types
+import System.IO
+
foreign import ccall "bar" dle :: IO CInt
-main = dle >>= print
+main = do
+ dle >>= print
+ -- This shouldn't be necessary but it appears that the finalizer is
+ -- not executed reliably, especially in the dynamic way.
+ hFlush stdout
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2500516d363d81829c2458a9855608…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2500516d363d81829c2458a9855608…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/backports-9.14] 53 commits: users-guide: Add missing libraries to release notes
by Ben Gamari (@bgamari) 02 Oct '25
by Ben Gamari (@bgamari) 02 Oct '25
02 Oct '25
Ben Gamari pushed to branch wip/backports-9.14 at Glasgow Haskell Compiler / GHC
Commits:
e73e2ef5 by Ben Gamari at 2025-10-02T16:05:31-04:00
users-guide: Add missing libraries to release notes
Fixes #26421.
- - - - -
d7df293a by sheaf at 2025-10-02T16:05:31-04:00
Revert "Remove hptAllFamInstances usage during upsweep"
This reverts commit 3bf6720eff5e86e673568e756161e6d6150eb440.
(cherry picked from commit 0975d2b6c0747cd40abb4e881b2fb086cbc93726)
- - - - -
9c489d4c by soulomoon at 2025-10-02T16:05:31-04:00
Family consistency checks: add test for #26154
This commit adds the test T26154, to make sure that GHC doesn't crash
when performing type family consistency checks. This test case
was extracted from Agda.
Fixes #26154
(cherry picked from commit 0cf341761fa2b506868a62a0e20a6214eb275be0)
- - - - -
9aac600b by Simon Peyton Jones at 2025-10-02T16:05:31-04:00
Report solid equality errors before custom errors
This MR fixes #26255 by
* Reporting solid equality errors like
Int ~ Bool
before "custom type errors". See comments in `report1` in
`reportWanteds`
* Suppressing errors that arise from superclasses of
Wanteds. See (SCE1) in Note [Suppressing confusing errors]
More details in #26255.
(cherry picked from commit ba210d981b0812aea604f884d3c0aada4c8ca75c)
- - - - -
ab308f0c by Simon Peyton Jones at 2025-10-02T16:05:31-04:00
Fix a scoping error in Specialise
This small patch fixes #26329, which triggered a scoping error.
Test is in T21391, with -fpolymorphic-specialisation enabled
(cherry picked from commit b62491405ae851ae514afe18d51f0fe7fbefebf3)
- - - - -
176d7769 by Ben Gamari at 2025-10-02T16:05:31-04:00
Add primop to annotate the call stack with arbitrary data
We introduce a new primop `annotateStack#` which allows us to push
arbitrary data onto the call-stack.
This allows us to extract the data later when decoding the stack, for
example when an exception is thrown, showing more information to the
user without having to annotate the full call-stack with `HasCallStack`
constraints.
A new stack frame value is introduced `AnnFrame`, which consists of
nothing but a generic payload.
The primop has a small wrapper API that allows users to annotate their
call-stack in programs.
There is a pure API and an IO-based one. The former is a little bit
dubious, as it affects the evaluation of a program, so use with care.
The latter is "safe", as it doesn't change the evaluation of the
program.
The stack annotation mechanism is similarly implemented to the
`ExceptionAnnotation` and `Exception`, there is a typeclass to indicate
something can be pushed onto the call-stack and all values are wrapped
in the existential `SomeStackAnnotation`, which recover the type of the
annotation payload.
There is currently no builtin way to show the stack annotations when
`Backtraces` are displayed (i.e., when showing stack traces to the user),
which we will address in a follow-up MR.
-------------------------
Metric Increase:
ghc_experimental_so
-------------------------
We increase the size of the package, so this is not unreasonable.
Co-Authored-By: fendor <fendor(a)posteo.de>
Co-Authored-By: Ben Gamari <bgamari.foss(a)gmail.com>
(cherry picked from commit 774fec37d37fd9f31a3742f684b2b5621628f5bf)
- - - - -
2fc4c18b by Rodrigo Mesquita at 2025-10-02T16:05:31-04:00
bytecode: Use 32bits for breakpoint index
Fixes #26325
(cherry picked from commit e368e24779f8a7bf110a025383db23521b313407)
- - - - -
af241d6c by fendor at 2025-10-02T16:05:32-04:00
Move stack decoding logic from ghc-heap to ghc-internal
The stack decoding logic in `ghc-heap` is more sophisticated than the one
currently employed in `CloneStack`. We want to use the stack decoding
implementation from `ghc-heap` in `base`.
We cannot simply depend on `ghc-heap` in `base` due do bootstrapping
issues.
Thus, we move the code that is necessary to implement stack decoding to
`ghc-internal`. This is the right location, as we don't want to add a
new API to `base`.
Moving the stack decoding logic and re-exposing it in ghc-heap is
insufficient, though, as we have a dependency cycle between.
* ghc-heap depends on stage1:ghc-internal
* stage0:ghc depends on stage0:ghc-heap
To fix this, we remove ghc-heap from the set of `stage0` dependencies.
This is not entirely straight-forward, as a couple of boot dependencies,
such as `ghci` depend on `ghc-heap`.
Luckily, the boot compiler of GHC is now >=9.10, so we can migrate `ghci`
to use `ghc-internal` instead of `ghc-heap`, which already exports the
relevant modules.
However, we cannot 100% remove ghc's dependency on `ghc-heap`, since
when we compile `stage0:ghc`, `stage1:ghc-internal` is not yet
available.
Thus, when we compile with the boot-compiler, we still depend on an
older version of `ghc-heap`, and only use the modules from `ghc-internal`,
if the `ghc-internal` version is recent enough.
-------------------------
Metric Increase:
T24602_perf_size
T25046_perf_size_gzip
T25046_perf_size_unicode
T25046_perf_size_unicode_gzip
size_hello_artifact
size_hello_artifact_gzip
size_hello_unicode
size_hello_unicode_gzip
-------------------------
These metric increases are unfortunate, they are most likely caused by
the larger (literally in terms of lines of code) stack decoder implementation
that are now linked into hello-word binaries.
On linux, it is almost a 10% increase, which is considerable.
(cherry picked from commit 26dbcf616378afed9da9d50b5357786f3bd7ff9d)
- - - - -
2eefd0a7 by fendor at 2025-10-02T16:05:32-04:00
Implement `decode` in terms of `decodeStackWithIpe`
Uses the more efficient stack decoder implementation.
(cherry picked from commit bd80bb7013b1c2446557a56779c88e7ad1a06259)
- - - - -
dfa19170 by fendor at 2025-10-02T16:05:32-04:00
Remove stg_decodeStackzh
(cherry picked from commit 2444116517515ce7bc6bf7ac8479e919d945ed6a)
- - - - -
d2e07553 by fendor at 2025-10-02T16:05:32-04:00
Expose Stack Annotation frames in IPE backtraces by default
When decoding the Haskell-native call stack and displaying the IPE information
for the stack frames, we print the `StackAnnotation` of the `AnnFrame` by default.
This means, when an exception is thrown, any intermediate stack annotations will
be displayed in the `IPE Backtrace`.
Example backtrace:
```
Exception: ghc-internal:GHC.Internal.Exception.ErrorCall:
Oh no!
IPE backtrace:
annotateCallStackIO, called at app/Main.hs:48:10 in backtrace-0.1.0.0-inplace-server:Main
annotateCallStackIO, called at app/Main.hs:46:13 in backtrace-0.1.0.0-inplace-server:Main
Main.handler (app/Main.hs:(46,1)-(49,30))
Main.liftIO (src/Servant/Server/Internal/Handler.hs:30:36-42)
Servant.Server.Internal.Delayed.runHandler' (src/Servant/Server/Internal/Handler.hs:27:31-41)
Control.Monad.Trans.Resource.runResourceT (./Control/Monad/Trans/Resource.hs:(192,14)-(197,18))
Network.Wai.Handler.Warp.HTTP1.processRequest (./Network/Wai/Handler/Warp/HTTP1.hs:195:20-22)
Network.Wai.Handler.Warp.HTTP1.processRequest (./Network/Wai/Handler/Warp/HTTP1.hs:(195,5)-(203,31))
Network.Wai.Handler.Warp.HTTP1.http1server.loop (./Network/Wai/Handler/Warp/HTTP1.hs:(141,9)-(157,42))
HasCallStack backtrace:
error, called at app/Main.hs:48:32 in backtrace-0.1.0.0-inplace-server:Main
```
The first two entries have been added by `annotateCallStackIO`, defined in `annotateCallStackIO`.
(cherry picked from commit 26e0db16365059f0fdfe63b773852df45ebda913)
- - - - -
68fe9237 by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
cleanup: Move dehydrateCgBreakInfo to Stg2Bc
This no longer has anything to do with Core.
(cherry picked from commit 79816cc4071d281d6893ad3df4c06e9cf51daee7)
- - - - -
c1d6578f by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
rts/Disassembler: Fix spacing of BRK_FUN
(cherry picked from commit 53da94ff72f63b6ac09ecd16493a321843ea2c69)
- - - - -
9b824bb6 by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
debugger: Fix bciPtr in Step-out
We need to use `BCO_NEXT` to move bciPtr to ix=1, because ix=0 points to
the instruction itself!
I do not understand how this didn't crash before.
(cherry picked from commit 08c0cf85abdd0cf63c64f9819cd34b42d437d114)
- - - - -
78558caf by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
debugger: Allow BRK_FUNs to head case continuation BCOs
When we start executing a BCO, we may want to yield to the scheduler:
this may be triggered by a heap/stack check, context switch, or a
breakpoint. To yield, we need to put the stack in a state such that
when execution is resumed we are back to where we yielded from.
Previously, a BKR_FUN could only head a function BCO because we only
knew how to construct a valid stack for yielding from one -- simply add
`apply_interp_info` + the BCO to resume executing. This is valid because
the stack at the start of run_BCO is headed by that BCO's arguments.
However, in case continuation BCOs (as per Note [Case continuation BCOs]),
we couldn't easily reconstruct a valid stack that could be resumed
because we dropped too soon the stack frames regarding the value
returned (stg_ret) and received (stg_ctoi) by that continuation.
This is especially tricky because of the variable type and size return
frames (e.g. pointer ret_p/ctoi_R1p vs a tuple ret_t/ctoi_t2).
The trick to being able to yield from a BRK_FUN at the start of a case
cont BCO is to stop removing the ret frame headers eagerly and instead
keep them until the BCO starts executing. The new layout at the start of
a case cont. BCO is described by the new Note [Stack layout when entering run_BCO].
Now, we keep the ret_* and ctoi_* frames when entering run_BCO.
A BRK_FUN is then executed if found, and the stack is yielded as-is with
the preserved ret and ctoi frames.
Then, a case cont BCO's instructions always SLIDE off the headers of the
ret and ctoi frames, in StgToByteCode.doCase, turning a stack like
| .... |
+---------------+
| fv2 |
+---------------+
| fv1 |
+---------------+
| BCO |
+---------------+
| stg_ctoi_ret_ |
+---------------+
| retval |
+---------------+
| stg_ret_..... |
+---------------+
into
| .... |
+---------------+
| fv2 |
+---------------+
| fv1 |
+---------------+
| retval |
+---------------+
for the remainder of the BCO.
Moreover, this more uniform approach of keeping the ret and ctoi frames
means we need less ad-hoc logic concerning the variable size of
ret_tuple vs ret_p/np frames in the code generator and interpreter:
Always keep the return to cont. stack intact at the start of run_BCO,
and the statically generated instructions will take care of adjusting
it.
Unlocks BRK_FUNs at the start of case cont. BCOs which will enable a
better user-facing step-out (#26042) which is free of the bugs the
current BRK_ALTS implementation suffers from (namely, using BRK_FUN
rather than BRK_ALTS in a case cont. means we'll never accidentally end
up in a breakpoint "deeper" than the continuation, because we stop at
the case cont itself rather than on the first breakpoint we evaluate
after it).
(cherry picked from commit e7e021fa8ebb847823d2cc6c2a1ae73b94cd6fd8)
- - - - -
eb61b19d by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
BRK_FUN with InternalBreakLocs for code-generation time breakpoints
At the start of a case continuation BCO, place a BRK_FUN.
This BRK_FUN uses the new "internal breakpoint location" -- allowing us
to come up with a valid source location for this breakpoint that is not associated with a source-level tick.
For case continuation BCOs, we use the last tick seen before it as the
source location. The reasoning is described in Note [Debugger: Stepout internal break locs].
Note how T26042c, which was broken because it displayed the incorrect
behavior of the previous step out when we'd end up at a deeper level
than the one from which we initiated step-out, is now fixed.
As of this commit, BRK_ALTS is now dead code and is thus dropped.
Note [Debugger: Stepout internal break locs]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step-out tells the interpreter to run until the current function
returns to where it was called from, and stop there.
This is achieved by enabling the BRK_FUN found on the first RET_BCO
frame on the stack (See [Note Debugger: Step-out]).
Case continuation BCOs (which select an alternative branch) must
therefore be headed by a BRK_FUN. An example:
f x = case g x of <--- end up here
1 -> ...
2 -> ...
g y = ... <--- step out from here
- `g` will return a value to the case continuation BCO in `f`
- The case continuation BCO will receive the value returned from g
- Match on it and push the alternative continuation for that branch
- And then enter that alternative.
If we step-out of `g`, the first RET_BCO on the stack is the case
continuation of `f` -- execution should stop at its start, before
selecting an alternative. (One might ask, "why not enable the breakpoint
in the alternative instead?", because the alternative continuation is
only pushed to the stack *after* it is selected by the case cont. BCO)
However, the case cont. BCO is not associated with any source-level
tick, it is merely the glue code which selects alternatives which do
have source level ticks. Therefore, we have to come up at code
generation time with a breakpoint location ('InternalBreakLoc') to
display to the user when it is stopped there.
Our solution is to use the last tick seen just before reaching the case
continuation. This is robust because a case continuation will thus
always have a relevant breakpoint location:
- The source location will be the last source-relevant expression
executed before the continuation is pushed
- So the source location will point to the thing you've just stepped
out of
- Doing :step-local from there will put you on the selected
alternative (which at the source level may also be the e.g. next
line in a do-block)
Examples, using angle brackets (<<...>>) to denote the breakpoint span:
f x = case <<g x>> {- step in here -} of
1 -> ...
2 -> ...>
g y = <<...>> <--- step out from here
...
f x = <<case g x of <--- end up here, whole case highlighted
1 -> ...
2 -> ...>>
doing :step-local ...
f x = case g x of
1 -> <<...>> <--- stop in the alternative
2 -> ...
A second example based on T26042d2, where the source is a do-block IO
action, optimised to a chain of `case expressions`.
main = do
putStrLn "hello1"
<<f>> <--- step-in here
putStrLn "hello3"
putStrLn "hello4"
f = do
<<putStrLn "hello2.1">> <--- step-out from here
putStrLn "hello2.2"
...
main = do
putStrLn "hello1"
<<f>> <--- end up here again, the previously executed expression
putStrLn "hello3"
putStrLn "hello4"
doing step/step-local ...
main = do
putStrLn "hello1"
f
<<putStrLn "hello3">> <--- straight to the next line
putStrLn "hello4"
Finishes #26042
(cherry picked from commit ade3c1e60025c1f2e389742b526a141e5346c6b1)
- - - - -
cc4027a8 by Rodrigo Mesquita at 2025-10-02T16:05:32-04:00
debugger: Re-use the last BreakpointId whole in step-out
Previously, to come up with a location to stop at for `:stepout`, we
would store the location of the last BreakpointId surrounding the
continuation, as described by Note [Debugger: Stepout internal break locs].
However, re-using just the location from the last source breakpoint
isn't sufficient to provide the necessary information in the break
location. Specifically, it wouldn't bind any variables at that location.
Really, there is no reason not to re-use the last breakpoint wholesale,
and re-use all the information we had there. Step-out should behave just
as if we had stopped at the call, but s.t. continuing will not
re-execute the call.
This commit updates the CgBreakInfo to always store a BreakpointId, be
it the original one or the one we're emulating (for step-out).
It makes variable bindings on :stepout work
(cherry picked from commit c66910c06d63c1fe0b1c87d42a0cac8c1db260eb)
- - - - -
0d8a524a by Moritz Angermann at 2025-10-02T16:05:32-04:00
Improve mach-o relocation information
This change adds more information about the symbol and addresses
we try to relocate in the linker. This significantly helps when
deubbging relocation issues reported by users.
(cherry picked from commit 1537784bd4928f5ae60504e8ef467279fe541875)
- - - - -
2d13da9f by Moritz Angermann at 2025-10-02T16:05:32-04:00
test.mk expect GhcLeadingUnderscore, not LeadingUnderscore (in line with the other Ghc prefixed variables.
(cherry picked from commit 4e67855b01853bc4a23810b361061eceb1c49efd)
- - - - -
8a487b28 by Moritz Angermann at 2025-10-02T16:05:32-04:00
testsuite: Fix broken exec_signals_child.c
There is no signal 0. The signal mask is 1-32.
(cherry picked from commit c1cdd26507fa0b7cb7585af5a7b2ec5b1422d385)
- - - - -
b6d663c2 by Moritz Angermann at 2025-10-02T16:05:32-04:00
testsuite: clarify Windows/Darwin locale rationale for skipping T6037 T2507 T8959a
(cherry picked from commit 99ac335c54b648d04ced28e2a4d3840871bf9d15)
- - - - -
e69eee1a by Moritz Angermann at 2025-10-02T16:05:32-04:00
Skip broken tests on macOS (due to leading underscore not handled properly in the expected output.)
(cherry picked from commit 0e8fa77a72c601c9f4ee661bb9f335fff245885a)
- - - - -
f38c747b by Cheng Shao at 2025-10-02T16:05:32-04:00
rel-eng: update alpine images to 3.22
This patch is a part of #25876 and updates alpine images to 3.22,
while still retaining 3.12 for x86_64 fully_static bindists.
-------------------------
Metric Decrease:
MultiComponentModulesRecomp
-------------------------
(cherry picked from commit d17257edc178c66b930ba279133f462962702470)
- - - - -
59fa544f by Sylvain Henry at 2025-10-02T16:05:32-04:00
T16180: indicate that the stack isn't executable
(cherry picked from commit db3276bb5a2597bcaf8f830926298935066aeee6)
- - - - -
fbe34ee6 by Sylvain Henry at 2025-10-02T16:05:32-04:00
Fix some tests (statically linked GHC vs libc)
When GHC is linked statically, the stdout C global variable that GHC uses
isn't shared with the stdout C global variable used by loaded code.
As a consequence, the latter must be explicitly flushed because GHC
won't flush it before exiting.
(cherry picked from commit 11eeeba7dd50d16c8c7d62165d006bba8fa339a9)
- - - - -
963fd0a9 by Sylvain Henry at 2025-10-02T16:05:32-04:00
Testsuite: fix debug_rts detection
Running the testsuite without Hadrian should set config.debug_rts
correctly too.
(cherry picked from commit 80a07571623a6fe7692c08dbdee440ff90ce98c2)
- - - - -
52561996 by Simon Peyton Jones at 2025-10-02T16:05:32-04:00
Solve forall-constraints via an implication, again
In this earlier commit:
commit 953fd8f1dc080f1c56e3a60b4b7157456949be29
Author: Simon Peyton Jones <simon.peytonjones(a)gmail.com>
Date: Mon Jul 21 10:06:43 2025 +0100
Solve forall-constraints immediately, or not at all
I used a all-or-nothing strategy for quantified constraints
(aka forall-constraints). But alas that fell foul of #26315,
and #26376.
So this MR goes back to solving a quantified constraint by
turning it into an implication; UNLESS we are simplifying
constraints from a SPECIALISE pragma, in which case the
all-or-nothing strategy is great. See:
Note [Solving a Wanted forall-constraint]
Other stuff in this MR:
* TcSMode becomes a record of flags, rather than an enumeration
type; much nicer.
* Some fancy footwork to avoid error messages worsening again
(The above MR made them better; we want to retain that.)
See `GHC.Tc.Errors.Ppr.pprQCOriginExtra`.
-------------------------
Metric Decrease:
T24471
-------------------------
(cherry picked from commit 14123ee646f2b9738a917b7cec30f9d3941c13de)
- - - - -
b391e9b6 by Simon Peyton Jones at 2025-10-02T16:05:32-04:00
Add a test case for #26396
...same bug ast #26315
(cherry picked from commit e6c192e2ccdc6e7ac939ea70d891f176109c60e2)
- - - - -
166cc7cf by Cheng Shao at 2025-10-02T16:05:33-04:00
Revert "wasm: add brotli compression for ghci browser mode"
This reverts commit 731217ce68a1093b5f9e26a07d5bd2cdade2b352.
Benchmarks show non-negligible overhead when browser runs on the same
host, which is the majority of actual use cases.
(cherry picked from commit 42a189603e2e768795cb1684e1aa53ca840c0907)
- - - - -
19f4d5e7 by Cheng Shao at 2025-10-02T16:05:33-04:00
wasm: remove etag logic in ghci browser mode web server
This commit removes the etag logic in dyld script's ghci browser mode
web server. It was meant to support caching logic of wasm shared
libraries, but even if the port is manually specified to make caching
even relevant, for localhost the extra overhead around etag logic is
simply not worth it according to benchmarks.
(cherry picked from commit e6755b9fd10708057dfe1e52a931a579c417c3cf)
- - - - -
99a2d2e4 by Sylvain Henry at 2025-10-02T16:05:33-04:00
Print fully qualified unit names in name mismatch
It's more user-friendly to directly print the right thing instead of
requiring the user to retry with the additional `-dppr-debug` flag.
(cherry picked from commit 54b5950ebfed24429fae5111896ffc1f10750d08)
- - - - -
4934b3ff by Stefan Schulze Frielinghaus at 2025-10-02T16:05:33-04:00
rts: Fix alignment for gen_workspace #26334
After a0fa4941903272c48b050d24e93eec819eff51bd bootstrap is broken on
s390x and errors out with
rts/sm/GCThread.h:207:5: error:
error: alignment of array elements is greater than element size
207 | gen_workspace gens[];
| ^~~~~~~~~~~~~
The alignment constraint is applied via the attribute to the type
gen_workspace and leaves the underlying type struct gen_workspace_
untouched. On Aarch64, x86, and s390x the struct has a size of 128
bytes. On Aarch64 and x86 the alignments of 128 and 64 are divisors of
the size, respectively, which is why the type is a viable member type
for an array. However, on s390x, the alignment is 256 and therefore is
not a divisor of the size and hence cannot be used for arrays.
Basically I see two fixes here. Either decrease the alignment
requirement on s390x, or by applying the alignment constraint on the
struct itself. The former might affect performance as noted in
a0fa4941903272c48b050d24e93eec819eff51bd. The latter introduces padding
bits whenever necessary in order to ensure that
sizeof(gen_workspace[N])==N*sizeof(gen_workspace) holds which is done by
this patch.
(cherry picked from commit 6f63f57b86fffc8a9102b91a18a6de5bb4f8b7f0)
- - - - -
c216e6e9 by Cheng Shao at 2025-10-02T16:05:33-04:00
ghc-internal: fix codepages program
codepages was not properly updated during the base -> ghc-internal
migration, this commit fixes it.
(cherry picked from commit a4ff12bb8657c291a36f09bf2ee6a3798366cbb3)
- - - - -
97c73f1a by Cheng Shao at 2025-10-02T16:05:33-04:00
ghc-internal: relax ucd2haskell cabal upper bounds
This commit relaxes ucd2haskell cabal upper bounds to make it runnable
via ghc 9.12/9.14.
(cherry picked from commit 7e094def054d4a283e55f96167b3ab9eb8c3b4ea)
- - - - -
049163fb by Cheng Shao at 2025-10-02T16:05:33-04:00
ghc-internal: update to unicode 17.0.0
This commit updates the generated code in ghc-internal to match
unicode 17.0.0.
(cherry picked from commit 7077c9f76ebadedefd763078e7f7c42201b8a4b4)
- - - - -
e7e24498 by sheaf at 2025-10-02T16:05:33-04:00
Bad record update msg: allow out-of-scope datacons
This commit ensures that, when we encounter an invalid record update
(because no constructor exists which contains all of the record fields
mentioned in the record update), we graciously handle the situation in
which the constructors themselves are not in scope. In that case,
instead of looking up the constructors in the GlobalRdrEnv, directly
look up their GREInfo using the lookupGREInfo function.
Fixes #26391
(cherry picked from commit cef8938f3c0d22583f01d5ea29e6109bccd36040)
- - - - -
93049210 by sheaf at 2025-10-02T16:05:33-04:00
Improve Notes about disambiguating record updates
This commit updates the notes [Disambiguating record updates] and
[Type-directed record disambiguation], in particular adding more
information about the deprecation status of type-directed disambiguation
of record updates.
(cherry picked from commit a2d9d7c2073867ee0cabb8d49f93246d95ec0b09)
- - - - -
8f08bbee by Ben Gamari at 2025-10-02T16:05:33-04:00
StgToByteCode: Don't assume that data con workers are nullary
Previously StgToByteCode assumed that all data-con workers were of a
nullary representation. This is not a valid assumption, as seen
in #23210, where an unsaturated application of a unary data
constructor's worker resulted in invalid bytecode. Sadly, I have not yet
been able to reduce a minimal testcase for this.
Fixes #23210.
(cherry picked from commit d1d9e39ec293cd1d2b539b8246a349b539c6a61a)
- - - - -
98f9d9d8 by Ben Gamari at 2025-10-02T16:05:33-04:00
testsuite: Mark T23146* as unbroken
(cherry picked from commit 3eeecd508ef80812bc8ee84ab83f496f5030d59b)
- - - - -
89c08312 by Cheng Shao at 2025-10-02T16:05:33-04:00
rts: remove obsolete CC_SUPPORTS_TLS logic
This patch removes obsolete CC_SUPPORTS_TLS logic throughout the rts,
given __thread is now uniformly supported by C toolchains of all
platforms we currently support.
(cherry picked from commit 0f034942724233e1457549123b46880f7b93e805)
- - - - -
3617ed46 by Cheng Shao at 2025-10-02T16:05:33-04:00
rts: remove obsolete HAS_VISIBILITY_HIDDEN logic
This patch removes obsolete HAS_VISIBILITY_HIDDEN logic throughout the
rts, given __attribute__((visibility("hidden"))) is uniformly
supported by C toolchains of all platforms we currently support.
(cherry picked from commit ef7056554df5603ec4d1e33193abe953970e6ab3)
- - - - -
87990d6f by Cheng Shao at 2025-10-02T16:05:33-04:00
rts: remove -O3 pragma hack in Hash.c
This patch removes an obsolete gcc pragma to specify -O3 in Hash.c.
Hadrian already passes the right flag.
(cherry picked from commit 9fdc1f7d855cc61f90de909875f6ae0d6798dca7)
- - - - -
19d533f1 by Cheng Shao at 2025-10-02T16:05:33-04:00
rts: remove obsolete COMPILING_WINDOWS_DLL logic
This patch removes obsolete COMPILING_WINDOWS_DLL logic throughout the
rts. They were once used for compiling to win32 DLLs, but we haven't
been able to compile Haskell units to win32 DLLs for many years now,
due to PE format's restriction of no more than 65536 exported symbols
in a single DLL.
(cherry picked from commit b8cfa8f741729ef123569fb321c4b2ab4a1a941c)
- - - - -
30277f0b by Cheng Shao at 2025-10-02T16:05:33-04:00
wasm: bump browser_wasi_shim to 0.4.2
This patch bumps the browser_wasi_shim dependency of wasm dyld script
to 0.4.2.
(cherry picked from commit bb760611630402a1349b1952e345d879f83e4821)
- - - - -
a53571f6 by Vladislav Zavialov at 2025-10-02T16:05:33-04:00
Fix keyword in ExplicitNamespaces error message (#26418)
Consider this module header and the resulting error:
{-# LANGUAGE NoExplicitNamespaces #-}
module T26418 (data HeadC) where
-- error: [GHC-47007]
-- Illegal keyword 'type'
Previously, the error message would mention 'type' (as shown above),
even though the user wrote 'data'. This has now been fixed.
The error location has also been corrected: it is now reported at the
keyword position rather than at the position of the associated
import/export item.
(cherry picked from commit 4a8fed75e2094f9ae2af27bf86298873316c3acb)
- - - - -
644c05e9 by Cheng Shao at 2025-10-02T16:05:33-04:00
wasm: fix dyld handling for forward declared GOT.func items
This patch fixes wasm shared linker's handling of forward declared
GOT.func items, see linked issue for details. Also adds T26430 test to
witness the fix. Fixes #26430.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 867c26755e8855c6df949e65df0c2aebc9da64c3)
- - - - -
18927fce by Cheng Shao at 2025-10-02T16:05:33-04:00
rts: remove obsolete __GNUC__ related logic
This patch removes obsolete `__GNUC__` related logic, given on any
currently supported platform and toolchain, `__GNUC__ >= 4` is
universally true. Also pulls some other weeds and most notably, use
`__builtin___clear_cache` for clang as well, since clang has supported
this gcc intrinsic since 2014, see
https://github.com/llvm/llvm-project/commit/c491a8d4577052bc6b3b4c72a7db6a7….
(cherry picked from commit 67de53a6ced23caad640d2c7421089242f0dfb76)
- - - - -
f1999d7d by Brandon Chinn at 2025-10-02T16:05:33-04:00
Fix tabs in string gaps (#26415)
Tabs in string gaps were broken in bb030d0d because previously, string gaps were manually parsed, but now it's lexed by the usual Alex grammar and post-processed after successful lexing.
It broke because of a discrepancy between GHC's lexer grammar and the Haskell Report. The Haskell Report includes tabs in whitechar:
whitechar → newline | vertab | space | tab | uniWhite
$whitechar used to include tabs until 18 years ago, when it was removed in order to exclude tabs from $white_no_nl in order to warn on tabs: 6e202120. In this MR, I'm adding \t back into $whitechar, and explicitly excluding \t from the $white_no_nl+ rule ignoring all whitespace in source code, which more accurately colocates the "ignore all whitespace except tabs, which is handled in the next line" logic.
As a side effect of this MR, tabs are now allowed in pragmas; currently, a pragma written as {-# \t LANGUAGE ... #-} is interpreted as the tab character being the pragma name, and GHC warns "Unrecognized pragma". With this change, tabs are ignored as whitespace, which more closely matches the Report anyway.
(cherry picked from commit e9c5e46ffdb3cd8725e2ffdc2c440ea57af97bac)
- - - - -
8afc7a2e by Cheng Shao at 2025-10-02T16:05:33-04:00
hadrian: fix GHC.Platform.Host generation for cross stage1
This patch fixes incorrectly GHC.Platform.Host generation logic for
cross stage1 in hadrian (#26449). Also adds T26449 test case to
witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 8cbe006ad09d5a64e4a3cdf4c91a8b81ff1511be)
- - - - -
e5a34bb9 by Ben Gamari at 2025-10-02T16:05:33-04:00
base: Update changelog to reflect timing of IOPort# removal
This change will make 9.14 afterall.
(cherry picked from commit e05c496cf44c0cc86dcfa8ad8c5b024e44d8e4b4)
- - - - -
f75c7eba by Simon Peyton Jones at 2025-10-02T16:05:33-04:00
Fix buglet in GHC.Core.Unify.uVarOrFam
We were failing to match two totally-equal types!
This led to #26457.
(cherry picked from commit 9c293544a8b127aef3b4089f7e5cc21cb51a9946)
- - - - -
e72f3d36 by Cheng Shao at 2025-10-02T16:05:33-04:00
testsuite: remove unused expected output files
This patch removes unused expected output files in the testsuites on
platforms that we no longer support.
(cherry picked from commit 6992ac097b9da989f125f896afe21b75dba8b4c9)
- - - - -
f0f3babc by Ben Gamari at 2025-10-02T16:05:33-04:00
rts: Dynamically initialize built-in closures
To resolve #26166 we need to eliminate references to undefined symbols
in the runtime system. One such source of these is the runtime's
static references to `I#` and `C#` due the `stg_INTLIKE` and
`stg_CHARLIKE` arrays.
To avoid this we make these dynamic, initializing them during RTS
start-up.
(cherry picked from commit 39eaaaba5356e3fc9218d8e27375d6de24778cbc)
- - - - -
283 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/Lexer/String.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Debugger/Breakpoints.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/Solver/Solve.hs-boot
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/State.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- ghc/GHCi/UI.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Default.hs
- libraries/base/changelog.md
- libraries/base/src/GHC/Stack/CloneStack.hs
- libraries/base/tests/unicode002.stdout
- libraries/base/tests/unicode003.stdout
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs
- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
- + libraries/ghc-heap/GHC/Exts/Heap/Constants.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hs
- libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs
- libraries/ghc-heap/GHC/Exts/Stack.hs
- + libraries/ghc-heap/GHC/Exts/Stack/Constants.hs
- libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
- libraries/ghc-heap/ghc-heap.cabal.in
- libraries/ghc-heap/cbits/HeapPrim.cmm → libraries/ghc-internal/cbits/HeapPrim.cmm
- libraries/ghc-heap/cbits/Stack.cmm → libraries/ghc-internal/cbits/Stack.cmm
- libraries/ghc-internal/cbits/StackCloningDecoding.cmm
- libraries/ghc-heap/cbits/Stack_c.c → libraries/ghc-internal/cbits/Stack_c.c
- libraries/ghc-internal/cbits/atomic.c
- libraries/ghc-internal/cbits/ctz.c
- libraries/ghc-internal/codepages/MakeTable.hs
- libraries/ghc-internal/codepages/Makefile
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/jsbits/base.js
- libraries/ghc-internal/src/GHC/Internal/ClosureTypes.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Backtrace.hs
- + libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs
- libraries/ghc-heap/GHC/Exts/Heap/Constants.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/Constants.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable/Types.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc
- + libraries/ghc-internal/src/GHC/Internal/Heap/ProfInfo/Types.hs
- + libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/CloneStack.hs
- libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc → libraries/ghc-internal/src/GHC/Internal/Stack/Constants.hsc
- + libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/DerivedCoreProperties.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/GeneralCategory.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleLowerCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleTitleCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleUpperCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Version.hs
- + libraries/ghc-internal/tests/stack-annotation/Makefile
- + libraries/ghc-internal/tests/stack-annotation/TestUtils.hs
- + libraries/ghc-internal/tests/stack-annotation/all.T
- + libraries/ghc-internal/tests/stack-annotation/ann_frame001.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame002.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame003.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame004.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- libraries/ghc-internal/tools/ucd2haskell/ucd.sh
- libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
- libraries/ghc-internal/tools/ucd2haskell/unicode_version
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/ghci.cabal.in
- − m4/fp_visibility_hidden.m4
- rts/BeginPrivate.h
- + rts/BuiltinClosures.c
- + rts/BuiltinClosures.h
- rts/CloneStack.c
- rts/CloneStack.h
- rts/ClosureFlags.c
- rts/Disassembler.c
- rts/EndPrivate.h
- rts/Hash.c
- rts/Interpreter.c
- rts/LdvProfile.c
- rts/PrimOps.cmm
- rts/Printer.c
- rts/Profiling.c
- rts/RetainerProfile.c
- − rts/RtsDllMain.c
- − rts/RtsDllMain.h
- rts/RtsStartup.c
- rts/RtsSymbols.c
- rts/StgMiscClosures.cmm
- rts/Task.c
- rts/Task.h
- rts/TraverseHeap.c
- rts/configure.ac
- rts/include/Rts.h
- rts/include/RtsAPI.h
- rts/include/Stg.h
- rts/include/rts/Bytecodes.h
- rts/include/rts/Constants.h
- rts/include/rts/OSThreads.h
- rts/include/rts/Types.h
- rts/include/rts/storage/ClosureTypes.h
- rts/include/rts/storage/Closures.h
- rts/include/stg/DLL.h
- rts/include/stg/MiscClosures.h
- rts/js/profiling.js
- rts/linker/MachO.c
- rts/posix/OSThreads.c
- rts/rts.cabal
- rts/sm/BlockAlloc.c
- rts/sm/Compact.c
- rts/sm/Evac.c
- rts/sm/Evac.h
- rts/sm/GCTDecl.h
- rts/sm/GCThread.h
- rts/sm/NonMovingMark.c
- rts/sm/Sanity.c
- rts/sm/Scav.c
- rts/sm/Storage.c
- rts/win32/OSThreads.c
- testsuite/ghc-config/ghc-config.hs
- testsuite/mk/test.mk
- testsuite/tests/backpack/should_fail/bkpfail11.stderr
- testsuite/tests/backpack/should_fail/bkpfail43.stderr
- testsuite/tests/codeGen/should_run/T23146/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/cross/should_run/T26449.hs
- + testsuite/tests/cross/should_run/all.T
- + testsuite/tests/deriving/should_compile/T26396.hs
- testsuite/tests/deriving/should_compile/all.T
- testsuite/tests/deriving/should_fail/T12768.stderr
- testsuite/tests/deriving/should_fail/T1496.stderr
- testsuite/tests/deriving/should_fail/T21302.stderr
- testsuite/tests/deriving/should_fail/T22696b.stderr
- testsuite/tests/deriving/should_fail/T5498.stderr
- testsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/deriving/should_fail/T7148a.stderr
- testsuite/tests/driver/all.T
- testsuite/tests/ffi/should_run/T1288_c.c
- testsuite/tests/ffi/should_run/T1288_ghci_c.c
- testsuite/tests/ffi/should_run/T2276_c.c
- testsuite/tests/ffi/should_run/T2276_ghci_c.c
- + testsuite/tests/ghci-wasm/Makefile
- + testsuite/tests/ghci-wasm/T26430.hs
- + testsuite/tests/ghci-wasm/T26430A.c
- + testsuite/tests/ghci-wasm/T26430B.c
- + testsuite/tests/ghci-wasm/all.T
- testsuite/tests/ghci.debugger/scripts/T26042b.script
- testsuite/tests/ghci.debugger/scripts/T26042b.stdout
- testsuite/tests/ghci.debugger/scripts/T26042c.script
- testsuite/tests/ghci.debugger/scripts/T26042c.stdout
- + testsuite/tests/ghci.debugger/scripts/T26042d2.hs
- + testsuite/tests/ghci.debugger/scripts/T26042d2.script
- + testsuite/tests/ghci.debugger/scripts/T26042d2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042e.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f.script
- testsuite/tests/ghci.debugger/scripts/T26042f1.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042g.stdout
- testsuite/tests/ghci.debugger/scripts/all.T
- testsuite/tests/ghci/scripts/T7388.hs
- testsuite/tests/ghci/scripts/T7388.script
- testsuite/tests/impredicative/T17332.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/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- + testsuite/tests/overloadedrecflds/should_fail/T26391.hs
- + testsuite/tests/overloadedrecflds/should_fail/T26391.stderr
- testsuite/tests/overloadedrecflds/should_fail/all.T
- testsuite/tests/parser/should_fail/T16270h.stderr
- + testsuite/tests/parser/should_fail/T26418.hs
- + testsuite/tests/parser/should_fail/T26418.stderr
- testsuite/tests/parser/should_fail/all.T
- + testsuite/tests/parser/should_run/T26415.hs
- + testsuite/tests/parser/should_run/T26415.stdout
- testsuite/tests/parser/should_run/all.T
- − testsuite/tests/process/process010.stdout-i386-unknown-solaris2
- testsuite/tests/quantified-constraints/T19690.stderr
- testsuite/tests/quantified-constraints/T19921.stderr
- testsuite/tests/quantified-constraints/T21006.stderr
- testsuite/tests/roles/should_fail/RolesIArray.stderr
- testsuite/tests/rts/exec_signals_child.c
- − testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
- − testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
- testsuite/tests/rts/linker/T11223/all.T
- − testsuite/tests/rts/outofmem.stderr-i386-apple-darwin
- − testsuite/tests/rts/outofmem.stderr-i386-unknown-mingw32
- − testsuite/tests/rts/outofmem.stderr-powerpc-apple-darwin
- testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs
- testsuite/tests/simplCore/should_compile/DsSpecPragmas.stderr
- testsuite/tests/th/T16180.hs
- testsuite/tests/typecheck/should_compile/T14434.hs
- + testsuite/tests/typecheck/should_compile/T26154.hs
- + testsuite/tests/typecheck/should_compile/T26154_A.hs
- + testsuite/tests/typecheck/should_compile/T26154_B.hs
- + testsuite/tests/typecheck/should_compile/T26154_B.hs-boot
- + testsuite/tests/typecheck/should_compile/T26154_Other.hs
- + testsuite/tests/typecheck/should_compile/T26376.hs
- + testsuite/tests/typecheck/should_compile/T26457.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T15801.stderr
- testsuite/tests/typecheck/should_fail/T18851.hs
- testsuite/tests/typecheck/should_fail/T19627.stderr
- testsuite/tests/typecheck/should_fail/T20666.stderr
- testsuite/tests/typecheck/should_fail/T20666a.stderr
- testsuite/tests/typecheck/should_fail/T20666b.stderr
- testsuite/tests/typecheck/should_fail/T22912.stderr
- testsuite/tests/typecheck/should_fail/T23427.stderr
- + testsuite/tests/typecheck/should_fail/T26255a.hs
- + testsuite/tests/typecheck/should_fail/T26255a.stderr
- + testsuite/tests/typecheck/should_fail/T26255b.hs
- + testsuite/tests/typecheck/should_fail/T26255b.stderr
- + testsuite/tests/typecheck/should_fail/T26255c.hs
- + testsuite/tests/typecheck/should_fail/T26255c.stderr
- testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/deriveConstants/Main.hs
- utils/jsffi/dyld.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d9d6d2d8cf170d51e49b63e1a9d068…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d9d6d2d8cf170d51e49b63e1a9d068…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/backports-9.14] 52 commits: Revert "Remove hptAllFamInstances usage during upsweep"
by Ben Gamari (@bgamari) 02 Oct '25
by Ben Gamari (@bgamari) 02 Oct '25
02 Oct '25
Ben Gamari pushed to branch wip/backports-9.14 at Glasgow Haskell Compiler / GHC
Commits:
c935794d by sheaf at 2025-10-02T13:57:34-04:00
Revert "Remove hptAllFamInstances usage during upsweep"
This reverts commit 3bf6720eff5e86e673568e756161e6d6150eb440.
(cherry picked from commit 0975d2b6c0747cd40abb4e881b2fb086cbc93726)
- - - - -
821316e6 by soulomoon at 2025-10-02T13:57:38-04:00
Family consistency checks: add test for #26154
This commit adds the test T26154, to make sure that GHC doesn't crash
when performing type family consistency checks. This test case
was extracted from Agda.
Fixes #26154
(cherry picked from commit 0cf341761fa2b506868a62a0e20a6214eb275be0)
- - - - -
c5e841af by Simon Peyton Jones at 2025-10-02T13:58:24-04:00
Report solid equality errors before custom errors
This MR fixes #26255 by
* Reporting solid equality errors like
Int ~ Bool
before "custom type errors". See comments in `report1` in
`reportWanteds`
* Suppressing errors that arise from superclasses of
Wanteds. See (SCE1) in Note [Suppressing confusing errors]
More details in #26255.
(cherry picked from commit ba210d981b0812aea604f884d3c0aada4c8ca75c)
- - - - -
901ccaf1 by Simon Peyton Jones at 2025-10-02T13:58:31-04:00
Fix a scoping error in Specialise
This small patch fixes #26329, which triggered a scoping error.
Test is in T21391, with -fpolymorphic-specialisation enabled
(cherry picked from commit b62491405ae851ae514afe18d51f0fe7fbefebf3)
- - - - -
4369714d by Ben Gamari at 2025-10-02T13:58:50-04:00
Add primop to annotate the call stack with arbitrary data
We introduce a new primop `annotateStack#` which allows us to push
arbitrary data onto the call-stack.
This allows us to extract the data later when decoding the stack, for
example when an exception is thrown, showing more information to the
user without having to annotate the full call-stack with `HasCallStack`
constraints.
A new stack frame value is introduced `AnnFrame`, which consists of
nothing but a generic payload.
The primop has a small wrapper API that allows users to annotate their
call-stack in programs.
There is a pure API and an IO-based one. The former is a little bit
dubious, as it affects the evaluation of a program, so use with care.
The latter is "safe", as it doesn't change the evaluation of the
program.
The stack annotation mechanism is similarly implemented to the
`ExceptionAnnotation` and `Exception`, there is a typeclass to indicate
something can be pushed onto the call-stack and all values are wrapped
in the existential `SomeStackAnnotation`, which recover the type of the
annotation payload.
There is currently no builtin way to show the stack annotations when
`Backtraces` are displayed (i.e., when showing stack traces to the user),
which we will address in a follow-up MR.
-------------------------
Metric Increase:
ghc_experimental_so
-------------------------
We increase the size of the package, so this is not unreasonable.
Co-Authored-By: fendor <fendor(a)posteo.de>
Co-Authored-By: Ben Gamari <bgamari.foss(a)gmail.com>
(cherry picked from commit 774fec37d37fd9f31a3742f684b2b5621628f5bf)
- - - - -
af0fb3d0 by Rodrigo Mesquita at 2025-10-02T13:58:55-04:00
bytecode: Use 32bits for breakpoint index
Fixes #26325
(cherry picked from commit e368e24779f8a7bf110a025383db23521b313407)
- - - - -
79a59478 by fendor at 2025-10-02T13:59:05-04:00
Move stack decoding logic from ghc-heap to ghc-internal
The stack decoding logic in `ghc-heap` is more sophisticated than the one
currently employed in `CloneStack`. We want to use the stack decoding
implementation from `ghc-heap` in `base`.
We cannot simply depend on `ghc-heap` in `base` due do bootstrapping
issues.
Thus, we move the code that is necessary to implement stack decoding to
`ghc-internal`. This is the right location, as we don't want to add a
new API to `base`.
Moving the stack decoding logic and re-exposing it in ghc-heap is
insufficient, though, as we have a dependency cycle between.
* ghc-heap depends on stage1:ghc-internal
* stage0:ghc depends on stage0:ghc-heap
To fix this, we remove ghc-heap from the set of `stage0` dependencies.
This is not entirely straight-forward, as a couple of boot dependencies,
such as `ghci` depend on `ghc-heap`.
Luckily, the boot compiler of GHC is now >=9.10, so we can migrate `ghci`
to use `ghc-internal` instead of `ghc-heap`, which already exports the
relevant modules.
However, we cannot 100% remove ghc's dependency on `ghc-heap`, since
when we compile `stage0:ghc`, `stage1:ghc-internal` is not yet
available.
Thus, when we compile with the boot-compiler, we still depend on an
older version of `ghc-heap`, and only use the modules from `ghc-internal`,
if the `ghc-internal` version is recent enough.
-------------------------
Metric Increase:
T24602_perf_size
T25046_perf_size_gzip
T25046_perf_size_unicode
T25046_perf_size_unicode_gzip
size_hello_artifact
size_hello_artifact_gzip
size_hello_unicode
size_hello_unicode_gzip
-------------------------
These metric increases are unfortunate, they are most likely caused by
the larger (literally in terms of lines of code) stack decoder implementation
that are now linked into hello-word binaries.
On linux, it is almost a 10% increase, which is considerable.
(cherry picked from commit 26dbcf616378afed9da9d50b5357786f3bd7ff9d)
- - - - -
ffc61a4f by fendor at 2025-10-02T13:59:06-04:00
Implement `decode` in terms of `decodeStackWithIpe`
Uses the more efficient stack decoder implementation.
(cherry picked from commit bd80bb7013b1c2446557a56779c88e7ad1a06259)
- - - - -
03e01cd6 by fendor at 2025-10-02T13:59:07-04:00
Remove stg_decodeStackzh
(cherry picked from commit 2444116517515ce7bc6bf7ac8479e919d945ed6a)
- - - - -
20cdcbb4 by fendor at 2025-10-02T13:59:22-04:00
Expose Stack Annotation frames in IPE backtraces by default
When decoding the Haskell-native call stack and displaying the IPE information
for the stack frames, we print the `StackAnnotation` of the `AnnFrame` by default.
This means, when an exception is thrown, any intermediate stack annotations will
be displayed in the `IPE Backtrace`.
Example backtrace:
```
Exception: ghc-internal:GHC.Internal.Exception.ErrorCall:
Oh no!
IPE backtrace:
annotateCallStackIO, called at app/Main.hs:48:10 in backtrace-0.1.0.0-inplace-server:Main
annotateCallStackIO, called at app/Main.hs:46:13 in backtrace-0.1.0.0-inplace-server:Main
Main.handler (app/Main.hs:(46,1)-(49,30))
Main.liftIO (src/Servant/Server/Internal/Handler.hs:30:36-42)
Servant.Server.Internal.Delayed.runHandler' (src/Servant/Server/Internal/Handler.hs:27:31-41)
Control.Monad.Trans.Resource.runResourceT (./Control/Monad/Trans/Resource.hs:(192,14)-(197,18))
Network.Wai.Handler.Warp.HTTP1.processRequest (./Network/Wai/Handler/Warp/HTTP1.hs:195:20-22)
Network.Wai.Handler.Warp.HTTP1.processRequest (./Network/Wai/Handler/Warp/HTTP1.hs:(195,5)-(203,31))
Network.Wai.Handler.Warp.HTTP1.http1server.loop (./Network/Wai/Handler/Warp/HTTP1.hs:(141,9)-(157,42))
HasCallStack backtrace:
error, called at app/Main.hs:48:32 in backtrace-0.1.0.0-inplace-server:Main
```
The first two entries have been added by `annotateCallStackIO`, defined in `annotateCallStackIO`.
(cherry picked from commit 26e0db16365059f0fdfe63b773852df45ebda913)
- - - - -
9af6e276 by Rodrigo Mesquita at 2025-10-02T13:59:56-04:00
cleanup: Move dehydrateCgBreakInfo to Stg2Bc
This no longer has anything to do with Core.
(cherry picked from commit 79816cc4071d281d6893ad3df4c06e9cf51daee7)
- - - - -
8d63bbfb by Rodrigo Mesquita at 2025-10-02T14:00:01-04:00
rts/Disassembler: Fix spacing of BRK_FUN
(cherry picked from commit 53da94ff72f63b6ac09ecd16493a321843ea2c69)
- - - - -
d093b99b by Rodrigo Mesquita at 2025-10-02T14:00:02-04:00
debugger: Fix bciPtr in Step-out
We need to use `BCO_NEXT` to move bciPtr to ix=1, because ix=0 points to
the instruction itself!
I do not understand how this didn't crash before.
(cherry picked from commit 08c0cf85abdd0cf63c64f9819cd34b42d437d114)
- - - - -
e963318e by Rodrigo Mesquita at 2025-10-02T14:00:02-04:00
debugger: Allow BRK_FUNs to head case continuation BCOs
When we start executing a BCO, we may want to yield to the scheduler:
this may be triggered by a heap/stack check, context switch, or a
breakpoint. To yield, we need to put the stack in a state such that
when execution is resumed we are back to where we yielded from.
Previously, a BKR_FUN could only head a function BCO because we only
knew how to construct a valid stack for yielding from one -- simply add
`apply_interp_info` + the BCO to resume executing. This is valid because
the stack at the start of run_BCO is headed by that BCO's arguments.
However, in case continuation BCOs (as per Note [Case continuation BCOs]),
we couldn't easily reconstruct a valid stack that could be resumed
because we dropped too soon the stack frames regarding the value
returned (stg_ret) and received (stg_ctoi) by that continuation.
This is especially tricky because of the variable type and size return
frames (e.g. pointer ret_p/ctoi_R1p vs a tuple ret_t/ctoi_t2).
The trick to being able to yield from a BRK_FUN at the start of a case
cont BCO is to stop removing the ret frame headers eagerly and instead
keep them until the BCO starts executing. The new layout at the start of
a case cont. BCO is described by the new Note [Stack layout when entering run_BCO].
Now, we keep the ret_* and ctoi_* frames when entering run_BCO.
A BRK_FUN is then executed if found, and the stack is yielded as-is with
the preserved ret and ctoi frames.
Then, a case cont BCO's instructions always SLIDE off the headers of the
ret and ctoi frames, in StgToByteCode.doCase, turning a stack like
| .... |
+---------------+
| fv2 |
+---------------+
| fv1 |
+---------------+
| BCO |
+---------------+
| stg_ctoi_ret_ |
+---------------+
| retval |
+---------------+
| stg_ret_..... |
+---------------+
into
| .... |
+---------------+
| fv2 |
+---------------+
| fv1 |
+---------------+
| retval |
+---------------+
for the remainder of the BCO.
Moreover, this more uniform approach of keeping the ret and ctoi frames
means we need less ad-hoc logic concerning the variable size of
ret_tuple vs ret_p/np frames in the code generator and interpreter:
Always keep the return to cont. stack intact at the start of run_BCO,
and the statically generated instructions will take care of adjusting
it.
Unlocks BRK_FUNs at the start of case cont. BCOs which will enable a
better user-facing step-out (#26042) which is free of the bugs the
current BRK_ALTS implementation suffers from (namely, using BRK_FUN
rather than BRK_ALTS in a case cont. means we'll never accidentally end
up in a breakpoint "deeper" than the continuation, because we stop at
the case cont itself rather than on the first breakpoint we evaluate
after it).
(cherry picked from commit e7e021fa8ebb847823d2cc6c2a1ae73b94cd6fd8)
- - - - -
8a17e7f3 by Rodrigo Mesquita at 2025-10-02T14:00:03-04:00
BRK_FUN with InternalBreakLocs for code-generation time breakpoints
At the start of a case continuation BCO, place a BRK_FUN.
This BRK_FUN uses the new "internal breakpoint location" -- allowing us
to come up with a valid source location for this breakpoint that is not associated with a source-level tick.
For case continuation BCOs, we use the last tick seen before it as the
source location. The reasoning is described in Note [Debugger: Stepout internal break locs].
Note how T26042c, which was broken because it displayed the incorrect
behavior of the previous step out when we'd end up at a deeper level
than the one from which we initiated step-out, is now fixed.
As of this commit, BRK_ALTS is now dead code and is thus dropped.
Note [Debugger: Stepout internal break locs]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step-out tells the interpreter to run until the current function
returns to where it was called from, and stop there.
This is achieved by enabling the BRK_FUN found on the first RET_BCO
frame on the stack (See [Note Debugger: Step-out]).
Case continuation BCOs (which select an alternative branch) must
therefore be headed by a BRK_FUN. An example:
f x = case g x of <--- end up here
1 -> ...
2 -> ...
g y = ... <--- step out from here
- `g` will return a value to the case continuation BCO in `f`
- The case continuation BCO will receive the value returned from g
- Match on it and push the alternative continuation for that branch
- And then enter that alternative.
If we step-out of `g`, the first RET_BCO on the stack is the case
continuation of `f` -- execution should stop at its start, before
selecting an alternative. (One might ask, "why not enable the breakpoint
in the alternative instead?", because the alternative continuation is
only pushed to the stack *after* it is selected by the case cont. BCO)
However, the case cont. BCO is not associated with any source-level
tick, it is merely the glue code which selects alternatives which do
have source level ticks. Therefore, we have to come up at code
generation time with a breakpoint location ('InternalBreakLoc') to
display to the user when it is stopped there.
Our solution is to use the last tick seen just before reaching the case
continuation. This is robust because a case continuation will thus
always have a relevant breakpoint location:
- The source location will be the last source-relevant expression
executed before the continuation is pushed
- So the source location will point to the thing you've just stepped
out of
- Doing :step-local from there will put you on the selected
alternative (which at the source level may also be the e.g. next
line in a do-block)
Examples, using angle brackets (<<...>>) to denote the breakpoint span:
f x = case <<g x>> {- step in here -} of
1 -> ...
2 -> ...>
g y = <<...>> <--- step out from here
...
f x = <<case g x of <--- end up here, whole case highlighted
1 -> ...
2 -> ...>>
doing :step-local ...
f x = case g x of
1 -> <<...>> <--- stop in the alternative
2 -> ...
A second example based on T26042d2, where the source is a do-block IO
action, optimised to a chain of `case expressions`.
main = do
putStrLn "hello1"
<<f>> <--- step-in here
putStrLn "hello3"
putStrLn "hello4"
f = do
<<putStrLn "hello2.1">> <--- step-out from here
putStrLn "hello2.2"
...
main = do
putStrLn "hello1"
<<f>> <--- end up here again, the previously executed expression
putStrLn "hello3"
putStrLn "hello4"
doing step/step-local ...
main = do
putStrLn "hello1"
f
<<putStrLn "hello3">> <--- straight to the next line
putStrLn "hello4"
Finishes #26042
(cherry picked from commit ade3c1e60025c1f2e389742b526a141e5346c6b1)
- - - - -
7bb28c3c by Rodrigo Mesquita at 2025-10-02T14:00:04-04:00
debugger: Re-use the last BreakpointId whole in step-out
Previously, to come up with a location to stop at for `:stepout`, we
would store the location of the last BreakpointId surrounding the
continuation, as described by Note [Debugger: Stepout internal break locs].
However, re-using just the location from the last source breakpoint
isn't sufficient to provide the necessary information in the break
location. Specifically, it wouldn't bind any variables at that location.
Really, there is no reason not to re-use the last breakpoint wholesale,
and re-use all the information we had there. Step-out should behave just
as if we had stopped at the call, but s.t. continuing will not
re-execute the call.
This commit updates the CgBreakInfo to always store a BreakpointId, be
it the original one or the one we're emulating (for step-out).
It makes variable bindings on :stepout work
(cherry picked from commit c66910c06d63c1fe0b1c87d42a0cac8c1db260eb)
- - - - -
aa39f6dc by Moritz Angermann at 2025-10-02T14:01:43-04:00
Improve mach-o relocation information
This change adds more information about the symbol and addresses
we try to relocate in the linker. This significantly helps when
deubbging relocation issues reported by users.
(cherry picked from commit 1537784bd4928f5ae60504e8ef467279fe541875)
- - - - -
e408c37d by Moritz Angermann at 2025-10-02T14:01:51-04:00
test.mk expect GhcLeadingUnderscore, not LeadingUnderscore (in line with the other Ghc prefixed variables.
(cherry picked from commit 4e67855b01853bc4a23810b361061eceb1c49efd)
- - - - -
a0f11460 by Moritz Angermann at 2025-10-02T14:01:58-04:00
testsuite: Fix broken exec_signals_child.c
There is no signal 0. The signal mask is 1-32.
(cherry picked from commit c1cdd26507fa0b7cb7585af5a7b2ec5b1422d385)
- - - - -
336b01f6 by Moritz Angermann at 2025-10-02T14:02:04-04:00
testsuite: clarify Windows/Darwin locale rationale for skipping T6037 T2507 T8959a
(cherry picked from commit 99ac335c54b648d04ced28e2a4d3840871bf9d15)
- - - - -
73420955 by Moritz Angermann at 2025-10-02T14:02:18-04:00
Skip broken tests on macOS (due to leading underscore not handled properly in the expected output.)
(cherry picked from commit 0e8fa77a72c601c9f4ee661bb9f335fff245885a)
- - - - -
09f35a7a by Cheng Shao at 2025-10-02T14:02:26-04:00
rel-eng: update alpine images to 3.22
This patch is a part of #25876 and updates alpine images to 3.22,
while still retaining 3.12 for x86_64 fully_static bindists.
-------------------------
Metric Decrease:
MultiComponentModulesRecomp
-------------------------
(cherry picked from commit d17257edc178c66b930ba279133f462962702470)
- - - - -
c4828244 by Sylvain Henry at 2025-10-02T14:02:57-04:00
T16180: indicate that the stack isn't executable
(cherry picked from commit db3276bb5a2597bcaf8f830926298935066aeee6)
- - - - -
37d9a95a by Sylvain Henry at 2025-10-02T14:02:59-04:00
Fix some tests (statically linked GHC vs libc)
When GHC is linked statically, the stdout C global variable that GHC uses
isn't shared with the stdout C global variable used by loaded code.
As a consequence, the latter must be explicitly flushed because GHC
won't flush it before exiting.
(cherry picked from commit 11eeeba7dd50d16c8c7d62165d006bba8fa339a9)
- - - - -
09304ebb by Sylvain Henry at 2025-10-02T14:03:11-04:00
Testsuite: fix debug_rts detection
Running the testsuite without Hadrian should set config.debug_rts
correctly too.
(cherry picked from commit 80a07571623a6fe7692c08dbdee440ff90ce98c2)
- - - - -
f1e182b2 by Simon Peyton Jones at 2025-10-02T14:03:32-04:00
Solve forall-constraints via an implication, again
In this earlier commit:
commit 953fd8f1dc080f1c56e3a60b4b7157456949be29
Author: Simon Peyton Jones <simon.peytonjones(a)gmail.com>
Date: Mon Jul 21 10:06:43 2025 +0100
Solve forall-constraints immediately, or not at all
I used a all-or-nothing strategy for quantified constraints
(aka forall-constraints). But alas that fell foul of #26315,
and #26376.
So this MR goes back to solving a quantified constraint by
turning it into an implication; UNLESS we are simplifying
constraints from a SPECIALISE pragma, in which case the
all-or-nothing strategy is great. See:
Note [Solving a Wanted forall-constraint]
Other stuff in this MR:
* TcSMode becomes a record of flags, rather than an enumeration
type; much nicer.
* Some fancy footwork to avoid error messages worsening again
(The above MR made them better; we want to retain that.)
See `GHC.Tc.Errors.Ppr.pprQCOriginExtra`.
-------------------------
Metric Decrease:
T24471
-------------------------
(cherry picked from commit 14123ee646f2b9738a917b7cec30f9d3941c13de)
- - - - -
4e1ac9b4 by Simon Peyton Jones at 2025-10-02T14:03:33-04:00
Add a test case for #26396
...same bug ast #26315
(cherry picked from commit e6c192e2ccdc6e7ac939ea70d891f176109c60e2)
- - - - -
8809f195 by Cheng Shao at 2025-10-02T14:03:48-04:00
Revert "wasm: add brotli compression for ghci browser mode"
This reverts commit 731217ce68a1093b5f9e26a07d5bd2cdade2b352.
Benchmarks show non-negligible overhead when browser runs on the same
host, which is the majority of actual use cases.
(cherry picked from commit 42a189603e2e768795cb1684e1aa53ca840c0907)
- - - - -
33b71da1 by Cheng Shao at 2025-10-02T14:03:48-04:00
wasm: remove etag logic in ghci browser mode web server
This commit removes the etag logic in dyld script's ghci browser mode
web server. It was meant to support caching logic of wasm shared
libraries, but even if the port is manually specified to make caching
even relevant, for localhost the extra overhead around etag logic is
simply not worth it according to benchmarks.
(cherry picked from commit e6755b9fd10708057dfe1e52a931a579c417c3cf)
- - - - -
78d3e87d by Sylvain Henry at 2025-10-02T14:03:56-04:00
Print fully qualified unit names in name mismatch
It's more user-friendly to directly print the right thing instead of
requiring the user to retry with the additional `-dppr-debug` flag.
(cherry picked from commit 54b5950ebfed24429fae5111896ffc1f10750d08)
- - - - -
e0db4ebe by Stefan Schulze Frielinghaus at 2025-10-02T14:04:46-04:00
rts: Fix alignment for gen_workspace #26334
After a0fa4941903272c48b050d24e93eec819eff51bd bootstrap is broken on
s390x and errors out with
rts/sm/GCThread.h:207:5: error:
error: alignment of array elements is greater than element size
207 | gen_workspace gens[];
| ^~~~~~~~~~~~~
The alignment constraint is applied via the attribute to the type
gen_workspace and leaves the underlying type struct gen_workspace_
untouched. On Aarch64, x86, and s390x the struct has a size of 128
bytes. On Aarch64 and x86 the alignments of 128 and 64 are divisors of
the size, respectively, which is why the type is a viable member type
for an array. However, on s390x, the alignment is 256 and therefore is
not a divisor of the size and hence cannot be used for arrays.
Basically I see two fixes here. Either decrease the alignment
requirement on s390x, or by applying the alignment constraint on the
struct itself. The former might affect performance as noted in
a0fa4941903272c48b050d24e93eec819eff51bd. The latter introduces padding
bits whenever necessary in order to ensure that
sizeof(gen_workspace[N])==N*sizeof(gen_workspace) holds which is done by
this patch.
(cherry picked from commit 6f63f57b86fffc8a9102b91a18a6de5bb4f8b7f0)
- - - - -
ed1d23d6 by Cheng Shao at 2025-10-02T14:04:59-04:00
ghc-internal: fix codepages program
codepages was not properly updated during the base -> ghc-internal
migration, this commit fixes it.
(cherry picked from commit a4ff12bb8657c291a36f09bf2ee6a3798366cbb3)
- - - - -
b7b49047 by Cheng Shao at 2025-10-02T14:05:00-04:00
ghc-internal: relax ucd2haskell cabal upper bounds
This commit relaxes ucd2haskell cabal upper bounds to make it runnable
via ghc 9.12/9.14.
(cherry picked from commit 7e094def054d4a283e55f96167b3ab9eb8c3b4ea)
- - - - -
fb2ff96c by Cheng Shao at 2025-10-02T14:06:05-04:00
ghc-internal: update to unicode 17.0.0
This commit updates the generated code in ghc-internal to match
unicode 17.0.0.
(cherry picked from commit 7077c9f76ebadedefd763078e7f7c42201b8a4b4)
- - - - -
c106c827 by sheaf at 2025-10-02T14:09:08-04:00
Bad record update msg: allow out-of-scope datacons
This commit ensures that, when we encounter an invalid record update
(because no constructor exists which contains all of the record fields
mentioned in the record update), we graciously handle the situation in
which the constructors themselves are not in scope. In that case,
instead of looking up the constructors in the GlobalRdrEnv, directly
look up their GREInfo using the lookupGREInfo function.
Fixes #26391
(cherry picked from commit cef8938f3c0d22583f01d5ea29e6109bccd36040)
- - - - -
8f32480b by sheaf at 2025-10-02T14:09:09-04:00
Improve Notes about disambiguating record updates
This commit updates the notes [Disambiguating record updates] and
[Type-directed record disambiguation], in particular adding more
information about the deprecation status of type-directed disambiguation
of record updates.
(cherry picked from commit a2d9d7c2073867ee0cabb8d49f93246d95ec0b09)
- - - - -
f15ab39e by Ben Gamari at 2025-10-02T14:09:20-04:00
StgToByteCode: Don't assume that data con workers are nullary
Previously StgToByteCode assumed that all data-con workers were of a
nullary representation. This is not a valid assumption, as seen
in #23210, where an unsaturated application of a unary data
constructor's worker resulted in invalid bytecode. Sadly, I have not yet
been able to reduce a minimal testcase for this.
Fixes #23210.
(cherry picked from commit d1d9e39ec293cd1d2b539b8246a349b539c6a61a)
- - - - -
48b78360 by Ben Gamari at 2025-10-02T14:09:21-04:00
testsuite: Mark T23146* as unbroken
(cherry picked from commit 3eeecd508ef80812bc8ee84ab83f496f5030d59b)
- - - - -
06dfc9e9 by Cheng Shao at 2025-10-02T14:09:29-04:00
rts: remove obsolete CC_SUPPORTS_TLS logic
This patch removes obsolete CC_SUPPORTS_TLS logic throughout the rts,
given __thread is now uniformly supported by C toolchains of all
platforms we currently support.
(cherry picked from commit 0f034942724233e1457549123b46880f7b93e805)
- - - - -
68818652 by Cheng Shao at 2025-10-02T14:09:34-04:00
rts: remove obsolete HAS_VISIBILITY_HIDDEN logic
This patch removes obsolete HAS_VISIBILITY_HIDDEN logic throughout the
rts, given __attribute__((visibility("hidden"))) is uniformly
supported by C toolchains of all platforms we currently support.
(cherry picked from commit ef7056554df5603ec4d1e33193abe953970e6ab3)
- - - - -
9ff1879a by Cheng Shao at 2025-10-02T14:09:58-04:00
rts: remove -O3 pragma hack in Hash.c
This patch removes an obsolete gcc pragma to specify -O3 in Hash.c.
Hadrian already passes the right flag.
(cherry picked from commit 9fdc1f7d855cc61f90de909875f6ae0d6798dca7)
- - - - -
db110c52 by Cheng Shao at 2025-10-02T14:10:05-04:00
rts: remove obsolete COMPILING_WINDOWS_DLL logic
This patch removes obsolete COMPILING_WINDOWS_DLL logic throughout the
rts. They were once used for compiling to win32 DLLs, but we haven't
been able to compile Haskell units to win32 DLLs for many years now,
due to PE format's restriction of no more than 65536 exported symbols
in a single DLL.
(cherry picked from commit b8cfa8f741729ef123569fb321c4b2ab4a1a941c)
- - - - -
48a631dc by Cheng Shao at 2025-10-02T14:10:25-04:00
wasm: bump browser_wasi_shim to 0.4.2
This patch bumps the browser_wasi_shim dependency of wasm dyld script
to 0.4.2.
(cherry picked from commit bb760611630402a1349b1952e345d879f83e4821)
- - - - -
4042d7dd by Vladislav Zavialov at 2025-10-02T14:10:30-04:00
Fix keyword in ExplicitNamespaces error message (#26418)
Consider this module header and the resulting error:
{-# LANGUAGE NoExplicitNamespaces #-}
module T26418 (data HeadC) where
-- error: [GHC-47007]
-- Illegal keyword 'type'
Previously, the error message would mention 'type' (as shown above),
even though the user wrote 'data'. This has now been fixed.
The error location has also been corrected: it is now reported at the
keyword position rather than at the position of the associated
import/export item.
(cherry picked from commit 4a8fed75e2094f9ae2af27bf86298873316c3acb)
- - - - -
d5b4e70b by Cheng Shao at 2025-10-02T14:10:38-04:00
wasm: fix dyld handling for forward declared GOT.func items
This patch fixes wasm shared linker's handling of forward declared
GOT.func items, see linked issue for details. Also adds T26430 test to
witness the fix. Fixes #26430.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 867c26755e8855c6df949e65df0c2aebc9da64c3)
- - - - -
b88d7e8c by Cheng Shao at 2025-10-02T14:10:45-04:00
rts: remove obsolete __GNUC__ related logic
This patch removes obsolete `__GNUC__` related logic, given on any
currently supported platform and toolchain, `__GNUC__ >= 4` is
universally true. Also pulls some other weeds and most notably, use
`__builtin___clear_cache` for clang as well, since clang has supported
this gcc intrinsic since 2014, see
https://github.com/llvm/llvm-project/commit/c491a8d4577052bc6b3b4c72a7db6a7….
(cherry picked from commit 67de53a6ced23caad640d2c7421089242f0dfb76)
- - - - -
8c158303 by Brandon Chinn at 2025-10-02T14:10:52-04:00
Fix tabs in string gaps (#26415)
Tabs in string gaps were broken in bb030d0d because previously, string gaps were manually parsed, but now it's lexed by the usual Alex grammar and post-processed after successful lexing.
It broke because of a discrepancy between GHC's lexer grammar and the Haskell Report. The Haskell Report includes tabs in whitechar:
whitechar → newline | vertab | space | tab | uniWhite
$whitechar used to include tabs until 18 years ago, when it was removed in order to exclude tabs from $white_no_nl in order to warn on tabs: 6e202120. In this MR, I'm adding \t back into $whitechar, and explicitly excluding \t from the $white_no_nl+ rule ignoring all whitespace in source code, which more accurately colocates the "ignore all whitespace except tabs, which is handled in the next line" logic.
As a side effect of this MR, tabs are now allowed in pragmas; currently, a pragma written as {-# \t LANGUAGE ... #-} is interpreted as the tab character being the pragma name, and GHC warns "Unrecognized pragma". With this change, tabs are ignored as whitespace, which more closely matches the Report anyway.
(cherry picked from commit e9c5e46ffdb3cd8725e2ffdc2c440ea57af97bac)
- - - - -
4cd4e252 by Cheng Shao at 2025-10-02T14:10:58-04:00
hadrian: fix GHC.Platform.Host generation for cross stage1
This patch fixes incorrectly GHC.Platform.Host generation logic for
cross stage1 in hadrian (#26449). Also adds T26449 test case to
witness the fix.
Co-authored-by: Codex <codex(a)openai.com>
(cherry picked from commit 8cbe006ad09d5a64e4a3cdf4c91a8b81ff1511be)
- - - - -
b2719577 by Ben Gamari at 2025-10-02T14:12:25-04:00
base: Update changelog to reflect timing of IOPort# removal
This change will make 9.14 afterall.
(cherry picked from commit e05c496cf44c0cc86dcfa8ad8c5b024e44d8e4b4)
- - - - -
9b1286ab by Simon Peyton Jones at 2025-10-02T14:13:04-04:00
Fix buglet in GHC.Core.Unify.uVarOrFam
We were failing to match two totally-equal types!
This led to #26457.
(cherry picked from commit 9c293544a8b127aef3b4089f7e5cc21cb51a9946)
- - - - -
187b8a05 by Cheng Shao at 2025-10-02T14:13:09-04:00
testsuite: remove unused expected output files
This patch removes unused expected output files in the testsuites on
platforms that we no longer support.
(cherry picked from commit 6992ac097b9da989f125f896afe21b75dba8b4c9)
- - - - -
d9d6d2d8 by Ben Gamari at 2025-10-02T14:14:40-04:00
rts: Dynamically initialize built-in closures
To resolve #26166 we need to eliminate references to undefined symbols
in the runtime system. One such source of these is the runtime's
static references to `I#` and `C#` due the `stg_INTLIKE` and
`stg_CHARLIKE` arrays.
To avoid this we make these dynamic, initializing them during RTS
start-up.
(cherry picked from commit 39eaaaba5356e3fc9218d8e27375d6de24778cbc)
- - - - -
283 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/Lexer/String.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Runtime/Debugger/Breakpoints.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Prim.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/Solver/Solve.hs-boot
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/State.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.14.1-notes.rst
- ghc/GHCi/UI.hs
- hadrian/src/Oracles/TestSettings.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/ToolArgs.hs
- hadrian/src/Settings/Default.hs
- libraries/base/changelog.md
- libraries/base/src/GHC/Stack/CloneStack.hs
- libraries/base/tests/unicode002.stdout
- libraries/base/tests/unicode003.stdout
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/GHC/Stack/Annotation/Experimental.hs
- libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs
- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
- + libraries/ghc-heap/GHC/Exts/Heap/Constants.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hs
- + libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hs
- libraries/ghc-heap/GHC/Exts/Heap/ProfInfo/Types.hs
- libraries/ghc-heap/GHC/Exts/Stack.hs
- + libraries/ghc-heap/GHC/Exts/Stack/Constants.hs
- libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
- libraries/ghc-heap/ghc-heap.cabal.in
- libraries/ghc-heap/cbits/HeapPrim.cmm → libraries/ghc-internal/cbits/HeapPrim.cmm
- libraries/ghc-heap/cbits/Stack.cmm → libraries/ghc-internal/cbits/Stack.cmm
- libraries/ghc-internal/cbits/StackCloningDecoding.cmm
- libraries/ghc-heap/cbits/Stack_c.c → libraries/ghc-internal/cbits/Stack_c.c
- libraries/ghc-internal/cbits/atomic.c
- libraries/ghc-internal/cbits/ctz.c
- libraries/ghc-internal/codepages/MakeTable.hs
- libraries/ghc-internal/codepages/Makefile
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/jsbits/base.js
- libraries/ghc-internal/src/GHC/Internal/ClosureTypes.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Backtrace.hs
- + libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs
- libraries/ghc-heap/GHC/Exts/Heap/Constants.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/Constants.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable/Types.hsc
- libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc → libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc
- + libraries/ghc-internal/src/GHC/Internal/Heap/ProfInfo/Types.hs
- + libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/CloneStack.hs
- libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc → libraries/ghc-internal/src/GHC/Internal/Stack/Constants.hsc
- + libraries/ghc-internal/src/GHC/Internal/Stack/Decode.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/DerivedCoreProperties.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/GeneralCategory.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleLowerCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleTitleCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Char/UnicodeData/SimpleUpperCaseMapping.hs
- libraries/ghc-internal/src/GHC/Internal/Unicode/Version.hs
- + libraries/ghc-internal/tests/stack-annotation/Makefile
- + libraries/ghc-internal/tests/stack-annotation/TestUtils.hs
- + libraries/ghc-internal/tests/stack-annotation/all.T
- + libraries/ghc-internal/tests/stack-annotation/ann_frame001.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame001.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame002.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame002.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame003.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame003.stdout
- + libraries/ghc-internal/tests/stack-annotation/ann_frame004.hs
- + libraries/ghc-internal/tests/stack-annotation/ann_frame004.stdout
- libraries/ghc-internal/tools/ucd2haskell/ucd.sh
- libraries/ghc-internal/tools/ucd2haskell/ucd2haskell.cabal
- libraries/ghc-internal/tools/ucd2haskell/unicode_version
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/ghci.cabal.in
- − m4/fp_visibility_hidden.m4
- rts/BeginPrivate.h
- + rts/BuiltinClosures.c
- + rts/BuiltinClosures.h
- rts/CloneStack.c
- rts/CloneStack.h
- rts/ClosureFlags.c
- rts/Disassembler.c
- rts/EndPrivate.h
- rts/Hash.c
- rts/Interpreter.c
- rts/LdvProfile.c
- rts/PrimOps.cmm
- rts/Printer.c
- rts/Profiling.c
- rts/RetainerProfile.c
- − rts/RtsDllMain.c
- − rts/RtsDllMain.h
- rts/RtsStartup.c
- rts/RtsSymbols.c
- rts/StgMiscClosures.cmm
- rts/Task.c
- rts/Task.h
- rts/TraverseHeap.c
- rts/configure.ac
- rts/include/Rts.h
- rts/include/RtsAPI.h
- rts/include/Stg.h
- rts/include/rts/Bytecodes.h
- rts/include/rts/Constants.h
- rts/include/rts/OSThreads.h
- rts/include/rts/Types.h
- rts/include/rts/storage/ClosureTypes.h
- rts/include/rts/storage/Closures.h
- rts/include/stg/DLL.h
- rts/include/stg/MiscClosures.h
- rts/js/profiling.js
- rts/linker/MachO.c
- rts/posix/OSThreads.c
- rts/rts.cabal
- rts/sm/BlockAlloc.c
- rts/sm/Compact.c
- rts/sm/Evac.c
- rts/sm/Evac.h
- rts/sm/GCTDecl.h
- rts/sm/GCThread.h
- rts/sm/NonMovingMark.c
- rts/sm/Sanity.c
- rts/sm/Scav.c
- rts/sm/Storage.c
- rts/win32/OSThreads.c
- testsuite/ghc-config/ghc-config.hs
- testsuite/mk/test.mk
- testsuite/tests/backpack/should_fail/bkpfail11.stderr
- testsuite/tests/backpack/should_fail/bkpfail43.stderr
- testsuite/tests/codeGen/should_run/T23146/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/cross/should_run/T26449.hs
- + testsuite/tests/cross/should_run/all.T
- + testsuite/tests/deriving/should_compile/T26396.hs
- testsuite/tests/deriving/should_compile/all.T
- testsuite/tests/deriving/should_fail/T12768.stderr
- testsuite/tests/deriving/should_fail/T1496.stderr
- testsuite/tests/deriving/should_fail/T21302.stderr
- testsuite/tests/deriving/should_fail/T22696b.stderr
- testsuite/tests/deriving/should_fail/T5498.stderr
- testsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/deriving/should_fail/T7148a.stderr
- testsuite/tests/driver/all.T
- testsuite/tests/ffi/should_run/T1288_c.c
- testsuite/tests/ffi/should_run/T1288_ghci_c.c
- testsuite/tests/ffi/should_run/T2276_c.c
- testsuite/tests/ffi/should_run/T2276_ghci_c.c
- + testsuite/tests/ghci-wasm/Makefile
- + testsuite/tests/ghci-wasm/T26430.hs
- + testsuite/tests/ghci-wasm/T26430A.c
- + testsuite/tests/ghci-wasm/T26430B.c
- + testsuite/tests/ghci-wasm/all.T
- testsuite/tests/ghci.debugger/scripts/T26042b.script
- testsuite/tests/ghci.debugger/scripts/T26042b.stdout
- testsuite/tests/ghci.debugger/scripts/T26042c.script
- testsuite/tests/ghci.debugger/scripts/T26042c.stdout
- + testsuite/tests/ghci.debugger/scripts/T26042d2.hs
- + testsuite/tests/ghci.debugger/scripts/T26042d2.script
- + testsuite/tests/ghci.debugger/scripts/T26042d2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042e.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f.script
- testsuite/tests/ghci.debugger/scripts/T26042f1.stdout
- testsuite/tests/ghci.debugger/scripts/T26042f2.stdout
- testsuite/tests/ghci.debugger/scripts/T26042g.stdout
- testsuite/tests/ghci.debugger/scripts/all.T
- testsuite/tests/ghci/scripts/T7388.hs
- testsuite/tests/ghci/scripts/T7388.script
- testsuite/tests/impredicative/T17332.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/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- + testsuite/tests/overloadedrecflds/should_fail/T26391.hs
- + testsuite/tests/overloadedrecflds/should_fail/T26391.stderr
- testsuite/tests/overloadedrecflds/should_fail/all.T
- testsuite/tests/parser/should_fail/T16270h.stderr
- + testsuite/tests/parser/should_fail/T26418.hs
- + testsuite/tests/parser/should_fail/T26418.stderr
- testsuite/tests/parser/should_fail/all.T
- + testsuite/tests/parser/should_run/T26415.hs
- + testsuite/tests/parser/should_run/T26415.stdout
- testsuite/tests/parser/should_run/all.T
- − testsuite/tests/process/process010.stdout-i386-unknown-solaris2
- testsuite/tests/quantified-constraints/T19690.stderr
- testsuite/tests/quantified-constraints/T19921.stderr
- testsuite/tests/quantified-constraints/T21006.stderr
- testsuite/tests/roles/should_fail/RolesIArray.stderr
- testsuite/tests/rts/exec_signals_child.c
- − testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
- − testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
- testsuite/tests/rts/linker/T11223/all.T
- − testsuite/tests/rts/outofmem.stderr-i386-apple-darwin
- − testsuite/tests/rts/outofmem.stderr-i386-unknown-mingw32
- − testsuite/tests/rts/outofmem.stderr-powerpc-apple-darwin
- testsuite/tests/simplCore/should_compile/DsSpecPragmas.hs
- testsuite/tests/simplCore/should_compile/DsSpecPragmas.stderr
- testsuite/tests/th/T16180.hs
- testsuite/tests/typecheck/should_compile/T14434.hs
- + testsuite/tests/typecheck/should_compile/T26154.hs
- + testsuite/tests/typecheck/should_compile/T26154_A.hs
- + testsuite/tests/typecheck/should_compile/T26154_B.hs
- + testsuite/tests/typecheck/should_compile/T26154_B.hs-boot
- + testsuite/tests/typecheck/should_compile/T26154_Other.hs
- + testsuite/tests/typecheck/should_compile/T26376.hs
- + testsuite/tests/typecheck/should_compile/T26457.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T15801.stderr
- testsuite/tests/typecheck/should_fail/T18851.hs
- testsuite/tests/typecheck/should_fail/T19627.stderr
- testsuite/tests/typecheck/should_fail/T20666.stderr
- testsuite/tests/typecheck/should_fail/T20666a.stderr
- testsuite/tests/typecheck/should_fail/T20666b.stderr
- testsuite/tests/typecheck/should_fail/T22912.stderr
- testsuite/tests/typecheck/should_fail/T23427.stderr
- + testsuite/tests/typecheck/should_fail/T26255a.hs
- + testsuite/tests/typecheck/should_fail/T26255a.stderr
- + testsuite/tests/typecheck/should_fail/T26255b.hs
- + testsuite/tests/typecheck/should_fail/T26255b.stderr
- + testsuite/tests/typecheck/should_fail/T26255c.hs
- + testsuite/tests/typecheck/should_fail/T26255c.stderr
- testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/deriveConstants/Main.hs
- utils/jsffi/dyld.mjs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5bd800f0fb15dd4975130859e8c4f1…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5bd800f0fb15dd4975130859e8c4f1…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/bomb_out] 2 commits: Make accumulator raw size
by Andreas Klebinger (@AndreasK) 02 Oct '25
by Andreas Klebinger (@AndreasK) 02 Oct '25
02 Oct '25
Andreas Klebinger pushed to branch wip/andreask/bomb_out at Glasgow Haskell Compiler / GHC
Commits:
c9f7781b by Andreas Klebinger at 2025-10-02T20:05:49+02:00
Make accumulator raw size
- - - - -
6e725431 by Andreas Klebinger at 2025-10-02T20:12:25+02:00
Some cleanup
- - - - -
1 changed file:
- compiler/GHC/Core/Unfold.hs
Changes:
=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -62,7 +62,6 @@ import GHC.Data.Bag
import GHC.Utils.Misc
import GHC.Utils.Outputable
-import GHC.Utils.Panic.Plain (assert)
import qualified Data.ByteString as BS
import Data.List.NonEmpty (nonEmpty)
@@ -558,7 +557,6 @@ uncondInlineJoin bndrs body
go_arg (Var f) = Just $! f `notElem` bndrs
go_arg _ = Nothing
-
sizeExpr :: UnfoldingOpts
-> Int -- Bomb out if it gets bigger than this
-> [Id] -- Arguments; we're interested in which of these
@@ -571,44 +569,51 @@ sizeExpr :: UnfoldingOpts
-- Forcing bOMB_OUT_SIZE early prevents repeated
-- unboxing of the Int argument.
sizeExpr opts !bOMB_OUT_SIZE top_args expr
- = size_up sizeZero expr
+ = size_up 0 expr
where
-- (size_up s e) returns `s` plus the size of `e`
- size_up :: (ExprSize NoDiscount) -> CoreExpr -> ExprSize WithDiscount
- size_up s (Cast e _) = size_up s e
- size_up s (Tick _ e) = size_up s e
- size_up s (Type _) = withDiscount s -- Types cost nothing
- size_up s (Coercion _) = withDiscount s
- size_up s (Lit lit) = withDiscount $ s `addSizeN` litSize lit
- size_up s (Var f) | isZeroBitId f = withDiscount s
+ size_up :: Int -> CoreExpr -> ExprSize WithDiscount
+ size_up acc_size (Cast e _) = size_up acc_size e
+ size_up acc_size (Tick _ e) = size_up acc_size e
+ size_up acc_size (Type _) = mkSizeDiscount bOMB_OUT_SIZE acc_size emptyBag 0 -- Types cost nothing
+ size_up acc_size (Coercion _) = mkSizeDiscount bOMB_OUT_SIZE acc_size emptyBag 0
+ size_up acc_size (Lit lit) = (mkSizeDiscount bOMB_OUT_SIZE acc_size emptyBag 0) `addSizeND` litSize lit
+ size_up acc_size (Var f) | isZeroBitId f = mkSizeDiscount bOMB_OUT_SIZE acc_size emptyBag 0
-- Make sure we get constructor discounts even
-- on nullary constructors
- | otherwise = size_up_call s f [] 0
-
- size_up s (App fun arg)
- | isTyCoArg arg = size_up s fun
- | otherwise = size_up_app (stripDiscounts $ size_up s arg)
- fun [arg] (if isZeroBitExpr arg then 1 else 0)
-
- size_up s (Lam b e)
- | isId b && not (isZeroBitId b) = lamScrutDiscount opts (size_up (addSizeN s 10) e)
- | otherwise = size_up s e
-
- size_up s (Let (NonRec binder rhs) body)
- = let rhs_s = size_up_let s (binder, rhs)
- in size_up (stripDiscounts $ rhs_s) body
-
-
- size_up s (Let (Rec pairs) body)
- = size_up ((foldr (flip (size_up_let)) s pairs))
- body
-
- size_up s (Case e _ _ alts) = case nonEmpty alts of
- Nothing -> size_up s e -- case e of {} never returns, so take size of scrutinee
+ | otherwise = size_up_call acc_size emptyBag f [] 0
+
+ size_up acc_size (App fun arg)
+ | isTyCoArg arg = size_up acc_size fun
+ | otherwise = case size_up acc_size arg of
+ TooBig -> TooBig
+ SizeIs acc_size' acc_args' _d -> size_up_app acc_size' acc_args'
+ fun [arg] (if isZeroBitExpr arg then 1 else 0)
+
+ size_up acc_size (Lam b e)
+ | isId b && not (isZeroBitId b) = lamScrutDiscount opts (size_up (acc_size+10) e)
+ | otherwise = size_up acc_size e
+
+ size_up acc_size (Let (NonRec binder rhs) body)
+ = case size_up_let acc_size emptyBag (binder, rhs) of
+ TooBig -> TooBig
+ SizeIs acc_size' acc_args' _d -> size_up acc_size' body `addSizeB` acc_args'
+
+ size_up acc_size (Let (Rec pairs) body)
+ = do_pairs acc_size emptyBag pairs
+ where
+ do_pairs acc_size acc_args [] = size_up acc_size body `addSizeB` acc_args
+ do_pairs acc_size acc_args (pair:pairs) =
+ case size_up_let acc_size acc_args pair of
+ TooBig -> TooBig
+ SizeIs acc_size' acc_args' _d -> do_pairs acc_size' acc_args' pairs
+
+ size_up acc_size (Case e _ _ alts) = case nonEmpty alts of
+ Nothing -> size_up acc_size e -- case e of {} never returns, so take size of scrutinee
Just alts
| Just v <- is_top_arg e -> -- We are scrutinising an argument variable
let
- alt_sizes = NE.map (size_up_alt s) alts
+ alt_sizes = NE.map (size_up_alt acc_size) alts
-- alts_size tries to compute a good discount for
-- the case when we are scrutinising an argument variable
@@ -630,14 +635,14 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
alts_size tot_size _ = tot_size
in
- s `addSizeNSD` alts_size (foldr1 addAltSize alt_sizes) -- alts is non-empty
+ mkSizeNoDiscount bOMB_OUT_SIZE acc_size emptyBag `addSizeNSD` alts_size (foldr1 addAltSize alt_sizes) -- alts is non-empty
(foldr1 maxSize alt_sizes)
-- Good to inline if an arg is scrutinised, because
-- that may eliminate allocation in the caller
-- And it eliminates the case itself
- | otherwise -> foldr (addAltSize . size_up_alt s)
- (size_up (s `addSizeN` case_size) e)
+ | otherwise -> foldr (addAltSize . (size_up_alt acc_size))
+ (size_up (acc_size + case_size) e)
alts
where
@@ -683,35 +688,38 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
| otherwise
= False
- size_up_let :: ExprSize NoDiscount -> (Id, CoreExpr) -> ExprSize NoDiscount
- size_up_let s (bndr, rhs)
+ size_up_let :: Int -> Bag (Id,Int) -> (Id, CoreExpr) -> ExprSize NoDiscount
+ size_up_let acc_size acc_args (bndr, rhs)
| JoinPoint join_arity <- idJoinPointHood bndr
-- Skip arguments to join point
, (_bndrs, join_rhs) <- collectNBinders join_arity rhs
- = stripDiscounts $ size_up s join_rhs
+ = (stripDiscounts $ size_up acc_size join_rhs) `addSizeB` acc_args
| otherwise
- = stripDiscounts $ size_up (s `addSizeN` size_up_alloc bndr) rhs
+ = (stripDiscounts $ size_up (acc_size + size_up_alloc bndr) rhs) `addSizeB` acc_args
------------
-- size_up_app is used when there's ONE OR MORE value args
- size_up_app :: ExprSize NoDiscount -> CoreExpr -> [CoreExpr] -> Int -> ExprSize WithDiscount
- size_up_app s (App fun arg) args voids
- | isTyCoArg arg = size_up_app s fun args voids
- | isZeroBitExpr arg = size_up_app s fun (arg:args) (voids + 1)
- | otherwise = let arg_size = stripDiscounts $ size_up s arg
- in size_up_app arg_size fun (arg:args) voids
- size_up_app s (Var fun) args voids = size_up_call s fun args voids
- size_up_app s (Tick _ expr) args voids = size_up_app s expr args voids
- size_up_app s (Cast expr _) args voids = size_up_app s expr args voids
- size_up_app s other args voids = size_up (s `addSizeN` callSize (length args) voids) other
+ size_up_app :: Int -> Bag (Id,Int) -> CoreExpr -> [CoreExpr] -> Int -> ExprSize WithDiscount
+ size_up_app acc_size acc_args (App fun arg) args voids
+ | isTyCoArg arg = size_up_app acc_size acc_args fun args voids
+ | isZeroBitExpr arg = size_up_app acc_size acc_args fun (arg:args) (voids + 1)
+ | otherwise = case size_up acc_size arg of
+ TooBig -> TooBig
+ SizeIs acc_size' acc_args' _ ->
+ size_up_app acc_size' acc_args' fun (arg:args) voids
+ `addSizeB` acc_args
+ size_up_app acc_size acc_args (Var fun) args voids = size_up_call acc_size acc_args fun args voids
+ size_up_app acc_size acc_args (Tick _ expr) args voids = size_up_app acc_size acc_args expr args voids
+ size_up_app acc_size acc_args (Cast expr _) args voids = size_up_app acc_size acc_args expr args voids
+ size_up_app acc_size acc_args other args voids = size_up (acc_size + callSize (length args) voids) other `addSizeB` acc_args
-- if the lhs is not an App or a Var, or an invisible thing like a
-- Tick or Cast, then we should charge for a complete call plus the
-- size of the lhs itself.
------------
- size_up_call :: ExprSize NoDiscount -> Id -> [CoreExpr] -> Int -> ExprSize WithDiscount
- size_up_call !s fun val_args voids
+ size_up_call :: Int -> Bag (Id,Int) -> Id -> [CoreExpr] -> Int -> ExprSize WithDiscount
+ size_up_call acc_size acc_args fun val_args voids
= let !n_args = length val_args
call_size = case idDetails fun of
FCallId _ -> withDiscount $ sizeN (callSize n_args voids)
@@ -721,18 +729,18 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
_ | fun `hasKey` buildIdKey -> buildSize
| fun `hasKey` augmentIdKey -> augmentSize
| otherwise -> funSize opts top_args fun n_args voids
- in s `addSizeNSD` call_size
+ in mkSizeNoDiscount bOMB_OUT_SIZE acc_size acc_args `addSizeNSD` call_size
------------
- -- size_up_alt returns on the alternatives size, not counting the accumulated
+ -- size_up_alt returns only the alternatives size, not counting the accumulated
-- size passed in unless we reach TooBig. This is to facility better discount
-- calculation based on the size of only the alternative.
- size_up_alt TooBig _ = TooBig
- size_up_alt (SizeIs {_es_size_is=s}) (Alt _con _bndrs rhs) =
- size_up (sizeN s) rhs
+ -- size_up_alt acc_size acc_args = TooBig
+ size_up_alt acc_size (Alt _con _bndrs rhs) =
+ size_up acc_size rhs
-- Why add and then subtract s?
-- If the expression large enough this will ensure we bomb out early.
- `addSizeND` (10 -s)
+ `addSizeND` (10 -acc_size)
-- Don't charge for args, so that wrappers look cheap
-- (See comments about wrappers with Case)
@@ -758,10 +766,9 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
addSizeND TooBig _ = TooBig
addSizeND (SizeIs n xs d) m = mkSizeDiscount bOMB_OUT_SIZE (n + m) xs d
- addSizeN :: ExprSize NoDiscount -> Int -> ExprSize NoDiscount
- addSizeN TooBig _ = TooBig
- addSizeN (SizeIs n xs _d) m = mkSizeNoDiscount bOMB_OUT_SIZE (n + m) xs
-
+ addSizeB :: ExprSize a -> Bag (Id,Int) -> ExprSize a
+ addSizeB TooBig _ = TooBig
+ addSizeB (SizeIs sz bg1 dc) bg2 = SizeIs sz (bg1 `unionBags` bg2) dc
-- addAltSize is used to add the sizes of case alternatives
addAltSize TooBig _ = TooBig
addAltSize _ TooBig = TooBig
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40785dff24cabba149b6fe3c44a5ef…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/40785dff24cabba149b6fe3c44a5ef…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
02 Oct '25
Ben Gamari pushed new branch wip/drop-unicode-update at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/drop-unicode-update
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/bomb_out] Skip TooBig check in size_up
by Andreas Klebinger (@AndreasK) 02 Oct '25
by Andreas Klebinger (@AndreasK) 02 Oct '25
02 Oct '25
Andreas Klebinger pushed to branch wip/andreask/bomb_out at Glasgow Haskell Compiler / GHC
Commits:
40785dff by Andreas Klebinger at 2025-10-02T19:18:22+02:00
Skip TooBig check in size_up
- - - - -
1 changed file:
- compiler/GHC/Core/Unfold.hs
Changes:
=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -574,11 +574,7 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
= size_up sizeZero expr
where
-- (size_up s e) returns `s` plus the size of `e`
- size_up :: ExprSize NoDiscount -> CoreExpr -> ExprSize WithDiscount
- size_up TooBig !_ = TooBig
- size_up (SizeIs !s _ d) _
- | assert (d == 0) $ s > bOMB_OUT_SIZE
- = TooBig
+ size_up :: (ExprSize NoDiscount) -> CoreExpr -> ExprSize WithDiscount
size_up s (Cast e _) = size_up s e
size_up s (Tick _ e) = size_up s e
size_up s (Type _) = withDiscount s -- Types cost nothing
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/40785dff24cabba149b6fe3c44a5ef3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/40785dff24cabba149b6fe3c44a5ef3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/andreask/bomb_out] ExprSize: Encode presence of discount in type argument
by Andreas Klebinger (@AndreasK) 02 Oct '25
by Andreas Klebinger (@AndreasK) 02 Oct '25
02 Oct '25
Andreas Klebinger pushed to branch wip/andreask/bomb_out at Glasgow Haskell Compiler / GHC
Commits:
947bd476 by Andreas Klebinger at 2025-10-02T19:11:38+02:00
ExprSize: Encode presence of discount in type argument
- - - - -
1 changed file:
- compiler/GHC/Core/Unfold.hs
Changes:
=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -1,3 +1,6 @@
+{-# OPTIONS_GHC -ddump-simpl -ddump-to-file -dumpdir dumps #-}
+{-# LANGUAGE DataKinds #-}
+
{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1994-1998
@@ -59,6 +62,7 @@ import GHC.Data.Bag
import GHC.Utils.Misc
import GHC.Utils.Outputable
+import GHC.Utils.Panic.Plain (assert)
import qualified Data.ByteString as BS
import Data.List.NonEmpty (nonEmpty)
@@ -560,7 +564,7 @@ sizeExpr :: UnfoldingOpts
-> [Id] -- Arguments; we're interested in which of these
-- get case'd
-> CoreExpr
- -> ExprSize
+ -> ExprSize WithDiscount
-- Note [Computing the size of an expression]
@@ -569,16 +573,18 @@ sizeExpr :: UnfoldingOpts
sizeExpr opts !bOMB_OUT_SIZE top_args expr
= size_up sizeZero expr
where
- size_up :: ExprSize -> CoreExpr -> ExprSize
+ -- (size_up s e) returns `s` plus the size of `e`
+ size_up :: ExprSize NoDiscount -> CoreExpr -> ExprSize WithDiscount
size_up TooBig !_ = TooBig
- size_up (SizeIs !s _ _) _
- | s > bOMB_OUT_SIZE = TooBig
+ size_up (SizeIs !s _ d) _
+ | assert (d == 0) $ s > bOMB_OUT_SIZE
+ = TooBig
size_up s (Cast e _) = size_up s e
size_up s (Tick _ e) = size_up s e
- size_up s (Type _) = s -- Types cost nothing
- size_up s (Coercion _) = s
- size_up s (Lit lit) = addSizeNSD (sizeN (litSize lit)) s
- size_up s (Var f) | isZeroBitId f = s
+ size_up s (Type _) = withDiscount s -- Types cost nothing
+ size_up s (Coercion _) = withDiscount s
+ size_up s (Lit lit) = withDiscount $ s `addSizeN` litSize lit
+ size_up s (Var f) | isZeroBitId f = withDiscount s
-- Make sure we get constructor discounts even
-- on nullary constructors
| otherwise = size_up_call s f [] 0
@@ -598,7 +604,7 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
size_up s (Let (Rec pairs) body)
- = size_up (stripDiscounts (foldr (flip size_up_let) s pairs))
+ = size_up ((foldr (flip (size_up_let)) s pairs))
body
size_up s (Case e _ _ alts) = case nonEmpty alts of
@@ -635,7 +641,7 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
-- And it eliminates the case itself
| otherwise -> foldr (addAltSize . size_up_alt s)
- (stripDiscounts $ size_up (s `addSizeN` case_size) e)
+ (size_up (s `addSizeN` case_size) e)
alts
where
@@ -681,18 +687,18 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
| otherwise
= False
- size_up_let :: ExprSize -> (Id, CoreExpr) -> ExprSize
+ size_up_let :: ExprSize NoDiscount -> (Id, CoreExpr) -> ExprSize NoDiscount
size_up_let s (bndr, rhs)
| JoinPoint join_arity <- idJoinPointHood bndr
-- Skip arguments to join point
- , (_bndrs, body) <- collectNBinders join_arity rhs
- = size_up s body
+ , (_bndrs, join_rhs) <- collectNBinders join_arity rhs
+ = stripDiscounts $ size_up s join_rhs
| otherwise
- = size_up (s `addSizeN` size_up_alloc bndr) rhs
+ = stripDiscounts $ size_up (s `addSizeN` size_up_alloc bndr) rhs
------------
-- size_up_app is used when there's ONE OR MORE value args
- size_up_app :: ExprSize -> CoreExpr -> [CoreExpr] -> Int -> ExprSize
+ size_up_app :: ExprSize NoDiscount -> CoreExpr -> [CoreExpr] -> Int -> ExprSize WithDiscount
size_up_app s (App fun arg) args voids
| isTyCoArg arg = size_up_app s fun args voids
| isZeroBitExpr arg = size_up_app s fun (arg:args) (voids + 1)
@@ -708,14 +714,14 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
-- size of the lhs itself.
------------
- size_up_call :: ExprSize -> Id -> [CoreExpr] -> Int -> ExprSize
+ size_up_call :: ExprSize NoDiscount -> Id -> [CoreExpr] -> Int -> ExprSize WithDiscount
size_up_call !s fun val_args voids
= let !n_args = length val_args
call_size = case idDetails fun of
- FCallId _ -> sizeN (callSize n_args voids)
+ FCallId _ -> withDiscount $ sizeN (callSize n_args voids)
DataConWorkId dc -> conSize dc n_args
- PrimOpId op _ -> primOpSize op n_args
- ClassOpId cls _ -> classOpSize opts cls top_args val_args
+ PrimOpId op _ -> withDiscount $ primOpSize op n_args
+ ClassOpId cls _ -> withDiscount $ classOpSize opts cls top_args val_args
_ | fun `hasKey` buildIdKey -> buildSize
| fun `hasKey` augmentIdKey -> augmentSize
| otherwise -> funSize opts top_args fun n_args voids
@@ -730,7 +736,7 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
size_up (sizeN s) rhs
-- Why add and then subtract s?
-- If the expression large enough this will ensure we bomb out early.
- `addSizeN` (10 -s)
+ `addSizeND` (10 -s)
-- Don't charge for args, so that wrappers look cheap
-- (See comments about wrappers with Case)
@@ -752,23 +758,29 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
------------
-- These addSize things have to be here because
-- I don't want to give them bOMB_OUT_SIZE as an argument
+ addSizeND :: ExprSize WithDiscount -> Int -> ExprSize WithDiscount
+ addSizeND TooBig _ = TooBig
+ addSizeND (SizeIs n xs d) m = mkSizeDiscount bOMB_OUT_SIZE (n + m) xs d
+
+ addSizeN :: ExprSize NoDiscount -> Int -> ExprSize NoDiscount
addSizeN TooBig _ = TooBig
- addSizeN (SizeIs n xs d) m = mkSizeIs bOMB_OUT_SIZE (n + m) xs d
+ addSizeN (SizeIs n xs _d) m = mkSizeNoDiscount bOMB_OUT_SIZE (n + m) xs
-- addAltSize is used to add the sizes of case alternatives
addAltSize TooBig _ = TooBig
addAltSize _ TooBig = TooBig
addAltSize (SizeIs n1 xs d1) (SizeIs n2 ys d2)
- = mkSizeIs bOMB_OUT_SIZE (n1 + n2)
+ = mkSizeDiscount bOMB_OUT_SIZE (n1 + n2)
(xs `unionBags` ys)
(d1 + d2) -- Note [addAltSize result discounts]
-- This variant ignores the result discount from its LEFT argument
-- It's used when the second argument isn't part of the result
+ addSizeNSD :: ExprSize NoDiscount -> ExprSize WithDiscount -> ExprSize WithDiscount
addSizeNSD TooBig _ = TooBig
addSizeNSD _ TooBig = TooBig
addSizeNSD (SizeIs n1 xs _) (SizeIs n2 ys d2)
- = mkSizeIs bOMB_OUT_SIZE (n1 + n2)
+ = mkSizeDiscount bOMB_OUT_SIZE (n1 + n2)
(xs `unionBags` ys)
d2 -- Ignore d1
@@ -777,6 +789,7 @@ sizeExpr opts !bOMB_OUT_SIZE top_args expr
-- this benefit for the body.
-- Why? `x` is visible to `body` either way, so it really should not
-- affect our inlining decision either way.
+ stripDiscounts :: ExprSize a -> ExprSize NoDiscount
stripDiscounts TooBig = TooBig
stripDiscounts (SizeIs n xs _) = (SizeIs n xs 0)
@@ -801,7 +814,7 @@ litSize _other = 0 -- Must match size of nullary constructors
-- Key point: if x |-> 4, then x must inline unconditionally
-- (eg via case binding)
-classOpSize :: UnfoldingOpts -> Class -> [Id] -> [CoreExpr] -> ExprSize
+classOpSize :: UnfoldingOpts -> Class -> [Id] -> [CoreExpr] -> ExprSize NoDiscount
-- See Note [Conlike is interesting]
classOpSize opts cls top_args args
| isUnaryClass cls
@@ -844,7 +857,7 @@ jumpSize _n_val_args _voids = 0 -- Jumps are small, and we don't want penalise
-- spectral/puzzle. TODO Perhaps adjusting the default threshold would be a
-- better solution?
-funSize :: UnfoldingOpts -> [Id] -> Id -> Int -> Int -> ExprSize
+funSize :: UnfoldingOpts -> [Id] -> Id -> Int -> Int -> ExprSize WithDiscount
-- Size for function calls where the function is not a constructor or primops
-- Note [Function applications]
funSize opts top_args fun n_val_args voids
@@ -870,14 +883,14 @@ funSize opts top_args fun n_val_args voids
-- If the function is partially applied, show a result discount
-- XXX maybe behave like ConSize for eval'd variable
-conSize :: DataCon -> Int -> ExprSize
+conSize :: DataCon -> Int -> ExprSize WithDiscount
conSize dc n_val_args
| n_val_args == 0 = SizeIs 0 emptyBag 10 -- Like variables
-- See Note [Unboxed tuple size and result discount]
| isUnboxedTupleDataCon dc = SizeIs 0 emptyBag 10
- | isUnaryClassDataCon dc = sizeZero
+ | isUnaryClassDataCon dc = withDiscount sizeZero
-- See Note [Constructor size and result discount]
| otherwise = SizeIs 10 emptyBag 10
@@ -974,7 +987,7 @@ that mention a literal Integer, because the float-out pass will float
all those constants to top level.
-}
-primOpSize :: PrimOp -> Int -> ExprSize
+primOpSize :: PrimOp -> Int -> ExprSize NoDiscount
primOpSize op n_val_args
= if primOpOutOfLine op
then sizeN (op_size + n_val_args)
@@ -983,7 +996,7 @@ primOpSize op n_val_args
op_size = primOpCodeSize op
-buildSize :: ExprSize
+buildSize :: ExprSize WithDiscount
buildSize = SizeIs 0 emptyBag 40
-- We really want to inline applications of build
-- build t (\cn -> e) should cost only the cost of e (because build will be inlined later)
@@ -992,13 +1005,13 @@ buildSize = SizeIs 0 emptyBag 40
-- build is saturated (it usually is). The "-2" discounts for the \c n,
-- The "4" is rather arbitrary.
-augmentSize :: ExprSize
+augmentSize :: ExprSize WithDiscount
augmentSize = SizeIs 0 emptyBag 40
-- Ditto (augment t (\cn -> e) ys) should cost only the cost of
-- e plus ys. The -2 accounts for the \cn
-- When we return a lambda, give a discount if it's used (applied)
-lamScrutDiscount :: UnfoldingOpts -> ExprSize -> ExprSize
+lamScrutDiscount :: UnfoldingOpts -> ExprSize a -> ExprSize WithDiscount
lamScrutDiscount opts (SizeIs n vs _) = SizeIs n vs (unfoldingFunAppDiscount opts)
lamScrutDiscount _ TooBig = TooBig
@@ -1071,18 +1084,25 @@ In a function application (f a b)
Code for manipulating sizes
-}
+-- | Does an ExprSize include an evaluation Discount?
+data HasDiscount = NoDiscount | WithDiscount deriving (Eq)
+
-- | The size of a candidate expression for unfolding
-data ExprSize
+--
+-- We don't use a separate constructor without a discount field as the
+-- re-allocation here as the resulting re-allocation when converting
+-- between them outweights any benefit.
+data ExprSize (hasDiscount :: HasDiscount)
= TooBig
| SizeIs { _es_size_is :: {-# UNPACK #-} !Int -- ^ Size found
, _es_args :: !(Bag (Id,Int))
-- ^ Arguments cased herein, and discount for each such
, _es_discount :: {-# UNPACK #-} !Int
-- ^ Size to subtract if result is scrutinised by a case
- -- expression
+ -- expression. Must be zero if `hasDiscount == NoDiscount`
}
-instance Outputable ExprSize where
+instance Outputable (ExprSize a) where
ppr TooBig = text "TooBig"
ppr (SizeIs a _ c) = brackets (int a <+> int c)
@@ -1091,18 +1111,26 @@ instance Outputable ExprSize where
-- tup = (a_1, ..., a_99)
-- x = case tup of ...
--
-mkSizeIs :: Int -> Int -> Bag (Id, Int) -> Int -> ExprSize
-mkSizeIs max n xs d | (n - d) > max = TooBig
- | otherwise = SizeIs n xs d
+mkSizeDiscount :: Int -> Int -> Bag (Id, Int) -> Int -> ExprSize WithDiscount
+mkSizeDiscount max n xs d | (n - d) > max = TooBig
+ | otherwise = SizeIs n xs d
+
+mkSizeNoDiscount :: Int -> Int -> Bag (Id, Int) -> ExprSize NoDiscount
+mkSizeNoDiscount max n xs | n > max = TooBig
+ | otherwise = SizeIs n xs 0
-maxSize :: ExprSize -> ExprSize -> ExprSize
+maxSize :: ExprSize a -> ExprSize a -> ExprSize a
maxSize TooBig _ = TooBig
maxSize _ TooBig = TooBig
maxSize s1@(SizeIs n1 _ _) s2@(SizeIs n2 _ _) | n1 > n2 = s1
| otherwise = s2
+withDiscount :: ExprSize NoDiscount -> ExprSize WithDiscount
+withDiscount s = case s of
+ TooBig -> TooBig
+ SizeIs x1 x2 x3 -> SizeIs x1 x2 x3
-sizeZero :: ExprSize
-sizeN :: Int -> ExprSize
+sizeZero :: ExprSize NoDiscount
+sizeN :: Int -> ExprSize NoDiscount
sizeZero = SizeIs 0 emptyBag 0
sizeN n = SizeIs n emptyBag 0
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/947bd476e7f2c0d2103004e6d8f8fc2…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/947bd476e7f2c0d2103004e6d8f8fc2…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: testsuite: remove unused expected output files
by Marge Bot (@marge-bot) 02 Oct '25
by Marge Bot (@marge-bot) 02 Oct '25
02 Oct '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
6992ac09 by Cheng Shao at 2025-10-02T07:27:55-04:00
testsuite: remove unused expected output files
This patch removes unused expected output files in the testsuites on
platforms that we no longer support.
- - - - -
39eaaaba by Ben Gamari at 2025-10-02T07:28:45-04:00
rts: Dynamically initialize built-in closures
To resolve #26166 we need to eliminate references to undefined symbols
in the runtime system. One such source of these is the runtime's
static references to `I#` and `C#` due the `stg_INTLIKE` and
`stg_CHARLIKE` arrays.
To avoid this we make these dynamic, initializing them during RTS
start-up.
- - - - -
c254c54b by Cheng Shao at 2025-10-02T07:29:33-04:00
compiler: only invoke keepCAFsForGHCi if internal-interpreter is enabled
This patch makes the ghc library only invoke keepCAFsForGHCi if
internal-interpreter is enabled. For cases when it's not (e.g. the
host build of a cross ghc), this avoids unnecessarily retaining all
CAFs in the heap. Also fixes the type signature of c_keepCAFsForGHCi
to match the C ABI.
- - - - -
52208cef by Simon Hengel at 2025-10-02T12:41:47-04:00
Update copyright in documentation
- - - - -
4ae51be9 by Matthew Pickering at 2025-10-02T12:41:48-04:00
loader: Unify loadDecls and loadModuleLinkables functions
These two functions nearly did the same thing. I have refactored them so
that `loadDecls` now calls `loadModuleLinkables`.
Fixes #26459
- - - - -
406b7b23 by Simon Hengel at 2025-10-02T12:41:48-04:00
Fix typo
- - - - -
20 changed files:
- compiler/GHC.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/cbits/keepCAFsForGHCi.c
- compiler/ghc.cabal.in
- docs/users_guide/conf.py
- + rts/BuiltinClosures.c
- + rts/BuiltinClosures.h
- rts/RtsStartup.c
- rts/StgMiscClosures.cmm
- rts/include/rts/Constants.h
- rts/include/stg/MiscClosures.h
- rts/rts.cabal
- − testsuite/tests/process/process010.stdout-i386-unknown-solaris2
- − testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32
- − testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32
- − testsuite/tests/rts/outofmem.stderr-i386-apple-darwin
- − testsuite/tests/rts/outofmem.stderr-i386-unknown-mingw32
- − testsuite/tests/rts/outofmem.stderr-powerpc-apple-darwin
Changes:
=====================================
compiler/GHC.hs
=====================================
@@ -463,6 +463,9 @@ import System.Exit ( exitWith, ExitCode(..) )
import System.FilePath
import System.IO.Error ( isDoesNotExistError )
+#if defined(HAVE_INTERNAL_INTERPRETER)
+import Foreign.C
+#endif
-- %************************************************************************
-- %* *
@@ -597,12 +600,12 @@ withCleanupSession ghc = ghc `MC.finally` cleanup
initGhcMonad :: GhcMonad m => Maybe FilePath -> m ()
initGhcMonad mb_top_dir = setSession =<< liftIO ( do
-#if !defined(javascript_HOST_ARCH)
+#if defined(HAVE_INTERNAL_INTERPRETER)
-- The call to c_keepCAFsForGHCi must not be optimized away. Even in non-debug builds.
-- So we can't use assertM here.
-- See Note [keepCAFsForGHCi] in keepCAFsForGHCi.c for details about why.
!keep_cafs <- c_keepCAFsForGHCi
- massert keep_cafs
+ massert $ keep_cafs /= 0
#endif
initHscEnv mb_top_dir
)
@@ -2092,7 +2095,7 @@ mkApiErr :: DynFlags -> SDoc -> GhcApiError
mkApiErr dflags msg = GhcApiError (showSDoc dflags msg)
-#if !defined(javascript_HOST_ARCH)
+#if defined(HAVE_INTERNAL_INTERPRETER)
foreign import ccall unsafe "keepCAFsForGHCi"
- c_keepCAFsForGHCi :: IO Bool
+ c_keepCAFsForGHCi :: IO CBool
#endif
=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -2777,10 +2777,12 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr = do
{- load it -}
bco_time <- getCurrentTime
- (fv_hvs, mods_needed, units_needed) <- loadDecls interp hsc_env srcspan $
+ (mods_needed, units_needed) <- loadDecls interp hsc_env srcspan $
Linkable bco_time this_mod $ NE.singleton $ BCOs bcos
+ -- Get the foreign reference to the name we should have just loaded.
+ mhvs <- lookupFromLoadedEnv interp (idName binding_id)
{- Get the HValue for the root -}
- return (expectJust $ lookup (idName binding_id) fv_hvs, mods_needed, units_needed)
+ return (expectJust mhvs, mods_needed, units_needed)
=====================================
compiler/GHC/Linker/Loader.hs
=====================================
@@ -28,6 +28,7 @@ module GHC.Linker.Loader
, withExtendedLoadedEnv
, extendLoadedEnv
, deleteFromLoadedEnv
+ , lookupFromLoadedEnv
-- * Internals
, allocateBreakArrays
, rmDupLinkables
@@ -213,6 +214,15 @@ deleteFromLoadedEnv interp to_remove =
return $ modifyClosureEnv pls $ \ce ->
delListFromNameEnv ce to_remove
+-- | Have we already loaded a name into the interpreter?
+lookupFromLoadedEnv :: Interp -> Name -> IO (Maybe ForeignHValue)
+lookupFromLoadedEnv interp name = do
+ mstate <- getLoaderState interp
+ return $ do
+ pls <- mstate
+ res <- lookupNameEnv (closure_env (linker_env pls)) name
+ return (snd res)
+
-- | Load the module containing the given Name and get its associated 'HValue'.
--
-- Throws a 'ProgramError' if loading fails or the name cannot be found.
@@ -258,7 +268,7 @@ loadDependencies interp hsc_env pls span needed_mods = do
-- Link the packages and modules required
pls1 <- loadPackages' interp hsc_env (ldUnits deps) pls
- (pls2, succ) <- loadModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps)
+ (pls2, succ) <- loadExternalModuleLinkables interp hsc_env pls1 (ldNeededLinkables deps)
let this_pkgs_loaded = udfmRestrictKeys all_pkgs_loaded $ getUniqDSet trans_pkgs_needed
all_pkgs_loaded = pkgs_loaded pls2
trans_pkgs_needed = unionManyUniqDSets (this_pkgs_needed : [ loaded_pkg_trans_deps pkg
@@ -684,42 +694,23 @@ get_reachable_nodes hsc_env mods
********************************************************************* -}
-loadDecls :: Interp -> HscEnv -> SrcSpan -> Linkable -> IO ([(Name, ForeignHValue)], [Linkable], PkgsLoaded)
+-- | Load the dependencies of a linkable, and then load the linkable itself.
+loadDecls :: Interp -> HscEnv -> SrcSpan -> Linkable -> IO ([Linkable], PkgsLoaded)
loadDecls interp hsc_env span linkable = do
-- Initialise the linker (if it's not been done already)
initLoaderState interp hsc_env
-- Take lock for the actual work.
modifyLoaderState interp $ \pls0 -> do
- -- Link the foreign objects first; BCOs in linkable are ignored here.
- (pls1, objs_ok) <- loadObjects interp hsc_env pls0 [linkable]
- when (failed objs_ok) $ throwGhcExceptionIO $ ProgramError "loadDecls: failed to load foreign objects"
-
-- Link the packages and modules required
- (pls, ok, links_needed, units_needed) <- loadDependencies interp hsc_env pls1 span needed_mods
+ (pls, ok, links_needed, units_needed) <- loadDependencies interp hsc_env pls0 span needed_mods
if failed ok
- then throwGhcExceptionIO (ProgramError "")
+ then throwGhcExceptionIO (ProgramError "could not load dependencies for decls")
else do
- -- Link the expression itself
- let le = linker_env pls
- let lb = linked_breaks pls
- le2_itbl_env <- linkITbls interp (itbl_env le) (concat $ map bc_itbls cbcs)
- le2_addr_env <- foldlM (\env cbc -> allocateTopStrings interp (bc_strs cbc) env) (addr_env le) cbcs
- le2_breakarray_env <- allocateBreakArrays interp (breakarray_env lb) (catMaybes $ map bc_breaks cbcs)
- le2_ccs_env <- allocateCCS interp (ccs_env lb) (catMaybes $ map bc_breaks cbcs)
- let le2 = le { itbl_env = le2_itbl_env
- , addr_env = le2_addr_env }
- let lb2 = lb { breakarray_env = le2_breakarray_env
- , ccs_env = le2_ccs_env }
-
- -- Link the necessary packages and linkables
- new_bindings <- linkSomeBCOs interp (pkgs_loaded pls) le2 lb2 cbcs
- nms_fhvs <- makeForeignNamedHValueRefs interp new_bindings
- let ce2 = extendClosureEnv (closure_env le2) nms_fhvs
- !pls2 = pls { linker_env = le2 { closure_env = ce2 }
- , linked_breaks = lb2 }
- mapM_ (linkSptEntry interp ce2) (concatMap bc_spt_entries cbcs)
- return (pls2, (nms_fhvs, links_needed, units_needed))
+ (pls2, ok2) <- loadInternalModuleLinkables interp hsc_env pls [linkable]
+ when (failed ok2) $
+ throwGhcExceptionIO (ProgramError "could not load linkable for decls")
+ return (pls2, (links_needed, units_needed))
where
cbcs = linkableBCOs linkable
@@ -761,8 +752,29 @@ loadModule interp hsc_env mod = do
********************************************************************* -}
-loadModuleLinkables :: Interp -> HscEnv -> LoaderState -> [Linkable] -> IO (LoaderState, SuccessFlag)
-loadModuleLinkables interp hsc_env pls linkables
+-- | Which closures from a Linkable to add to the 'ClosureEnv' in the 'LoaderState'
+data KeepModuleLinkableDefinitions = KeepAllDefinitions -- ^ Keep all definitions
+ | KeepExternalDefinitions -- ^ Only keep external definitions
+
+-- | Interpret a 'KeepModuleLinkableDefinitions' specification to a predictate on 'Name'
+keepDefinitions :: KeepModuleLinkableDefinitions -> (Name -> Bool)
+keepDefinitions KeepAllDefinitions = const True
+keepDefinitions KeepExternalDefinitions = isExternalName
+
+-- | Load a linkable from a module, and only add externally visible names to the
+-- environment.
+loadExternalModuleLinkables :: Interp -> HscEnv -> LoaderState -> [Linkable] -> IO (LoaderState, SuccessFlag)
+loadExternalModuleLinkables interp hsc_env pls linkables =
+ loadModuleLinkables interp hsc_env pls KeepExternalDefinitions linkables
+
+-- | Load a linkable from a module, and add all the names from the linkable into the
+-- closure environment.
+loadInternalModuleLinkables :: Interp -> HscEnv -> LoaderState -> [Linkable] -> IO (LoaderState, SuccessFlag)
+loadInternalModuleLinkables interp hsc_env pls linkables =
+ loadModuleLinkables interp hsc_env pls KeepAllDefinitions linkables
+
+loadModuleLinkables :: Interp -> HscEnv -> LoaderState -> KeepModuleLinkableDefinitions -> [Linkable] -> IO (LoaderState, SuccessFlag)
+loadModuleLinkables interp hsc_env pls keep_spec linkables
= mask_ $ do -- don't want to be interrupted by ^C in here
debugTraceMsg (hsc_logger hsc_env) 3 $
@@ -777,7 +789,7 @@ loadModuleLinkables interp hsc_env pls linkables
if failed ok_flag then
return (pls1, Failed)
else do
- pls2 <- dynLinkBCOs interp pls1 bcos
+ pls2 <- dynLinkBCOs interp pls1 keep_spec bcos
return (pls2, Succeeded)
where
(objs, bcos) = partitionLinkables linkables
@@ -920,8 +932,8 @@ rmDupLinkables already ls
********************************************************************* -}
-dynLinkBCOs :: Interp -> LoaderState -> [Linkable] -> IO LoaderState
-dynLinkBCOs interp pls bcos = do
+dynLinkBCOs :: Interp -> LoaderState -> KeepModuleLinkableDefinitions -> [Linkable] -> IO LoaderState
+dynLinkBCOs interp pls keep_spec bcos = do
let (bcos_loaded', new_bcos) = rmDupLinkables (bcos_loaded pls) bcos
pls1 = pls { bcos_loaded = bcos_loaded' }
@@ -945,7 +957,7 @@ dynLinkBCOs interp pls bcos = do
names_and_refs <- linkSomeBCOs interp (pkgs_loaded pls) le2 lb2 cbcs
-- We only want to add the external ones to the ClosureEnv
- let (to_add, to_drop) = partition (isExternalName.fst) names_and_refs
+ let (to_add, to_drop) = partition (keepDefinitions keep_spec . fst) names_and_refs
-- Immediately release any HValueRefs we're not going to add
freeHValueRefs interp (map snd to_drop)
=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -2778,7 +2778,7 @@ the appropriate component of the product, discarding the rest:
checkPatOf3 (_, _, p) = p -- interpret as a pattern
We can easily define ambiguities between arbitrary subsets of interpretations.
-For example, when we know ahead of type that only an expression or a command is
+For example, when we know ahead of time that only an expression or a command is
possible, but not a pattern, we can use a smaller type:
type ExpCmd = (PV (LHsExpr GhcPs), PV (LHsCmd GhcPs))
=====================================
compiler/cbits/keepCAFsForGHCi.c
=====================================
@@ -21,7 +21,7 @@
// the constructor to be run, allowing the assertion to succeed in the first place
// as keepCAFs will have been set already during initialization of constructors.
-
+#if defined(HAVE_INTERNAL_INTERPRETER)
bool keepCAFsForGHCi(void) __attribute__((constructor));
@@ -32,4 +32,4 @@ bool keepCAFsForGHCi(void)
return was_set;
}
-
+#endif
=====================================
compiler/ghc.cabal.in
=====================================
@@ -156,6 +156,7 @@ Library
if flag(internal-interpreter)
CPP-Options: -DHAVE_INTERNAL_INTERPRETER
+ cc-options: -DHAVE_INTERNAL_INTERPRETER
-- if no dynamic system linker is available, don't try DLLs.
if flag(dynamic-system-linker)
=====================================
docs/users_guide/conf.py
=====================================
@@ -7,6 +7,7 @@
#
import sys
import os
+from datetime import datetime, timezone
# Support for :base-ref:, etc.
sys.path.insert(0, os.path.abspath('.'))
@@ -44,7 +45,7 @@ rst_prolog = """
# General information about the project.
project = u'Glasgow Haskell Compiler'
-copyright = u'2023, GHC Team'
+copyright = f"{datetime.now(timezone.utc).year}, GHC Team"
# N.B. version comes from ghc_config
release = version # The full version, including alpha/beta/rc tags.
=====================================
rts/BuiltinClosures.c
=====================================
@@ -0,0 +1,30 @@
+#include "Rts.h"
+#include "Prelude.h"
+#include "BuiltinClosures.h"
+
+/*
+ * Note [CHARLIKE and INTLIKE closures]
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * These are static representations of Chars and small Ints, so that
+ * we can remove dynamic Chars and Ints during garbage collection and
+ * replace them with references to the static objects.
+ */
+
+StgIntCharlikeClosure stg_INTLIKE_closure[MAX_INTLIKE - MIN_INTLIKE + 1];
+StgIntCharlikeClosure stg_CHARLIKE_closure[MAX_CHARLIKE - MIN_CHARLIKE + 1];
+
+void initBuiltinClosures(void) {
+ // INTLIKE closures
+ for (int i = MIN_INTLIKE; i <= MAX_INTLIKE; i++) {
+ StgIntCharlikeClosure *c = &stg_INTLIKE_closure[i - MIN_INTLIKE];
+ SET_HDR((StgClosure* ) c, Izh_con_info, CCS_SYSTEM_OR_NULL);
+ c->data = i;
+ }
+
+ // CHARLIKE closures
+ for (int i = MIN_CHARLIKE; i <= MAX_CHARLIKE; i++) {
+ StgIntCharlikeClosure *c = &stg_CHARLIKE_closure[i - MIN_CHARLIKE];
+ SET_HDR((StgClosure* ) c, Czh_con_info, CCS_SYSTEM_OR_NULL);
+ c->data = i;
+ }
+}
=====================================
rts/BuiltinClosures.h
=====================================
@@ -0,0 +1,14 @@
+/*
+ * (c) The GHC Team, 2025-2026
+ *
+ * RTS/ghc-internal interface
+ *
+ */
+
+#pragma once
+
+#include "BeginPrivate.h"
+
+void initBuiltinClosures(void);
+
+#include "EndPrivate.h"
=====================================
rts/RtsStartup.c
=====================================
@@ -14,6 +14,7 @@
#include "linker/MMap.h"
#include "RtsFlags.h"
#include "RtsUtils.h"
+#include "BuiltinClosures.h"
#include "Prelude.h"
#include "Printer.h" /* DEBUG_LoadSymbols */
#include "Schedule.h" /* initScheduler */
@@ -373,6 +374,9 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
traceInitEvent(traceOSProcessInfo);
flushTrace();
+ /* initialize INTLIKE and CHARLIKE closures */
+ initBuiltinClosures();
+
/* initialize the storage manager */
initStorage();
=====================================
rts/StgMiscClosures.cmm
=====================================
@@ -13,8 +13,6 @@
#include "Cmm.h"
import pthread_mutex_lock;
-import ghczminternal_GHCziInternalziTypes_Czh_info;
-import ghczminternal_GHCziInternalziTypes_Izh_info;
import AcquireSRWLockExclusive;
import ReleaseSRWLockExclusive;
@@ -23,7 +21,6 @@ import whitehole_lockClosure_spin;
import whitehole_lockClosure_yield;
#endif
-
#if !defined(UnregisterisedCompiler)
import CLOSURE CCS_SYSTEM;
import CLOSURE ENT_DYN_IND_ctr;
@@ -1031,554 +1028,3 @@ INFO_TABLE_CONSTR(stg_ASYNCIO_LIVE0,0,0,0,CONSTR_NOCAF,"ASYNCIO_LIVE0","ASYNCIO_
{ foreign "C" barf("ASYNCIO_LIVE0 object (%p) entered!", R1) never returns; }
CLOSURE(stg_ASYNCIO_LIVE0_closure,stg_ASYNCIO_LIVE0);
-
-/* ----------------------------------------------------------------------------
- Note [CHARLIKE and INTLIKE closures]
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- These are static representations of Chars and small Ints, so that
- we can remove dynamic Chars and Ints during garbage collection and
- replace them with references to the static objects.
- ------------------------------------------------------------------------- */
-
-#define Char_hash_con_info ghczminternal_GHCziInternalziTypes_Czh_con_info
-#define Int_hash_con_info ghczminternal_GHCziInternalziTypes_Izh_con_info
-
-#define CHARLIKE_HDR(n) CLOSURE(Char_hash_con_info, n)
-#define INTLIKE_HDR(n) CLOSURE(Int_hash_con_info, n)
-
-section "data" {
- stg_CHARLIKE_closure:
- CHARLIKE_HDR(0)
- CHARLIKE_HDR(1)
- CHARLIKE_HDR(2)
- CHARLIKE_HDR(3)
- CHARLIKE_HDR(4)
- CHARLIKE_HDR(5)
- CHARLIKE_HDR(6)
- CHARLIKE_HDR(7)
- CHARLIKE_HDR(8)
- CHARLIKE_HDR(9)
- CHARLIKE_HDR(10)
- CHARLIKE_HDR(11)
- CHARLIKE_HDR(12)
- CHARLIKE_HDR(13)
- CHARLIKE_HDR(14)
- CHARLIKE_HDR(15)
- CHARLIKE_HDR(16)
- CHARLIKE_HDR(17)
- CHARLIKE_HDR(18)
- CHARLIKE_HDR(19)
- CHARLIKE_HDR(20)
- CHARLIKE_HDR(21)
- CHARLIKE_HDR(22)
- CHARLIKE_HDR(23)
- CHARLIKE_HDR(24)
- CHARLIKE_HDR(25)
- CHARLIKE_HDR(26)
- CHARLIKE_HDR(27)
- CHARLIKE_HDR(28)
- CHARLIKE_HDR(29)
- CHARLIKE_HDR(30)
- CHARLIKE_HDR(31)
- CHARLIKE_HDR(32)
- CHARLIKE_HDR(33)
- CHARLIKE_HDR(34)
- CHARLIKE_HDR(35)
- CHARLIKE_HDR(36)
- CHARLIKE_HDR(37)
- CHARLIKE_HDR(38)
- CHARLIKE_HDR(39)
- CHARLIKE_HDR(40)
- CHARLIKE_HDR(41)
- CHARLIKE_HDR(42)
- CHARLIKE_HDR(43)
- CHARLIKE_HDR(44)
- CHARLIKE_HDR(45)
- CHARLIKE_HDR(46)
- CHARLIKE_HDR(47)
- CHARLIKE_HDR(48)
- CHARLIKE_HDR(49)
- CHARLIKE_HDR(50)
- CHARLIKE_HDR(51)
- CHARLIKE_HDR(52)
- CHARLIKE_HDR(53)
- CHARLIKE_HDR(54)
- CHARLIKE_HDR(55)
- CHARLIKE_HDR(56)
- CHARLIKE_HDR(57)
- CHARLIKE_HDR(58)
- CHARLIKE_HDR(59)
- CHARLIKE_HDR(60)
- CHARLIKE_HDR(61)
- CHARLIKE_HDR(62)
- CHARLIKE_HDR(63)
- CHARLIKE_HDR(64)
- CHARLIKE_HDR(65)
- CHARLIKE_HDR(66)
- CHARLIKE_HDR(67)
- CHARLIKE_HDR(68)
- CHARLIKE_HDR(69)
- CHARLIKE_HDR(70)
- CHARLIKE_HDR(71)
- CHARLIKE_HDR(72)
- CHARLIKE_HDR(73)
- CHARLIKE_HDR(74)
- CHARLIKE_HDR(75)
- CHARLIKE_HDR(76)
- CHARLIKE_HDR(77)
- CHARLIKE_HDR(78)
- CHARLIKE_HDR(79)
- CHARLIKE_HDR(80)
- CHARLIKE_HDR(81)
- CHARLIKE_HDR(82)
- CHARLIKE_HDR(83)
- CHARLIKE_HDR(84)
- CHARLIKE_HDR(85)
- CHARLIKE_HDR(86)
- CHARLIKE_HDR(87)
- CHARLIKE_HDR(88)
- CHARLIKE_HDR(89)
- CHARLIKE_HDR(90)
- CHARLIKE_HDR(91)
- CHARLIKE_HDR(92)
- CHARLIKE_HDR(93)
- CHARLIKE_HDR(94)
- CHARLIKE_HDR(95)
- CHARLIKE_HDR(96)
- CHARLIKE_HDR(97)
- CHARLIKE_HDR(98)
- CHARLIKE_HDR(99)
- CHARLIKE_HDR(100)
- CHARLIKE_HDR(101)
- CHARLIKE_HDR(102)
- CHARLIKE_HDR(103)
- CHARLIKE_HDR(104)
- CHARLIKE_HDR(105)
- CHARLIKE_HDR(106)
- CHARLIKE_HDR(107)
- CHARLIKE_HDR(108)
- CHARLIKE_HDR(109)
- CHARLIKE_HDR(110)
- CHARLIKE_HDR(111)
- CHARLIKE_HDR(112)
- CHARLIKE_HDR(113)
- CHARLIKE_HDR(114)
- CHARLIKE_HDR(115)
- CHARLIKE_HDR(116)
- CHARLIKE_HDR(117)
- CHARLIKE_HDR(118)
- CHARLIKE_HDR(119)
- CHARLIKE_HDR(120)
- CHARLIKE_HDR(121)
- CHARLIKE_HDR(122)
- CHARLIKE_HDR(123)
- CHARLIKE_HDR(124)
- CHARLIKE_HDR(125)
- CHARLIKE_HDR(126)
- CHARLIKE_HDR(127)
- CHARLIKE_HDR(128)
- CHARLIKE_HDR(129)
- CHARLIKE_HDR(130)
- CHARLIKE_HDR(131)
- CHARLIKE_HDR(132)
- CHARLIKE_HDR(133)
- CHARLIKE_HDR(134)
- CHARLIKE_HDR(135)
- CHARLIKE_HDR(136)
- CHARLIKE_HDR(137)
- CHARLIKE_HDR(138)
- CHARLIKE_HDR(139)
- CHARLIKE_HDR(140)
- CHARLIKE_HDR(141)
- CHARLIKE_HDR(142)
- CHARLIKE_HDR(143)
- CHARLIKE_HDR(144)
- CHARLIKE_HDR(145)
- CHARLIKE_HDR(146)
- CHARLIKE_HDR(147)
- CHARLIKE_HDR(148)
- CHARLIKE_HDR(149)
- CHARLIKE_HDR(150)
- CHARLIKE_HDR(151)
- CHARLIKE_HDR(152)
- CHARLIKE_HDR(153)
- CHARLIKE_HDR(154)
- CHARLIKE_HDR(155)
- CHARLIKE_HDR(156)
- CHARLIKE_HDR(157)
- CHARLIKE_HDR(158)
- CHARLIKE_HDR(159)
- CHARLIKE_HDR(160)
- CHARLIKE_HDR(161)
- CHARLIKE_HDR(162)
- CHARLIKE_HDR(163)
- CHARLIKE_HDR(164)
- CHARLIKE_HDR(165)
- CHARLIKE_HDR(166)
- CHARLIKE_HDR(167)
- CHARLIKE_HDR(168)
- CHARLIKE_HDR(169)
- CHARLIKE_HDR(170)
- CHARLIKE_HDR(171)
- CHARLIKE_HDR(172)
- CHARLIKE_HDR(173)
- CHARLIKE_HDR(174)
- CHARLIKE_HDR(175)
- CHARLIKE_HDR(176)
- CHARLIKE_HDR(177)
- CHARLIKE_HDR(178)
- CHARLIKE_HDR(179)
- CHARLIKE_HDR(180)
- CHARLIKE_HDR(181)
- CHARLIKE_HDR(182)
- CHARLIKE_HDR(183)
- CHARLIKE_HDR(184)
- CHARLIKE_HDR(185)
- CHARLIKE_HDR(186)
- CHARLIKE_HDR(187)
- CHARLIKE_HDR(188)
- CHARLIKE_HDR(189)
- CHARLIKE_HDR(190)
- CHARLIKE_HDR(191)
- CHARLIKE_HDR(192)
- CHARLIKE_HDR(193)
- CHARLIKE_HDR(194)
- CHARLIKE_HDR(195)
- CHARLIKE_HDR(196)
- CHARLIKE_HDR(197)
- CHARLIKE_HDR(198)
- CHARLIKE_HDR(199)
- CHARLIKE_HDR(200)
- CHARLIKE_HDR(201)
- CHARLIKE_HDR(202)
- CHARLIKE_HDR(203)
- CHARLIKE_HDR(204)
- CHARLIKE_HDR(205)
- CHARLIKE_HDR(206)
- CHARLIKE_HDR(207)
- CHARLIKE_HDR(208)
- CHARLIKE_HDR(209)
- CHARLIKE_HDR(210)
- CHARLIKE_HDR(211)
- CHARLIKE_HDR(212)
- CHARLIKE_HDR(213)
- CHARLIKE_HDR(214)
- CHARLIKE_HDR(215)
- CHARLIKE_HDR(216)
- CHARLIKE_HDR(217)
- CHARLIKE_HDR(218)
- CHARLIKE_HDR(219)
- CHARLIKE_HDR(220)
- CHARLIKE_HDR(221)
- CHARLIKE_HDR(222)
- CHARLIKE_HDR(223)
- CHARLIKE_HDR(224)
- CHARLIKE_HDR(225)
- CHARLIKE_HDR(226)
- CHARLIKE_HDR(227)
- CHARLIKE_HDR(228)
- CHARLIKE_HDR(229)
- CHARLIKE_HDR(230)
- CHARLIKE_HDR(231)
- CHARLIKE_HDR(232)
- CHARLIKE_HDR(233)
- CHARLIKE_HDR(234)
- CHARLIKE_HDR(235)
- CHARLIKE_HDR(236)
- CHARLIKE_HDR(237)
- CHARLIKE_HDR(238)
- CHARLIKE_HDR(239)
- CHARLIKE_HDR(240)
- CHARLIKE_HDR(241)
- CHARLIKE_HDR(242)
- CHARLIKE_HDR(243)
- CHARLIKE_HDR(244)
- CHARLIKE_HDR(245)
- CHARLIKE_HDR(246)
- CHARLIKE_HDR(247)
- CHARLIKE_HDR(248)
- CHARLIKE_HDR(249)
- CHARLIKE_HDR(250)
- CHARLIKE_HDR(251)
- CHARLIKE_HDR(252)
- CHARLIKE_HDR(253)
- CHARLIKE_HDR(254)
- CHARLIKE_HDR(255)
-}
-
-section "data" {
- stg_INTLIKE_closure:
- INTLIKE_HDR(-16) /* MIN_INTLIKE == -16 */
- INTLIKE_HDR(-15)
- INTLIKE_HDR(-14)
- INTLIKE_HDR(-13)
- INTLIKE_HDR(-12)
- INTLIKE_HDR(-11)
- INTLIKE_HDR(-10)
- INTLIKE_HDR(-9)
- INTLIKE_HDR(-8)
- INTLIKE_HDR(-7)
- INTLIKE_HDR(-6)
- INTLIKE_HDR(-5)
- INTLIKE_HDR(-4)
- INTLIKE_HDR(-3)
- INTLIKE_HDR(-2)
- INTLIKE_HDR(-1)
- INTLIKE_HDR(0)
- INTLIKE_HDR(1)
- INTLIKE_HDR(2)
- INTLIKE_HDR(3)
- INTLIKE_HDR(4)
- INTLIKE_HDR(5)
- INTLIKE_HDR(6)
- INTLIKE_HDR(7)
- INTLIKE_HDR(8)
- INTLIKE_HDR(9)
- INTLIKE_HDR(10)
- INTLIKE_HDR(11)
- INTLIKE_HDR(12)
- INTLIKE_HDR(13)
- INTLIKE_HDR(14)
- INTLIKE_HDR(15)
- INTLIKE_HDR(16)
- INTLIKE_HDR(17)
- INTLIKE_HDR(18)
- INTLIKE_HDR(19)
- INTLIKE_HDR(20)
- INTLIKE_HDR(21)
- INTLIKE_HDR(22)
- INTLIKE_HDR(23)
- INTLIKE_HDR(24)
- INTLIKE_HDR(25)
- INTLIKE_HDR(26)
- INTLIKE_HDR(27)
- INTLIKE_HDR(28)
- INTLIKE_HDR(29)
- INTLIKE_HDR(30)
- INTLIKE_HDR(31)
- INTLIKE_HDR(32)
- INTLIKE_HDR(33)
- INTLIKE_HDR(34)
- INTLIKE_HDR(35)
- INTLIKE_HDR(36)
- INTLIKE_HDR(37)
- INTLIKE_HDR(38)
- INTLIKE_HDR(39)
- INTLIKE_HDR(40)
- INTLIKE_HDR(41)
- INTLIKE_HDR(42)
- INTLIKE_HDR(43)
- INTLIKE_HDR(44)
- INTLIKE_HDR(45)
- INTLIKE_HDR(46)
- INTLIKE_HDR(47)
- INTLIKE_HDR(48)
- INTLIKE_HDR(49)
- INTLIKE_HDR(50)
- INTLIKE_HDR(51)
- INTLIKE_HDR(52)
- INTLIKE_HDR(53)
- INTLIKE_HDR(54)
- INTLIKE_HDR(55)
- INTLIKE_HDR(56)
- INTLIKE_HDR(57)
- INTLIKE_HDR(58)
- INTLIKE_HDR(59)
- INTLIKE_HDR(60)
- INTLIKE_HDR(61)
- INTLIKE_HDR(62)
- INTLIKE_HDR(63)
- INTLIKE_HDR(64)
- INTLIKE_HDR(65)
- INTLIKE_HDR(66)
- INTLIKE_HDR(67)
- INTLIKE_HDR(68)
- INTLIKE_HDR(69)
- INTLIKE_HDR(70)
- INTLIKE_HDR(71)
- INTLIKE_HDR(72)
- INTLIKE_HDR(73)
- INTLIKE_HDR(74)
- INTLIKE_HDR(75)
- INTLIKE_HDR(76)
- INTLIKE_HDR(77)
- INTLIKE_HDR(78)
- INTLIKE_HDR(79)
- INTLIKE_HDR(80)
- INTLIKE_HDR(81)
- INTLIKE_HDR(82)
- INTLIKE_HDR(83)
- INTLIKE_HDR(84)
- INTLIKE_HDR(85)
- INTLIKE_HDR(86)
- INTLIKE_HDR(87)
- INTLIKE_HDR(88)
- INTLIKE_HDR(89)
- INTLIKE_HDR(90)
- INTLIKE_HDR(91)
- INTLIKE_HDR(92)
- INTLIKE_HDR(93)
- INTLIKE_HDR(94)
- INTLIKE_HDR(95)
- INTLIKE_HDR(96)
- INTLIKE_HDR(97)
- INTLIKE_HDR(98)
- INTLIKE_HDR(99)
- INTLIKE_HDR(100)
- INTLIKE_HDR(101)
- INTLIKE_HDR(102)
- INTLIKE_HDR(103)
- INTLIKE_HDR(104)
- INTLIKE_HDR(105)
- INTLIKE_HDR(106)
- INTLIKE_HDR(107)
- INTLIKE_HDR(108)
- INTLIKE_HDR(109)
- INTLIKE_HDR(110)
- INTLIKE_HDR(111)
- INTLIKE_HDR(112)
- INTLIKE_HDR(113)
- INTLIKE_HDR(114)
- INTLIKE_HDR(115)
- INTLIKE_HDR(116)
- INTLIKE_HDR(117)
- INTLIKE_HDR(118)
- INTLIKE_HDR(119)
- INTLIKE_HDR(120)
- INTLIKE_HDR(121)
- INTLIKE_HDR(122)
- INTLIKE_HDR(123)
- INTLIKE_HDR(124)
- INTLIKE_HDR(125)
- INTLIKE_HDR(126)
- INTLIKE_HDR(127)
- INTLIKE_HDR(128)
- INTLIKE_HDR(129)
- INTLIKE_HDR(130)
- INTLIKE_HDR(131)
- INTLIKE_HDR(132)
- INTLIKE_HDR(133)
- INTLIKE_HDR(134)
- INTLIKE_HDR(135)
- INTLIKE_HDR(136)
- INTLIKE_HDR(137)
- INTLIKE_HDR(138)
- INTLIKE_HDR(139)
- INTLIKE_HDR(140)
- INTLIKE_HDR(141)
- INTLIKE_HDR(142)
- INTLIKE_HDR(143)
- INTLIKE_HDR(144)
- INTLIKE_HDR(145)
- INTLIKE_HDR(146)
- INTLIKE_HDR(147)
- INTLIKE_HDR(148)
- INTLIKE_HDR(149)
- INTLIKE_HDR(150)
- INTLIKE_HDR(151)
- INTLIKE_HDR(152)
- INTLIKE_HDR(153)
- INTLIKE_HDR(154)
- INTLIKE_HDR(155)
- INTLIKE_HDR(156)
- INTLIKE_HDR(157)
- INTLIKE_HDR(158)
- INTLIKE_HDR(159)
- INTLIKE_HDR(160)
- INTLIKE_HDR(161)
- INTLIKE_HDR(162)
- INTLIKE_HDR(163)
- INTLIKE_HDR(164)
- INTLIKE_HDR(165)
- INTLIKE_HDR(166)
- INTLIKE_HDR(167)
- INTLIKE_HDR(168)
- INTLIKE_HDR(169)
- INTLIKE_HDR(170)
- INTLIKE_HDR(171)
- INTLIKE_HDR(172)
- INTLIKE_HDR(173)
- INTLIKE_HDR(174)
- INTLIKE_HDR(175)
- INTLIKE_HDR(176)
- INTLIKE_HDR(177)
- INTLIKE_HDR(178)
- INTLIKE_HDR(179)
- INTLIKE_HDR(180)
- INTLIKE_HDR(181)
- INTLIKE_HDR(182)
- INTLIKE_HDR(183)
- INTLIKE_HDR(184)
- INTLIKE_HDR(185)
- INTLIKE_HDR(186)
- INTLIKE_HDR(187)
- INTLIKE_HDR(188)
- INTLIKE_HDR(189)
- INTLIKE_HDR(190)
- INTLIKE_HDR(191)
- INTLIKE_HDR(192)
- INTLIKE_HDR(193)
- INTLIKE_HDR(194)
- INTLIKE_HDR(195)
- INTLIKE_HDR(196)
- INTLIKE_HDR(197)
- INTLIKE_HDR(198)
- INTLIKE_HDR(199)
- INTLIKE_HDR(200)
- INTLIKE_HDR(201)
- INTLIKE_HDR(202)
- INTLIKE_HDR(203)
- INTLIKE_HDR(204)
- INTLIKE_HDR(205)
- INTLIKE_HDR(206)
- INTLIKE_HDR(207)
- INTLIKE_HDR(208)
- INTLIKE_HDR(209)
- INTLIKE_HDR(210)
- INTLIKE_HDR(211)
- INTLIKE_HDR(212)
- INTLIKE_HDR(213)
- INTLIKE_HDR(214)
- INTLIKE_HDR(215)
- INTLIKE_HDR(216)
- INTLIKE_HDR(217)
- INTLIKE_HDR(218)
- INTLIKE_HDR(219)
- INTLIKE_HDR(220)
- INTLIKE_HDR(221)
- INTLIKE_HDR(222)
- INTLIKE_HDR(223)
- INTLIKE_HDR(224)
- INTLIKE_HDR(225)
- INTLIKE_HDR(226)
- INTLIKE_HDR(227)
- INTLIKE_HDR(228)
- INTLIKE_HDR(229)
- INTLIKE_HDR(230)
- INTLIKE_HDR(231)
- INTLIKE_HDR(232)
- INTLIKE_HDR(233)
- INTLIKE_HDR(234)
- INTLIKE_HDR(235)
- INTLIKE_HDR(236)
- INTLIKE_HDR(237)
- INTLIKE_HDR(238)
- INTLIKE_HDR(239)
- INTLIKE_HDR(240)
- INTLIKE_HDR(241)
- INTLIKE_HDR(242)
- INTLIKE_HDR(243)
- INTLIKE_HDR(244)
- INTLIKE_HDR(245)
- INTLIKE_HDR(246)
- INTLIKE_HDR(247)
- INTLIKE_HDR(248)
- INTLIKE_HDR(249)
- INTLIKE_HDR(250)
- INTLIKE_HDR(251)
- INTLIKE_HDR(252)
- INTLIKE_HDR(253)
- INTLIKE_HDR(254)
- INTLIKE_HDR(255) /* MAX_INTLIKE == 255
- See #16961 for why 255 */
-}
=====================================
rts/include/rts/Constants.h
=====================================
@@ -57,11 +57,12 @@
#define MAX_SPEC_CONSTR_SIZE 2
/* Range of built-in table of static small int-like and char-like closures.
+ * Range is inclusive of both minimum and maximum.
*
* NB. This corresponds with the number of actual INTLIKE/CHARLIKE
* closures defined in rts/StgMiscClosures.cmm.
*/
-#define MAX_INTLIKE 255
+#define MAX_INTLIKE 255 /* See #16961 for why 255 */
#define MIN_INTLIKE (-16)
#define MAX_CHARLIKE 255
=====================================
rts/include/stg/MiscClosures.h
=====================================
@@ -277,8 +277,8 @@ RTS_ENTRY(stg_NO_FINALIZER);
extern StgWordArray stg_CHARLIKE_closure;
extern StgWordArray stg_INTLIKE_closure;
#else
-extern StgIntCharlikeClosure stg_CHARLIKE_closure[];
-extern StgIntCharlikeClosure stg_INTLIKE_closure[];
+extern StgIntCharlikeClosure stg_CHARLIKE_closure[MAX_CHARLIKE - MIN_CHARLIKE + 1];
+extern StgIntCharlikeClosure stg_INTLIKE_closure[MAX_INTLIKE - MIN_INTLIKE + 1];
#endif
/* StgStartup */
=====================================
rts/rts.cabal
=====================================
@@ -403,6 +403,7 @@ library
adjustor/AdjustorPool.c
ExecPage.c
Arena.c
+ BuiltinClosures.c
Capability.c
CheckUnload.c
CheckVectorSupport.c
=====================================
testsuite/tests/process/process010.stdout-i386-unknown-solaris2 deleted
=====================================
@@ -1,4 +0,0 @@
-ExitSuccess
-ExitFailure 255
-Exc: /non/existent: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory)
-Done
=====================================
testsuite/tests/rts/linker/T11223/T11223_link_order_a_b_2_fail.stderr-ws-32-mingw32 deleted
=====================================
@@ -1,25 +0,0 @@
-GHC runtime linker: fatal error: I found a duplicate definition for symbol
- _a
-whilst processing object file
- E:\ghc-dev\msys64\home\Tamar\ghc\testsuite\tests\rts\T11223\T11223_link_order_a_b_2_fail.run\libfoo_link_lib_3.a
-The symbol was previously defined in
- E:\ghc-dev\msys64\home\Tamar\ghc\testsuite\tests\rts\T11223\T11223_link_order_a_b_2_fail.run\libbar_link_lib_3.a(#3:bar_link_lib_3.o)
-This could be caused by:
- * Loading two different object files which export the same symbol
- * Specifying the same object file twice on the GHCi command line
- * An incorrect `package.conf' entry, causing some object to be
- loaded twice.
-ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above. You might consider using --optimistic-linking
-
-
-GHC.ByteCode.Linker: can't find label
-During interactive linking, GHCi couldn't find the following symbol:
- c
-This may be due to you not asking GHCi to load extra object files,
-archives or DLLs needed by your current session. Restart GHCi, specifying
-the missing library using the -L/path/to/object/dir and -lmissinglibname
-flags, or simply by naming the relevant files on the GHCi command line.
-Alternatively, this link failure might indicate a bug in GHCi.
-If you suspect the latter, please report this as a GHC bug:
- https://www.haskell.org/ghc/reportabug
-
=====================================
testsuite/tests/rts/linker/T11223/T11223_simple_duplicate_lib.stderr-ws-32-mingw32 deleted
=====================================
@@ -1,25 +0,0 @@
-GHC runtime linker: fatal error: I found a duplicate definition for symbol
- _a
-whilst processing object file
- E:\ghc-dev\msys64\home\Tamar\ghc\testsuite\tests\rts\T11223\T11223_simple_duplicate_lib.run\libfoo_dup_lib.a
-The symbol was previously defined in
- E:\ghc-dev\msys64\home\Tamar\ghc\testsuite\tests\rts\T11223\T11223_simple_duplicate_lib.run\bar_dup_lib.o
-This could be caused by:
- * Loading two different object files which export the same symbol
- * Specifying the same object file twice on the GHCi command line
- * An incorrect `package.conf' entry, causing some object to be
- loaded twice.
-ghc-stage2.exe: ^^ Could not load '_c', dependency unresolved. See top entry above. You might consider using --optimistic-linking
-
-
-GHC.ByteCode.Linker: can't find label
-During interactive linking, GHCi couldn't find the following symbol:
- c
-This may be due to you not asking GHCi to load extra object files,
-archives or DLLs needed by your current session. Restart GHCi, specifying
-the missing library using the -L/path/to/object/dir and -lmissinglibname
-flags, or simply by naming the relevant files on the GHCi command line.
-Alternatively, this link failure might indicate a bug in GHCi.
-If you suspect the latter, please report this as a GHC bug:
- https://www.haskell.org/ghc/reportabug
-
=====================================
testsuite/tests/rts/outofmem.stderr-i386-apple-darwin deleted
=====================================
@@ -1 +0,0 @@
-outofmem: memory allocation failed (requested 1074790400 bytes)
=====================================
testsuite/tests/rts/outofmem.stderr-i386-unknown-mingw32 deleted
=====================================
@@ -1 +0,0 @@
-outofmem.exe: Out of memory
=====================================
testsuite/tests/rts/outofmem.stderr-powerpc-apple-darwin deleted
=====================================
@@ -1 +0,0 @@
-outofmem: memory allocation failed (requested 1074790400 bytes)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/911b0177199a3197a28d9ce04defaa…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/911b0177199a3197a28d9ce04defaa…
You're receiving this email because of your account on gitlab.haskell.org.
1
0