[Bug other/85398] g++ reports "array subscript is above array bounds" when it cannot be sure

2018-04-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398 --- Comment #4 from Martin Sebor --- A simpler test case is this (which is analogous to what the loop is transformed into): $ cat x.c && gcc -O2 -S -Wall x.c unsigned left[1]; unsigned long right[1]; void f (unsigned i) { if (i)

[Bug other/85398] g++ reports "array subscript is above array bounds" when it cannot be sure

2018-04-18 Thread patrickdepinguin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398 --- Comment #3 from Thomas De Schampheleire --- (In reply to Richard Biener from comment #2) > > We could change the warning to have a "may be above array bounds" form > for your case but that wouldn't handle the bar() case. The problem with

[Bug other/85398] g++ reports "array subscript is above array bounds" when it cannot be sure

2018-04-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398 --- Comment #2 from Richard Biener --- This is the simple case of GCC optimizing the access to a constant: [50.00%]: max.0_11 = max; if (max.0_11 > 1) goto ; [50.00%] else goto ; [50.00%] [25.00%]: _13 = right[0];

[Bug other/85398] g++ reports "array subscript is above array bounds" when it cannot be sure

2018-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85398 Martin Sebor changed: What|Removed |Added Keywords||diagnostic, |