[m-dev.] Bug #309

Mark Brown mark at mercurylang.org
Wed Jan 22 15:15:36 AEDT 2014

On Wed, Jan 22, 2014 at 2:18 PM, Paul Bone <paul at bone.id.au> wrote:
> Another idea I had was to turn an exist_cast HLDS goal of something like io
> or store(S) into an assignment from NULL (eg: "MR_r3 = NULL"[0]) rather than
> an assignment from where-ever we thought that store(S) or io was stored.

Yes, this is also correct.

> NULL is just as good as junk but it has the benefit of being a 'cached'
> value (as far as the LLDS is concerned), this means that if all it's
> locations get clobbered that we can generate a new value for it from the
> constant NULL.  No stack slot or temporary register is required.  This is
> not an improvement on your suggestion above, it's just easier.

NULL won't point to the heap, hence won't cause Boehm to hang onto any
further garbage. So I think your solution is probably better. :-)


More information about the developers mailing list