View Single Post
Posts: 362 | Thanked: 426 times | Joined on Nov 2010 @ Italy, Lombardia
#122
Originally Posted by mirakels View Post
Yes it will be the same and probably will be compiled away.
But in this form it will show the weirdness of needing to scroll way beyond
the actual framebuffer.
It is the same only for values smaller than 2^(n-2), where n is the number of bits contained on you variable/constant (8, 16, 32 or 64).
So compiler can optimize (and remove useless operations) only if it is a constant and the fixed value assigned is less then 2^(n-2) alias 1,073,741,824 for an integer costant

Last edited by Fabry; 2011-10-09 at 20:21.