Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!sgi!deb@kea.wpd.sgi.com From: deb@kea.wpd.sgi.com (Deb Ryan) Newsgroups: comp.sys.sgi Subject: Re: C compiler optimization bug? Summary: Fixed in next release Message-ID: <56303@sgi.sgi.com> Date: 10 Apr 90 19:03:38 GMT References: <1990Apr7.190012.22354@jarvis.csri.toronto.edu> Sender: deb@kea.wpd.sgi.com Distribution: na Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 36 In article <1990Apr7.190012.22354@jarvis.csri.toronto.edu>, lansd@dgp.toronto.edu (Robert Lansdale) writes: > > --------------------------------------------------------------------------- > > /* Calculate weights and Col at each of the points */ > wt0 = xLowWt * yLowWt; > wt1 = xLowWt * yHighWt; > wt2 = xHighWt * yLowWt; > wt3 = xHighWt * yHighWt; > c0 = text[yLow * size + xLow]; > c1 = text[yHigh * size + xLow]; > c2 = text[yLow * size + xHigh]; > c3 = text[yHigh * size + xHigh]; > > /* Calculate averaged colour */ > col.r = (c0.r * wt0 + c1.r * wt1 + c2.r * wt2 + c3.r * wt3) / 255.0; > col.g = (c0.g * wt0 + c1.g * wt1 + c2.g * wt2 + c3.g * wt3) / 255.0; > col.b = (c0.b * wt0 + c1.b * wt1 + c2.b * wt2 + c3.b * wt3) / 255.0; > > #if 0 > printf("Weights: wt0 = %g, wt1 = %g, wt2 = %g, wt3 = %g\n", wt0, wt1, wt2, wt3); > printf("Red colours: 0 = %d, 1 = %d, 2 = %d, 3 = %d\n", c0.r, c1.r, c2.r, c3.r); > #endif > printf("Colour = %g, %g, %g\n", col.r, col.g, col.b); > > return (col); > } I've looked at an executable version of this code. There was an optimizer bug in 3.2. It has been fixed, and will be available in the next release. -Deb deb@sgi.com Deborah Ryan Caruso @ Silicon Graphics