Panic: Template variable unbound in rewrite rule
Installing singletons-1.0
with GHC 7.8.2 on both OS X 10.9.2 and Ubuntu 2014.04 fails:
ghc: panic! (the 'impossible' happened)
(GHC version 7.8.2 for x86_64-apple-darwin):
Template variable unbound in rewrite rule
This seems to be an issue with the optimizer, as the bug only appears with optimization level 2, using the following line in ~/.cabal/config
:
optimization: 2
See also goldfirere/singletons#83
- Show closed items
Relates to
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Miëtek Bak changed weight to 5
changed weight to 5
- Miëtek Bak added Tbug Trac import labels
added Tbug Trac import labels
- Author Developer
Attached file
singletons-1.0.log
(download).Build log
- Author Developer
Trac metadata
Trac field Value Related → #4524 (closed) - Author Developer
Attached file
ghc.info
(download).ghc --info
- Miëtek Bak changed the description
changed the description
- Author Developer
- Author Developer
Trac metadata
Trac field Value Operating system MacOS X → Unknown/Multiple - Miëtek Bak changed the description
changed the description
- Author Developer
- Simon Peyton Jones mentioned in commit b637585d
mentioned in commit b637585d
- Developer
Trac metadata
Trac field Value Test case → indexed_types/should_fail/T9160 - Simon Peyton Jones added 1 deleted label
added 1 deleted label
- thoughtpolice changed milestone to %7.8.3
changed milestone to %7.8.3
- thoughtpolice closed
closed
Merged into 7.8.3.
Trac metadata
Trac field Value Resolution Unresolved → ResolvedFixed - thoughtpolice removed 1 deleted label
removed 1 deleted label
- mjo reopened
reopened
I'm seeing the same symptoms with 7.8.3:
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.3
Only with -O2 set, again.
$ cd singletons-1.0/ $ runghc Setup.hs configure --user -O2 Configuring singletons-1.0... $ runghc Setup.hs build ... [39 of 45] Compiling Data.Singletons.Prelude.List ( src/Data/Singletons/Prelude/List.hs, dist/build/Data/Singletons/Prelude/List.o ) ghc: panic! (the 'impossible' happened) (GHC version 7.8.3 for x86_64-unknown-linux): Template variable unbound in rewrite rule
Trac metadata
Trac field Value Resolution ResolvedFixed → Unresolved I should also mention that the test cases passes, i.e. fails:
$ ghc T9160.hs [1 of 1] Compiling T9160 ( T9160.hs, T9160.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package array-0.5.0.0 ... linking ... done. Loading package deepseq-1.3.0.2 ... linking ... done. Loading package containers-0.5.5.1 ... linking ... done. Loading package pretty-1.1.1.1 ... linking ... done. Loading package template-haskell ... linking ... done. T9160.hs:18:8: Type indexes must match class instance head Found ‘* -> *’ but expected ‘*’ In the type instance declaration for ‘F’ In the instance declaration for ‘C (a :: *)’
Same thing happens with -O2.
- Reporter
I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug:
cabal install bitmap [ 3 of 10] Compiling Data.Bitmap.IO ( Data/Bitmap/IO.hs, dist/build/Data/Bitmap/IO.o )
Data/Bitmap/IO.hs:1248:1: Warning:
SPECIALISE pragma for non-overloaded function ‘myPlusPtr’
Data/Bitmap/IO.hs:1249:1: Warning:
SPECIALISE pragma for non-overloaded function ‘myPlusPtr’
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.1 for x86_64-apple-darwin):
Template variable unbound in rewrite rule
$fPixelComponentFloat3_X2Rc [$fPixelComponentFloat3_X2Rc] [$fPixelComponentFloat3_X2Rc] [] []
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value CC jstolarek, slyfox → george, jstolarek, slyfox - Reporter
Replying to [ticket:9160#comment:97896 George]:
I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug:
cabal install bitmap [ 3 of 10] Compiling Data.Bitmap.IO ( Data/Bitmap/IO.hs, dist/build/Data/Bitmap/IO.o )
I've distilled it a bit to a selfcontained test:
-- sf 9160 # cat B.hs {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -O2 #-} module B (bug) where data D = D data E = E class Storable a where poke2 :: a -> E instance Storable D where poke2 = poke2 -- undefined class Foo a where instance Foo D where class (Foo t, Storable t) => FooStorable t where instance FooStorable D where {-# SPECIALIZE instance FooStorable D #-} {-# SPECIALIZE bug :: D -> E #-} bug :: FooStorable t => t -> E bug = poke2 {- sf 9160 # ghc -c -fforce-recomp -Wall B.hs B.hs:5:10: Warning: Defined but not used: data constructor ‘D’ B.hs:6:10: Warning: Defined but not used: data constructor ‘E’ ghc: panic! (the 'impossible' happened) (GHC version 7.10.1 for x86_64-unknown-linux): Template variable unbound in rewrite rule $fFooStorableD_XU [$fFooStorableD_XU] [$fFooStorableD_XU] [] [] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug -}
- Simon Peyton Jones mentioned in issue #10251 (closed)
mentioned in issue #10251 (closed)
- Developer
Good report, but ticket:9160#comment:97918 and #9160 (closed) are definitely a different bug to #9160 (closed). I've opened #10251 (closed).
Simon
- Developer
Should we re-close this ticket then?
- Simon Peyton Jones closed
closed
- Developer
Well, ticket:9160#comment:89989 claims that GHC 7.8.3 couldn't compile
singletons
. However I've confirmed that HEAD can compilesingletons-1.1
, so yes, I'll close this.Simon
Trac metadata
Trac field Value Resolution Unresolved → ResolvedFixed - dibblego mentioned in issue #12212 (closed)
mentioned in issue #12212 (closed)
- trac-import added compiler crash label
added compiler crash label
- Ben Gamari added Pnormal label
added Pnormal label