aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2015-12-01 05:22:16 +0000
committerBin Cheng <amker@gcc.gnu.org>2015-12-01 05:22:16 +0000
commitcdf66caf4fa836a4398f74faceb373d84e019bb7 (patch)
treeb0feb2d5b46ce5a54088544843561463d10ac4f5 /gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c
parent6ea98dee208bef31e56452969bfa7e85d0dd3c36 (diff)
downloadgcc-cdf66caf4fa836a4398f74faceb373d84e019bb7.zip
gcc-cdf66caf4fa836a4398f74faceb373d84e019bb7.tar.gz
gcc-cdf66caf4fa836a4398f74faceb373d84e019bb7.tar.bz2
re PR tree-optimization/68529 (scev failed for while(i--))
PR tree-optimization/68529 * tree-ssa-loop-niter.c (number_of_iterations_ne): Add new param. Compute no-overflow information for control iv. (number_of_iterations_lt, number_of_iterations_le): Add new param. (number_of_iterations_cond): Pass new argument to above functions. PR tree-optimization/68529 * gcc.dg/tree-ssa/pr68529-1.c: New test. * gcc.dg/tree-ssa/pr68529-2.c: New test. * gcc.dg/tree-ssa/pr68529-3.c: New test. From-SVN: r231097
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c
new file mode 100644
index 0000000..6d57618
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68529-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
+
+void bar(char *s);
+int foo(unsigned short l)
+{
+ char c[10000] = {};
+ unsigned short nchar = 9999;
+
+ if (nchar <= l)
+ return -1;
+
+ while(nchar-- != l)
+ {
+ c[nchar] = 'A';
+ }
+
+ bar (c);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "distributed: split to 0 loops and 1 library calls" "ldist" } } */
+/* { dg-final { scan-tree-dump "generated memset" "ldist" } } */