From 7ce7896c390e4c3d4bfacf41bcfa6170e3c9adb8 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 9 Sep 2005 13:31:16 +0200 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/tree-chrec.c | 13 ++++++++++--- 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 + * 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 + * 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))) { -- 2.7.4