GHC infinite loop when building vector program

Hello, When benchmarking my new vector-bytestring[1] 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 = flip (:) z = [] I use vector-0.9 and ghc-7.2.1. Regards, Bas [1] https://github.com/basvandijk/vector-bytestring

On Tuesday 11 October 2011, 21:11:30, Bas van Dijk wrote:
Hello,
When benchmarking my new vector-bytestring[1] package I discovered that building the following program causes GHC to go into, what seems to be, an infinite loop:
I use vector-0.9 and ghc-7.2.1.
Replicated with vector-0.7.1 and ghc-7.2.1 (^C'ed after six minutes). Compilation finishes (unsurprisingly) with -fno-spec-constr or with {-# NOINLINE f #-}. It compiles fine with vector-0.7.0.1 and ghc-7.0.4.
Regards,
Bas

Thanks Daniel for confirming this. I suspect this is caused by some rewrite rules in vector. So I reported it in their issue-tracker: http://trac.haskell.org/vector/ticket/63 Regards, Bas
participants (2)
-
Bas van Dijk
-
Daniel Fischer