diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-13 17:34:59 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-13 17:34:59 +0000 |
commit | c4ccbe87dae599b81683031c8b48e9f2459f668c (patch) | |
tree | 59ee96a3f882ff306e3bca6a9946de2c16d2688d /gcc/tree-chrec.c | |
parent | 94ba21de76678316108cb184d517133a66622525 (diff) | |
download | gcc-c4ccbe87dae599b81683031c8b48e9f2459f668c.tar.gz |
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: svn+ssh://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.c | 12 |
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; |