From: utzoo!decvax!harpo!seismo!dmy Newsgroups: net.unix-wizard,net.lang.c,net.misc Title: c2 (c optimizer) bug Article-I.D.: seismo.179 Posted: Tue Dec 14 16:48:43 1982 Received: Wed Dec 15 07:09:28 1982 /* The following program contains, as one line, the smallest version of a c-optimizer bug that I could construct. I looked at the erroneous assembler code produced by the optimizer, and this is definitely a compiler problem. Anyone know of this bug before? On our 4.1absd, running a.out after cc -O test.c produces 840. After cc test.c, it produces the correct value of 50. The bug (in the optimized object code) is a missing cvtdl (I believe). */ main() { float f; int n; f = 50.0; n = (int)f & 07777; /* this statement is the bug */ printf("%d\n",n); } /* --dmy-- */