From: | Alastair M. Robinson |
Date: | 21 Sep 2000 at 19:57:58 |
Subject: | Re: Stack |
Hi Allan,
> The compilers I know use link & unlink to allocate space for local
> variables, so even though the space is taken from the stack then it
> isn't indexed using the stack pointer register (A7).
Good point. So for which compilers is this true?
Gunther says it's not true for SAS/C V6+, or GCC with certain options; my
experiments suggest it's not true for VBCC.
Am I right in thinking you were talking about StormC?
Anyone know about Maxon, Hisoft, Aztec (Colin?), DICE and NorthC?
The other potential disaster is the compiler generating code like:
move.l #newstack,-(a7)
jsr (_LVOStackSwap,a6)
adda.l #4,a7
which is why I suggested leaving some slop at the top of the new stack...
All the best,
-- You know you've been hacking too long when...
...in non-computer related situation you start thinking that whatever you
are doing, it could be done more easily in a shell script.