Ticket #63 (new defect)

Opened 20 months ago

Last modified 15 months ago

GHC infinite loop when building vector program

Reported by: basvandijk Owned by:
Priority: minor Milestone:
Version: 0.7 Keywords:
Cc: haskell.org@…

Description

As reported on the glasgow-haskell-users mailinglist, when benchmarking my new 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.

Daniel Fischer replicated it 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.

Change History

follow-up: ↓ 2   Changed 20 months ago by rl

  • priority changed from major to minor

This is definitely a GHC (more precisely, SpecConstr) bug. I'm not sure if we need to find a workaround or if it's ok to just wait until it's fixed in GHC. How critical is this?

in reply to: ↑ 1   Changed 20 months ago by basvandijk

Replying to rl:

How critical is this?

It's not critical for me.

I noticed a GHC ticket was already created for this. Great!

  Changed 15 months ago by liyang

  • cc haskell.org@… added
Note: See TracTickets for help on using tickets.