[GHC] #9035: ghci sometimes displays Word32 as Word64

GHC ghc-devs at haskell.org
Mon May 19 07:16:28 UTC 2014


#9035: ghci sometimes displays Word32 as Word64
------------------------------------------------+--------------------------
        Reporter:  MikeIzbicki                  |            Owner:
            Type:  bug                          |           Status:  closed
        Priority:  normal                       |        Milestone:
       Component:  GHCi                         |          Version:  7.8.2
      Resolution:  invalid                      |         Keywords:
Operating System:  Linux                        |     Architecture:  x86_64
 Type of failure:  Incorrect result at runtime  |  (amd64)
       Test Case:                               |       Difficulty:
        Blocking:                               |  Unknown
                                                |       Blocked By:
                                                |  Related Tickets:
------------------------------------------------+--------------------------

Comment (by simonpj):

 I think it would be a great idea for Core Lint to check for uses of
 `unsafeCoerce` that don't obey the rules.  It won't catch all cases, of
 course, but it would have caught this one. Specficially, look for:
  * Coercions between lifted and unboxed types
  * Coercion between unboxed types of different sizes
  * Coercion between unboxed ints and floats.

 Would anyone like to make a patch for this?  Anything that can be checked
 by Core Lint, should be checked!

 I'm afraid I don't know where to look for the reason for the int/float
 difficulty.  I'd write a tiny function that exhibits the unsafe conversion
 and look the code it generates.

 Simon

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


More information about the ghc-tickets mailing list