diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-03 11:51:36 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-03 11:51:36 +0000 |
commit | 663608f58b3a0be4a195fbcb2b2b7c1dbad9818c (patch) | |
tree | 4e849176d532002d0c8d07318e28dbf4d03df03c /gcc/tree-chrec.c | |
parent | 9c6bada3cc58aca3bd3182dd897598aaccd7473d (diff) | |
download | gcc-663608f58b3a0be4a195fbcb2b2b7c1dbad9818c.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132835 138bc75d-0d04-0410-961f-82ee72b054a4
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) |