From: panne Date: Thu, 25 Apr 2002 18:48:02 +0000 (+0000) Subject: [project @ 2002-04-25 18:48:02 by panne] X-Git-Tag: Approx_11550_changesets_converted~2097 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=787d1071615b42b191ace5b1eeced66891841fe5;p=ghc-hetmet.git [project @ 2002-04-25 18:48:02 by panne] Ooops, I mixed up PowerPC and SPARC ABIs: On SPARC the stack is always double-word aligned (quad-word on PowerPC), so the "fully correct" solution is very probably really correct. => Fixed the comment. :-} --- diff --git a/ghc/rts/Adjustor.c b/ghc/rts/Adjustor.c index b6887ad..72cc3b6 100644 --- a/ghc/rts/Adjustor.c +++ b/ghc/rts/Adjustor.c @@ -193,9 +193,13 @@ createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr) machinery should then work in all cases. (Or would it? Perhaps it would trash parts of the caller's frame. Dunno). - SUP, 25 Apr 02: Alas, the "fully correct" solution above is only - half correct: "%sp has to be 16-byte aligned at all time", the - almighty ABI spec says... + SUP, 25 Apr 02: We are quite lucky to push a multiple of 8 bytes in + front of the existing arguments, because %sp must stay double-word + aligned at all times, see: http://www.sparc.org/standards/psABI3rd.pdf + Although we extend the *caller's* stack frame, this shouldn't cause + any problems for a C-like caller: alloca is implemented similarly, and + local variables should be accessed via %fp, not %sp. In a nutshell: + This should work. (Famous last words! :-) */ if ((adjustor = stgMallocBytes(4*(8+1), "createAdjustor")) != NULL) { unsigned long *const adj_code = (unsigned long *)adjustor;