https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64277
Bug ID: 64277
Summary: [4.9/5.0 Regression] Incorrect warning "array
subscript is above array bounds"
Product: gcc
Version: 4.9.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: aivchenk at gmail dot com
>cat test.c
void foo(short a[], short m)
{
int i, j;
int f1[10];
short nc;
nc = m + 1;
if (nc > 3)
{
for (i = 0; i <= nc; i++)
{
f1[i] = f1[i] + 1;
}
}
for (i = 0, j = m; i < nc; i++, j--)
{
a[i] = f1[i];
a[j] = i;
}
return;
}
>gcc -O3 -mssse3 -Wall
/export/users/aivchenk/src/gcc_obj/test.c:21:16: warning: array subscript is
above array bounds [-Warray-bounds]
a[i] = f1[i];
^
If compile with "-msse3" there is no warning.