-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Urgent
-
Code Generation Tools
-
CODEGEN-15855
-
-
-
default
-
At the -O[s,z,2,3] optimization level, combinations of immediate left shift and right shift expressions of the form (x << N) >> 16 or (x << N) >> 24 where N is a immediate between 0-31 and x is any 32 bit value such as 'unsigned int' or 'int' may result in erroneous values.
Example Source:
// With the value of in being 0x2000 int shift_off_13(int in) { int x = in << 13; return x >> 16; }
The resulting value will become 1 instead of the correct value of 0x400.