unsafeCoerce# causing invalid assembly generation
Discovered by MichaelBurge on IRC:
{-# 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)
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |