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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/521157f905926556eaa02a8fbb2f0645efe24a80

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

commit 521157f905926556eaa02a8fbb2f0645efe24a80
Author: David M Peixotto <[email protected]>
Date:   Thu Oct 20 09:18:19 2011 -0500

    Ignore stdcall c-call in native codegen on x86_64
    
    The stdcall calling convention is not supported on x86_64.
    When an ffi import requests stdcall, a warning is issued as
    desired by #3336. However, the native codegen was still
    generating code that expected the callee to cleanup the
    stack arguments when calling a c function that requests
    stdcall.
    
    This patch changes the codegen to actually use the ccall
    calling convention as intended.
    
    Signed-off-by: David Terei <[email protected]>

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

 compiler/nativeGen/X86/CodeGen.hs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/nativeGen/X86/CodeGen.hs 
b/compiler/nativeGen/X86/CodeGen.hs
index 458f379..19bef8f 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -1894,8 +1894,9 @@ genCCall64 target dest_regs args =
         let call = callinsns `appOL`
                    toOL (
                             -- Deallocate parameters after call for ccall;
-                            -- but not for stdcall (callee does it)
-                      (if cconv == StdCallConv || real_size==0 then [] else
+                            -- stdcall has callee do it, but is not supported 
on
+                            -- x86_64 target (see #3336)
+                      (if real_size==0 then [] else
                        [ADD (intSize wordWidth) (OpImm (ImmInt real_size)) 
(OpReg esp)])
                       ++
                       [DELTA (delta + real_size)]



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to