Opened 3 years ago

Closed 3 years ago

#7499 closed bug (duplicate)

Case-inspecting unboxed unit causes codegen crash

Reported by: rl Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Here is a minimal test case:

foo :: (() -> (# #)) -> Int
foo f = case f () of (# #) -> 5

GHC crashes with:

ghc.exe: panic! (the 'impossible' happened)
  (GHC version 7.6.1 for i386-unknown-mingw32):
        compiler\codeGen\CgCase.lhs:572:15-61: Irrefutable pattern failed for pattern ((CoreSyn.DEFAULT,
                                        deflt_absC) : others)

Here is the actual function (simplified) that triggered the bug:

foo :: [a] -> Int
foo xs = foldl' (flip seq) () xs `seq` 5

Change History (2)

comment:1 Changed 3 years ago by ChrisN

This appears to be fixed in 7.7

[Fri 15:24]/tmp>ghc-7.6.1 --make crash.hs -O2 -fforce-recomp
[1 of 1] Compiling Main             ( crash.hs, crash.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.1 for x86_64-unknown-linux):
	compiler/codeGen/CgCase.lhs:572:15-61: Irrefutable pattern failed for pattern ((CoreSyn.DEFAULT,
                                        deflt_absC) : others)


Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug



[Fri 15:24]/tmp>ghc-7.7.20121207 --make crash.hs -O2 -fforce-recomp
[1 of 1] Compiling Main             ( crash.hs, crash.o )
Linking crash ...

comment:2 Changed 3 years ago by simonpj

  • difficulty set to Unknown
  • Resolution set to duplicate
  • Status changed from new to closed

Yes I assume it's a dup of #7392 and #7237. Re-open if you disagree.

Thanks

Simon

Note: See TracTickets for help on using tickets.