-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-8437
-
-
-
default
The attached source file is a complete single file program. It has this line ...
fxdLogX = -6 * (X - 5000) * (X - 5000) + 120040 * (X - 5000) - 1682360000;
It appears two times in slightly different contexts. The code generated for each appearance of this expression is quite different. The results computed are unexpectedly different.
Build the program ...
% cl6x -mv6500 -g -s -o1 main.c -z -o main.out -m main.map <Linking>
When it is executed ...
Fail! x = 2000 func_fail(x) = 439698000 func_pass(x) = -419296000 Assertion failed, (0), file main.c, line 66
The value 2000 is used because it does not cause the expression to overflow. The func_fail and func_pass lines should show the same value. The Assertion line should not appear.