#4211: LLVM: Stack alignment on OSX
------------------------------+---------------------------------------------
Reporter: dterei | Owner: dterei
Type: task | Status: new
Priority: normal | Milestone: 7.6.2
Component: Compiler (LLVM) | Version: 6.13
Resolution: | Keywords:
Os: MacOS X | Architecture: x86
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
------------------------------+---------------------------------------------
Changes (by simonmar):
* status: infoneeded => new
Comment:
I'm slightly unhappy about the solution to this ticket. Since
a9ce36118f0de3aeb427792f8f2c5ae097c94d3f we now align the stack to 16+8
bytes on x86_64, which means that virtually every foreign call now looks
like
{{{
subq $8,%rsp
movl $0,%eax
call foo
addq $8,%rsp
}}}
since most calls on x86_64 pass arguments in registers, the 8 byte
adjustment is to keep the alignment constraint after the return address is
pushed. (The assignment to `%eax` is to keep the ABI happy just in case
the function we're calling is varargs, which is a separate issue).
Now I understand the reason this was done, but I hate having to emit those
two extra instructions around every call. I just wanted to record my
dissatisfaction in this ticket in case it inspires someone to find a
better solution :-)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4211#comment:27>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs