#5550: GHC infinite loop when compiling vector
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.2.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by rl):

 Here is what the #4448 example would look like with !ForceSpecConstr:

 {{{
 import GHC.Exts ( SpecConstrAnnotation(..) )

 data SPEC = SPEC | SPEC2
 {-# ANN type SPEC ForceSpecConstr #-}

 foo :: Int -> Int -> Int -> (Int,Int)
 foo !a !b !c = loop SPEC (Left (a,b))
   where
     loop :: SPEC -> Either (Int,Int) (Int, (Int,Int)) -> (Int,Int)
     loop SPEC (Left (!x,!n))
       | n > 0     = loop SPEC (Right (x,(x+c,n-1)))
       | otherwise = (x,n)

     loop SPEC (Right (i,t))
       | i < c     = loop SPEC (Right (i+1,t))
       | otherwise = loop SPEC (Left t)
 }}}

 I think there is a misunderstanding here. Specialising on `SPEC` isn't the
 problem, that happens anyway. It's specialising on other arguments that's
 problematic. I also suggest a type-specific approach: only turn off
 condition (3) for non-recursive types.

 Perhaps you mean that we should use !ForceSpecConstr to mark individual
 arguments? That doesn't work for a variety of reasons.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to