Re: how to generate code for (a,b):=(b,a)

Hans-Juergen Boehm <boehm@mti.mti.sgi.com>
25 May 1997 12:38:08 -0400

          From comp.compilers

Related articles
[13 earlier articles]
Re: how to generate code for (a,b):=(b,a) will@ccs.neu.edu (William D Clinger) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) wilson@cs.utexas.edu (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-17)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-25)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-27)
Re: how to generate code for (a,b):=(b,a) fjh@murlibobo.cs.mu.OZ.AU (1997-05-30)
Re: how to generate code for (a,b):=(b,a) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-05-30)
Re: how to generate code for (a,b):=(b,a) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-06-11)
conservative GC (was Re: how to generate code for (a,b):=(b,a)) boehm@mti.mti.sgi.com (Hans-Juergen Boehm) (1997-06-13)
| List of all articles for this month |

From: Hans-Juergen Boehm <boehm@mti.mti.sgi.com>
Newsgroups: comp.compilers
Date: 25 May 1997 12:38:08 -0400
Organization: Silicon Graphics Inc., Mountain View, CA
References: 97-05-058 97-05-129 97-05-148 97-05-262
Keywords: storage, C, GC

Dave Lloyd wrote:
>
> Paul Wilson <wilson@cs.utexas.edu> wrote:
[XOR to swap pointers confuses conservative GC]


> Best argument I've heard against conservative GC in a long time -
> NOT the code-generation technique. As I mentionned in another post
> on this thread, we use this technique, BUT we use a mark-and-sweep
> GC with our Algol and Fortran compilers so no problem. (I do
> appreciate the problem with C really <evil-grin>)


This doesn't make much sense to me:


1) Most conservative GCs are mark-and-sweep GCs.


2) The problem has little to do with Algol/Fortran vs. C. It's
illegal to exclusive-or pointers together in C without a bunch of
intervening casts. There have been long arguments about whether or
not those casts are strictly conforming, but it doesn't matter here.
They're clearly not in the subset of C that I'm willing to address
with a conservative collector, and they can be easily made to generate
warnings. The issue here is whether the COMPILER can exclusive-or
pointers in the absence of source code that does it. This could
happen with either Fortran/Algol or C.


3) If you use the pointer-xor technique with a nonconservative
collector, you probably don't split the xor sequence across procedure
calls, and you garbage collect only at procedure calls. If you do
split the code or collect at arbitrary points, I'd love to see how the
collector deals with seeing the intermediate state. (Yes, it's
possible, but ...) If you don't, you could also safely use a
conservative GC.
--
Hans-Juergen Boehm
boehm@mti.sgi.com
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.