diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2008-03-03 11:51:36 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2008-03-03 11:51:36 +0000 |
commit | 6a732743bdccfe0eac5e67d90ef5ee5fe70dfe35 (patch) | |
tree | 4e849176d532002d0c8d07318e28dbf4d03df03c /gcc/tree-chrec.c | |
parent | 9310e5e3189bad87ed8eb2bc1e53a0a0be0c5524 (diff) | |
download | gcc-6a732743bdccfe0eac5e67d90ef5ee5fe70dfe35.tar.gz |
tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME defined in a loop at depth 0 is invariant.
* tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME
defined in a loop at depth 0 is invariant.
* tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Should never
be called at loop depth 0.
From-SVN: r132835
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 37b7c0d671d..295fb7920c9 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -948,8 +948,9 @@ evolution_function_is_invariant_rec_p (tree chrec, int loopnum) if (evolution_function_is_constant_p (chrec)) return true; - if (TREE_CODE (chrec) == SSA_NAME - && expr_invariant_in_loop_p (get_loop (loopnum), chrec)) + if (TREE_CODE (chrec) == SSA_NAME + && (loopnum == 0 + || expr_invariant_in_loop_p (get_loop (loopnum), chrec))) return true; if (TREE_CODE (chrec) == POLYNOMIAL_CHREC) |