[m-dev.] accurate GC stack layout bug

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 18 20:28:33 AEDT 2003


On 15-Nov-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Building in grade asm_fast.agc (& no other special options) results in
> code for library/rational.m which appears to have an invalid stack layout
> for one of the procedures.  This causes the accurate collector to crash.

I had another look at this.  It seems that the problem is due to dupelim.m.
Dupelim combines labels whose code is the same, but whose GC info differs,
e.g. for
	f(...) = X :-
		( ... ->
			p(A),
			X = [A]
		;
			q(B),
			X = [B]
		)
the code to construct a list will be the same, but the GC info will differ
in the variable numbers.  After dupelim combines the two labels, we assume
that if a variable is not live on one branch, it is not live on the other,
and so erroneously conclude that neither A nor B are live after the call.

A work-around is to compile with --no-optimize-dups.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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