diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-17 14:58:20 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-17 14:58:20 +0000 |
commit | a9b4b38edf5847dc42a32af32f46deccf1955e5b (patch) | |
tree | 603886208f6dc46c6797854e6aebdb6cb74efdb9 /gcc/tree-vrp.c | |
parent | b0abacf1b509954fb23ddfd6a98c731731907003 (diff) | |
download | gcc-a9b4b38edf5847dc42a32af32f46deccf1955e5b.tar.gz |
* tree-vrp.c (compare_values): Check that VAL1 and VAL2 are
both pointers or both integers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98273 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index c1f910e5ce1..3bb4a6b0cb0 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -286,14 +286,13 @@ compare_values (tree val1, tree val2) if (val1 == val2) return 0; + /* Below we rely on the fact that VAL1 and VAL2 are both pointers or + both integers. */ + gcc_assert (POINTER_TYPE_P (TREE_TYPE (val1)) + == POINTER_TYPE_P (TREE_TYPE (val2))); + /* Do some limited symbolic comparisons. */ - /* FIXME: The second check of POINTER_TYPE_P should not be necessary - because we should be comparing values of the same type here, but - for whatever reason, the front end throws us a type mismatched - comparison. For now, work around the problem by checking both - types. See PR 21021 and PR 21024. */ - if (!POINTER_TYPE_P (TREE_TYPE (val1)) - && !POINTER_TYPE_P (TREE_TYPE (val2))) + if (!POINTER_TYPE_P (TREE_TYPE (val1))) { /* We can determine some comparisons against +INF and -INF even if the other value is an expression. */ @@ -406,13 +405,7 @@ compare_values (tree val1, tree val2) if (!is_gimple_min_invariant (val1) || !is_gimple_min_invariant (val2)) return -2; - /* FIXME: The second check of POINTER_TYPE_P should not be necessary - because we should be comparing values of the same type here, but - for whatever reason, the front end throws us a type mismatched - comparison. For now, work around the problem by checking both - types. See PR 21021 and PR 21024. */ - if (!POINTER_TYPE_P (TREE_TYPE (val1)) - && !POINTER_TYPE_P (TREE_TYPE (val2))) + if (!POINTER_TYPE_P (TREE_TYPE (val1))) return tree_int_cst_compare (val1, val2); else { |