[GHC] #12184: unsafeCoerce# causing invalid assembly generation

GHC ghc-devs at haskell.org
Sun Jun 12 20:30:15 UTC 2016


#12184: unsafeCoerce# causing invalid assembly generation
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I don't really think this is a bug. You used `unsafeCoerce#` in an invalid
 way, and you were lucky enough to get an error message. From the
 documentation of `unsafeCoerce#`:

 > The following uses of {\tt unsafeCoerce\#} are supposed to work (i.e.
 not lead to        spurious compile-time or run-time crashes):
 >
 >          * Casting an unboxed type to another unboxed type of the same
 size           (but not coercions between floating-point and integral
 types)

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


More information about the ghc-tickets mailing list