[GHC] #10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule'

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2-rc2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- First observed on singletons-1.1.2.1 package ghc-7.10.2. I've tried to distill it down to a single file. The file manages to crash both GHC and GHCi. GHCi: {{{ $ inplace/bin/ghc-stage2 -hide-all-packages -package=base --interactive List.hs GHCi, version 7.11.20150723: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling List ( List.hs, interpreted ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.11.20150723 for x86_64-unknown-linux): floatExpr tick break<2>() Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} GHC: {{{ $ inplace/bin/ghc-stage2 -hide-all-packages -package=base --make List.hs -dsuppress-all -dsuppress-uniques [1 of 1] Compiling List ( List.hs, List.o ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.11.20150723 for x86_64-unknown-linux): Template variable unbound in rewrite rule m [a_afdP, x, m, ipv, ipv, sc, sc, sc, sg] [a_afdP, x, m, ipv, ipv, sc, sc, sc, sg] [TYPE a_afdP, TYPE x, TYPE Let1627448493XsSym4 x m ipv ipv, sc, (SCons @~ ... sc sc) `cast` ...] [TYPE a_afdP, TYPE x, TYPE Let1627448493XsSym4 x ipv ipv ipv, sc, (SCons @~ ... ipv ipv) `cast` ...] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} The "minimal" single-file sample is attached. If you need original selfcontained reproducer (79 modules, template haskell code) this is the version i've started with: http://code.haskell.org/~slyfox/unbound-template-var.tar.gz Adjusting path to GHC in '''./trigger-a-bug.bash''' should be enough. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by slyfox): * Attachment "List.hs" added. a tiny part of singletons-1.1.2.1/src/Data/Singletons/Prelude/List.hs required to trigger a bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * priority: normal => high * milestone: => 7.10.2 Comment: Bumping priority, as these sorts of bugs regularly get reported to me. But there's an easy workaround, so this certainly shouldn't be "highest". -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.2 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): Confirmed reproducible on the 7.10 tip, and in a recent HEAD. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * milestone: 7.10.2 => 7.10.3 Comment: (milestone:7.10.2 is effectively closed; we're way past the RC-phase, we have all binary dists built and tested, the Git commit has been signed, ...) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): I'm on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template
variable unbound in rewrite rule'
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner:
Type: bug | Status: new
Priority: high | Milestone: 7.10.3
Component: Compiler | Version: 7.10.2-rc2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | simplCore/should_compile/T10689, | T10689a Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => simplCore/should_compile/T10689, T10689a * status: new => merge Comment: Fixed. We could merge to 7.10.3 I guess, so I'll set it to 'merge'. It's not an entirely trivial fix, so I'm a bit inclined not to, though. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: merge Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | simplCore/should_compile/T10689, | T10689a Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by bgamari): This has been merged to `ghc-7.10` as c289c689d697b69145dbd3e9e773fc5e780414ad. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule' -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.10.3 Component: Compiler | Version: 7.10.2-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | simplCore/should_compile/T10689, | T10689a Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10689#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC