summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-02 16:34:52 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-02 16:34:52 +0000
commit72276d01ede840f437b084eb0f89495f0d69f49f (patch)
treef422408bb685a50d53e449a1a6c13e851119cfe9 /gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
parentb73e53043ae7c29b715538961c8af71e22727585 (diff)
downloadgcc-72276d01ede840f437b084eb0f89495f0d69f49f.tar.gz
PR middle-end/55079
* tree-ssa-loop-niter.c (number_of_iterations_exit): Update MAX field if NITER was folded to contant. (record_estimate): Sanity check. * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): New function. (remove_redundant_iv_test): New function. (loops_to_unloop, loops_to_unloop_nunroll): New static vars. (unloop_loops): Break out from ... (try_unroll_loop_completely): ... here; Pass in MAXITER; use remove_exits_and_undefined_stmts; do not unloop. (canonicalize_loop_induction_variables): Compute MAXITER; use remove_redundant_iv_test; remove loop_close_ssa_invalidated and irred_invalidated arguments. (canonicalize_induction_variables): Compute fresh bound estimates; unloop; walk from innermost. (tree_unroll_loops_completely): Likewise. * gcc.dg/tree-ssa/cunroll-10.c: New testcase. * gcc.dg/tree-ssa/cunroll-9.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
new file mode 100644
index 00000000000..3205b8d3965
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-9.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-cunrolli" } */
+void abort (void);
+int a[10];
+int b[11];
+t (int n)
+{
+ int i;
+ int sum = 0;
+ for (i = 0; i < n; i++)
+ {
+ if (i > 1000)
+ abort ();
+ if (q ())
+ sum += a[i];
+ else
+ sum += b[i];
+ }
+ return sum;
+}
+/* { dg-final { scan-tree-dump-times 1 "Removed pointless exit:" "cunroli" } } */
+/* { dg-final { cleanup-tree-dump "cunroli" } } */