aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2015-01-28 14:16:01 +0300
committerAlexander Ivchenko <alexander.ivchenko@intel.com>2015-01-28 15:41:39 +0300
commit63fd708bd182b50b37b9f64fa330458c9109380a (patch)
tree2799a45bf3f48cd9f4039d79aa82b5c0b2189f6a /gcc-4.9/gcc/testsuite/g++.dg
parent866bd0b46cd84957df84e7a3e674d9777807b7f7 (diff)
downloadtoolchain_gcc-63fd708bd182b50b37b9f64fa330458c9109380a.tar.gz
toolchain_gcc-63fd708bd182b50b37b9f64fa330458c9109380a.tar.bz2
toolchain_gcc-63fd708bd182b50b37b9f64fa330458c9109380a.zip
[4.9] Fix bogus warnings about array-bounds.
2015-01-28 Ilya Enkovich <ilya.enkovich@intel.com> PR tree-optimization/64277 * tree-ssa-loop-niter.c (record_nonwrapping_iv): Use base range info when possible to refine estimation. 2015-01-27 Richard Biener <rguenther@suse.de> PR tree-optimization/56273 PR tree-optimization/59124 PR tree-optimization/64277 * tree-vrp.c (vrp_finalize): Emit array-bound warnings only from the first VRP pass. * g++.dg/warn/Warray-bounds-6.C: New testcase. * gcc.dg/Warray-bounds-12.c: Likewise. * gcc.dg/Warray-bounds-13.c: Likewise. Change-Id: I175b420a4c8150ecf986d477e4c51cbbff276c82 Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
new file mode 100644
index 000000000..f2e5f2f59
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Warray-bounds-6.C
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// { dg-options "-O3 -Warray-bounds" }
+
+struct type {
+ bool a, b;
+ bool get_b() { return b; }
+};
+
+type stuff[9u];
+
+void bar();
+
+void foo()
+{
+ for(unsigned i = 0u; i < 9u; i++)
+ {
+ if(!stuff[i].a)
+ continue;
+
+ bar();
+
+ for(unsigned j = i + 1u; j < 9u; j++)
+ if(stuff[j].a && stuff[j].get_b()) // { dg-bogus "above array bounds" }
+ return;
+ }
+}