[m-dev.] diff: fix tabling for GCC back-end

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 1 02:57:23 AEDT 2001


Estimated hours taken: 1

Fix a bug that broke tabling for the GCC back-end.

compiler/mlds.m:
	Document that `one_copy' (static) variables
	must have initializers.

compiler/ml_code_gen.m:
	Explicitly initialize the tabling_pointer variables to null.

Workspace: /home/hg/fjh/gcc-cvs/gcc/mercury
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.76
diff -u -d -r1.76 ml_code_gen.m
--- compiler/ml_code_gen.m	2001/02/20 07:52:16	1.76
+++ compiler/ml_code_gen.m	2001/02/28 15:53:31
@@ -1000,10 +1000,11 @@
 		ml_gen_pred_label(ModuleInfo, PredId, ProcId,
 			MLDS_PredLabel, _MLDS_PredModule),
 		Var = tabling_pointer(MLDS_PredLabel - ProcId),
+		Type = mlds__generic_type,
+		Initializer = init_obj(const(null(Type))),
 		proc_info_context(ProcInfo, Context),
 		TablePointerVarDefn = ml_gen_mlds_var_decl(
-			Var, mlds__generic_type,
-			mlds__make_context(Context)),
+			Var, Type, Initializer, mlds__make_context(Context)),
 		Defns = [TablePointerVarDefn | Defns0]
 	;
 		Defns = Defns0
Index: compiler/mlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds.m,v
retrieving revision 1.48
diff -u -d -r1.48 mlds.m
--- compiler/mlds.m	2001/02/26 06:19:31	1.48
+++ compiler/mlds.m	2001/02/28 15:45:15
@@ -414,6 +414,8 @@
 			mlds__class_defn
 		).
 
+	% Note that `one_copy' variables *must* have an initializer
+	% (the GCC back-end relies on this).
 :- type mlds__initializer
 	--->	init_obj(mlds__rval)
 	;	init_struct(list(mlds__initializer))
@@ -595,6 +597,9 @@
 	--->	one_copy	% i.e. "static" storage duration
 				% (but not necessarily static linkage)
 				% or static member function
+				% Note that `one_copy' variables
+				% *must* have an initializer
+				% (the GCC back-end relies on this.)
 	;	per_instance.	% i.e. "auto" local variable in function,
 				% or non-static member of class.
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  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