[m-dev.] diff: fix aborts during deforestation

Simon Taylor stayl at cs.mu.OZ.AU
Wed Sep 6 00:42:46 AEDT 2000


> > compiler/inlining.m:
> > 	If some of the output variables of an inlined call are not
> > 	used by the caller, run quantification on the goal
> > 	to push that information into the inlined goal.
> 
> That one is not a bug as such, because it is OK for the
> non-locals field to be a superset of the true non-locals.
> That should just be an optimization issue.
> 
> If you leave that change out, does anything break?

No.

> > Index: compiler/inlining.m
> > @@ -558,7 +587,7 @@
> > +	% Typechecking has already succeeded, so we don't need
> > +	% to check for binding of head type parameters.
> > +	% Also, existentially-typed head type parameters
> > +	% may be bound by inlining.
> > +	HeadTypeParams = [],
> >  	inlining__get_type_substitution(HeadTypes, ArgTypes, HeadTypeParams,
> >  		CalleeExistQVars, TypeSubn),
> 
> The log message didn't mention that change.

Sorry, I meant to fix that one. Type specialization wasn't handling
the existentially quantified type variables of specialized versions.
I'm testing a proper fix for that problem now.

> > Index: compiler/modes.m
> > +compute_goal_instmap_delta(InstMap0, Goal,
> > +		GoalInfo0, GoalInfo, ModeInfo0, ModeInfo) :-
> > +	( Goal = conj([]) ->
> > +		instmap_delta_init_reachable(DeltaInstMap),
> > +		mode_info_set_instmap(InstMap0, ModeInfo0, ModeInfo)
> > +	;
> > +		mode_info_get_completed_nonlocals(GoalInfo0, NonLocals,
> > +			ModeInfo0, ModeInfo),
> > +		mode_info_get_instmap(ModeInfo, InstMap),
> > +		compute_instmap_delta(InstMap0, InstMap,
> > +			NonLocals, DeltaInstMap)
> > +	),
> >  	goal_info_set_instmap_delta(GoalInfo0, DeltaInstMap, GoalInfo).
> 
> It would be helpful to have a comment here explaining why `conj([])'
> needs to be treated specially.

Estimated hours taken: 0.1

compiler/modes.m:
        Add a comment explaining why `true' goals need to be treated 
        specially when computing instmap_deltas.

Index: modes.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modes.m,v
retrieving revision 1.245
diff -u -u -r1.245 modes.m
--- modes.m     2000/09/01 10:31:08     1.245
+++ modes.m     2000/09/05 13:29:13
@@ -989,6 +989,14 @@
 compute_goal_instmap_delta(InstMap0, Goal,
                GoalInfo0, GoalInfo, ModeInfo0, ModeInfo) :-
        ( Goal = conj([]) ->
+               %
+               % When modecheck_unify.m replaces a unification with a
+               % dead variable with `true', make sure the instmap_delta
+               % of the goal is empty. The code generator and
+               % mode_util__recompute_instmap_delta can be confused
+               % by references to the dead variable in the instmap_delta,
+               % resulting in calls to error/1.
+               %
                instmap_delta_init_reachable(DeltaInstMap),
                mode_info_set_instmap(InstMap0, ModeInfo0, ModeInfo)
        ;

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