[GHC] #12274: GHC panic: simplifier ticks exhausted

GHC ghc-devs at haskell.org
Tue Jul 19 18:51:18 UTC 2016


#12274: GHC panic: simplifier ticks exhausted
-------------------------------------+-------------------------------------
        Reporter:  mrkkrp            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by thomie):

 The problems start in the `Specialise` phase:
 {{{
 # 7.8.4:
 # Result size of Simplifier = {terms: 62, types: 158, coercions: 1}
 # Result size of Specialise = {terms: 62, types: 158, coercions: 1}
 #
 # 7.10.3:
 # Result size of Simplifier = {terms: 66, types: 158, coercions: 1}
 # Result size of Specialise = {terms: 751, types: 2,319, coercions: 169}
 }}}

 * The output of `-ddump-spec` for `7.10` contains a list of `Local rules
 for imported ids`, but none for `7.8`.

 * The output of `-ddump-rule-firings` contains 326 rules for `7.10`, but
 only `20` for `7.8`.

 Some of the rule firings with `7.10`:
 {{{
 Rule fired: Class op eof
 Rule fired: Class op fmap
 Rule fired: Class op fmap
 Rule fired: Class op $p1Stream
 Rule fired: Class op uncons
 Rule fired: Class op updatePos
 Rule fired: Class op updatePos
 Rule fired: Class op uncons
 Rule fired: Class op updatePos
 Rule fired: Class op updatePos
 Rule fired: Class op uncons
 Rule fired: Class op updatePos
 Rule fired: Class op updatePos
 Rule fired: Class op uncons
 Rule fired: Class op updatePos
 Rule fired: Class op updatePos
 Rule fired:
     SPEC/Test $fApplicativeParsecT @ Dec @ [Char] @ Identity
 Rule fired:
     SPEC/Test $fAlternativeParsecT @ Dec @ [Char] @ Identity
 Rule fired: Class op pure
 Rule fired: Class op pure
 ...
 ...
 ...
 }}}


 Here is a simplified example:

 Test.hs:
 {{{#!hs
 module Test where

 import A

 xs = mymap (+1) [1,2,3]
 }}}

 A.hs:
 {{{#!hs
 module A where

 mymap :: Functor f => (a -> b) -> f a -> f b
 mymap = fmap
 }}}

 ghc-7.8.4:
 {{{
 $ ghc-7.8.4 Test.hs -ddump-rule-firings -O -fforce-recomp
 [1 of 2] Compiling A                ( A.hs, A.o )
 [2 of 2] Compiling Test             ( Test.hs, Test.o )
 Rule fired: Class op +
 Rule fired: Class op fmap
 Rule fired: map
 Rule fired: mapList
 }}}

 ghc-7.10.3:
 {{{
 $ ghc-7.10.3 Test.hs -ddump-rule-firings -O -fforce-recomp
 [1 of 2] Compiling A                ( A.hs, A.o )
 [2 of 2] Compiling Test             ( Test.hs, Test.o )
 Rule fired: Class op +
 Rule fired: Class op fmap
 Rule fired: Class op fmap
 Rule fired: Class op fmap
 Rule fired: map
 Rule fired: mapList
 }}}

 Why does the `Class op fmap` fire three times with 7.10.3?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12274#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list