--- Comment #7 from Steven Schveighoffer <> 2011-07-13 
13:27:56 PDT ---
(In reply to comment #6)
> There is no way VRP will support this. After the statement 'int x = 1', the
> information that 'x == 1' is lost. We don't have data flow analysis. So in the
> expression '1 / x', x is treated as having the complete range of 'int'.

I was taking this into account.

if the divisor is zero, you get a floating point exception (i.e. SIGFPE), so
VRP is able to safely use [-1, 1] as the range.

Technically, the set of possible values is [1, -1, undefined], and we can
simply ignore the undefined part for VRP.

Indeed the example is quite questionable, but I suppose if you know none of the
values are 0, it's valid code.

In any case, I don't think VRP is the answer to the problem.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to