[PATCH][2/2] Improve array-bound warnings and VRP

Richard Biener rguenther@suse.de
Mon Jan 26 16:08:00 GMT 2015


On Mon, 26 Jan 2015, Jakub Jelinek wrote:

> On Mon, Jan 26, 2015 at 04:06:11PM +0100, Richard Biener wrote:
> > 
> > This is the 2nd thing I came up with after looking at PR64277.
> > VRP does a poor job computing value-ranges of unrolled loop IVs
> > thus a very simple thing to do is to factor in previous VRP results
> > by intersecting what VRP2 computes with recorded SSA name range infos
> > (that also makes errors in those more likely to pop up... :/).
> > 
> > This reduces the number of array bound warnings I get from the testcase
> > but doesn't fix it completely.  It also ends up with saner value-ranges.
> > 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu (with one
> > libstdc++ runtime failure which I am now checking if caused by the patch,
> > and thus likely an existing latent issue with SSA name range info).
> > 
> > Ok for trunk?  Or should I delay this to GCC 6?
> 
> Does this work even without the other patch?

Yes, I've actually developed 2/2 first.  The other patch only ever
emits more warnings...

> What do you think about Ilya's patch to set TREE_NO_WARNING in the unrolled
> iterations where we had to keep the exit check?

I don't like it too much - it papers over the real issue and prevents
valid warnings from being emitted.  Maybe we can set TREE_NO_WARNING on
the last iteration (that is the only one we usually end up warning
on - like after this patch).  There are also many dups - regressions
in 4.8 I belive where we warn for the last iteration in an unrolled loop.

Richard.



More information about the Gcc-patches mailing list