[GHC] #4211: LLVM: Stack alignment on OSX

GHC cvs-ghc at haskell.org
Tue Jun 28 09:34:16 CEST 2011


#4211: LLVM: Stack alignment on OSX
--------------------------------+-------------------------------------------
    Reporter:  dterei           |        Owner:  dterei      
        Type:  task             |       Status:  new         
    Priority:  normal           |    Milestone:  7.2.1       
   Component:  Compiler (LLVM)  |      Version:  6.13        
    Keywords:                   |     Testcase:              
   Blockedby:                   |   Difficulty:              
          Os:  MacOS X          |     Blocking:              
Architecture:  x86              |      Failure:  None/Unknown
--------------------------------+-------------------------------------------

Comment(by simonmar):

 Right, C calls with no arguments will now need an esp adjustment, but I
 don't think it's a big deal (and it's only for calls with no arguments,
 those with arguments already need an Sp adjustment).

 Do you want to have a go?  There are only two places that need to be
 changed: `StgCRun.c`, where we currently add 12 to esp to align it, we can
 just drop that.  The other place is `X86.CodeGen.genCCall` where we pad
 the stack offset if necessary.

 Urgh, I just realised that we probably need to do something in
 `rts/Adjustor.c` too.  I looked at the code there, and the Darwin/x86
 version is vastly more complicated than the non-Darwin x86 version, and
 I'm surprised if all that complexity is needed just to get the stack
 pointer aligned...

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4211#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list