[GHC] #9160: Panic: Template variable unbound in rewrite rule

#9160: Panic: Template variable unbound in rewrite rule ----------------------------------+--------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: MacOS X Architecture: x86_64 (amd64) | Type of failure: Compile-time crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+--------------------------------------- Installing `singletons-1.0` with GHC 7.8.2 on OS X 10.9.2 fails: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-apple-darwin): Template variable unbound in rewrite rule }}} Full build log attached. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule ---------------------------------------+---------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: 4524 ---------------------------------------+---------------------------------- Changes (by mietek): * related: => 4524 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule ---------------------------------------+---------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #4524 ---------------------------------------+---------------------------------- Changes (by mietek): * related: 4524 => #4524 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule ---------------------------------------+---------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #4524 ---------------------------------------+---------------------------------- Description changed by mietek: Old description:
Installing `singletons-1.0` with GHC 7.8.2 on OS X 10.9.2 fails:
{{{ ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-apple-darwin): Template variable unbound in rewrite rule }}}
Full build log attached.
New description: Installing `singletons-1.0` with GHC 7.8.2 on OS X 10.9.2 fails: {{{ ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-apple-darwin): Template variable unbound in rewrite rule }}} See also [https://github.com/goldfirere/singletons/issues/83 goldfirere/singletons#83] -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule ---------------------------------------+---------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #4524 ---------------------------------------+---------------------------------- Changes (by mietek): * os: MacOS X => Unknown/Multiple -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule ---------------------------------------+---------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #4524 ---------------------------------------+---------------------------------- Description changed by mietek: Old description:
Installing `singletons-1.0` with GHC 7.8.2 on OS X 10.9.2 fails:
{{{ ghc: panic! (the 'impossible' happened) (GHC version 7.8.2 for x86_64-apple-darwin): Template variable unbound in rewrite rule }}}
See also [https://github.com/goldfirere/singletons/issues/83 goldfirere/singletons#83]
New description: 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 [https://github.com/goldfirere/singletons/issues/83 goldfirere/singletons#83] -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule
---------------------------------------+----------------------------------
Reporter: mietek | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: x86_64 (amd64)
Type of failure: Compile-time crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #4524
---------------------------------------+----------------------------------
Comment (by Simon Peyton Jones

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------------------+------------------------- Reporter: mietek | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | x86_64 (amd64) Test Case: | Difficulty: indexed_types/should_fail/T9160 | Unknown Blocking: | Blocked By: | Related Tickets: #4524 -------------------------------------------------+------------------------- Changes (by simonpj): * status: new => merge * testcase: => indexed_types/should_fail/T9160 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------------------+------------------------- Reporter: mietek | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time crash | x86_64 (amd64) Test Case: | Difficulty: indexed_types/should_fail/T9160 | Unknown Blocking: | Blocked By: | Related Tickets: #4524 -------------------------------------------------+------------------------- Changes (by thoughtpolice): * milestone: => 7.8.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------------------+------------------------- Reporter: mietek | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: 7.8.3 Resolution: fixed | Version: 7.8.2 Operating System: Unknown/Multiple | Keywords: Type of failure: Compile-time crash | Architecture: Test Case: | x86_64 (amd64) indexed_types/should_fail/T9160 | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: #4524 -------------------------------------------------+------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged into 7.8.3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: | Architecture: x86_64 (amd64) Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time crash | Related Tickets: #4524 Test Case: | indexed_types/should_fail/T9160 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by mjo): * status: closed => new * resolution: fixed => Comment: 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 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: | Architecture: x86_64 (amd64) Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time crash | Related Tickets: #4524 Test Case: | indexed_types/should_fail/T9160 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by mjo): 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by slyfox): * cc: slyfox (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by George): I am also see 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 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by George): * cc: george (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by slyfox): Replying to [comment:13 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: {{{#!hs -- 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 -} }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Good report, but comment:15 and comment:16 are definitely a different bug to #9160. I've opened #10251. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): Should we re-close this ticket then? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9160: Panic: Template variable unbound in rewrite rule -------------------------------------+------------------------------------- Reporter: mietek | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.3 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | indexed_types/should_fail/T9160 Related Tickets: #4524 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed Comment: Well, comment:10 claims that GHC 7.8.3 couldn't compile `singletons`. However I've confirmed that HEAD can compile `singletons-1.1`, so yes, I'll close this. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9160#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC