[m-dev.] diff: fix acc intro/deforestation problem

Peter Ross petdr at cs.mu.OZ.AU
Fri Feb 11 16:37:26 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 0.5

mercury/compiler/accumulator.m:
    The goal_info of the initial call to the introduced predicate had
    the incorrect set of nonlocals causing problems for deforestation.


Index: accumulator.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/accumulator.m,v
retrieving revision 1.7
diff -u -r1.7 accumulator.m
--- accumulator.m	1999/09/12 04:26:36	1.7
+++ accumulator.m	2000/02/11 05:20:29
@@ -994,7 +994,7 @@
 	DP = goal(DecomposeProcess, _InstMapBeforeDecomposeProcess),
 	R0 = goal(Recursive, _InstMapBeforeRecursive),
 	(
-		Recursive = GoalExpr0 - GoalInfo,
+		Recursive = GoalExpr0 - GoalInfo0,
 		GoalExpr0 = call(_, _, Vars, Builtin, Context, _)
 	->
 			% Calculate what vars the new call should use.
@@ -1004,6 +1004,9 @@
 		list__append(CallVars0, ExtraVars, CallVars),
 		GoalExpr = call(PredId, ProcId, CallVars,
 				Builtin, Context, Name),
+
+		goal_info_set_nonlocals(GoalInfo0, set__list_to_set(CallVars),
+				GoalInfo),
 
 			% Rename the variables in the goal.
 		map__init(Subst0),

----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
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