diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-08-24 11:37:50 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-08-24 11:37:50 +0000 |
commit | 506299fe7ab11594a15e2167c128ab0f7a8ec89c (patch) | |
tree | 2274b712d64b613fee77df4cf3b3a1b9aa159112 /rts/StgCRun.c | |
parent | af0d070b456efbb42da8f48f25a0c2928065a58c (diff) | |
download | haskell-506299fe7ab11594a15e2167c128ab0f7a8ec89c.tar.gz |
Sparc fix: work around gcc optimising away the reserved stack chunk
This bug causes crashse on Sparc when calling foreign functions with
more than 13 arguments.
Diffstat (limited to 'rts/StgCRun.c')
-rw-r--r-- | rts/StgCRun.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/StgCRun.c b/rts/StgCRun.c index c1afc16559..70c4bf04c5 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -328,13 +328,16 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { ".align 4\n" ".global " STG_RETURN "\n" STG_RETURN ":" - : : : "l0","l1","l2","l3","l4","l5","l6","l7"); + : : "p" (space) : "l0","l1","l2","l3","l4","l5","l6","l7"); /* we tell the C compiler that l0-l7 are clobbered on return to * StgReturn, otherwise it tries to use these to save eg. the * address of space[100] across the call. The correct thing * to do would be to save all the callee-saves regs, but we * can't be bothered to do that. * + * We also explicitly mark space as used since gcc eliminates it + * otherwise. + * * The code that gcc generates for this little fragment is now * terrible. We could do much better by coding it directly in * assembler. |