ghc 7.6.3 and 7.4.2 hang on -O2
I haven't had any luck finding a minimal test case for this, but the following replicates the issue on my two Linux machines running ghc 7.6.3:
git clone https://github.com/tsuraan/optimal-blocks cd optimal-blocks git checkout bceee69f9f03d2e559f96cdf58412ada09c96a8c cabal sandbox init cabal install --only-dependencies cabal configure cabal build
Cabal build will successfully build Algorithm.OptimalBlocks.SipHash and Algorithm.OptimalBlocks.BuzzHash, and it will attempt to build Algorithm.OptimalBlocks, but it will hang forever, using 100% of a single core. I have no idea how to debug this, but in src/Algorithm/OptimalBlocks.hs, if you replace the "in Blocks (reverse rlist) end" with "in Blocks  bs", it will compile. Also, if that same file starts with the line "# OPTIONS_GHC -O1 #" it will compile.
This also happens on my Mac running OSX 10.8.5 and ghc 7.4.2 without llvm; I have to tweak the .cabal file a little to drop the lower bound on base and to get rid of the "-fllvm" flag, but if I do that I see the exact same behaviour.