diff: nonexistent relations in fixpoint check

Simon Taylor stayl at cs.mu.OZ.AU
Thu Mar 18 11:56:14 AEDT 1999


Estimated hours taken: 0.5

Fix a bug where the generated code tested whether
a relation which was never created was empty.

compiler/rl_gen.m:
	Don't include procedures with `generate_inline' markers
	(used to create input relations for calls) in the list of entry
	points for a procedure. Difference relations for these
	are never created, so they should not be included in the
	fixpoint check at the start of each iteration.


Index: rl_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rl_gen.m,v
retrieving revision 1.1
diff -u -u -r1.1 rl_gen.m
--- rl_gen.m	1998/12/06 23:45:13	1.1
+++ rl_gen.m	1999/03/18 00:54:45
@@ -1,5 +1,5 @@
 %-----------------------------------------------------------------------------%
-% Copyright (C) 1998 University of Melbourne.
+% Copyright (C) 1998-1999 University of Melbourne.
 % This file may only be copied under the terms of the GNU General
 % Public License - see the file COPYING in the Mercury distribution.
 %-----------------------------------------------------------------------------%
@@ -289,9 +289,20 @@
 		map(int, relation_id)::in, rl_tree::out, 
 		rl_info::rl_info_di, rl_info::rl_info_uo) is det.
 
-rl_gen__scc(SCC, SCCs, InputMap, SCCCode) -->
-	rl_info_set_scc(SCC),
+rl_gen__scc(SCC0, SCCs, InputMap, SCCCode) -->
 	rl_info_get_module_info(ModuleInfo),
+
+	% Make sure predicates with `generate_inline' markers (used to
+	% create input relations for calls) do not have code generated for
+	% them, and are not considered to be entry points to the SCC.
+	{ list__filter(lambda([PredProcId::in] is semidet, (
+		PredProcId = proc(PredId, _),
+		module_info_pred_info(ModuleInfo, PredId, PredInfo),
+		pred_info_get_markers(PredInfo, Markers),
+		\+ check_marker(Markers, generate_inline)
+	)), SCC0, SCC) },
+ 
+	rl_info_set_scc(SCC),
 	{ dependency_graph__get_scc_entry_points(SCC, SCCs, 
 		ModuleInfo, EntryPoints) },
 	rl_info_set_scc_entry_points(EntryPoints),



More information about the developers mailing list