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 <spop@gcc.gnu.org>2010-03-13 17:34:59 +0000
commit1f3803148ffa5702cb86f43a6bf2ecaeacb1b1bd (patch)
tree59ee96a3f882ff306e3bca6a9946de2c16d2688d /gcc/tree-chrec.c
parentb6bb0094b2486476e45570135f4b6fada05cdba6 (diff)
downloadgcc-1f3803148ffa5702cb86f43a6bf2ecaeacb1b1bd.zip
gcc-1f3803148ffa5702cb86f43a6bf2ecaeacb1b1bd.tar.gz
gcc-1f3803148ffa5702cb86f43a6bf2ecaeacb1b1bd.tar.bz2
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. From-SVN: r157434
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 c945f93..929bbc0 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;