
#14090: Static pointers are not being registered under certain conditions -------------------------------------+------------------------------------- Reporter: mnislaih | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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:D3843 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
But I also wonder if deleting dead code this early is a good idea.
I don't see why not. The less code we hand to the simplifier the better.
I submitted a patch that makes the bindings containing static forms exported. Please, take a look.
I don't think Phab:D3843 is the right solution here. Not only does it require that we sweep the entire Core program looking for statics (and consequently fairly expensive), but it's quite indirect. Teaching the occurrence analysis about statics sounds somewhat sensible; afterall, static forms essentially allow the user to refer to static subexpression from any context, regardless of scoping. Declaring such a subexpressions as dead is obviously wrong. One way to teach the analyser this would be to add a "contains static form" flag to `UsageDetails`. Then when analysing a binding check the flag of the analysis result of the RHS; if set, `markMany` the binding. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14090#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler