[m-rev.] diff: reduce the size of debug-grade .c files

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Mar 8 15:07:26 AEDT 2004


Reduce the size of the generated C source files in debugging grades. The
motivation for this change is the observation that a workspace compiled in
a debug grade takes up a large fraction of a gigabyte, and the largest
fraction of this is the C files. The largest debug-grade generated source
file, parse_tree.modules.c, is 23.5 megabytes (!) in size, whereas
parse_tree.modules.o is only about 3.5 megabytes (modules.m itself is only
about a quarter of a megabyte).

We use three techniques to reduce the C source file size.

The first is to get rid of unnecessary casts of constants in data structure
initialization. When putting an integer constant into a field of type (e.g.)
MR_uint_least8_t, the general purpose rval output routines we used to use
cast the constant first to MR_Integer and then to MR_uint_least8_t, even
though in that specific case neither cast is needed. Similarly, there is no
need to cast pointer constants (or the integer 0) twice when used in
contexts where pointers are expected; one cast to the final type is enough.

The second technique is to take advantage of sequences of fields of the
same type. Instead of using long type definitions with one field per argument,
we can now use much shorter type definitions with one field, an array,
per run of arguments of the same type.

The third technique is reduce the length of the names of the data structures
containing common cells and their types, by reducing the length of their
prefixes and module qualify them only if we have to, and deleting the duplicate
mercury_ prefixes from the names of some debugger data structures.

Together, these changes reduce the size of parse_tree.modules.c to 13.2 Mb,
a reduction of more than 43%. There is a small reduction in the size of the
object file (about 3%, due to shorter symbol names in the relocation section),
and there is a very slight increase in compilation time in debug grades
(in non-debug grades, the increase in compilation time is negligible).
Given the inconvenience of running out of disk space, this is a good tradeoff.

compiler/llds.m:
	Change the definition of static term data structures to allow for
	the type of the cell being defined in terms of structure fields
	containing arrays.

compiler/llds_out.m:
	Change the code that writes out the types and the contents of
	static term data structures to handle structure fields containing
	arrays.

	Do not cast integer initializers unnecessarily.

	Do not module qualify the names of the global variables holding
	common cells unnecessarily, and use shorter prefixes for them.

compiler/global_data.m:
	Look for opportunities to group sequences of fields into arrays.

	Use the more compact description of cell types possible when using
	arrays to speed up lookups in the cell type map.

	Change a predicate interface to make it cheaper to implement in the
	presence of array fields.

compiler/var_locn.m:
	Use the updated interface in global_data.m.

compiler/name_mangle.m:
	Provide functions for the shorter prefixes for common cell names and
	types.

	Provide a predicate for printing proc_labels without the mercury_
	prefix.

compiler/layout_out.m:
	Omit the duplicate mercury_ prefixes within the names of most debugger
	data structures. (Some need it to allow C macros to derive their names
	from the names of labels.)

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/global_data.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/global_data.m,v
retrieving revision 1.1
diff -u -b -r1.1 global_data.m
--- compiler/global_data.m	9 May 2003 06:08:03 -0000	1.1
+++ compiler/global_data.m	6 Mar 2004 18:58:19 -0000
@@ -76,8 +76,8 @@
 :- pred add_static_cell_natural_types(list(rval)::in, data_addr::out,
 	static_cell_info::in, static_cell_info::out) is det.
 
-:- pred search_static_cell(static_cell_info::in, data_addr::in,
-	assoc_list(rval, llds_type)::out) is semidet.
+:- pred search_static_cell_offset(static_cell_info::in, data_addr::in, int::in,
+	rval::out) is semidet.
 
 :- func get_static_cells(static_cell_info) = list(comp_gen_c_data).
 
@@ -95,7 +95,7 @@
 :- import_module ll_backend__layout.
 :- import_module ll_backend__llds_out.
 
-:- import_module int, counter, set, map, std_util.
+:- import_module int, counter, set, map, std_util, require.
 
 :- type proc_var_map	==	map(pred_proc_id, comp_gen_c_var).
 :- type proc_layout_map	==	map(pred_proc_id, proc_layout_info).
@@ -194,9 +194,20 @@
 
 %-----------------------------------------------------------------------------%
 
+:- type cell_type
+	--->	plain_type(list(llds_type))
+	;	grouped_type(assoc_list(llds_type, int)).
+
+:- type cell_args
+	--->	plain_args(assoc_list(rval, llds_type))
+	;	grouped_args(list(common_cell_arg_group)).
+
+	% There is one cell_type_group for every group of cells that share
+	% the same sequence of argument types. We don't actually need the
+	% cell type here, since we can't get to a cell_type_group from
+	% the cell_group_map without knowing it.
 :- type cell_type_group
 	--->	cell_type_group(
-			% cell_arg_types		:: list(llds_type)
 			cell_type_number 	:: int,
 			cell_group_members	:: map(list(rval), data_name)
 		).
@@ -209,8 +220,7 @@
 			cell_counter	:: counter,	% next cell number
 			type_counter	:: counter,	% next type number
 			cells		:: map(int, comp_gen_c_data),
-			cell_group_map	:: map(list(llds_type),
-						cell_type_group)
+			cell_group_map	:: map(cell_type, cell_type_group)
 					% map cell argument types and then cell
 					% contents to the id of the common cell
 		).
@@ -221,6 +231,11 @@
 	Info0 = static_cell_info(BaseName, UnboxFloat, CommonData,
 		counter__init(0), counter__init(0), Cells0, CellMap0).
 
+add_static_cell_natural_types(Args, DataAddr, !Info) :-
+	list__map(associate_natural_type(!.Info ^ unbox_float), Args,
+		ArgsTypes),
+	add_static_cell(ArgsTypes, DataAddr, !Info).
+
 add_static_cell(ArgsTypes0, DataAddr, !Info) :-
 		% If we have an empty cell, place a dummy field in it,
 		% so that the generated C structure isn't empty.
@@ -229,10 +244,18 @@
 	;
 		ArgsTypes = ArgsTypes0
 	),
