[m-dev.] ground->clobbered argument modes

Simon Taylor stayl at cs.mu.OZ.AU
Fri Aug 6 12:13:22 AEST 1999


 
> According to this analysis, the code for sc_get/3 is OK;
> the mode checker should allow that.  Instead, the uncaught mode error
> in this module is in the call to sc_set/3 in sc2/4; this code should
> be illegal because sc2/4 calls sc_set/3 with an argument which is still
> (in part) live, even though the final inst is `clobbered'.
> When checking if a variable is live, mode analysis needs to also check whether
> any of the variables that it (or any part of it) is aliased to are live.

sc1(A, B, Foo0, Foo) :-
        sc_get(B::out, Foo0::(ground->clobbered), Foo1::out),
        sc_set(A::in, Foo1::(ground->clobbered), Foo::out).

How does the mode checker know that `B' is aliased to part of
`Foo1' before inlining?
 
> > One possible fix would be to unify the uniqueness (but not the bindings)
> > of the final insts in the argument modes with the final insts of
> > the argument variables before calling inst_matches_final.
>
> I'm not certain that I understand what you mean here -- perhaps you should
> explain in more detail -- but at first glance I don't think that would work.

OK, it won't work.

Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list