aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-03-13 17:34:59 +0000
committerSebastian Pop <sebastian.pop@amd.com>2010-03-13 17:34:59 +0000
commit9c215d152ab47708271926eacd4cb16568b10e44 (patch)
tree59ee96a3f882ff306e3bca6a9946de2c16d2688d /gcc/tree-chrec.c
parent7eda1a17fb30a1a849d57784f3a01df10a4ae351 (diff)
Fix PR43306: correct evolution_function_right_is_integer_cst.
2010-03-09 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/43306 * tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT should be an INTEGER_CST. Also handle CASE_CONVERT. * gcc.dg/graphite/pr43306.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@157434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index c945f93190e..929bbc08e02 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1529,14 +1529,12 @@ evolution_function_right_is_integer_cst (const_tree chrec)
return true;
case POLYNOMIAL_CHREC:
- if (!evolution_function_right_is_integer_cst (CHREC_RIGHT (chrec)))
- return false;
-
- if (TREE_CODE (CHREC_LEFT (chrec)) == POLYNOMIAL_CHREC
- && !evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)))
- return false;
+ return TREE_CODE (CHREC_RIGHT (chrec)) == INTEGER_CST
+ && (TREE_CODE (CHREC_LEFT (chrec)) != POLYNOMIAL_CHREC
+ || evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)));
- return true;
+ CASE_CONVERT:
+ return evolution_function_right_is_integer_cst (TREE_OPERAND (chrec, 0));
default:
return false;