+	compute_cell_type(ArgsTypes, CellType, CellTypeAndValue), 
+	do_add_static_cell(ArgsTypes, CellType, CellTypeAndValue, DataAddr,
+		!Info).
+
+:- pred do_add_static_cell(assoc_list(rval, llds_type)::in, cell_type::in,
+	cell_args::in, data_addr::out,
+	static_cell_info::in, static_cell_info::out) is det.
+
+do_add_static_cell(ArgsTypes, CellType, CellArgs, DataAddr, !Info) :-
 	assoc_list__keys(ArgsTypes, Args),
-	assoc_list__values(ArgsTypes, Types),
 	CellGroupMap0 = !.Info ^ cell_group_map,
-	( map__search(CellGroupMap0, Types, CellGroup0) ->
+	( map__search(CellGroupMap0, CellType, CellGroup0) ->
 		TypeNum = CellGroup0 ^ cell_type_number,
 		CellGroup1 = CellGroup0
 	;
@@ -255,7 +278,8 @@
 			map__set(MembersMap0, Args, DataName, MembersMap),
 			CellGroup = CellGroup1 ^ cell_group_members
 				:= MembersMap,
-			map__set(CellGroupMap0, Types, CellGroup, CellGroupMap),
+			map__set(CellGroupMap0, CellType, CellGroup,
+				CellGroupMap),
 			!:Info = !.Info ^ cell_group_map := CellGroupMap
 		;
 			!.Info ^ common_data = no
@@ -264,90 +288,101 @@
 			% be useful when comparing the LLDS and MLDS backends.
 		),
 		Cells0 = !.Info ^ cells,
-		Cell = common_data(ModuleName, CellNum, TypeNum, ArgsTypes),
+		(
+			CellArgs = plain_args(PlainArgs),
+			CellTypeAndValue =
+				plain_type_and_value(TypeNum, PlainArgs)
+		;
+			CellArgs = grouped_args(GroupedArgs),
+			CellTypeAndValue =
+				grouped_type_and_value(TypeNum, GroupedArgs)
+		),
+		Cell = common_data(ModuleName, CellNum, CellTypeAndValue),
 		map__det_insert(Cells0, CellNum, Cell, Cells),
 		!:Info = !.Info ^ cells := Cells
 	),
 	DataAddr = data_addr(ModuleName, DataName).
 
-add_static_cell_natural_types(Args, DataAddr, !Info) :-
-	list__map(associate_natural_type(!.Info ^ unbox_float), Args,
-		ArgsTypes),
-	add_static_cell(ArgsTypes, DataAddr, !Info).
+:- pred compute_cell_type(assoc_list(rval, llds_type)::in, cell_type::out,
+	cell_args::out) is det.
 
-search_static_cell(Info, DataAddr, ArgsTypes) :-
+compute_cell_type(ArgsTypes, CellType, CellTypeAndValue) :-
+	(
+		ArgsTypes = [FirstArg - FirstArgType | LaterArgsTypes],
+		threshold_group_types(FirstArgType, [FirstArg], LaterArgsTypes,
+			TypeGroups, TypeAndArgGroups),
+		OldLength = list__length(ArgsTypes),
+		NewLength = list__length(TypeAndArgGroups),
+		OldLength >= NewLength * 2
+	->
+		CellType = grouped_type(TypeGroups),
+		CellTypeAndValue = grouped_args(TypeAndArgGroups)
+	;
+		CellType = plain_type(assoc_list__values(ArgsTypes)),
+		CellTypeAndValue = plain_args(ArgsTypes)
+	).
+
+:- pred threshold_group_types(llds_type::in, list(rval)::in,
+	assoc_list(rval, llds_type)::in, assoc_list(llds_type, int)::out,
+	list(common_cell_arg_group)::out) is semidet.
+
+threshold_group_types(CurType, RevArgsSoFar, LaterArgsTypes, TypeGroups,
+		TypeAndArgGroups) :-
+	(
+		LaterArgsTypes = [],
+		list__length(RevArgsSoFar, NumArgsSoFar),
+		TypeGroup = CurType - NumArgsSoFar,
+		TypeAndArgGroup = common_cell_arg_group(CurType,
+			NumArgsSoFar, list__reverse(RevArgsSoFar)),
+		TypeGroups = [TypeGroup],
+		TypeAndArgGroups = [TypeAndArgGroup]
+	;
+		LaterArgsTypes = [NextArg - NextType | MoreArgsTypes],
+		( CurType = NextType ->
+			threshold_group_types(CurType,
+				[NextArg | RevArgsSoFar], MoreArgsTypes,
+				TypeGroups, TypeAndArgGroups)
+		;
+			list__length(RevArgsSoFar, NumArgsSoFar),
+			threshold_group_types(NextType, [NextArg],
+				MoreArgsTypes,
+				TypeGroupsTail, TypeAndArgGroupsTail),
+			TypeGroup = CurType - NumArgsSoFar,
+			TypeAndArgGroup = common_cell_arg_group(CurType,
+				NumArgsSoFar, list__reverse(RevArgsSoFar)),
+			TypeGroups = [TypeGroup | TypeGroupsTail],
+			TypeAndArgGroups = [TypeAndArgGroup |
+				TypeAndArgGroupsTail]
+		)
+	).
+
+search_static_cell_offset(Info, DataAddr, Offset, Rval) :-
 	DataAddr = data_addr(Info ^ module_name, DataName),
 	DataName = common(CellNum, _),
 	map__search(Info ^ cells, CellNum, CompGenCData),
-	CompGenCData = common_data(_, _, _, ArgsTypes).
+	CompGenCData = common_data(_, _, TypeAndValue),
+	(
+		TypeAndValue = plain_type_and_value(_, ArgsTypes),
+		list__index0_det(ArgsTypes, Offset, Rval - _)
+	;
+		TypeAndValue = grouped_type_and_value(_, ArgGroups),
+		offset_into_group(ArgGroups, Offset, Rval)
+	).
 
-get_static_cells(Info) = map__values(Info ^ cells).
+:- pred offset_into_group(list(common_cell_arg_group)::in, int::in, rval::out)
+	is det.
 
