Using distributive property to optimize.

Chuck L. Peterson clp at altos86.Altos.COM
Sat Feb 3 09:29:21 AEST 1990


We just noticed that this old 286 XENIX compiler we have floating
around changes the statement:
	n = a - (b + c);
To this:
	n = a - b - c;

Anyone know if it is valid for a C Compiler to do this?
The two will most certainly give different results when
dealing with overflow/underflow conditions.

Chuck L. Peterson
clp at altos.com



More information about the Comp.lang.c mailing list