[GHC] #16327: NCG: Don't double adjust SP before calls on Windows.

GHC ghc-devs at haskell.org
Sat Feb 16 00:51:39 UTC 2019


#16327: NCG: Don't double adjust SP before calls on Windows.
-------------------------------------+-------------------------------------
           Reporter:  AndreasK       |             Owner:  (none)
               Type:  task           |            Status:  new
           Priority:  low            |         Milestone:
          Component:  Compiler       |           Version:  8.6.3
  (CodeGen)                          |
           Keywords:                 |  Operating System:  Windows
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Windows ABI requires callers to allocate 32 byte of space in the parameter
 stack space.
 This should be rolled into the stack adjustment for

 Currently we generate this code:
 {{{
         subq $8,%rsp   # for stack alignment?
         movq %r13,%rcx # Arg1
         movq %rbx,%rdx # Arg2
         subq $32,%rsp  # Reserve "shadow" space + align stack if required
         xorl %eax,%eax # Not required for windows, even on linux only for
 vararg functions
         call newCAF

         addq $40,%rsp
         testq %rax,%rax
         je _c9N5
 }}}

 Ideally this should become
 {{{
         movq %r13,%rcx # Arg1
         movq %rbx,%rdx # Arg2
         subq $40,%rsp  # Reserve "shadow" space
         xorl %eax,%eax
         call newCAF

         addq $40,%rsp
         testq %rax,%rax
         je _c9N5
 }}}

 I haven't looked deeper into this and don't plan in the near future.

 But if anyone is interested I'm willing to lend a hand.

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


More information about the ghc-tickets mailing list