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

GHC ghc-devs at haskell.org
Sun Jan 7 18:08:07 UTC 2018


#10245: panic in new integer switch logic with "out-of-range" literals
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:  AndreasK
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  7.11
  (CodeGen)                          |
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4218
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by AndreasK):

 * status:  patch => closed
 * resolution:   => fixed


Comment:

 Replying to [comment:15 AndreasK]:
 > In MatchLit
 [https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/deSugar/MatchLit.hs#L76
 dsLit] doesn't use the `mkMachInt` functions resulting in potentially
 faulty code.
 >
 > `y = I# 0x8000000000000000# :: Int` compiles without warning with -Wall
 for example.

 Fixing this would incur a overhead when compiling Code which generates
 Prim Literals.

 As these use the same code Path as user specified Literals we can't skip
 the checks on these even when we know these will not be out of bounds.

 Closing this after a discussion on IRC and it's not deemed a big enough
 issue to warrant the overhead. (wontfix as to not confuse this issue with
 the original one)

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


More information about the ghc-tickets mailing list