<div dir="ltr">Hello.<div><br></div><div>While hacking in one of my projects, one of my modules stopped to compile for apparently no reason. The compiler just freezes (like if it where in an infinite loop) while trying to compile that particular module. Since I had this problem I have been trying to reduce the problem as much as I could, and I came out with this small piece of code:</div>
<div><br></div><div>&gt; module Blah (foo) where</div><div><div><br></div><div>&gt; import Data.Vector (Vector)</div><div>&gt; import qualified Data.Vector as V</div><div><br></div><div>&gt; foo :: (a -&gt; a) -&gt; Vector a -&gt; Vector a</div>
<div>&gt; foo f = V.fromList . V.foldl (\xs x -&gt; f x : xs) []</div></div><div><br></div><div>The module I am importing comes from package vector-0.10.0.1. The compiler I am using is ghc-7.6.3. The problem arises when compiling using the following flags:</div>
<div><br></div><div>ghc Blah.hs -O1 -fspec-constr</div><div><br></div><div>If I compile it verbosely (with -v), I can see that the compiler stops in the SpecConstr optimization step. I have tried to reduce the -O1 flag to a particular set of flags, but I didn&#39;t manage yet to find the complete set of flags that -O1 translates to (optLevelFlags [1] seems to give not enough information).</div>
<div><br></div><div>Since this problem can be OS-dependent, my system is Debian 7 and I didn&#39;t try yet to reproduce my problem in other systems (mainly because I don&#39;t have access to other systems at the moment).</div>
<div><br></div><div>I am posting this here to, with the help of the Haskell Community, check first if this is indeed a bug and, in such case, to find out where that bug comes from (GHC, vector library, something else?). Then, if necessary, I would write a bug report where appropriate.</div>
<div><br></div><div>Thank you,</div><div>Daniel Díaz.</div><div><br></div><div>-- References</div><div><br></div><div>[1] - <a href="https://github.com/ghc/ghc/blob/ghc-7.6.3-release/compiler/main/DynFlags.hs#L2266">https://github.com/ghc/ghc/blob/ghc-7.6.3-release/compiler/main/DynFlags.hs#L2266</a></div>
</div>