/lib/c2 bug in 4.1
chris at umcp-cs.UUCP
chris at umcp-cs.UUCP
Sat Nov 19 09:07:18 AEST 1983
Index: 4.1 lib/c2
Description:
/lib/c2 will, in certain cases (which the compiler never generates by
itself, it seems) eat labels that are needed. Compiling the following
program demonstrates the bug.
(For the curious: this came up in an experiment to determine just
how much less efficient it is to use calls/ret rather than jsb/rsb.
The answer? Much, much, less efficient, at least when there are no
parameters. Looks like about 13 usec / call difference. Haven't
gotten to parameters yet...)
Repeat-By:
main () {
register int i = 100000;
while (--i >= 0)
asm ("jsb foo");
exit (0);
}
foo () {
/*
* The symbol L22: is eaten by c2, even though it is
* being used by the jbr generated at the top of the
* function (the one for getting stack space).
*/
/* asm ("L22:"); /* get around c2 bug */
asm ("foo:.globl foo");
asm ("rsb");
}
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris.umcp-cs at CSNet-Relay
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list