[patch] tree-vrp.c: Compute a correct range when adding two pointers.

Kazu Hirata kazu@codesourcery.com
Thu Jun 23 15:48:00 GMT 2005


Hi Jeff,

> Does this ever happen in practice?  While I can follow the reasoning
> which leads to a non-null result for R, I have a hard time seeing
> this happening often enough in real code to matter.

No, I don't think this happens often enough.  In fact, I found this 
problem while working on another VRP problem, namely PR 22026, but I 
don't think that allows us to walk away from the problem.

> If you want to do something interesting with VRP you might look at
> extracting ranges from BIT_AND_EXPRs -- that's relatively common and
> can often lead to further optimizations, particularly when the
> BIT_AND_EXPR turns off the sign bit or constrains a result to a 
> smaller type.

Ah, that's interesting.  I might actually look into this.

Kazu Hirata



More information about the Gcc-patches mailing list