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

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Oct 16 14:53:32 AEST 2006


On Thu, 12 Oct 2006, Nancy Mazur wrote:

> 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

s/get_type_substition/get_type_substitution/

> +        % 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
> +    ).

Yes, although the whole thing looks a bit dodgy (...we really should fix 
polymorphism.m in this respect).  Until then this looks to be the best
that can be done.

Julien.







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