aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index bdb29b8..9cafe43 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -68,6 +68,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-vector-builder.h"
#include "gimple-fold.h"
#include "escaped_string.h"
+#include "gimple-range.h"
/* Tree code classes. */
@@ -13831,8 +13832,8 @@ get_range_pos_neg (tree arg)
if (TREE_CODE (arg) != SSA_NAME)
return 3;
- wide_int arg_min, arg_max;
- while (get_range_info (arg, &arg_min, &arg_max) != VR_RANGE)
+ value_range r;
+ while (!get_global_range_query ()->range_of_expr (r, arg) || r.kind () != VR_RANGE)
{
gimple *g = SSA_NAME_DEF_STMT (arg);
if (is_gimple_assign (g)
@@ -13858,16 +13859,16 @@ get_range_pos_neg (tree arg)
{
/* For unsigned values, the "positive" range comes
below the "negative" range. */
- if (!wi::neg_p (wi::sext (arg_max, prec), SIGNED))
+ if (!wi::neg_p (wi::sext (r.upper_bound (), prec), SIGNED))
return 1;
- if (wi::neg_p (wi::sext (arg_min, prec), SIGNED))
+ if (wi::neg_p (wi::sext (r.lower_bound (), prec), SIGNED))
return 2;
}
else
{
- if (!wi::neg_p (wi::sext (arg_min, prec), SIGNED))
+ if (!wi::neg_p (wi::sext (r.lower_bound (), prec), SIGNED))
return 1;
- if (wi::neg_p (wi::sext (arg_max, prec), SIGNED))
+ if (wi::neg_p (wi::sext (r.upper_bound (), prec), SIGNED))
return 2;
}
return 3;