summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-03-11 00:27:45 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-12 09:46:29 -0400
commit3a259092a02e84d6b45da6b232cfc022898451a0 (patch)
tree8b6327e34c09d14f351fcbeedc3354f4e17699e2 /compiler/GHC/HsToCore.hs
parent5cb93af73499f9cee4a17427629840feb26171e5 (diff)
downloadhaskell-3a259092a02e84d6b45da6b232cfc022898451a0.tar.gz
Expose compulsory unfoldings always
The unsafeCoerce# patch requires that unsafeCoerce# has a compulsory unfolding that is always available. So we have to be careful to expose compulsory unfoldings unconditionally and consistently. We didn't get this quite right: #17871. This patch fixes it. No real surprises here. See Note [Always expose compulsory unfoldings] in GHC.Iface.Tidy
Diffstat (limited to 'compiler/GHC/HsToCore.hs')
-rw-r--r--compiler/GHC/HsToCore.hs13
1 files changed, 1 insertions, 12 deletions
diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs
index 7b4659edba..d467e559cd 100644
--- a/compiler/GHC/HsToCore.hs
+++ b/compiler/GHC/HsToCore.hs
@@ -639,18 +639,7 @@ The solution is documented in Note [Patching magic definitions]. We now
simply look up the UnsafeEquality GADT in the environment, leaving us
only to wire in unsafeCoerce# directly.
-Wrinkle:
---------
-We must make absolutely sure that unsafeCoerce# is inlined. You might
-think that giving it a compulsory unfolding is enough. However,
-unsafeCoerce# is put in an interface file like any other definition.
-At optimization level 0, we enable -fignore-interface-pragmas, which
-ignores pragmas in interface files. We thus must check to see whether
-there is a compulsory unfolding, even with -fignore-interface-pragmas.
-This is done in TcIface.tcIdInfo.
-
-Test case: ghci/linker/dyn/T3372
-
+Wrinkle: see Note [Always expose compulsory unfoldings] in GHC.Iface.Tidy
-}