Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!linus!philabs!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.bugs.4bsd Subject: /lib/c2 bug in 4.1 Message-ID: <3905@umcp-cs.UUCP> Date: Fri, 18-Nov-83 18:07:18 EST Article-I.D.: umcp-cs.3905 Posted: Fri Nov 18 18:07:18 1983 Date-Received: Sat, 19-Nov-83 23:49:21 EST Organization: Univ. of Maryland, Computer Science Dept. Lines: 40 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@umcp-cs ARPA: chris.umcp-cs@CSNet-Relay