[m-rev.] for review: [CTGC] two bugfixes...

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Thu Oct 12 23:48:51 AEST 2006


Hi,


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



Estimated hours taken: 3
Branches: main

compiler/ctgc.util.m:
	(bugfix) Calls to type_list_subsumes_det were aborting for
	compiler generated procedures (TypeSpecOf__) although at that
	stage of the compiler, types should be unifiable. The fix consists
	of taking the empty type substitution whenever type_list_subsumes
	fails (inspired by inlining.get_type_substition).

compiler/structure_reuse.domain.m:
	(bugfix) Fixpoint was never being reached when a recursive procedure
	had unconditional reuse resulting in neverending loops. 
	The fix consists of stating that the unconditional reuse description
	obviously subsumes any other unconditional reuse description.



Index: compiler/ctgc.util.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ctgc.util.m,v
retrieving revision 1.9
diff -u -d -r1.9 ctgc.util.m
--- compiler/ctgc.util.m	20 Aug 2006 08:20:56 -0000	1.9
+++ compiler/ctgc.util.m	12 Oct 2006 13:46:13 -0000
@@ -107,7 +107,19 @@
     % types of the head variables.
     pred_info_get_arg_types(PredInfo, FormalTypes),
 
-    type_list_subsumes_det(FormalTypes, ActualTypes, TypeSubstitution).
+    (
+        type_list_subsumes(FormalTypes, ActualTypes, TypeSubstitution0)
+    -> 
+        TypeSubstitution = TypeSubstitution0
+    ; 
+        % XXX Sharing analysis of compiler generated procedures fails due
+        % to the fact that type_list_subsumes fails; I assume that the 
+        % same reasoning as in inlining.get_type_substition/5 is applicable
+        % here: "The head types should always be unifiable with the actual
+        % argument types, otherwise it is a type error that should have
+        % been detected by typechecking. [...]"
+        TypeSubstitution = map.init
+    ).
 
 %-----------------------------------------------------------------------------%
 
Index: compiler/structure_reuse.domain.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/structure_reuse.domain.m,v
retrieving revision 1.5
diff -u -d -r1.5 structure_reuse.domain.m
--- compiler/structure_reuse.domain.m	31 Jul 2006 08:32:02 -0000	1.5
+++ compiler/structure_reuse.domain.m	12 Oct 2006 13:46:14 -0000
@@ -374,6 +374,9 @@
         % reuse is unconditional, hence also the calling environments that
         % satisfy the conditions expressed by SecondReuseAs.
     ;
+        FirstReuseAs = unconditional,
+        SecondReuseAs = unconditional
+    ;
         FirstReuseAs = conditional(ReuseConditionsFirst),
         SecondReuseAs = conditional(ReuseConditionsSecond),
         list.takewhile(reuse_conditions_subsume_reuse_condition(ModuleInfo,

-- 
nancy.mazur at cs.kuleuven.ac.be ------------ Katholieke Universiteit Leuven -
tel: +32-16-327596 - fax: +32-16-327996 ------- Dept. of Computer Science -
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list