
#11158: Combine exprIsTrivial and cpe_ExprIsTrivial -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: task | Status: infoneeded Priority: highest | Milestone: 8.2.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1656 Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): It arose out of `main = return ()`. In CoreTidy, it is {{{ main = return @ IO GHC.Base.$fMonadIO @ () GHC.Tuple.() }}} and CorePrep turns that (due to my change of `cpe_ExprIsTrivial`!) into {{{ -- RHS size: {terms: 1, types: 0, coercions: 0} sat_sNJ :: () [LclId] sat_sNJ = GHC.Tuple.() -- RHS size: {terms: 3, types: 2, coercions: 0} T11158.main :: GHC.Types.IO () [GblId] T11158.main = GHC.Base.return @ GHC.Types.IO GHC.Base.$fMonadIO @ () sat_sNJ }}} which yields this STG {{{ sat_sNJ :: () [LclId] = NO_CCS ()! []; T11158.main :: GHC.Types.IO () [GblId] = \u [] GHC.Base.return GHC.Base.$fMonadIO sat_sNJ; }}} Given that the crash happens in `scavenge_static ()` I think it is likely that the SRT table is related to the issue. I don’t see anywhere in `cpeArg` (which creates the float) code that would set CAF information on the floated argument. According to note `Note [CafInfo and floating]` it is safe to have top-level binds with `HasCafRef` even when they do not actually reference any CAFs. (Trying to set `NoCafInfo` on all the extra floats I am generating here, and rebuilding the libraries. Will report back.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11158#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler