[m-dev.] diff: GCC back-end: bug fix with static initializers

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 10 20:27:32 AEDT 2001


This fixes some but not all of the bugs with --static-ground-terms.

----------

Estimated hours taken: 0.75

mercury/compiler/mlds_to_gcc.m:
	Fix a bug: it wasn't passing the array size down for
	initializers of global variables.

--- mlds_to_gcc.m	2001/01/08 03:01:53	1.14
+++ mlds_to_gcc.m	2001/01/10 09:24:19	1.15
@@ -631,8 +631,10 @@
 		{ FuncInfo = func_info(GlobalInfo0, Name, LocalVars,
 			LabelTable) },
 		{ GCC_Name = build_qualified_name(Name) },
-		build_type(Type, GlobalInfo0, GCC_Type),
-		build_initializer(Initializer, GCC_Type, FuncInfo, GCC_Initializer),
+		build_type(Type, initializer_array_size(Initializer),
+			GlobalInfo0, GCC_Type),
+		build_initializer(Initializer, GCC_Type, FuncInfo,
+			GCC_Initializer),
 		gcc__build_global_var_decl(GCC_Name, GCC_Type, GCC_Initializer,
 			GCC_Defn),
 		add_var_decl_flags(Flags, GCC_Defn),

-- 
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