Skip to content

Commit

Permalink
Fix Darwin/x86 stack alignment
Browse files Browse the repository at this point in the history
... again.
For now, I've added a TODO comment, but sooner or later this will have to
be made gcc-version-independent.
  • Loading branch information
wolfgang.thaller@gmx.net committed Mar 25, 2006
1 parent 1da8365 commit 2dadc32
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions ghc/rts/StgCRun.c
Expand Up @@ -145,12 +145,12 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
*/
"movl %2,%%eax\n\t"

#if darwin_TARGET_OS
/*
* Darwin: keep the stack aligned
* Darwin note:
* The stack pointer has to be aligned to a multiple of 16 bytes at
* this point. This works out correctly with gcc 4.0.1, but it might
* break at any time in the future. TODO: Make this future-proof.
*/
"subl $12,%%esp\n\t"
#endif

/*
* jump to it
Expand All @@ -160,13 +160,6 @@ StgRun(StgFunPtr f, StgRegTable *basereg) {
STG_GLOBAL STG_RETURN "\n"
STG_RETURN ":\n\t"

#if darwin_TARGET_OS
/*
* Darwin: keep the stack aligned
*/
"addl $12,%%esp\n\t"
#endif

"movl %%esi, %%eax\n\t" /* Return value in R1 */

/*
Expand Down

0 comments on commit 2dadc32

Please sign in to comment.