See the regression tests under this number.
The front end optimises division by a constant power of two as in:
volatile int left;
left = -18;
ASSERT(left/4 == (-18/4));
However, if left is negative then shifting and division are not equivalent.
The optimisation still holds if left is unsigned.
Log in to post a comment.