[EMAIL PROTECTED] (Richard Kenner)  wrote on 12.08.05 in <[EMAIL PROTECTED]>:

> What has to happen is that we need some sort of way of indicating that it's
> not permissible to derive information through a particular conversion.

That may be the only practical solution, but it seems to me it's not the  
perfect solution.

The point is that there are two different kinds of value range  
calculations. You have value range information from program flow, and you  
have value range information from types.

You want 'Valid optimization to ignore range information from types,  
because that's what you're checking for in the first place.

On the other hand, you *want* to use range information from program flow.  
For example, if you just assigned a constant, you *know* the exact range  
of the thing. Or maybe you already passed a program point where any out-of- 
range value would have been caught by an implicit 'Valid. It could  
optimize away a lot of implicit 'Valid checks done, say, on the same  
variable used as an array index multiple times.

Now that is certainly nontrivial to implement, and may not be worth it for  
gcc. But I believe it would be better than the other way.

MfG Kai

Reply via email to