needless deep recursion in gt-c-decl.h

Per Bothner per@bothner.com
Mon Aug 5 15:37:00 GMT 2002


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?

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.  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.)

(Of course if we were implementing a general-purpose garbage collector
we should not use recursion to follow pointers!)
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Gcc mailing list