diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-20 10:19:12 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-20 10:19:12 +0000 |
commit | 5fa7ce8ceacd83028cd63988a46f7e1b985b15d8 (patch) | |
tree | 49475129f1d63a4e3092e32510059f6a3c26bc16 /gcc/tree-chrec.h | |
parent | 9613c0039f67f7ae0c1c82d3f25640268b48d11b (diff) | |
download | gcc-5fa7ce8ceacd83028cd63988a46f7e1b985b15d8.tar.gz |
2013-09-20 Richard Biener <rguenther@suse.de>
PR middle-end/58473
* tree-chrec.h (build_polynomial_chrec): Use gcc_checking_assert,
make type comparison less strict.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.h')
-rw-r--r-- | gcc/tree-chrec.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h index ad39a6b22d3..c69183b966e 100644 --- a/gcc/tree-chrec.h +++ b/gcc/tree-chrec.h @@ -137,15 +137,18 @@ build_polynomial_chrec (unsigned loop_num, || !val) return chrec_dont_know; - /* Pointer types should occur only on the left hand side, i.e. in - the base of the chrec, and not in the step. */ - gcc_assert (!POINTER_TYPE_P (TREE_TYPE (right))); - - /* Types of left and right sides of a chrec should be compatible. */ + /* Types of left and right sides of a chrec should be compatible, but + pointer CHRECs are special in that the evolution is of ptroff type. */ if (POINTER_TYPE_P (TREE_TYPE (left))) - gcc_assert (ptrofftype_p (TREE_TYPE (right))); + gcc_checking_assert (ptrofftype_p (TREE_TYPE (right))); else - gcc_assert (TREE_TYPE (left) == TREE_TYPE (right)); + { + /* Pointer types should occur only on the left hand side, i.e. in + the base of the chrec, and not in the step. */ + gcc_checking_assert (!POINTER_TYPE_P (TREE_TYPE (right)) + && types_compatible_p (TREE_TYPE (left), + TREE_TYPE (right))); + } if (chrec_zerop (right)) return left; |