Commit 6906ea8b by Martin Sebor Committed by Martin Sebor

PR tree-optimization/87072 - false warning: array subscript is above array bounds

gcc/testsuite/ChangeLog:
	* gcc.dg/Warray-bounds-35.c: New test.

From-SVN: r263822
parent 464c1bd8
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
......
/* 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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment