Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!decwrl!ucbvax!ucsfcgl!pixar!mccoy From: mccoy@pixar.UUCP (Daniel McCoy) Newsgroups: comp.unix.ultrix Subject: Re: Warning! Compiler Bug (DecSt.3100) Message-ID: <7830@pixar.UUCP> Date: 22 Nov 89 22:06:11 GMT References: <458@tron.UUCP> <473@contex.UUCP> Reply-To: mccoy@pixar.UUCP (Daniel McCoy) Organization: Pixar -- Marin County, California Lines: 16 In article <473@contex.UUCP> chris@contex.UUCP (Chris Anderson) writes: >The following program, when compiled on the DecStation 3100, >produces d=0, when it should be d=1: > > unsigned a = 2, d; > int b = 1, c = 1; > > d = (c >= (b - a + 1)); ... >(Note, this happens even without -O). Voila! Bad code. It is the optimizer. The default optimization level is -O1 The program produces d=1 when compiled with -O0 to turn off all optimization. Dan McCoy Pixar {ucbvax,sun}!pixar!mccoy