🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.usg
Article #17

Bugs in profiling and C compile on PDP-11

#17
From: utzoodecvaxharponpoivnpoishouxmh...
Date: Mon, 07 Mar 1983 23:03
22 lines
1396 bytes
Profiling doesn't work for programs with text sizes greater than 32K bytes
on the PDP-11.  There are two reasons for this.  First, rather than testing
for lowpc greater than highpc, the monitor routine subtracts the two and
tests the difference.  Since no error message is printed, the test doesn't
do much good anyway, so I just deleted it.  The second problem is a bug
in the code generator for the C compiler.  In the assignment to text, it
compiles the shift operator into a signed shift rather than an unsigned
shift.  I haven't found the bug in the C compiler, but it can be sidestepped
by breaking the assignment up into two statements.  A diff of the two ver-
sions of the monitor routine is given below.
					Kenneth Almquist

$ diff /usr/src/lib/libc/pdp11/gen/mon.c mon.c
54,57c54,55
< 	if(bufsiz <= 0 || lowpc-highpc >= 0)
< 		return;
< 
< 	text = (unsigned)(highpc+1-lowpc)>>1;	/* No. WORD's of text*/
---
> 	text = (unsigned)(highpc+1-lowpc);	/* No. WORD's of text*/
> 	text >>= 1;
$ 
Technical Details
Message-ID: <bnews.spanky.231>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!npoiv!npois!houxm!houxa!houxi!houxz!hocda!spanky!ka
Newsgroups: net.bugs.usg
Title: Bugs in profiling and C compile on PDP-11
Article-I.D.: spanky.231
Posted: Mon Mar  7 23:03:18 1983
Received: Tue Mar  8 05:49:08 1983
Subject: Bugs in profiling and C compile on PDP-11
Date: Mon, 07 Mar 1983 23:03:18 +0000
Message-ID: <bnews.spanky.231>