This is the mail archive of the
mailing list for the GCC project.
Re: [patch] tree-vrp.c: Compute a correct range when addingtwo pointers.
On Thu, 2005-06-23 at 11:47 -0400, Kazu Hirata wrote:
> 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.
There's also a few cases were BIT_IOR_EXPR creates useful ranges
(such as when it turns on the sign bit).