aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2016-08-02 10:13:28 +0000
committerBin Cheng <amker@gcc.gnu.org>2016-08-02 10:13:28 +0000
commit69b806f6a60efcf150b995e418f08b96d26dd5dc (patch)
tree96e4edc600bc2e24873a666089d8219b03b880b5 /gcc/testsuite
parent4e2f2da341683a28aa56fae94bc38c2b6341a9ad (diff)
downloadgcc-69b806f6a60efcf150b995e418f08b96d26dd5dc.zip
gcc-69b806f6a60efcf150b995e418f08b96d26dd5dc.tar.gz
gcc-69b806f6a60efcf150b995e418f08b96d26dd5dc.tar.bz2
re PR tree-optimization/34114 (Missed optimization: cannot determine loop termination)
PR tree-optimization/34114 * tree-ssa-loop-niter.c (number_of_iterations_ne): Prove no-overflow information for more control IVs. gcc/testsuite PR tree-optimization/34114 * gcc.dg/tree-ssa/loop-42.c: New test. From-SVN: r238983
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-42.c36
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f5bd074..c1a98ec 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-02 Bin Cheng <bin.cheng@arm.com>
+
+ PR tree-optimization/34114
+ * gcc.dg/tree-ssa/loop-42.c: New test.
+
2016-08-02 Tamar Christina <tamar.christina@arm.com>
* gcc.target/aarch64/vminmaxnm.c: New.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-42.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-42.c
new file mode 100644
index 0000000..3f9d91a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-42.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ivcanon-details" } */
+
+void foo2 (unsigned int num, int *a)
+{
+ unsigned int i, n = (num - (num % 2));
+
+ for(i = 0; i != n; i += 2)
+ a[i] = 0;
+}
+
+void foo3 (unsigned int num, int *a)
+{
+ unsigned int i, n = (num - (num % 3));
+
+ for(i = 0; i != n; i += 3)
+ a[i] = 0;
+}
+
+void foo4 (unsigned int num, int *a)
+{
+ unsigned int i, n = (num - (num % 4));
+
+ for(i = 0; i != n; i += 4)
+ a[i] = 0;
+}
+
+void foo5 (unsigned int num, int *a)
+{
+ unsigned int i, n = (num - (num % 5));
+
+ for(i = 0; i != n; i += 5)
+ a[i] = 0;
+}
+
+/* { dg-final { scan-tree-dump-not "under assumptions " "ivcanon" } } */