C compiler optimization bug?

Deb Ryan deb at kea.wpd.sgi.com
Wed Apr 11 05:03:38 AEST 1990


In article <1990Apr7.190012.22354 at jarvis.csri.toronto.edu>, lansd at 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 at sgi.com
 					 Deborah Ryan Caruso @ Silicon Graphics



More information about the Comp.sys.sgi mailing list