[GHC] #10251: Bad rule generated in pathological cases

#10251: Bad rule generated in pathological cases -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- George reports: I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug (#9160): {{{ 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] [] [] }}} But it's ''not'' #9160 at all. So I'm making a new ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10251 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10251: Bad rule generated in pathological cases -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Old description:
George reports: I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug (#9160): {{{ 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] [] [] }}} But it's ''not'' #9160 at all. So I'm making a new ticket.
New description: George reports: I am also seeing this on ghc 7.10.1, not sure if this is another instance of this bug (#9160): {{{ 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] [] [] }}} But it's ''not'' #9160 at all. So I'm making a new ticket. -- Comment (by simonpj): Slyfox says 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 -} }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10251#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10251: Bad rule generated in pathological cases
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10251: Bad rule generated in pathological cases -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | deSugar/should_compile/T10251 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => deSugar/should_compile/T10251 * milestone: => 7.10.2 Comment: Very good, thanks for the report. This is worth merging to 7.10, because it makes the `bitmap` library compile again Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10251#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10251: Bad rule generated in pathological cases -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | deSugar/should_compile/T10251 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10` via 211cc28688c9424105c204f535ff54033a2c657e -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10251#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10251: Bad rule generated in pathological cases -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | deSugar/should_compile/T10251 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): #10389 is another example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10251#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC