On 4/26/2021 8:27 AM, Aldy Hernandez via Gcc-patches wrote:
Right now we have GTY support for static storage iranges
(int_range<>).  However, there's no reason why the base
class can't be used with GC, other than it was an oversight.

For that matter, the base class has a pointer to the sub-range
storage, so we can use the same implementation for both.  This
patch does so.

I have also removed the DEFINE_INT_RANGE_GC_STUBS
stuff, and have documented why we need a separate
gt_pch_nx (int_range<1> *&) version.  This has to do with
hash-traits.h, which ipa-prop.c is using to store a value_range.
The header file hash-traits.h is defining an extern of
gt_pch_nx (int_range<1> *&) etc, instead of calling the
more generic (int_range<1> *) which is already available.

It seems suspect that has-traits.h has their own externs
for GC functions, and if someone has a better solution, I'd
be glad to hear it.

OK?

gcc/ChangeLog:

        * value-range.cc (DEFINE_INT_RANGE_GC_STUBS): Remove.
        (gt_pch_nx (int_range<1> *&)): New.
        (gt_ggc_mx (int_range<1> *&)): New.
        * value-range.h (class irange): Add GTY support for
        the base class.

OK

jeff

Reply via email to