re PR tree-optimization/18527 (cannot determine number of iterations for loops with <=)
authorZdenek Dvorak <dvorakz@suse.cz>
Fri, 6 Jan 2006 20:22:56 +0000 (21:22 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Fri, 6 Jan 2006 20:22:56 +0000 (20:22 +0000)
commita6f778b21e8ed7c51e7b7fea73e2105c0996095c
tree2f80a9e9f7dc377dcb9bdd829e0f2a5a8d6c28d9
parent782e98753b7ce46cc3fa79253d57b3365149fa54
re PR tree-optimization/18527 (cannot determine number of iterations for loops with <=)

PR tree-optimization/18527
* tree-ssa-loop-niter.c (number_of_iterations_cond,
number_of_iterations_special, number_of_iterations_exit):
Move base and step of an iv to a single structure.  Add
no_overflow flag, and use it in # of iterations analysis.
* tree-scalar-evolution.c (analyze_scalar_evolution_in_loop): Add
folded_casts argument.
(simple_iv): Pass base and step in a structure.  Set no_overflow
flag.
(scev_const_prop): Add argument to analyze_scalar_evolution_in_loop.
Evaluate expensiveness of computing # of iterations instead of
the final expression.
* tree-scalar-evolution.h (affine_iv): New structure.
(simple_iv): Declaration changed.
* tree-chrec.c (chrec_apply): Handle chrecs containing symbols.
* tree-ssa-loop-ivopts.c (determine_biv_step, find_givs_in_stmt_scev,
find_givs_in_stmt): Changed due to simple_iv change.

* gcc.dg/tree-ssa/loop-15.c: New test.

From-SVN: r109427
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/loop-15.c [new file with mode: 0644]
gcc/tree-chrec.c
gcc/tree-scalar-evolution.c
gcc/tree-scalar-evolution.h
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-loop-niter.c