diff options
author | Sebastian Pop <pop@cri.ensmp.fr> | 2005-09-09 13:31:16 +0200 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2005-09-09 11:31:16 +0000 |
commit | 7ce7896c390e4c3d4bfacf41bcfa6170e3c9adb8 (patch) | |
tree | 9e6e96f7ddb875b5d7b4772af040fa1b3005dc67 /gcc/tree-chrec.c | |
parent | 18aed06a02f80320c60d5cd2ce1fc30b5b676eb1 (diff) | |
download | gcc-7ce7896c390e4c3d4bfacf41bcfa6170e3c9adb8.tar.gz |
tree-chrec.c (evolution_function_is_invariant_rec_p): Use CHREC_LEFT and CHREC_RIGHT for accessing chrec components instead of...
* tree-chrec.c (evolution_function_is_invariant_rec_p): Use
CHREC_LEFT and CHREC_RIGHT for accessing chrec components instead
of wrongly accessing operands.
From-SVN: r104093
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 3324c8bc2b7..88b27d84aa6 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -935,9 +935,16 @@ evolution_function_is_invariant_rec_p (tree chrec, int loopnum) chrec)) return true; - if (TREE_CODE (chrec) == POLYNOMIAL_CHREC - && CHREC_VARIABLE (chrec) == (unsigned) loopnum) - return false; + if (TREE_CODE (chrec) == POLYNOMIAL_CHREC) + { + if (CHREC_VARIABLE (chrec) == (unsigned) loopnum + || !evolution_function_is_invariant_rec_p (CHREC_RIGHT (chrec), + loopnum) + || !evolution_function_is_invariant_rec_p (CHREC_LEFT (chrec), + loopnum)) + return false; + return true; + } switch (TREE_CODE_LENGTH (TREE_CODE (chrec))) { |