aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-chrec.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e9295e6..b0294d4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2005-09-09 Sebastian Pop <pop@cri.ensmp.fr>
+ * tree-chrec.c (evolution_function_is_invariant_rec_p): Use
+ CHREC_LEFT and CHREC_RIGHT for accessing chrec components instead
+ of wrongly accessing operands.
+
+2005-09-09 Sebastian Pop <pop@cri.ensmp.fr>
+
* Makefile.in (tree-chrec.o): Depends on SCEV_H.
* tree-chrec.c: Include tree-scalar-evolution.h.
(chrec_convert): Instantiate the base and step before calling
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 3324c8b..88b27d8 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)))
{