summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-21 14:54:47 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-21 14:54:47 +0000
commit079589a4e7165bbbea63a5a9d1cb43d9e12807cc (patch)
tree30178c30f5f53ba548194c129e6273ceb7ad0460 /gcc/tree-vrp.c
parenta3dadcdea63dfb7f7543a26ee101f6ddde1c3b5a (diff)
downloadgcc-079589a4e7165bbbea63a5a9d1cb43d9e12807cc.tar.gz
2007-06-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32453 * tree-vrp.c (extract_range_from_assert): Build POINTER_PLUS_EXPR for pointer anti-range. * gcc.c-torture/compile/pr32453.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125922 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 8fba946ff6a..937a76b7046 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1473,10 +1473,13 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
}
min = positive_overflow_infinity (TREE_TYPE (var_vr->min));
}
- else
+ else if (!POINTER_TYPE_P (TREE_TYPE (var_vr->min)))
min = fold_build2 (PLUS_EXPR, TREE_TYPE (var_vr->min),
anti_max,
build_int_cst (TREE_TYPE (var_vr->min), 1));
+ else
+ min = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
+ anti_max, size_int (1));
max = real_max;
set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
}