#5252: UNPACK without optimisation leads to panic
-------------------------------------------+--------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.1
Resolution: | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: deSugar/should_compile/T5252 | Blockedby:
Blocking: | Related:
-------------------------------------------+--------------------------------
Changes (by simonpj):
* cc: qdunkan@… (added)
* difficulty: => Unknown
* status: closed => new
* resolution: fixed =>
* version: 7.0.3 => 7.6.1
Comment:
Evan Laforge writes (to ghc-users): I have something that looks similar to
#5252, namely, given these two modules:
{{{
% cat Midi.hs
{-# OPTIONS_GHC -funbox-strict-fields #-}
module Midi (
WriteMessage(..)
, WriteDevice
-- TODO due ghc bug: http://hackage.haskell.org/trac/ghc/ticket/5252
-- , WriteDevice(WriteDevice)
) where
import qualified Data.ByteString as ByteString
data WriteMessage = WriteMessage !WriteDevice
newtype WriteDevice = WriteDevice ByteString.ByteString
% cat CoreMidi.hs
module CoreMidi where
import qualified Midi
write_message :: Midi.WriteMessage -> IO Bool
write_message (Midi.WriteMessage _) = return True
}}}
If I compile thus I get a compiler crash with GHC 7.6.1
{{{
% ghc -c Midi.hs
% ghc -c CoreMidi.hs
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.1 for x86_64-apple-darwin):
reboxProduct: not a product main:Midi.WriteDevice{tc r2M}
}}}
Oddly, if I put `{-# UNPACK #-}` on the strict `WriteDevice` and remove
`-funbox-strict-fields`, I don't get a crash anymore. Also, it has to
be `ByteString` inside, I guess it has to do with the optimization
`ByteString` applies.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5252#comment:3>
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