Warning! Compiler Bug (DecSt.3100)
Daniel McCoy
mccoy at pixar.UUCP
Thu Nov 23 09:06:11 AEST 1989
In article <473 at contex.UUCP> chris at 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
More information about the Comp.unix.ultrix
mailing list