Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6d5f25f5e0b33173fb2e7983cab40808c723f220

>---------------------------------------------------------------

commit 6d5f25f5e0b33173fb2e7983cab40808c723f220
Author: Geoffrey Mainland <gmain...@microsoft.com>
Date:   Thu Jan 3 16:59:03 2013 +0000

    Fix LLVM code generated for word2Float# and word2Double#.

>---------------------------------------------------------------

 compiler/llvmGen/LlvmCodeGen/CodeGen.hs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs 
b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index c510185..763656a 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -189,11 +189,15 @@ genCall env (PrimTarget MO_Touch) _ _
 
 genCall env (PrimTarget (MO_UF_Conv w)) [dst] [e] = do
     let (env1, dstV, stmts1, top1) = getCmmReg env (CmmLocal dst)
+        ty = cmmToLlvmType $ localRegType dst
         width = widthToLlvmFloat w
+    castV <- mkLocalVar ty
     (env2, ve, stmts2, top2) <- exprToVar env1 e
-    let stmt = Assignment dstV $ Cast LM_Uitofp ve width
-        stmts = stmts1 `appOL` stmts2 `snocOL` stmt
+    let stmt3 = Assignment castV $ Cast LM_Uitofp ve width
+        stmt4 = Store castV dstV
+        stmts = stmts1 `appOL` stmts2 `snocOL` stmt3 `snocOL` stmt4
     return (env2, stmts, top1 ++ top2)
+
 genCall _ (PrimTarget (MO_UF_Conv _)) [_] args =
     panic $ "genCall: Too many arguments to MO_UF_Conv. " ++
     "Can only handle 1, given" ++ show (length args) ++ "."



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to