mrm@puffin.eng.sun.com (Marianne Mueller) (05/31/90)
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.