summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-14 15:18:16 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-14 15:18:16 +0000
commit368ab101e6adf8b09b8c9652c4f0c9fcb1ce78d3 (patch)
tree871019a30b59d9e1b0d6fe583ffd1c9d728dd7ee
parent240a30d446683bc052852bdf4486dbfe037ba95b (diff)
downloadgcc-368ab101e6adf8b09b8c9652c4f0c9fcb1ce78d3.tar.gz
2017-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/66974 * gcc.dg/Warray-bounds-24.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255642 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-24.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 981c3a2771f..a053fcba4d0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2017-12-14 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/66974
+ * gcc.dg/Warray-bounds-24.c: New testcase.
+
+2017-12-14 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/65258
* gcc.dg/Warray-bounds-23.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-24.c b/gcc/testsuite/gcc.dg/Warray-bounds-24.c
new file mode 100644
index 00000000000..35631737647
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-24.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds" } */
+
+int foo(unsigned order)
+{
+ int c[3] = {1, 2, 3};
+ unsigned i, j;
+ for (i = 1; i < order; i++) {
+ for (j = 0; j < i / 2; j++) {
+ c[j] += c[i] * c[i-j-1]; /* { dg-bogus "array bounds" } */
+ c[i-j-1] += c[i] * c[j]; /* { dg-bogus "array bounds" } */
+ }
+ }
+ return c[0];
+}