public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* an experiment with garbage collection
@ 1998-05-09  3:34 Richard Henderson
  1998-05-09 15:57 ` Joern Rennecke
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Richard Henderson @ 1998-05-09  3:34 UTC (permalink / raw)
  To: egcs

Having been annoyed by obstacks one too many times, I decided to
try and do something about it.  There now exists a branch of EGCS
in the CVS tree tagged `egcs_gc_branch'.  On it, you will find a
fledgeling attempt to replace all of the stupid obstack nonsense
with an actual garbage collector.

There are several design constraints that ought to be mentioned.  

  (1) We will only garbage collect rtl and trees.  Everything else 
      will eventually be converted to use plain malloc/free.

  (2) The collector will be given all of the roots that need to stay
      live across calls to the collector.  If the collector is to 
      invoke GC implicitly on a failed allocation request, it must 
      be able to find all roots not given (i.e. a conservative gc).

  (3) The default collector must be strictly conforming -- or at least
      as much as GCC currently is with its allocation and casting.
      I.e. the default collector must run on every system gcc is 
      currently supported on.

  (4) The interface from gcc to the collector must be generic enough
      to drop in different gc implementations.

Current status of the work is that rtl and tree allocation now
happens with the collector, while the rest of the obstack usage is
mostly unchanged.  It is good enough to compile enquire.c with `-O0'
and `-g -O4'.  Time spent in GC seems to be about the same as sched,
though this is with a sample-set of 1.

Note that anything but the C front end will not even build at the moment.

Anyway, I'll keep working on this off-and-on as I find time.  Check
it out and let me know what you think.


r~

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: an experiment with garbage collection
@ 1998-05-10 18:07 Michael Meissner
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Meissner @ 1998-05-10 18:07 UTC (permalink / raw)
  To: rth; +Cc: egcs

One thought that occurs to me, is that most passes start out with a scan over
all of the insns.  You could do GC as part of that scan.  Another more limited
possibility, is a lot of phases call regcan.  Regscan could do the gc and
not have to touch other phases into you get into register allocation.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: an experiment with garbage collection
@ 1998-05-11 15:07 Mike Stump
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Stump @ 1998-05-11 15:07 UTC (permalink / raw)
  To: egcs, rth

I generally like this idea.  It solves some of the copy to permanent
type things, the `we freed it too soon' problem, and can wind up
freeing things that aren't used anymore, but we just got the calls to
obstack wrong.  We will just need to be careful to zero out any stray
pointers that we don't need anymore in order to keep memory usage down.

Let us know what type of results you see in working set size, and max
memory used and compilation speed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1998-05-11 15:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-09  3:34 an experiment with garbage collection Richard Henderson
1998-05-09 15:57 ` Joern Rennecke
1998-05-09 21:03   ` Richard Henderson
1998-05-09 22:13   ` Jeffrey A Law
1998-05-09 15:57 ` Francois-Rene Rideau
1998-05-09 11:03   ` Richard Henderson
1998-05-09 16:35 ` John Carr
1998-05-09 16:35   ` Richard Henderson
1998-05-09 21:03   ` David S. Miller
1998-05-10 18:07 Michael Meissner
1998-05-11 15:07 Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).