This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][2/2] Improve array-bound warnings and VRP
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 26 Jan 2015 16:31:56 +0100
- Subject: Re: [PATCH][2/2] Improve array-bound warnings and VRP
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1501261602400 dot 12482 at zhemvz dot fhfr dot qr> <20150126151033 dot GP1746 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1501261615390 dot 12482 at zhemvz dot fhfr dot qr> <20150126152337 dot GQ1746 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1501261625300 dot 12482 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 26, 2015 at 04:28:02PM +0100, Richard Biener wrote:
> Sure - but for unrolling
>
> int a[2];
> for (int i = 0; i < 5; i++)
> a[i] = i;
>
> I'd like to see warnings and we only warn if we unroll this because
> the value-range of i includes indexes that are valid.
Don't we warn here for -Waggressive-loop-optimizations already?
> > IMHO the warning should be done in VRP1 only.
>
> Yeah, I agree - but I remember that people wanted the extra stuff
> from VRP2 (just quickly checked that gcc.dg/Warray-bounds* doesn't
> regress with disabling VRP2).
>
> So - do we want to disable array bound warnings for VRP2? I'd be
> happy to approve of that and it will most certainly fix all of the
> recent (4.8+) regressions related to loop peeling.
That would be my preference, if not many people complain about that.
People can use -fsanitize=undefined if they want more accurate and detailed
out of bounds checking anyway, and/or -fsanitize=address.
Jakub