Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site vaxine.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!talcott!panda!genrad!decvax!wanginst!vaxine!jwf From: jwf@vaxine.UUCP (Jim Franklin) Newsgroups: net.unix-wizards Subject: bug related to "cc -p" on SUN's Message-ID: <612@vaxine.UUCP> Date: Thu, 1-Aug-85 11:28:06 EDT Article-I.D.: vaxine.612 Posted: Thu Aug 1 11:28:06 1985 Date-Received: Sat, 3-Aug-85 05:46:53 EDT Organization: Automatix, Inc., Billerica, MA Lines: 27 There is a bug related to the C profiler switch (i.e., cc -p) on SUN Microsystems 4.2BSD systems. Take the following C program and call it "junk.c". main () { int i, j; i = -2147483648; j = i / 10; printf ("%d\n", j); } Then do the following on your SUN: > cc junk.c -o junk > junk -214748364 (right) > cc -p junk.c -o junk > junk 214748364 (oops) We are running 4.2BSD, SUN version 1.2. This works fine on our VAXen. I looked at the .s files for the profiled and normal compile, the only difference is the mcount call. The SUN compiler calls ldivt() to do the integer divide. I suspect that the problem is in the ldivt() you get from the profiling version of libc.a (/usr/lib/libc_p.a).