On 1/24/2013 10:33 AM, Jeffrey Walton wrote:

In this case, I claim we must perform the operation. Its the result
that we can't use under some circumstances (namely, overflow or wrap).

You do not have to do the operation if the program has an
overflow. The compiler can reason about this, so for example

      a = b + 1;
      if (a < b) ...

The compiler can assume that the test is true, because the only
conceivable way it would be false is on an overflow that wraps,
but that's undefined. If a is not used other than in this test,
the compiler can also eliminate the addition and the assignment


Reply via email to