From bfd9415761dabcfa3ddef2c78c169ac82702cd00 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Mon, 21 Nov 2022 01:06:58 +0100 Subject: 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. --- gcc/tree-vrp.cc | 86 --------------------------------------------------------- 1 file changed, 86 deletions(-) (limited to 'gcc/tree-vrp.cc') 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 -- cgit v1.1