From: Marco Antoniotti
Subject: GCC and garbage collection: I am curious
Date: 
Message-ID: <MARCOXA.95Aug11085553@mosaic.robotics>
Hello

I have asked these questions many times but never got an answer that I
found satisfactory.

1 - How difficult it is to instrument the GCC backend to support GC
    languages (not necessarily Lisp or Dylan)?

2 - If it "not that difficult" are there plans to include support for
    GC in the standard distribution of GCC?

Answer in private. I'll post a summary

Thanks

-- 
Marco G. Antoniotti - Resistente Umano
-------------------------------------------------------------------------------
Robotics Lab		| room: 1220 - tel. #: (212) 998 3370
Courant Institute NYU	| e-mail: ·······@cs.nyu.edu
			| WWW:    http://found.cs.nyu.edu/marcoxa

...e` la semplicita` che e` difficile a farsi.
...it is simplicity that is difficult to make.
				Bertholdt Brecht
From: Hans Boehm
Subject: Re: GCC and garbage collection: I am curious
Date: 
Message-ID: <40o4v2$5hq@news.parc.xerox.com>
·······@mosaic.robotics (Marco Antoniotti) writes:


>Hello

>I have asked these questions many times but never got an answer that I
>found satisfactory.

>1 - How difficult it is to instrument the GCC backend to support GC
>    languages (not necessarily Lisp or Dylan)?

>2 - If it "not that difficult" are there plans to include support for
>    GC in the standard distribution of GCC?

If you use a conservative garbage collector, it empirically works now.
(Sather, Modula-3 and GCL all take advantage of this, I believe.)
If you really want to guarantee safety of the result with optimization
enabled, you need to do a bit of work to ensure that the optimizer does
not disguise pointers.   Empirically, this doesn't seem to happen in real
code, but we can contrive code that causes problems.  I believe it is
possible now to generate even C source code that is completely safe with
a conservative garbage collector, provided you know it will be compiled
only with gcc.

You can get to some more details from

ftp://parcftp.xerox.com/pub/gc/gc.html

Hans-J. Boehm
(·····@parc.xerox.com)
Standard disclaimer ...