[GHC] #4831: Infinite loop in SpecConstr

GHC cvs-ghc at haskell.org
Sun Feb 13 20:18:49 CET 2011


#4831: Infinite loop in SpecConstr
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:  simonpj     
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:  7.0.3       
   Component:  Compiler          |      Version:  7.0.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by rl):

 Don't be so impatient! It does terminate eventually after generating 6162
 specialisations.

 For the lifted version of the function, we produce a loop with this type:

 {{{
                 $wa_s5Ep [Occ=LoopBreaker]
                   :: Data.Vector.Fusion.Stream.Monadic.SPEC
                      -> GHC.Prim.Int#
                      -> Data.Maybe.Maybe Data.Array.Parallel.Base.Util.Tag
                      -> GHC.Prim.Int#
                      -> Data.Maybe.Maybe Data.Array.Parallel.Base.Util.Tag
                      -> (GHC.Types.Int, GHC.Types.Int, Data.Maybe.Maybe
 GHC.Types.Int)
                      -> (GHC.Types.Bool,
                          Data.Maybe.Maybe GHC.Types.Int,
                          GHC.Types.Int,
                          ((GHC.Types.Int, Data.Maybe.Maybe GHC.Types.Int,
 GHC.Types.Int),
                           (GHC.Types.Int,
                            Data.Maybe.Maybe GHC.Types.Int,
                            (GHC.Types.Int, GHC.Types.Int, Data.Maybe.Maybe
 GHC.Types.Int)),
                           Data.Maybe.Maybe GHC.Types.Int),
                          GHC.Types.Int,
                          (GHC.Types.Bool,
                           Data.Maybe.Maybe GHC.Types.Int,
                           GHC.Types.Int,
                           (GHC.Types.Int, GHC.Types.Int),
                           GHC.Types.Int,
                           ((GHC.Types.Int, Data.Maybe.Maybe GHC.Types.Int,
 GHC.Types.Int),
                            (GHC.Types.Int,
                             Data.Maybe.Maybe GHC.Types.Int,
                             (GHC.Types.Int, GHC.Types.Int,
 Data.Maybe.Maybe GHC.Types.Int)),
                            Data.Maybe.Maybe GHC.Types.Int)))
                      -> (GHC.Types.Int,
                          (GHC.Types.Int,
                           Data.Maybe.Maybe
 Data.Array.Parallel.Base.Util.Tag,
                           (GHC.Types.Int, GHC.Types.Int, Data.Maybe.Maybe
 GHC.Types.Int)),
                          Data.Maybe.Maybe GHC.Types.Double)
                      -> GHC.Prim.State# s_X3Gj
                      -> (# GHC.Prim.State# s_X3Gj, GHC.Types.Int #)

 }}}

 We basically expect SpecConstr to specialise on every `Maybe` and `Bool`
 which is what it does for all combinations that can actually occur when
 the program runs.

 The real problem is that we simply fuse too much in this example. I
 suppose we'll just have to give up on fusing lifted concatenation when
 generating sequential code. We don't do it in the parallel case, anyway,
 which explains why the examples only fail to compile with `-fdph-seq`. I'm
 going to rebrand this as a DPH bug.

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



More information about the Glasgow-haskell-bugs mailing list