Opened 4 years ago
Closed 4 years ago
#8836 closed bug (fixed)
ghc 7.6.3 and 7.4.2 hang on -O2
Reported by: | tsuraan | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Compiler | Version: | 7.6.3 |
Keywords: | Cc: | ||
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | GHC doesn't work at all | Test Case: | |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
Description
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.
Change History (9)
comment:1 Changed 4 years ago by
Summary: | ghc 7.6.3 (Linux) hangs on -O2 → ghc 7.6.3 and 7.4.2 hang on -O2 |
---|
comment:2 Changed 4 years ago by
comment:3 Changed 4 years ago by
comment:4 Changed 4 years ago by
You are right, it hangs at the same spot as #7944:
... *** SpecConstr: Result size of SpecConstr
comment:5 Changed 4 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Right, then we know what's wrong. Unfortunately, there isn't really a good 'fix' that's possible to backport to fix SpecConstr
for 7.6 users - in the mean time, you'll have to get by with -O1
or (-O2 -fno-spec-constr
, I suppose). Alternatively, you can also try tuning the constructor specialisation threshold as noted in #7944.
There won't be a 7.6.4 release, and as this is fixed in HEAD, I'm marking this as a duplicate.
comment:6 Changed 4 years ago by
Resolution: | duplicate |
---|---|
Status: | closed → new |
I believe this is finally fixed; see #8852. Can you try now, with HEAD?
Simon
comment:7 Changed 4 years ago by
Status: | new → infoneeded |
---|
comment:9 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | infoneeded → closed |
I can reproduce the issue with 7.6.3 (removing the -fllvm flag), but not with 7.8.20140130 (also removing the upper bound on base). Must have been fixed already.