diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-11-21 01:06:58 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2023-04-26 10:28:12 +0200 |
commit | bfd9415761dabcfa3ddef2c78c169ac82702cd00 (patch) | |
tree | 1dcaf0bac0d640b71943f59a81b0331e2fec583a /gcc | |
parent | 3c9372dfee0bb893b99dd28658c98d397cda5b49 (diff) | |
download | gcc-bfd9415761dabcfa3ddef2c78c169ac82702cd00.zip gcc-bfd9415761dabcfa3ddef2c78c169ac82702cd00.tar.gz gcc-bfd9415761dabcfa3ddef2c78c169ac82702cd00.tar.bz2 |
Remove range_fold_{unary,binary}_expr.
gcc/ChangeLog:
* tree-vrp.cc (supported_types_p): Remove.
(defined_ranges_p): Remove.
(range_fold_binary_expr): Remove.
(range_fold_unary_expr): Remove.
* tree-vrp.h (range_fold_unary_expr): Remove.
(range_fold_binary_expr): Remove.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vrp.cc | 86 | ||||
-rw-r--r-- | gcc/tree-vrp.h | 5 |
2 files changed, 0 insertions, 91 deletions
diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index 9b87064..2712608 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -587,92 +587,6 @@ compare_values (tree val1, tree val2) return compare_values_warnv (val1, val2, &sop); } -/* If the types passed are supported, return TRUE, otherwise set VR to - VARYING and return FALSE. */ - -static bool -supported_types_p (value_range *vr, - tree type0, - tree = NULL) -{ - if (!value_range::supports_p (type0)) - { - vr->set_varying (type0); - return false; - } - return true; -} - -/* If any of the ranges passed are defined, return TRUE, otherwise set - VR to UNDEFINED and return FALSE. */ - -static bool -defined_ranges_p (value_range *vr, - const value_range *vr0, const value_range *vr1 = NULL) -{ - if (vr0->undefined_p () && (!vr1 || vr1->undefined_p ())) - { - vr->set_undefined (); - return false; - } - return true; -} - -/* Perform a binary operation on a pair of ranges. */ - -void -range_fold_binary_expr (value_range *vr, - enum tree_code code, - tree expr_type, - const value_range *vr0_, - const value_range *vr1_) -{ - if (!supported_types_p (vr, expr_type) - || !defined_ranges_p (vr, vr0_, vr1_)) - return; - range_op_handler op (code, expr_type); - if (!op) - { - vr->set_varying (expr_type); - return; - } - - value_range vr0 (*vr0_); - value_range vr1 (*vr1_); - if (vr0.undefined_p ()) - vr0.set_varying (expr_type); - if (vr1.undefined_p ()) - vr1.set_varying (expr_type); - vr0.normalize_addresses (); - vr1.normalize_addresses (); - if (!op.fold_range (*vr, expr_type, vr0, vr1)) - vr->set_varying (expr_type); -} - -/* Perform a unary operation on a range. */ - -void -range_fold_unary_expr (value_range *vr, - enum tree_code code, tree expr_type, - const value_range *vr0, - tree vr0_type) -{ - if (!supported_types_p (vr, expr_type, vr0_type) - || !defined_ranges_p (vr, vr0)) - return; - range_op_handler op (code, expr_type); - if (!op) - { - vr->set_varying (expr_type); - return; - } - - value_range vr0_cst (*vr0); - vr0_cst.normalize_addresses (); - if (!op.fold_range (*vr, expr_type, vr0_cst, value_range (expr_type))) - vr->set_varying (expr_type); -} - /* Helper for overflow_comparison_p OP0 CODE OP1 is a comparison. Examine the comparison and potentially diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h index 3b1d6dc..bad50e3 100644 --- a/gcc/tree-vrp.h +++ b/gcc/tree-vrp.h @@ -28,11 +28,6 @@ extern int compare_values (tree, tree); extern int compare_values_warnv (tree, tree, bool *); extern int operand_less_p (tree, tree); -void range_fold_unary_expr (value_range *, enum tree_code, tree type, - const value_range *, tree op0_type); -void range_fold_binary_expr (value_range *, enum tree_code, tree type, - const value_range *, const value_range *); - extern enum value_range_kind intersect_range_with_nonzero_bits (enum value_range_kind, wide_int *, wide_int *, const wide_int &, signop); |