IBM PC/RT pl8cc compiler and stack frames
Bjorn Engsig
bengsig at orcenl.uucp
Fri Jan 20 21:23:57 AEST 1989
I'm sorry about cross-posting this to comp.lang.c, but I am not sure that
I will reach all the right persons if only posting to comp.sys.ibm.pc.rt.
Please follow up to comp.sys.ibm.pc.rt only, or mail replies to me.
We are doing compilation of our software with the pl8 C compiler, and it
seems, that it generates wrong stack frame code in certain static functions.
According to the assembler manual (dated November 1985), all routines should
decrement the stack frame (stack grows down) if it needs space on the stack
for local variables or if it calls other routines. The following
routine produces however NO stack frame decrements, when compiled with pl8cc:
static void stat_func(a,b,c)
int a,b,c;
{
sub_func(a,b,c);
other_func(1000);
}
If I remove the static, the stack frame decrement is produced. It seems to
me, that the routine above uses the 5 word reserved area on the stack to
save GPR 15 (the return address). Again according to the assembler manual,
these 5 words should not be used.
Does anyone have any comments or similar experiences, please let me know.
I can provide you with more detailed testprograms, etc.
I use options -qlist -O to pl8cc, and our pl8cc is dated 87/09/10, i.e.
the following line is in the .list file:
COMPILER WAS CREATED 87/09/10 19:14:24
If you could provide me with more information on the DF06 to DF09 assembler
codes, it would (probably) help me a lot. The only information I have is
from /usr/include/sys/debug.h, since my assembler manual only mentions DF00 to
DF05.
That's all for now!
--
Bjorn Engsig, ORACLE Europe \ / "Hofstadter's Law: It always takes
mcvax!orcenl!bengsig at uunet.UU.NET X longer than you expect, even if you
phone: +31 21 59 56 411 / \ take into account Hofstadter's Law"
More information about the Comp.lang.c
mailing list