[patch] multi-range implementation for value_range (irange)

Aldy Hernandez aldyh@redhat.com
Wed Aug 5 15:45:01 GMT 2020



On 8/5/20 4:27 PM, Gerald Pfeifer wrote:
> Hi Aldy,
> 
> On Fri, 31 Jul 2020, Aldy Hernandez via Gcc-patches wrote:
>> Jeff approved this patch off-list.  I will re-run tests once again and
>> commit by Monday.
> 
> I believe this has broken the bootstrap with clang (specifically
> FreeBSD clang version 10.0.0):
> 
> In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/c/gimple-parser.c:44:
> In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vrp.h:23:
> /scratch/tmp/gerald/GCC-HEAD/gcc/value-range.h:347:1: error: static declaration of 'gt_ggc_mx' follows non-static declaration gt_ggc_mx (int_range<N> *x)
> /scratch/tmp/gerald/GCC-HEAD/gcc/value-range.h:150:37: note: previous declaration is here
>    template <unsigned X> friend void gt_ggc_mx (int_range<X> *);
>                                      ^
> 
> /scratch/tmp/gerald/GCC-HEAD/gcc/value-range.h:358:1: error: static declaration of 'gt_pch_nx' follows non-static declaration gt_pch_nx (int_range<N> *x)
> /scratch/tmp/gerald/GCC-HEAD/gcc/value-range.h:151:37: note: previous declaration is here
>    template <unsigned X> friend void gt_pch_nx (int_range<X> *);
>                                      ^
> 
> My daily tester started to 20200803T1640, so the root cause of this must
> have entered GCC trunk between Sunday 16:40 UTC and Monday 16:40 UTC.

Yeah, this is definitely caused by the irange patch.

GTY makes my head spin, and it took forever to get these gt_* functions 
set up.  I can't claim I understand them entirely :).

Just a guess, does removing the static solve the problem?

diff --git a/gcc/value-range.h b/gcc/value-range.h
index e3282c4ad03..1ab39939703 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -343,7 +343,7 @@ range_includes_zero_p (const irange *vr)
  }

  template<unsigned N>
-static inline void
+inline void
  gt_ggc_mx (int_range<N> *x)
  {
    for (unsigned i = 0; i < N; ++i)
@@ -354,7 +354,7 @@ gt_ggc_mx (int_range<N> *x)
  }

  template<unsigned N>
-static inline void
+inline void
  gt_pch_nx (int_range<N> *x)
  {
    for (unsigned i = 0; i < N; ++i)
@@ -365,7 +365,7 @@ gt_pch_nx (int_range<N> *x)
  }

  template<unsigned N>
-static inline void
+inline void
  gt_pch_nx (int_range<N> *x, gt_pointer_operator op, void *cookie)
  {
    for (unsigned i = 0; i < N; ++i)



More information about the Gcc-patches mailing list