diff options
author | rus <rus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-09 20:58:24 +0000 |
---|---|---|
committer | rus <rus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-09 20:58:24 +0000 |
commit | 7f4db7c80779ecbc57d1146654daf0acfe18de66 (patch) | |
tree | 3af522a3b5e149c3fd498ecb1255994daae2129a /gcc/tree-scalar-evolution.c | |
parent | 611349f0ec42a37591db2cd02974a11a48d10edb (diff) | |
download | gcc-profile-stdlib.tar.gz |
merge from trunkprofile-stdlib
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/profile-stdlib@154052 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 02a4eed646e..70af0fda610 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -1492,18 +1492,29 @@ analyze_evolution_in_loop (gimple loop_phi_node, bb = gimple_phi_arg_edge (loop_phi_node, i)->src; if (!flow_bb_inside_loop_p (loop, bb)) continue; - + if (TREE_CODE (arg) == SSA_NAME) { + bool val = false; + ssa_chain = SSA_NAME_DEF_STMT (arg); /* Pass in the initial condition to the follow edge function. */ ev_fn = init_cond; res = follow_ssa_edge (loop, ssa_chain, loop_phi_node, &ev_fn, 0); + + /* If ev_fn has no evolution in the inner loop, and the + init_cond is not equal to ev_fn, then we have an + ambiguity between two possible values, as we cannot know + the number of iterations at this point. */ + if (TREE_CODE (ev_fn) != POLYNOMIAL_CHREC + && no_evolution_in_loop_p (ev_fn, loop->num, &val) && val + && !operand_equal_p (init_cond, ev_fn, 0)) + ev_fn = chrec_dont_know; } else res = t_false; - + /* When it is impossible to go back on the same loop_phi_node by following the ssa edges, the evolution is represented by a peeled chrec, i.e. the |