-
Bug
-
Resolution: Cannot Reproduce
-
Not Prioritized
-
Code Generation Tools
-
CODEGEN-9041
-
-
-
default
-
No error observed in submitted test case
The attached test case has these two source lines ...
iTempLAAx = (int)((int)CurU - (int)32612); ... iTempLAAx = (int)((int)CurW - (int)32612);
Build it ...
% cl2000 -@options.txt file.c
Inspect the assembly code associated with these statements. Here is the code for the first statement ...
;---------------------------------------------------------------------- ; 21044 | iTempLAAx = (int)((int)CurU - (int)32612); ;---------------------------------------------------------------------- MOVL ACC,@_CurU ; [CPU_ALU] |21044| SETC SXM ; [CPU_ALU] SUB AL,#32612 ; [CPU_ALU] |21044| MOV ACC,AL ; [CPU_ALU] |21044| MOVL *-SP[2],ACC ; [CPU_ALU] |21044|
CurU is a 32-bit global variable. All of it is loaded into the accumulator. But because of the (int) cast, only the lower part should be loaded.