comparison gcc/testsuite/gcc.dg/Warray-bounds-35.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* PR tree-optimization/87072 - g++6.2.0 false warning: array subscript
2 is above array bounds, with misleading line number
3 { dg-do compile }
4 { dg-options "-O3 -Wall" } */
5
6 int a[10];
7
8 void f (unsigned n)
9 {
10 for (unsigned j = 0; j < n; j++) {
11 for (unsigned k = 0; k < j; k++)
12 a[j] += k; /* { dg-bogus "\\\[-Warray-bounds]" } */
13 a[j] += j;
14 }
15 }