Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!ucsd!pacbell.com!decwrl!pa.dec.com!src.dec.com!src.dec.com!muller From: muller@src.dec.com (Eric Muller) Newsgroups: comp.lang.modula3 Subject: Re: optimization and garbage collection Message-ID: <1991Jan9.184352.5678@src.dec.com> Date: 10 Jan 91 02:43:52 GMT References: <91Jan2.131022pst.3117@arcturia.parc.xerox.com> <5142@exodus.Eng.Sun.COM> <39976@super.ORG> <5293@exodus.Eng.Sun.COM> Sender: news@src.dec.com (News) Reply-To: muller@src.dec.com (Eric Muller) Organization: DEC Systems Research Center Lines: 32 David Chase argues that an aggressive C optimizer can disturb Modula-3 programs (in the case of a Modula-3 compiler that generates C, of course). In particular, garbage collection can be a real trouble, as roots can be "hidden". While such occurrences are possible, I would not rule out a bug in the Modula-3 compiler or in the C optimizer to conclude right away in favor of an unwanted side-effect of aggressive optimization. If I were to give probabilities to: 1. SRC Modula-3 generates incorrect C code 2. the C compiler is incorrect 3. it is one of those things we cannot do because we generate C I would say: p(1) = 99.9%, p(2) = 0.099%, p(3) = 0.001%. Of course, we make assumptions when generating code and in the garbage collector, and they may not be satisfied. As for the generated code, we try to use no more than what ANSI-C says. For the garbage collector, we assume that if a traced heap object (i.e. a traced OBJECT or REF) is accessible by the program, then there is somewhere in the stacks or the registers a reference to one of the pages that contains that object. If it turns out that this is not reasonable, we can increase the level of conservatism, for example that saying that the pointer can be as far as x bytes from object. However, we have yet to see an example of 3. In the mean time, keep these bug reports coming so that we can achieve p(1) = 50%. Eric Muller. ------------------------------------------------------------------------------ System Research Center - 130 Lytton Av. - Palo Alto, CA 94301 - (415) 853 2193