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.

Reply via email to