Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHC panic: Template variable unbound in rewrite rule #83

Closed
mietek opened this issue Jun 3, 2014 · 6 comments
Closed

GHC panic: Template variable unbound in rewrite rule #83

mietek opened this issue Jun 3, 2014 · 6 comments

Comments

@mietek
Copy link

mietek commented Jun 3, 2014

Installing singletons-1.0 with GHC 7.8.2 on both OS X 10.9.2 and Ubuntu 2014.04 causes a GHC panic:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for x86_64-apple-darwin):
        Template variable unbound in rewrite rule

See also GHC #9160.

@mietek mietek changed the title GHC Panic: Template unbound in rewrite rule GHC panic: Template unbound in rewrite rule Jun 3, 2014
@mietek mietek changed the title GHC panic: Template unbound in rewrite rule GHC panic: Template variable unbound in rewrite rule Jun 3, 2014
@jstolarek
Copy link
Collaborator

Does this also happen with the latest singletons code from github?

@goldfirere
Copy link
Owner

Thanks for reporting this here, but if GHC is panicking, then it's properly a GHC bug. Has anyone else run into this? I'm not labeling this as blocked, because perhaps singletons can include a workaround, but first, we'll have to find a way to reproduce...

@mietek
Copy link
Author

mietek commented Jun 6, 2014

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

@mietek
Copy link
Author

mietek commented Jul 7, 2014

Fixed in GHC 7.8.3.

EDIT: By which I mean—reported as fixed. Apologies for not verifying the fix myself.

@thomie
Copy link

thomie commented Nov 16, 2014

Although it's a GHC issue, it's not actually fixed. See: https://ghc.haskell.org/trac/ghc/ticket/9160#comment:10.

This might be related to #96, since the failure happens in the same module (Data.Singletons.Prelude.List).

@goldfirere
Copy link
Owner

Still keeping this ticket closed, as it's not singletons's problem and there is an easy workaround: use -O1 or -O0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants