diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2019-10-14 06:43:03 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2019-10-14 06:43:03 +0000 |
commit | dede82f21ba8b569ad0f5538a0c00216ea71d2b4 (patch) | |
tree | 92959d5a6425c96a01ed74d448c3ba4bf9128c06 /gcc/tree-vrp.c | |
parent | 103197a183446a81d97a6ef975cc7095a64c8c4b (diff) | |
download | gcc-dede82f21ba8b569ad0f5538a0c00216ea71d2b4.zip gcc-dede82f21ba8b569ad0f5538a0c00216ea71d2b4.tar.gz gcc-dede82f21ba8b569ad0f5538a0c00216ea71d2b4.tar.bz2 |
Normalize unsigned ~[0,0] into [1,MAX].
From-SVN: r276949
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index d69cfb1..cffa050 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -800,13 +800,13 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max) kind = VR_RANGE; } else if (is_min - /* As a special exception preserve non-null ranges. */ - && !(TYPE_UNSIGNED (TREE_TYPE (min)) - && integer_zerop (max))) + /* Allow non-zero pointers to be normalized to [1,MAX]. */ + || (POINTER_TYPE_P (TREE_TYPE (min)) + && integer_zerop (min))) { tree one = build_int_cst (TREE_TYPE (max), 1); min = int_const_binop (PLUS_EXPR, max, one); - max = vrp_val_max (TREE_TYPE (max)); + max = vrp_val_max (TREE_TYPE (max), true); kind = VR_RANGE; } else if (is_max) |