gcc/testsuite/ChangeLog:
* gcc.dg/Warray-bounds-35.c: New test.
From-SVN: r263822
+2018-08-23 Martin Sebor <msebor@redhat.com>
+
+ PR tree-optimization/87072
+ * gcc.dg/Warray-bounds-35.c: New test.
+
2018-08-23 Richard Biener <rguenther@suse.de>
PR middle-end/87024
--- /dev/null
+/* PR tree-optimization/87072 - g++6.2.0 false warning: array subscript
+ is above array bounds, with misleading line number
+ { dg-do compile }
+ { dg-options "-O3 -Wall" } */
+
+int a[10];
+
+void f (unsigned n)
+{
+ for (unsigned j = 0; j < n; j++) {
+ for (unsigned k = 0; k < j; k++)
+ a[j] += k; /* { dg-bogus "\\\[-Warray-bounds]" } */
+ a[j] += j;
+ }
+}