From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id 50FD0385840A; Sun, 28 Apr 2024 19:04:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50FD0385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714331045; bh=LibfZRbiA1QJKeaCgi0bB+bjhgBMydxjlnY3StyXaOc=; h=From:To:Subject:Date:From; b=K/4yvlGGM7zAYie73J/buZYFoOrQfFytO6pIzbQaJQ/PsWmAeCjy6RccQHH909CPR 7X+3Y5esE9uCFgBQEk5EuoKE90/GEVxoi/ZLApnXnn8O0fjER+faQCYneLG/CQxwgg RqQcbaQfJofhAO14r9OWnZlKXBZBvsQPesyiuvhY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r15-31] Remove GTY support for vrange and derived classes. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: fd4cf7a092bb2ce21c0d8246c17c0b7f82de440c X-Git-Newrev: eeef1f69c5e77ecf13fdcf44df5bcf592a9993e6 Message-Id: <20240428190405.50FD0385840A@sourceware.org> Date: Sun, 28 Apr 2024 19:04:05 +0000 (GMT) List-Id: https://gcc.gnu.org/g:eeef1f69c5e77ecf13fdcf44df5bcf592a9993e6 commit r15-31-geeef1f69c5e77ecf13fdcf44df5bcf592a9993e6 Author: Aldy Hernandez Date: Wed Feb 21 09:34:29 2024 +0100 Remove GTY support for vrange and derived classes. Now that we have a vrange storage class to save ranges in long-term memory, there is no need for GTY markers for any of the vrange classes, since they should never live in GC. gcc/ChangeLog: * value-range-storage.h: Remove friends. * value-range.cc (gt_ggc_mx): Remove. (gt_pch_nx): Remove. * value-range.h (class vrange): Remove GTY markers. (class irange): Same. (class int_range): Same. (class frange): Same. (gt_ggc_mx): Remove. (gt_pch_nx): Remove. Diff: --- gcc/value-range-storage.h | 4 --- gcc/value-range.cc | 73 ----------------------------------------------- gcc/value-range.h | 46 +++-------------------------- 3 files changed, 4 insertions(+), 119 deletions(-) diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h index d94c520aa73..5756de7e32d 100644 --- a/gcc/value-range-storage.h +++ b/gcc/value-range-storage.h @@ -75,10 +75,6 @@ private: static size_t size (const irange &r); const unsigned short *lengths_address () const; unsigned short *write_lengths_address (); - friend void gt_ggc_mx_irange_storage (void *); - friend void gt_pch_p_14irange_storage (void *, void *, - gt_pointer_operator, void *); - friend void gt_pch_nx_irange_storage (void *); // The shared precision of each number. unsigned short m_precision; diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 926f7b707ea..b901c864a7b 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -2165,79 +2165,6 @@ vrp_operand_equal_p (const_tree val1, const_tree val2) return true; } -void -gt_ggc_mx (irange *x) -{ - if (!x->undefined_p ()) - gt_ggc_mx (x->m_type); -} - -void -gt_pch_nx (irange *x) -{ - if (!x->undefined_p ()) - gt_pch_nx (x->m_type); -} - -void -gt_pch_nx (irange *x, gt_pointer_operator op, void *cookie) -{ - for (unsigned i = 0; i < x->m_num_ranges; ++i) - { - op (&x->m_base[i * 2], NULL, cookie); - op (&x->m_base[i * 2 + 1], NULL, cookie); - } -} - -void -gt_ggc_mx (frange *x) -{ - gt_ggc_mx (x->m_type); -} - -void -gt_pch_nx (frange *x) -{ - gt_pch_nx (x->m_type); -} - -void -gt_pch_nx (frange *x, gt_pointer_operator op, void *cookie) -{ - op (&x->m_type, NULL, cookie); -} - -void -gt_ggc_mx (vrange *x) -{ - if (is_a (*x)) - return gt_ggc_mx ((irange *) x); - if (is_a (*x)) - return gt_ggc_mx ((frange *) x); - gcc_unreachable (); -} - -void -gt_pch_nx (vrange *x) -{ - if (is_a (*x)) - return gt_pch_nx ((irange *) x); - if (is_a (*x)) - return gt_pch_nx ((frange *) x); - gcc_unreachable (); -} - -void -gt_pch_nx (vrange *x, gt_pointer_operator op, void *cookie) -{ - if (is_a (*x)) - gt_pch_nx ((irange *) x, op, cookie); - else if (is_a (*x)) - gt_pch_nx ((frange *) x, op, cookie); - else - gcc_unreachable (); -} - #define DEFINE_INT_RANGE_INSTANCE(N) \ template int_range::int_range(tree_node *, \ const wide_int &, \ diff --git a/gcc/value-range.h b/gcc/value-range.h index 991ffeafcb8..2650ded6d10 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -72,7 +72,7 @@ enum value_range_discriminator // if (f.supports_type_p (type)) ... // } -class GTY((user)) vrange +class vrange { template friend bool is_a (vrange &); friend class Value_Range; @@ -279,7 +279,7 @@ irange_bitmask::intersect (const irange_bitmask &orig_src) // An integer range without any storage. -class GTY((user)) irange : public vrange +class irange : public vrange { friend value_range_kind get_legacy_range (const irange &, tree &, tree &); friend class irange_storage; @@ -350,10 +350,6 @@ protected: // Hard limit on max ranges allowed. static const int HARD_MAX_RANGES = 255; private: - friend void gt_ggc_mx (irange *); - friend void gt_pch_nx (irange *); - friend void gt_pch_nx (irange *, gt_pointer_operator, void *); - bool varying_compatible_p () const; bool intersect_bitmask (const irange &r); bool union_bitmask (const irange &r); @@ -379,7 +375,7 @@ protected: // HARD_MAX_RANGES. This new storage is freed upon destruction. template -class GTY((user)) int_range : public irange +class int_range : public irange { public: int_range (); @@ -484,13 +480,10 @@ nan_state::neg_p () const // The representation is a type with a couple of endpoints, unioned // with the set of { -NAN, +Nan }. -class GTY((user)) frange : public vrange +class frange : public vrange { friend class frange_storage; friend class vrange_printer; - friend void gt_ggc_mx (frange *); - friend void gt_pch_nx (frange *); - friend void gt_pch_nx (frange *, gt_pointer_operator, void *); public: frange (); frange (const frange &); @@ -991,37 +984,6 @@ range_includes_zero_p (const irange *vr) return vr->contains_p (zero); } -extern void gt_ggc_mx (vrange *); -extern void gt_pch_nx (vrange *); -extern void gt_pch_nx (vrange *, gt_pointer_operator, void *); -extern void gt_ggc_mx (irange *); -extern void gt_pch_nx (irange *); -extern void gt_pch_nx (irange *, gt_pointer_operator, void *); -extern void gt_ggc_mx (frange *); -extern void gt_pch_nx (frange *); -extern void gt_pch_nx (frange *, gt_pointer_operator, void *); - -template -inline void -gt_ggc_mx (int_range *x) -{ - gt_ggc_mx ((irange *) x); -} - -template -inline void -gt_pch_nx (int_range *x) -{ - gt_pch_nx ((irange *) x); -} - -template -inline void -gt_pch_nx (int_range *x, gt_pointer_operator op, void *cookie) -{ - gt_pch_nx ((irange *) x, op, cookie); -} - // Constructors for irange inline