diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2019-11-04 22:57:51 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2019-11-04 22:57:51 +0000 |
commit | 04373f9288435fa2980dda99ad988fa5ce99331a (patch) | |
tree | a7c533a9ffa2837a5f645618a09da4ef6920be25 | |
parent | 1dee89967b74196012a4b177fed0ccce3a520706 (diff) | |
download | gcc-04373f9288435fa2980dda99ad988fa5ce99331a.zip gcc-04373f9288435fa2980dda99ad988fa5ce99331a.tar.gz gcc-04373f9288435fa2980dda99ad988fa5ce99331a.tar.bz2 |
Do not special case pointers in value_range_base::set.
From-SVN: r277799
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a11c08f..254b395 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-11-04 Aldy Hernandez <aldyh@redhat.com> + + * tree-vrp.c (value_range_base::set): Do not special case pointers. + 2019-11-04 Tobias Burnus <tobias@codesourcery.com> * config/gcn/gcn.c (gcn_omp_device_kind_arch_isa): New function. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 0a0d7d7..452895b 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -793,10 +793,8 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max) { /* For -fstrict-enums we may receive out-of-range ranges so consider values < -INF and values > INF as -INF/INF as well. */ - bool is_min = (INTEGRAL_TYPE_P (type) - && tree_int_cst_compare (min, TYPE_MIN_VALUE (type)) <= 0); - bool is_max = (INTEGRAL_TYPE_P (type) - && tree_int_cst_compare (max, TYPE_MAX_VALUE (type)) >= 0); + bool is_min = vrp_val_is_min (min); + bool is_max = vrp_val_is_max (max); if (is_min && is_max) { @@ -816,10 +814,7 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max) min = max = vrp_val_min (TREE_TYPE (min)); kind = VR_RANGE; } - else if (is_min - /* Allow non-zero pointers to be normalized to [1,MAX]. */ - || (POINTER_TYPE_P (TREE_TYPE (min)) - && integer_zerop (min))) + else if (is_min) { tree one = build_int_cst (TREE_TYPE (max), 1); min = int_const_binop (PLUS_EXPR, max, one); |