http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55529
Bug #: 55529
Summary: Bogus array-bounds warning
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
% cat test.i
int *level[1];
int rcu_num_lvls;
void
fn1 ()
{
int i;
for (i = 1; i < rcu_num_lvls; i++)
level[i] = level[i - 1];
}
% gcc -Wall -O2 -c test.i
test.i: In function ‘fn1’:
test.i:8:14: warning: array subscript is above array bounds [-Warray-bounds]
level[i] = level[i - 1];
^