diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-03-05 20:37:44 +0000 |
---|---|---|
committer | Sebastian Pop <sebastian.pop@amd.com> | 2010-03-05 20:37:44 +0000 |
commit | 5ef6b9fdacdf8804936ba60436ae738e340fae44 (patch) | |
tree | 0a76a3fed9efd2857f0e155b3c235f79073b8067 /gcc/tree-chrec.c | |
parent | 1bf62c8c4e47540f51b1888f17920d5c4e7563b2 (diff) |
Fix PR42326: Handle more carefully convert expressions in chrec_fold_plus and chrec_fold_mult.
2010-03-05 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42326
* tree-chrec.c (chrec_fold_plus_1): Do not handle convert expressions
that contain scevs.
(chrec_fold_multiply): Same.
* gfortran.dg/graphite/pr42326.f90: New.
* gfortran.dg/graphite/pr42326-1.f90: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@157244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r-- | gcc/tree-chrec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 18ed4ed2a38..c945f93190e 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -283,6 +283,10 @@ chrec_fold_plus_1 (enum tree_code code, tree type, case POLYNOMIAL_CHREC: return chrec_fold_plus_poly_poly (code, type, op0, op1); + CASE_CONVERT: + if (tree_contains_chrecs (op1, NULL)) + return chrec_dont_know; + default: if (code == PLUS_EXPR || code == POINTER_PLUS_EXPR) return build_polynomial_chrec @@ -296,6 +300,10 @@ chrec_fold_plus_1 (enum tree_code code, tree type, CHREC_RIGHT (op0)); } + CASE_CONVERT: + if (tree_contains_chrecs (op0, NULL)) + return chrec_dont_know; + default: switch (TREE_CODE (op1)) { @@ -314,6 +322,10 @@ chrec_fold_plus_1 (enum tree_code code, tree type, ? build_real (type, dconstm1) : build_int_cst_type (type, -1))); + CASE_CONVERT: + if (tree_contains_chrecs (op1, NULL)) + return chrec_dont_know; + default: { int size = 0; @@ -393,6 +405,10 @@ chrec_fold_multiply (tree type, case POLYNOMIAL_CHREC: return chrec_fold_multiply_poly_poly (type, op0, op1); + CASE_CONVERT: + if (tree_contains_chrecs (op1, NULL)) + return chrec_dont_know; + default: if (integer_onep (op1)) return op0; @@ -405,6 +421,10 @@ chrec_fold_multiply (tree type, chrec_fold_multiply (type, CHREC_RIGHT (op0), op1)); } + CASE_CONVERT: + if (tree_contains_chrecs (op0, NULL)) + return chrec_dont_know; + default: if (integer_onep (op0)) return op1; @@ -420,6 +440,10 @@ chrec_fold_multiply (tree type, chrec_fold_multiply (type, CHREC_LEFT (op1), op0), chrec_fold_multiply (type, CHREC_RIGHT (op1), op0)); + CASE_CONVERT: + if (tree_contains_chrecs (op1, NULL)) + return chrec_dont_know; + default: if (integer_onep (op1)) return op0; |