#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
---------------------------------+------------------------------------------
 Bas reports: When benchmarking my new [https://github.com/basvandijk
 /vector-bytestring vector-bytestring] package I discovered that building
 the following program causes GHC to go into, what seems to be, an infinite
 loop:
 {{{
 import Data.Vector (Vector)
 import qualified Data.Vector.Generic as VG

 main = print $ VG.foldl f z (VG.fromList [] :: Vector Int)

 f = flip (:)
 z = []
 }}}
 I build it with:
 {{{
 $ ghc --make vectorGHCloop.hs -O2
 }}}
 It compiles fine without the -O2 or if you specify `-fno-enable-rewrite-
 rules`. So it's probably a loop in a rule somewhere.

 Note that the program also builds fine when I change the 'f' and 'z' to:
 {{{
 f = (+)
 z = 0
 }}}

 I use vector-0.9 and ghc-7.2.1.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5550>
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