[GHC] #10245: panic in new integer switch logic with "out-of-range" literals

GHC ghc-devs at haskell.org
Sun Apr 5 18:52:01 UTC 2015


#10245: panic in new integer switch logic with "out-of-range" literals
-------------------------------------+-------------------------------------
              Reporter:  rwbarton    |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  high        |         Milestone:
             Component:  Compiler    |           Version:  7.11
  (CodeGen)                          |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  Compile-time
          Architecture:  x86_64      |  crash
  (amd64)                            |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Compiling this module
 {{{
 module D (f) where
 f :: Int -> String
 f n = case n of
   0x8000000000000000 -> "yes"
   _ -> "no"
 }}}
 crashes with the error
 {{{
 [1 of 1] Compiling D                ( /tmp/D.hs, /tmp/D.o )
 ghc-stage1: panic! (the 'impossible' happened)
   (GHC version 7.11.20150403 for x86_64-unknown-linux):
         Map.findMin: empty map has no minimal element
 }}}
 The constant does not have to be exactly `0x8000000000000000`, everything
 I tested from there up to `0xffffffffffffffff` yields the same crash. Also
 occurs with `Word` and negative literals.

 The bug seems to be tied to the target's word size somehow, though: a
 64-bit compiler does not panic on `Int32` and `0x80000000`, but a 32-bit
 compiler does.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10245>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list