-% %-----------------------------------------------------------------------------%
-% 
-% :- pred flatten_arg_types(list(rval)::in, create_arg_types::in,
-% 	bool::in, assoc_list(rval, llds_type)::out) is det.
-% 
-% flatten_arg_types(Args, uniform(MaybeType), UnboxFloat, TypedRvals) :-
-% 	flatten_uniform_arg_types(Args, MaybeType, UnboxFloat, TypedRvals).
-% flatten_arg_types(Args, initial(InitialTypes, RestTypes), UnboxFloat,
-% 		TypedRvals) :-
-% 	flatten_initial_arg_types(Args, InitialTypes, RestTypes, UnboxFloat,
-% 		TypedRvals).
-% flatten_arg_types(Args, none, _, []) :-
-% 	require(unify(Args, []), "too many args for specified arg types").
-% 
-% :- pred flatten_uniform_arg_types(list(rval)::in, maybe(llds_type)::in,
-% 	bool::in, assoc_list(rval, llds_type)::out) is det.
-% 
-% flatten_uniform_arg_types([], _, _, []).
-% flatten_uniform_arg_types([Rval | Rvals], MaybeType, UnboxFloat,
-% 		[Rval - Type | TypedRvals]) :-
-% 	llds_arg_type(Rval, MaybeType, UnboxFloat, Type),
-% 	flatten_uniform_arg_types(Rvals, MaybeType, UnboxFloat, TypedRvals).
-% 
-% :- pred flatten_initial_arg_types(list(rval)::in, initial_arg_types::in,
-% 	create_arg_types::in, bool::in, assoc_list(rval, llds_type)::out)
-% 	is det.
-% 
-% flatten_initial_arg_types(Args, [], RestTypes, UnboxFloat, TypedRvals) :-
-% 	flatten_arg_types(Args, RestTypes, UnboxFloat, TypedRvals).
-% flatten_initial_arg_types(Args, [N - MaybeType | InitTypes], RestTypes,
-% 		UnboxFloat, TypedRvals) :-
-% 	flatten_initial_arg_types_2(Args, N, MaybeType, InitTypes, RestTypes,
-% 		UnboxFloat, TypedRvals).
-% 
-% :- pred flatten_initial_arg_types_2(list(rval)::in, int::in,
-% 	maybe(llds_type)::in, initial_arg_types::in, create_arg_types::in,
-% 	bool::in, assoc_list(rval, llds_type)::out) is det.
-% 
-% flatten_initial_arg_types_2([], N, _, _, _, _, []) :-
-% 	require(unify(N, 0), "not enough args for specified arg types").
-% flatten_initial_arg_types_2([Rval | Rvals], N, MaybeType, InitTypes,
-% 		RestTypes, UnboxFloat, TypedRvals) :-
-% 	( N = 0 ->
-% 		flatten_initial_arg_types([Rval | Rvals], InitTypes,
-% 			RestTypes, UnboxFloat, TypedRvals)
-% 	;
-% 		llds_arg_type(Rval, MaybeType, UnboxFloat, Type),
-% 		flatten_initial_arg_types_2(Rvals, N - 1, MaybeType,
-% 			InitTypes, RestTypes, UnboxFloat,
-% 			TypedRvalsTail),
-% 		TypedRvals = [Rval - Type | TypedRvalsTail]
-% 	).
-% 
-% 	% Given an rval, figure out the type it would have as an argument,
-% 	% if it is not explicitly specified.
-% 
-% :- pred llds_arg_type(rval::in, maybe(llds_type)::in, bool::in,
-% 	llds_type::out) is det.
-% 
-% llds_arg_type(Rval, MaybeType, UnboxFloat, Type) :-
-% 	( MaybeType = yes(SpecType) ->
-% 		Type = SpecType
-% 	;
-% 		rval_type_as_arg(Rval, UnboxFloat, Type)
-% 	).
+offset_into_group([], _, _) :-
+	error("offset_into_group: offset out of bounds").
+offset_into_group([Group | Groups], Offset, Rval) :-
+	Group = common_cell_arg_group(_, NumRvalsInGroup, Rvals),
+	( Offset < NumRvalsInGroup ->
+		list__index0_det(Rvals, Offset, Rval)
+	;
+		offset_into_group(Groups, Offset - NumRvalsInGroup, Rval)
+	).
+
+get_static_cells(Info) = map__values(Info ^ cells).
 
 rval_type_as_arg(Rval, ExprnOpts, Type) :-
 	natural_type(ExprnOpts ^ unboxed_float, Rval, Type).
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.28
diff -u -b -r1.28 layout_out.m
--- compiler/layout_out.m	11 Nov 2003 03:35:07 -0000	1.28
+++ compiler/layout_out.m	8 Mar 2004 02:35:22 -0000
@@ -188,6 +188,10 @@
 
 	% This code should be kept in sync with output_layout_name/3 below.
 make_label_layout_name(Label) = Name :-
