This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds"
- From: "enkovich.gnu at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Jan 2015 13:28:03 +0000
- Subject: [Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds"
- Auto-submitted: auto-generated
- References: <bug-64277-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64277
Ilya Enkovich <enkovich.gnu at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |enkovich.gnu at gmail dot com
--- Comment #7 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
Here is a reduced test case:
>cat test.c
int f1[10];
void foo(short a[], short m, unsigned short l)
{
int i = l;
for (i = i + 5; i < m; i++)
f1[i] = a[i]++;
}
>gcc test.c -O3 -c -Wall
test.c: In function 'foo':
test.c:6:7: warning: array subscript is above array bounds [-Warray-bounds]
f1[i] = a[i]++;
^
test.c:6:7: warning: array subscript is above array bounds [-Warray-bounds]
test.c:6:7: warning: array subscript is above array bounds [-Warray-bounds]
test.c:6:7: warning: array subscript is above array bounds [-Warray-bounds]
test.c:6:7: warning: array subscript is above array bounds [-Warray-bounds]
Here we have complete unroll of the loop by 10 due to f1 size. Later vrp
complains of last five produced iterations accessing above array bounds.
Used GCC 5.0.