
#12184: unsafeCoerce# causing invalid assembly generation -------------------------------------+------------------------------------- Reporter: osa1 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Discovered by MichaelBurge on IRC: {{{#!haskell {-# LANGUAGE MagicHash #-} import GHC.Prim import GHC.Types x = D# ((unsafeCoerce# (5# :: Int#) :: Double#) +## 5.0##) main = putStrLn $ show x }}} Compile with GHC 7.8, 8.0.1 or HEAD: {{{ [1 of 1] Compiling Main ( weird.hs, weird.o ) /tmp/ghc23262_0/ghc_2.s: Assembler messages: /tmp/ghc23262_0/ghc_2.s:43:0: error: Error: junk `naughty x86_64 register' after expression `gcc' failed in phase `Assembler'. (Exit code: 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12184 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler