Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!rice!sun-spots-request From: mrm@puffin.eng.sun.com (Marianne Mueller) Newsgroups: comp.sys.sun Subject: Sun3 optimizer bug fixed in "next release" Keywords: Software Message-ID: <8305@brazos.Rice.edu> Date: 30 May 90 21:55:58 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 33 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 9, Issue 187, message 14 Yup, bug in the 4.1 sun3 cc for the program #include "stdio.h" cgf2(x) { int dir, step, steps; (void) printf("%d\n", x); steps = (x == 50) ? 2 : 0; dir = -1; for (step = steps; step > 0; --step) cgf2(x + dir * step); } main() { cgf2(50); } This bug, alas, seems to be present in C 1.0, but gladly, is fixed in the "next release", for which alpha is just begun. total proof: mrm% /usr/lang/SC1.0/cc -O4 optbug.c mrm% a.out 50 48 49 As you say, the workaround is to compile at -O1.