-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-7141
-
-
-
default
-
Use an --opt_for_speed value less than 3.
-
The attached file contains this expression ...
DataRes = (DatastructPtr->b*10)/3;
The structure member b contains 15, so the correct result is 50.
Build it ...
% cl2000 -@options.txt try1.c
By looking at the compiler generated comments in the assembly file, you can see this divide expression is changed into ...
DataRes = ((long)(*DatastructPtr).b*5463L>>14)-((long)((*DatastructPtr).b*10)>>31);
The result of this expression is 5, which is incorrect.