Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!rutgers!mephisto!prism!sun13!hudgens From: hudgens@sun13.scri.fsu.edu (Jim Hudgens) Newsgroups: comp.sys.dec Subject: Re: Compiler Bug Message-ID: <327@sun13.scri.fsu.edu> Date: 30 Jul 90 14:20:37 GMT References: <3152@rwthinf.UUCP> <5889@crltrx.crl.dec.com> Distribution: na Organization: SCRI, Florida State University Lines: 50 How about this one. Under Ultrix 4.0, we get this behavior: $ cat bug.c #include main() { int d; double f; long l; int i; i = 4; f = 244.0; l = 2000; d = l * i/f; printf("%d * %d / %f = %d\n", l, i, f, d); } $ cc bug.c $ a.out 2000 * 4 / 244.000000 = 32 $ cc -O3 bug.c $ a.out Segmentation fault It seems to be crashing in the printf. Nothing obvious in the assembly listing. Yet under Ultrix 3.1d, we get: $ cc bug.c $ a.out 2000 * 4 / 244.000000 = 32 $ cc -O3 bug.c $ a.out 2000 * 4 / 244.000000 = 32 $ This code is condensed from a fairly large program and was found by a scientist here. --- Disclaimer: I didn't do it. Jim Hudgens Supercomputer Computations Research Institute hudgens@sun13.scri.fsu.edu -- --- Disclaimer: I didn't do it. Jim Hudgens Supercomputer Computations Research Institute hudgens@sun13.scri.fsu.edu