[GHC] #12622: Unboxed static pointers lead to missing SPT entries
GHC
ghc-devs at haskell.org
Fri Nov 18 13:41:59 UTC 2016
#12622: Unboxed static pointers lead to missing SPT entries
-------------------------------------+-------------------------------------
Reporter: mboes | Owner:
| facundo.dominguez
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.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:D2709
Wiki Page: | Phab:D2720
-------------------------------------+-------------------------------------
Comment (by facundo.dominguez):
I infer that:
* `makeStatic` should never be unfolded,
* FloatOut needs to treat it specially when **deciding what to float**
(unlike it does now with `StaticPtr`)
* Besides keeping the floated bindings, the optimizations should never
inline them, or the SPT construction pass wouldn't replace the inlined
calls to `makeStatic`.
* the SPT construction needs to do more work (which is replacing this call
with a StaticPtr).
It is probably doable, but how is it simpler than using the twin data
constructor?
Something that could be simpler is to stop relaying on the FloatOut pass.
Instead:
1. As you suggest: Make `static e` expand into the ordinary function call
`makeStatic e`
2. Make the SPT construction phase float all such calls and insert them in
the SPT.
Thus there is no need to worry about unfloated calls during linting and
there will be no interference from optimizations.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12622#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list