Opened 4 years ago

Closed 4 years ago

#10372 closed bug (duplicate)

panic! compiling Y combinator with optimizations

Reported by: cdk Owned by:
Priority: lowest Milestone:
Component: Compiler Version: 7.10.1
Keywords: panic, simplifier Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #424 Differential Rev(s):
Wiki Page:

Description

The following causes GHC 7.6.3, 7.8.3 and 7.10.1 (at least) to panic when compiling with optimizations:

module Y (y) where

newtype Rec a = Rec { out :: Rec a -> a}

k x = out x x

y f = (f . k) (Rec (f . k))
/tmp ««« ghc -O y.hs -fforce-recomp
[1 of 1] Compiling Y                ( y.hs, y.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.1 for x86_64-unknown-linux):
        Simplifier ticks exhausted
  When trying UnfoldingDone a_sof
  To increase the limit, use -fsimpl-tick-factor=N (default 100)
  If you need to do this, let GHC HQ know, and what factor you needed
  To see detailed counts use -ddump-simpl-stats
  Total ticks: 5282

Change History (2)

comment:1 Changed 4 years ago by simonpj

Milestone:
Priority: normallowest

Yes indeed: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html

Alas I know of no good solution, but happily it doesn't seem to bite much (ever?) in real programs.

Simon

comment:2 Changed 4 years ago by thomie

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.