This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: needless deep recursion in gt-c-decl.h


> Date: Mon, 05 Aug 2002 15:43:36 -0700
> From: Per Bothner <per@bothner.com>

> Geoff Keating wrote:
> > This won't avoid the LABEL_REF.  It will be encountered the first time
> > it's used in RTL, which will still be much earlier than the position
> > of the label.
> 
> Same point:  Do we really need to follow LABEL_REFs?  Aren't their
> targets guaranteed to be referenced by something else?

I would need to see a proof before I would believe that this is always
true.  Note that there is currently special code for GC in rtl.h which
has to deal with the possiblity that insns might exist which are not
on the insn chain.  Also note that it is not true that every RTL
expression that's live is actually computed by the program.

> General point:  We're acting as if we're implementing a general-purpose
> garbage collector that needs to work without any knowledge of the
> semantics of its objects beyond being able to chase pointers.  However,
> we don't need a general gc - we just need something that works for gcc.
> And gcc doesn't willy-nilly allocate chunks of rtl and stash them in
> random places.  We know how gcc allocates and uses rtl.

Speak for yourself!  I certainly wouldn't claim to know all the places
RTL gets allocated or used.

> Thus we don't need to chase every cross-reference and back-pointer -
> they are redundant, if the compiler isn't broken.  (Of course having
> self-checks in the compiler is good.  But that's a separate issue.)

... so, what collection of pointers takes up a significant amount of
the time spent in GC, yet is guaranteed to be redundant with other
pointers?

> (Of course if we were implementing a general-purpose garbage collector
> we should not use recursion to follow pointers!)

A general-purpose collector would indeed work differently.

-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]