#3990: UNPACK doesn't unbox data families
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: low | Milestone: 7.6.2
Component: Compiler | Version: 7.0.3
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Runtime performance bug
Difficulty: | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by simonpj@…):
commit 1ee1cd4194555e498d05bfc391b7b0e635d11e29
{{{
Author: Simon Peyton Jones <[email protected]>
Date: Sun Dec 23 15:38:48 2012 +0000
Make {-# UNPACK #-} work for type/data family invocations
This fixes most of Trac #3990. Consider
data family D a
data instance D Double = CD Int Int
data T = T {-# UNPACK #-} !(D Double)
Then we want the (D Double unpacked).
To do this we need to construct a suitable coercion, and it's much
safer to record that coercion in the interface file, lest the in-scope
instances differ somehow. That in turn means elaborating the HsBang
type to include a coercion.
To do that I moved HsBang from BasicTypes to DataCon, which caused
quite a few minor knock-on changes.
Interface-file format has changed!
Still to do: need to do knot-tying to allow instances to take effect
within the same module.
compiler/basicTypes/BasicTypes.lhs | 51 ------
compiler/basicTypes/DataCon.lhs | 52 ++++++-
compiler/basicTypes/MkId.lhs | 230
++++++++++++++----------
compiler/hsSyn/HsTypes.lhs | 1 +
compiler/iface/BinIface.hs | 20 +--
compiler/iface/BuildTyCl.lhs | 12 +-
compiler/iface/IfaceSyn.lhs | 13 +-
compiler/iface/MkIface.lhs | 8 +-
compiler/iface/TcIface.lhs | 13 ++-
compiler/main/PprTyThing.hs | 3 +-
compiler/prelude/TysWiredIn.lhs | 2 +-
compiler/simplCore/Simplify.lhs | 4 +-
compiler/stranal/DmdAnal.lhs | 4 +-
compiler/typecheck/TcRnDriver.lhs | 2 +-
compiler/typecheck/TcSplice.lhs | 10 +-
compiler/typecheck/TcTyClsDecls.lhs | 6 +-
compiler/vectorise/Vectorise/Generic/PData.hs | 9 +-
compiler/vectorise/Vectorise/Type/TyConDecl.hs | 4 +-
18 files changed, 253 insertions(+), 191 deletions(-)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3990#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs