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