Hi,

On Wed, 6 Nov 2013, Ilya Enkovich wrote:

> >>> Well, but clearly you can see that bounds for p == NULL are
> >>> useless and thus there is no problem with the transform.
> >>
> >> This example just demonstrates the issue. I may use some var's address
> >> in comparison with the similar result. And value does not always allow
> >> to determine bounds, because pointers with the same value may have
> >> different bounds.
> >
> > Some vars address can be used for better bounds deriving though.
> > Well, it clearly shows it's a "get me good results" issue and not
> > a correctness issue.  And for "good results" you trade in missed
> > general optimizations.  That doesn't sound very good to me.
> 
> That is definitely a correctness issue.  Compiler cannot assume bounds
> by pointer value ignoring bounds passed to the function.

Of course they can.  They assume "unbounded" for unknown bounds and emit 
correct code.  It's merely more conservative than you'd like (as the 
function got passed tighter bounds than unbounded), and hence no 
correctness but a QoI problem.


Ciao,
Michael.

Reply via email to