+	% We can't omit the mercury_ prefix on LabelName, even though the
+	% mercury_data_prefix duplicates it, because there is no simply way
+	% to make the MR_init_label_sl macro delete that prefix from the
+	% label's name to get the name of its layout structure.
 	LabelName = label_to_c_string(Label, yes),
 	string__append_list([
 		mercury_data_prefix,
@@ -203,19 +207,23 @@
 output_layout_name(proc_layout(ProcLabel, _)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_proc_layout__"),
-	output_proc_label(ProcLabel).
+	% We can't omit the mercury_ prefix on ProcLabel, even though the
+	% mercury_data_prefix duplicates it, because there is no simply way
+	% to make the MR_init_entryl_sl macro delete that prefix from the
+	% entry label's name to get the name of its layout structure.
+	output_proc_label(ProcLabel, yes).
 output_layout_name(proc_layout_head_var_nums(ProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_head_var_nums__"),
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(proc_layout_var_names(ProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_var_names__"),
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(closure_proc_id(CallerProcLabel, SeqNo, _)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_closure_layout__"),
-	output_proc_label(CallerProcLabel),
+	output_proc_label(CallerProcLabel, no),
 	io__write_string("_"),
 	io__write_int(SeqNo).
 output_layout_name(file_layout(ModuleName, FileNum)) -->
@@ -263,32 +271,32 @@
 	io__write_string(mercury_data_prefix),
 	io__write_string("_proc_static__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(proc_static_call_sites(RttiProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_proc_static_call_sites__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(table_io_decl(RttiProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_table_io_decl__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(table_gen_info(RttiProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_table_gen__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(table_gen_enum_params(RttiProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_table_enum_params__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 output_layout_name(table_gen_steps(RttiProcLabel)) -->
 	io__write_string(mercury_data_prefix),
 	io__write_string("_table_steps__"),
 	{ ProcLabel = make_proc_label_from_rtti(RttiProcLabel) },
-	output_proc_label(ProcLabel).
+	output_proc_label(ProcLabel, no).
 
 output_layout_name_storage_type_name(label_layout(Label, LabelVars),
 		_BeingDefined) -->
@@ -495,19 +503,33 @@
 		VarInfo = label_var_info(EncodedVarCount,
 			LocnsTypes, VarNums, TypeParams),
 		io__write_int(EncodedVarCount, !IO),
-		io__write_string(",\n\t(const void *)\n\t\t", !IO),
-		output_rval(LocnsTypes, !IO),
-		io__write_string(",\n\t(const MR_uint_least16_t *)\n\t\t", !IO),
-		output_rval(VarNums, !IO),
-		io__write_string(",\n\t(const MR_Type_Param_Locns *)\n\t\t",
-			!IO),
-		output_rval(TypeParams, !IO)
+		io__write_string(",\n\t(const void *)", !IO),
+		output_rval_as_addr(LocnsTypes, !IO),
+		io__write_string(",\n\t(const MR_uint_least16_t *)", !IO),
+		output_rval_as_addr(VarNums, !IO),
+		io__write_string(",\n\t(const MR_Type_Param_Locns *)", !IO),
+		output_rval_as_addr(TypeParams, !IO)
 	;
 		MaybeVarInfo = no,
 		io__write_int(-1, !IO)
 	),
 	io__write_string("\n};\n", !IO),
 	decl_set_insert(data_addr(layout_addr(LayoutName)), !DeclSet).
+
+	% Output the rval in a context in which it is immediately cast to an
+	% address.
+:- pred output_rval_as_addr(rval::in, io::di, io::uo) is det.
+
+output_rval_as_addr(Rval, !IO) :-
+	( Rval = const(int_const(0)) ->
+		io__write_string(" 0", !IO)
+	; Rval = const(data_addr_const(DataAddr, no)) ->
+		io__write_string(" &", !IO),
+		output_data_addr(DataAddr, !IO)
+	;
+		io__write_string("\n\t\t", !IO),
+		output_rval(Rval, !IO)
+	).
 
 :- func trace_port_to_string(trace_port) = string.
 
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.296
diff -u -b -r1.296 llds.m
--- compiler/llds.m	20 Oct 2003 07:29:06 -0000	1.296
+++ compiler/llds.m	6 Mar 2004 18:40:40 -0000
@@ -71,6 +71,41 @@
 						% represents.
 		).
 
+:- type common_cell_arg_group
+	--->	common_cell_arg_group(
+			llds_type,		% The shared type of the
+						% fields in the group.
+			int,			% The number of fields in the
+						% group. This will contain the
+						% length of the list in the
+						% third argument, but computed
+						% only once.
+			list(rval)		% The field values themselves.
+		).
+
+:- type common_cell_type_and_value
+	--->	plain_type_and_value(
+			int,			% The id number of the C type
+						% of the form common_type_N.
+						% That type will be a structure
+						% with one field for each one
+						% of the cell's arguments.
+			assoc_list(rval, llds_type)
+						% The arguments of the create,
+						% together with their types.
+		)
+	;	grouped_type_and_value(
+			int,			% The id number of the C type
+						% of the form common_type_N.
+						% That type will be a structure
+						% with one field for each group
+						% of the cell's arguments, with
+						% each group containing
+						% elements of the same
+						% llds_type.
+			list(common_cell_arg_group)
+		).
+
 	% Global data generated by the compiler. Usually readonly,
 	% with one exception: data containing code addresses must
 	% be initialized.
@@ -78,15 +113,15 @@
 	--->	common_data(
 			module_name,		% The basename of this C file.
 			int,			% The id number of the cell.
-			int,			% The id number of the C type
-						% giving the types of the args.
+			common_cell_type_and_value
 						% The data_addr referring to
 						% this common_data will be
 						% data_addr(ModuleName,
-						% common(CellNum, TypeNum)).
-			assoc_list(rval, llds_type)
-						% The arguments of the create,
-						% together with their types.
+						% common(CellNum, TypeNum)),
+						% where TypeNum is the
+						% first field of either
+						% plain_type_and_value or
+						% grouped_type_and_value.
 		)
 	;	rtti_data(
 			rtti_data
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.221
diff -u -b -r1.221 llds_out.m
--- compiler/llds_out.m	14 Nov 2003 01:06:03 -0000	1.221
+++ compiler/llds_out.m	7 Mar 2004 11:02:39 -0000
@@ -761,7 +761,7 @@
 :- pred output_c_data_type_def(comp_gen_c_data::in,
 	decl_set::in, decl_set::out, io__state::di, io__state::uo) is det.
 
-output_c_data_type_def(common_data(ModuleName, CellNum, TypeNum, ArgsTypes),
+output_c_data_type_def(common_data(ModuleName, CellNum, TypeAndValue),
 		!DeclSet, !IO) :-
 	io__write_string("\n", !IO),
 
@@ -772,20 +772,19 @@
 		% visible to the other C files for that Mercury module.
 	globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
 	ExportedFromFile = SplitFiles,
-
+	TypeNum = common_cell_get_type_num(TypeAndValue),
 	TypeDeclId = common_type(ModuleName, TypeNum),
 	( decl_set_is_member(TypeDeclId, !.DeclSet) ->
 		true
 	;
-		assoc_list__values(ArgsTypes, Types),
-		output_const_term_type(Types, ModuleName, TypeNum,
+		output_const_term_type(TypeAndValue, ModuleName,
 			"", "", 0, _, !IO),
 		io__write_string("\n", !IO),
 		decl_set_insert(TypeDeclId, !DeclSet)
 	),
 	VarName = common(CellNum, TypeNum),
 	VarDeclId = data_addr(data_addr(ModuleName, VarName)),
-	output_const_term_decl_or_defn(ArgsTypes, ModuleName, CellNum, TypeNum,
+	output_const_term_decl_or_defn(TypeAndValue, ModuleName, CellNum,
 		ExportedFromFile, no, "", "", 0, _, !IO),
 	decl_set_insert(VarDeclId, !DeclSet).
 output_c_data_type_def(rtti_data(RttiData), !DeclSet, !IO) :-
@@ -831,10 +830,10 @@
 :- pred output_comp_gen_c_data(comp_gen_c_data::in,
 	decl_set::in, decl_set::out, io__state::di, io__state::uo) is det.
 
-output_comp_gen_c_data(common_data(ModuleName, CellNum, TypeNum, ArgsTypes),
+output_comp_gen_c_data(common_data(ModuleName, CellNum, TypeAndValue),
 		!DeclSet, !IO) :-
 	io__write_string("\n", !IO),
-	assoc_list__keys(ArgsTypes, Args),
+	Args = common_cell_get_rvals(TypeAndValue),
 	output_rvals_decls(Args, !DeclSet, !IO),
 
 		% The code for data local to a Mercury module
@@ -845,9 +844,10 @@
 	globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
 	ExportedFromFile = SplitFiles,
 
+	TypeNum = common_cell_get_type_num(TypeAndValue),
 	VarName = common(CellNum, TypeNum),
 	VarDeclId = data_addr(data_addr(ModuleName, VarName)),
-	output_const_term_decl_or_defn(ArgsTypes, ModuleName, CellNum, TypeNum,
+	output_const_term_decl_or_defn(TypeAndValue, ModuleName, CellNum,
 		ExportedFromFile, yes, "", "", 0, _, !IO),
 	decl_set_insert(VarDeclId, !DeclSet).
 output_comp_gen_c_data(rtti_data(RttiData), !DeclSet, !IO) :-
@@ -2179,6 +2179,33 @@
 
 %-----------------------------------------------------------------------------%
 
+:- func common_cell_get_type_num(common_cell_type_and_value) = int.
+
+common_cell_get_type_num(TypeAndValue) = TypeNum :-
+	(
+		TypeAndValue = plain_type_and_value(TypeNum, _)
+	;
+		TypeAndValue = grouped_type_and_value(TypeNum, _)
+	).
+
+:- func common_cell_get_rvals(common_cell_type_and_value) = list(rval).
+
+common_cell_get_rvals(TypeAndValue) = Rvals :-
+	(
+		TypeAndValue = plain_type_and_value(_, RvalsTypes),
+		assoc_list__keys(RvalsTypes, Rvals)
+	;
+		TypeAndValue = grouped_type_and_value(_, Groups),
+		RvalLists = list__map(common_group_get_rvals, Groups),
+		list__condense(RvalLists, Rvals)
+	).
+
+:- func common_group_get_rvals(common_cell_arg_group) = list(rval).
+
+common_group_get_rvals(common_cell_arg_group(_, _, Rvals)) = Rvals.
+
+%-----------------------------------------------------------------------------%
+
 	% We output constant terms as follows:
 	%
 	%	struct <prefix>_common_type_<TypeNum> {		// Type
@@ -2201,27 +2228,35 @@
 	% output_const_term_type outputs the first part above. The second
 	% and third parts are output by output_const_term_decl_or_defn.
 
-:- pred output_const_term_type(list(llds_type)::in, module_name::in, int::in,
+:- pred output_const_term_type(common_cell_type_and_value::in, module_name::in,
 	string::in, string::in, int::in, int::out,
 	io__state::di, io__state::uo) is det.
 
-output_const_term_type(Types, ModuleName, TypeNum, FirstIndent, LaterIndent,
+output_const_term_type(TypeAndValue, ModuleName, FirstIndent, LaterIndent,
 		!N, !IO) :-
 	output_indent(FirstIndent, LaterIndent, !.N, !IO),
 	!:N = !.N + 1,
 	io__write_string("struct ", !IO),
+	TypeNum = common_cell_get_type_num(TypeAndValue),
 	output_common_cell_type_name(ModuleName, TypeNum, !IO),
 	io__write_string(" {\n", !IO),
-	output_cons_arg_types(Types, "\t", 1, !IO),
+	(
+		TypeAndValue = plain_type_and_value(_, ArgsTypes),
+		assoc_list__values(ArgsTypes, Types),
+		output_cons_arg_types(Types, "\t", 1, !IO)
+	;
+		TypeAndValue = grouped_type_and_value(_, ArgGroups),
+		output_cons_arg_group_types(ArgGroups, "\t", 1, !IO)
+	),
 	io__write_string("};\n", !IO).
 
-:- pred output_const_term_decl_or_defn(assoc_list(rval, llds_type)::in,
-	module_name::in, int::in, int::in, bool::in, bool::in,
+:- pred output_const_term_decl_or_defn(common_cell_type_and_value::in,
+	module_name::in, int::in, bool::in, bool::in,
 	string::in, string::in, int::in, int::out,
 	io__state::di, io__state::uo) is det.
 
-output_const_term_decl_or_defn(ArgsTypes, ModuleName, CellNum, TypeNum,
-		Exported, IsDefn, FirstIndent, LaterIndent, !N, !IO) :-
+output_const_term_decl_or_defn(TypeAndValue, ModuleName, CellNum, Exported,
+		IsDefn, FirstIndent, LaterIndent, !N, !IO) :-
 	output_indent(FirstIndent, LaterIndent, !.N, !IO),
 	!:N = !.N + 1,
 	(
@@ -2231,6 +2266,7 @@
 		Exported = no,
 		io__write_string("static const struct ", !IO)
 	),
+	TypeNum = common_cell_get_type_num(TypeAndValue),
 	output_common_cell_type_name(ModuleName, TypeNum, !IO),
 	io__write_string("\n\t", !IO),
 	VarDeclId = data_addr(ModuleName, common(CellNum, TypeNum)),
@@ -2241,7 +2277,13 @@
 	;
 		IsDefn = yes,
 		io__write_string(" =\n{\n", !IO),
-		output_cons_args(ArgsTypes, "\t", !IO),
+		(
+			TypeAndValue = plain_type_and_value(_, ArgsTypes),
+			output_cons_args(ArgsTypes, "\t", !IO)
+		;
+			TypeAndValue = grouped_type_and_value(_, ArgGroups),
+			output_cons_arg_groups(ArgGroups, "\t", !IO)
+		),
 		io__write_string(LaterIndent, !IO),
 		io__write_string("};\n", !IO)
 	).
@@ -2294,6 +2336,21 @@
 	io__write_string(";\n", !IO),
 	output_cons_arg_types(Types, Indent, ArgNum + 1, !IO).
 
+:- pred output_cons_arg_group_types(list(common_cell_arg_group)::in,
+	string::in, int::in, io__state::di, io__state::uo) is det.
+
+output_cons_arg_group_types([], _, _, !IO).
+output_cons_arg_group_types([Group | Groups], Indent, ArgNum, !IO) :-
+	io__write_string(Indent, !IO),
+	Group = common_cell_arg_group(Type, ArraySize, _),
+	output_llds_type(Type, !IO),
+	io__write_string(" f", !IO),
+	io__write_int(ArgNum, !IO),
+	io__write_string("[", !IO),
+	io__write_int(ArraySize, !IO),
+	io__write_string("];\n", !IO),
+	output_cons_arg_group_types(Groups, Indent, ArgNum + 1, !IO).
+
 	% Given an rval, figure out the type it would have as
 	% an argument.  Normally that's the same as its usual type;
 	% the exception is that for boxed floats, the type is data_ptr
@@ -2351,7 +2408,14 @@
 output_cons_args([], _Indent, !IO).
 output_cons_args([Rval - Type | RvalsTypes], Indent, !IO) :-
 	io__write_string(Indent, !IO),
-	output_rval_as_type(Rval, Type, !IO),
+	(
+		direct_field_int_constant(Type) = yes,
+		Rval = const(int_const(N))
+	->
+		io__write_int(N, !IO)
+	;
+		output_rval_as_type(Rval, Type, !IO)
+	),
 	( RvalsTypes \= [] ->
 		io__write_string(",\n", !IO),
 		output_cons_args(RvalsTypes, Indent, !IO)
@@ -2359,6 +2423,62 @@
 		io__write_string("\n", !IO)
 	).
 
+:- pred output_cons_arg_groups(list(common_cell_arg_group)::in, string::in,
+	io__state::di, io__state::uo) is det.
+
+output_cons_arg_groups([], _Indent, !IO).
+output_cons_arg_groups([Group | Groups], Indent, !IO) :-
+	Group = common_cell_arg_group(Type, _, Rvals),
+	io__write_string(Indent, !IO),
+	io__write_string("{\n", !IO),
+	(
+		direct_field_int_constant(Type) = yes,
+		list__map(project_int_constant, Rvals, Ints)
+	->
+		output_cons_arg_group_ints(Ints, Indent, !IO)
+	;
+		output_cons_arg_group_elements(Type, Rvals, Indent, !IO)
+	),
+	io__write_string(Indent, !IO),
+	( Groups \= [] ->
+		io__write_string("},\n", !IO),
+		output_cons_arg_groups(Groups, Indent, !IO)
+	;
+		io__write_string("}\n", !IO)
+	).
+
+:- pred output_cons_arg_group_elements(llds_type::in, list(rval)::in,
+	string::in, io__state::di, io__state::uo) is det.
+
+output_cons_arg_group_elements(_, [], _Indent, !IO).
+output_cons_arg_group_elements(Type, [Rval | Rvals], Indent, !IO) :-
+	io__write_string(Indent, !IO),
+	output_rval_as_type(Rval, Type, !IO),
+	( Rvals \= [] ->
+		io__write_string(",\n", !IO),
+		output_cons_arg_group_elements(Type, Rvals, Indent, !IO)
+	;
+		io__write_string("\n", !IO)
+	).
+
+:- pred output_cons_arg_group_ints(list(int)::in, string::in,
+	io__state::di, io__state::uo) is det.
+
+output_cons_arg_group_ints([], _Indent, !IO).
+output_cons_arg_group_ints([Int | Ints], Indent, !IO) :-
+	io__write_string(Indent, !IO),
+	io__write_int(Int, !IO),
+	( Ints \= [] ->
+		io__write_string(",\n", !IO),
+		output_cons_arg_group_ints(Ints, Indent, !IO)
+	;
+		io__write_string("\n", !IO)
+	).
+
+:- pred project_int_constant(rval::in, int::out) is semidet.
+
+project_int_constant(const(int_const(N)), N).
+
 %-----------------------------------------------------------------------------%
 
 % output_lval_decls(Lval, ...) outputs the declarations of any
@@ -2712,6 +2832,9 @@
 	).
 output_goto(imported(ProcLabel), CallerLabel, !IO) :-
 	io__write_string("MR_tailcall(MR_ENTRY(", !IO),
+/* ### In clause for predicate `ll_backend.llds_out.output_goto/4': */
+/* ###   error: wrong number of arguments (3; should be 4) */
+/* ###   in call to predicate `output_proc_label'. */
 	output_proc_label(ProcLabel, !IO),
 	io__write_string("),\n\t\t", !IO),
 	output_label_as_code_addr(CallerLabel, !IO),
@@ -2843,6 +2966,9 @@
 	output_label_as_code_addr(Label, !IO).
 output_code_addr(imported(ProcLabel), !IO) :-
 	io__write_string("MR_ENTRY(", !IO),
+/* ### In clause for predicate `ll_backend.llds_out.output_code_addr/3': */
+/* ###   error: wrong number of arguments (3; should be 4) */
+/* ###   in call to predicate `output_proc_label'. */
 	output_proc_label(ProcLabel, !IO),
 	io__write_string(")", !IO).
 output_code_addr(succip, !IO) :-
@@ -2923,10 +3049,7 @@
 output_data_addr(ModuleName, VarName, !IO) :-
 	(
 		VarName = common(CellNum, _TypeNum),
-		MangledModuleName = sym_name_mangle(ModuleName),
-		io__write_string(mercury_data_prefix, !IO),
-		io__write_string(MangledModuleName, !IO),
-		io__write_string("__common_", !IO),
+		output_common_prefix(ModuleName, common_prefix_var, !IO),
 		io__write_int(CellNum, !IO)
 	;
 		VarName = tabling_pointer(ProcLabel),
@@ -2937,11 +3060,38 @@
 	io__state::di, io__state::uo) is det.
 
 output_common_cell_type_name(ModuleName, TypeNum, !IO) :-
+	output_common_prefix(ModuleName, common_prefix_type, !IO),
+	io__write_int(TypeNum, !IO).
+
+:- type common_prefix
+	--->	common_prefix_var
+	;	common_prefix_type.
+
+:- pred output_common_prefix(module_name::in, common_prefix::in,
+	io::di, io::uo) is det.
+
+output_common_prefix(ModuleName, Prefix, !IO) :-
+	(
+		Prefix = common_prefix_var,
+		io__write_string(mercury_common_prefix, !IO)
+	;
+		Prefix = common_prefix_type,
+		io__write_string(mercury_common_type_prefix, !IO)
+	),
+	globals__io_lookup_bool_option(split_c_files, SplitFiles, !IO),
+	(
+		SplitFiles = no
+		% In the absence of split_c_files, common cells are always
+		% local to a C file, so we don't have to module qualify them,
+		% or the names of their types, and omitting the module
+		% qualification makes the generated C file significantly
+		% smaller in debugging grades.
+	;
+		SplitFiles = yes,
 	MangledModuleName = sym_name_mangle(ModuleName),
-	io__write_string(mercury_data_prefix, !IO),
 	io__write_string(MangledModuleName, !IO),
-	io__write_string("__common_type_", !IO),
-	io__write_int(TypeNum, !IO).
+		io__write_string("__", !IO)
+	).
 
 :- pred output_label_as_code_addr(label::in, io__state::di, io__state::uo)
 	is det.
@@ -3081,10 +3231,24 @@
 				error("output_rval_as_type: type error")
 			)
 		;
+			(
+				Rval = const(int_const(N)),
+				direct_field_int_constant(DesiredType) = yes
+			->
+				% The condition above increases the runtime of
+				% the compiler very slightly. The elimination
+				% of the unnecessary casts reduces the size
+				% of the generated C source file, which has
+				% a considerably longer lifetime. In debugging
+				% grades, the file size difference can be
+				% very substantial (in the range of megabytes).
+				io__write_int(N, !IO)
+			;
 			% cast value to desired type
 			output_llds_type_cast(DesiredType, !IO),
 			output_rval(Rval, !IO)
 		)
+		)
 	).
 
 	% types_match(DesiredType, ActualType) is true iff
@@ -3102,6 +3266,31 @@
 types_match(bool, word).
 types_match(integer, bool).
 
+	% Return true iff an integer constant can be used directly as a value
+	% in a structure field of the given type, instead of being cast to
+	% MR_Integer first and then to the type. The answer can be
+	% conservative: it is always ok to return `no'.
+	%
+	% Only the compiler generates values of the uint_leastN types,
+	% and for these the constant will never be negative.
+	%
+:- func direct_field_int_constant(llds_type) = bool.
+
+direct_field_int_constant(bool) = no.
+direct_field_int_constant(int_least8) = yes.
+direct_field_int_constant(uint_least8) = yes.
+direct_field_int_constant(int_least16) = yes.
+direct_field_int_constant(uint_least16) = yes.
+direct_field_int_constant(int_least32) = yes.
+direct_field_int_constant(uint_least32) = yes.
+direct_field_int_constant(integer) = yes.
+direct_field_int_constant(unsigned) = yes.
+direct_field_int_constant(float) = no.
+direct_field_int_constant(string) = no.
+direct_field_int_constant(data_ptr) = no.
+direct_field_int_constant(code_ptr) = no.
+direct_field_int_constant(word) = no.
+
 	% output a float rval, converted to type `MR_Word *'
 	%
 :- pred output_float_rval_as_data_ptr(rval::in, io__state::di, io__state::uo)
@@ -3206,25 +3395,23 @@
 		output_rval_as_type(Y, float),
 		io__write_string(")")
 	;
-/****
-XXX broken for C == minint
-(since `NewC is 0 - C' overflows)
-		{ Op = (+) },
-		{ Y = const(int_const(C)) },
-		{ C < 0 }
-	->
-		{ NewOp = (-) },
-		{ NewC is 0 - C },
-		{ NewY = const(int_const(NewC)) },
-		io__write_string("("),
-		output_rval(X),
-		io__write_string(" "),
-		output_binary_op(NewOp),
-		io__write_string(" "),
-		output_rval(NewY),
-		io__write_string(")")
-	;
-******/
+% XXX broken for C == minint
+% (since `NewC is 0 - C' overflows)
+% 		{ Op = (+) },
+% 		{ Y = const(int_const(C)) },
+% 		{ C < 0 }
+% 	->
+% 		{ NewOp = (-) },
+% 		{ NewC is 0 - C },
+% 		{ NewY = const(int_const(NewC)) },
+% 		io__write_string("("),
+% 		output_rval(X),
+% 		io__write_string(" "),
+% 		output_binary_op(NewOp),
+% 		io__write_string(" "),
+% 		output_rval(NewY),
+% 		io__write_string(")")
+% 	;
 		% special-case equality ops to avoid some unnecessary
 		% casts -- there's no difference between signed and
 		% unsigned equality, so if both args are unsigned, we
Index: compiler/name_mangle.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/name_mangle.m,v
retrieving revision 1.3
diff -u -b -r1.3 name_mangle.m
--- compiler/name_mangle.m	29 May 2003 17:10:54 -0000	1.3
+++ compiler/name_mangle.m	7 Mar 2004 11:13:19 -0000
@@ -26,9 +26,14 @@
 
 :- import_module io, bool, string.
 
-	% Output a proc label (used for building static call graph for prof).
+	% Output a proc label.
 
-:- pred output_proc_label(proc_label::in, io__state::di, io__state::uo) is det.
+:- pred output_proc_label(proc_label::in, io::di, io::uo) is det.
+
+	% Output a proc label. The boolean controls whether label_prefixs
+	% is added to it.
+
+:- pred output_proc_label(proc_label::in, bool::in, io::di, io::uo) is det.
 
 	% Get a proc label string (used by procs which are exported to C).
 	% The boolean controls whether label_prefix is added to the string.
@@ -85,10 +90,16 @@
 :- func mercury_label_prefix = string.
 
 	% All the C data structures we generate which are either fully static
-	% or static after initialization should have this prefix, to ensure
-	% that Mercury global variables don't clash with C symbols.
+	% or static after initialization should have one of these two prefixes,
+	% to ensure that Mercury global variables don't clash with C symbols.
 
 :- func mercury_data_prefix = string.
+:- func mercury_common_prefix = string.
+
+	% All the C types we generate should have this prefix to ensure
+	% that they don't clash with C symbols.
+
+:- func mercury_common_type_prefix = string.
 
 :- implementation.
 
@@ -101,7 +112,10 @@
 %-----------------------------------------------------------------------------%
 
 output_proc_label(ProcLabel, !IO) :-
-	ProcLabelString = proc_label_to_c_string(ProcLabel, yes),
+	output_proc_label(ProcLabel, yes, !IO).
+
+output_proc_label(ProcLabel, AddPrefix, !IO) :-
+	ProcLabelString = proc_label_to_c_string(ProcLabel, AddPrefix),
 	io__write_string(ProcLabelString, !IO).
 
 proc_label_to_c_string(proc(DefiningModule, PredOrFunc, PredModule,
@@ -359,6 +373,9 @@
 
 output_tabling_pointer_var_name(ProcLabel, !IO) :-
 	io__write_string("mercury_var__table_root__", !IO),
+/* ### In clause for predicate `backend_libs.name_mangle.output_tabling_pointer_var_name/3': */
+/* ###   error: wrong number of arguments (3; should be 4) */
+/* ###   in call to predicate `output_proc_label'. */
 	output_proc_label(ProcLabel, !IO).
 
 %-----------------------------------------------------------------------------%
@@ -366,5 +383,9 @@
 mercury_label_prefix = "mercury__".
 
 mercury_data_prefix = "mercury_data_".
+
+mercury_common_prefix = "mercury_common_".
+
+mercury_common_type_prefix = "mercury_type_".
 
 %-----------------------------------------------------------------------------%
Index: compiler/var_locn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/var_locn.m,v
retrieving revision 1.15
diff -u -b -r1.15 var_locn.m
--- compiler/var_locn.m	18 Dec 2003 16:35:23 -0000	1.15
+++ compiler/var_locn.m	6 Mar 2004 17:34:04 -0000
@@ -110,6 +110,7 @@
 %		operation may already have been executed on Var; otherwise,
 %		var_locn__var_becomes_dead will throw an exception if it does
 %		not know about Var.
+
 :- pred var_locn__var_becomes_dead(prog_var::in, bool::in,
 	var_locn_info::in, var_locn_info::out) is det.
 
@@ -439,9 +440,9 @@
 						% operation that moves a
 						% variable to the (free or
 						% freeable) lval associated
-						% with it in the exceptions.
+						% with it in the exceptions
 						% field. Used to implement
-						% calls, pragma_c_codes and the
+						% calls, foreign_procs and the
 						% store_maps at the ends of
 						% branched control structures.
 		exceptions	:: assoc_list(prog_var, lval)
@@ -506,8 +507,7 @@
 			map__det_insert(!.VarStateMap, Var, State,
 				!:VarStateMap)
 		),
-		var_locn__make_var_depend_on_lval_roots(Var, Lval,
-			!LocVarMap)
+		var_locn__make_var_depend_on_lval_roots(Var, Lval, !LocVarMap)
 	),
 	var_locn__init_state_2(Rest, MaybeLiveness, !VarStateMap, !LocVarMap).
 
@@ -688,20 +688,15 @@
 			% XXX We could drop the MaybeBaseOffset = no condition,
 			% but this would require more complex code below.
 			MaybeBaseOffset = no,
-			search_static_cell(StaticCellInfo, DataAddr,
-				StaticCellArgsTypes)
+			search_static_cell_offset(StaticCellInfo, DataAddr,
+				Offset, SelectedArgRval)
 		->
-			list__index0_det(StaticCellArgsTypes, Offset,
-				SelectedArgRval - _SelectedArgType),
 			MaybeConstRval = yes(SelectedArgRval),
-			Lvals = set__map(var_locn__add_field_offset(
-				yes(Ptag), const(int_const(Offset))),
-				BaseVarLvals),
+			Lvals = set__map(var_locn__add_field_offset(yes(Ptag),
+				const(int_const(Offset))), BaseVarLvals),
 			set__init(Using),
-			State = state(Lvals, MaybeConstRval, no,
-				Using, alive),
-			map__det_insert(VarStateMap0, Var, State,
-				VarStateMap),
+			State = state(Lvals, MaybeConstRval, no, Using, alive),
+			map__det_insert(VarStateMap0, Var, State, VarStateMap),
 			var_locn__set_var_state_map(VarStateMap, !VLI),
 
 			var_locn__get_loc_var_map(!.VLI, LocVarMap0),
@@ -848,8 +843,8 @@
 		( MaybeOffset = yes(_) ->
 			% Accurate GC and term profiling both want to own
 			% the word before this object
-			sorry(this_file,
-			  "accurate GC combined with term size profiling")
+			sorry(this_file, "accurate GC combined with " ++
+				"term size profiling")
 		;
 			TotalOffset = yes(1)
 		),
@@ -1270,8 +1265,7 @@
 		var_locn__get_var_state_map(!.VLI, VarStateMap0),
 		(
 			var_locn__find_one_occupying_var(EffAffectedVars,
-				Lval, VarStateMap0, OccupyingVar,
-				OtherSources)
+				Lval, VarStateMap0, OccupyingVar, OtherSources)
 		->
 			MovedVar = OccupyingVar,
 			list__delete_all(EffAffectedVars, MovedVar,
@@ -1486,7 +1480,7 @@
 
 %----------------------------------------------------------------------------%
 
-% Var has become dead. If there are no expression that depend on its value,
+% Var has become dead. If there are no expressions that depend on its value,
 % delete the record of its state, thus freeing up the resources it has
 % tied down: the locations it occupies, or the variables whose values its own
 % expression refers to. If there *are* expressions that depend on its value,
@@ -1525,8 +1519,7 @@
 		;
 			State = state(Lvals, MaybeConstRval, MaybeExprRval,
 				Using, dead),
-			map__det_update(VarStateMap0, Var, State,
-				VarStateMap),
+			map__det_update(VarStateMap0, Var, State, VarStateMap),
 			var_locn__set_var_state_map(VarStateMap, !VLI)
 		)
 	;
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list