
Ah, thanks Simon!
This helps a lot.
Cheers,
Tamar
From: Simon Peyton Jones
Sent: Wednesday, June 15, 2016 13:07
To: lonetiger@gmail.com; Ömer Sinan Ağacan
Cc: ghc-devs@haskell.org
Subject: RE: CoreToStg Asserts
Ah yes. This is a long-standing wart:
1. The CoreTidy pass predicts what will be CAFFY (see https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC/CAFs). It predicts that info because the output of CoreTidy is what goes into interface files.
2. The CorePrep pass messes the code a bit
3. The CoreToStg pass coverts to STG, and at that point we know for sure what will be CAFFY and what will not
The assert trips when the predication in (1) doesn’t agree with reality in (3).
It would be Much Much better if we took the info from (3) and used that to drive the Core-to-IfaceSyn conversion that creates the interface file content.
The only reason not to do this is that it’d mean delaying Core-to-IfaceSyn until pass (3) had happened.. possibly bad for space. But maybe it’s a non-issue in practice.
See https://ghc.haskell.org/trac/ghc/ticket/9718
Windows interacts with this because with DLLs some pointers that would be static closures turn into thunks (I think). See StgSyn.isDllConApp, and TidyPgm.hasCafRefs
Simon
From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of lonetiger@gmail.com
Sent: 15 June 2016 00:26
To: Ömer Sinan Ağacan
Hi *,
I'm hoping someone could help me understand what the asserts in CoreToStg on line 240 and 216 are trying to tell me.
I hit both of them while trying to compile libraries as dyn.
WARNING: file compiler\stgSyn\CoreToStg.hs, line 250 $trModule2 False True ghc-stage1.exe: panic! (the 'impossible' happened) (GHC version 8.1.20160612 for x86_64-unknown-mingw32): ASSERT failed! file compiler\stgSyn\CoreToStg.hs line 216 $trModule2
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
WARNING: file compiler\simplCore\SimplCore.hs, line 633 Simplifier bailing out after 4 iterations [6737, 736, 51, 9] Size = {terms: 12,990, types: 9,998, coercions: 443} WARNING: file compiler\stgSyn\CoreToStg.hs, line 250 $fEqBigNat_$c/= False True ghc-stage1.exe: panic! (the 'impossible' happened) (GHC version 8.1.20160612 for x86_64-unknown-mingw32): ASSERT failed! file compiler\stgSyn\CoreToStg.hs line 240 [$fEqBigNat_$c/=, $fEqBigNat]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Kind Regards, Tamar
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs