[m-rev.] for review: make private_builtin.store_at_ref impure

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Sep 8 20:50:20 AEST 2008


On Mon, 8 Sep 2008, Peter Wang wrote:

> These would be committed over some period of time.

At least 2-3 days per change.  You should check that the rotd host,
jupiter, at least has the new compiler installed before committing
subsequent changes.

> =============================================================================
>
> Branches: main
>
> `private_builtin.store_at_ref' is currently pure but should be impure.
> There would be bootstrapping problems if we just made it impure, as it is
> a builtin that the compiler needs to recognise.  Instead, we will add a
> new predicate `store_at_ref_impure' to take its place.  This needs to be
> done in three steps:
>
> 1. Get the compiler to recognise `store_at_ref_impure' as a builtin.
>
> 2. After step 1 has bootstrapped, add the predicate declaration for
>   `store_at_ref_impure'.  Change generated code to call it.
>
> 3. After step 2 has bootstrapped, delete `store_at_ref'.  The stage1
>   compiler in step 2 could be built by a compiler that still generates
>   references to `store_at_ref' so we couldn't just delete it at step 2.
>
>
> This is also part of fixing Mantis bug #42.  The bug there is that we
> didn't generate a valid definition for `store_at_ref'; the procedure
> existed but had an empty body.  Calls to `store_at_ref' introduced by the
> LCMC optimisation are normally replaced by inline code, but with
> `--no-inlining-builtins' we would call the procedure, which did nothing.

That looks fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list