[m-rev.] diff: add a test case for a bug in ho/type specialization

Simon Taylor stayl at cs.mu.OZ.AU
Tue May 3 17:54:33 AEST 2005


On 02-May-2005, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> Add a test case for a bug that causes an assertion failure in the
> compiler.  It seems to be caused by the interaction of higher-order and
> type specialization; a unification involving the construction of a
> type_ctor_info (for the type being specialized) in a predicate created
> by higher-order specialization seems to have an incorrect entry in the
> instmap - this results in simplify incorrectly optimizing away the
> unification, even though its output is need later.  (The unification is
> the one involving V_20 in the predicate foldl_ho1/5).

I've had a quick look at this.  The problem seems to be that
mode_util.recompute_instmap_delta_unify doesn't recompute
instmap_deltas for construction unifications.

I think the sequence of actions leading to the problem is:
- construction of type-info created, but type-info not used anywhere
- quantification finds the type-info is not used and removes it from
	the non-locals of the goal, removing it from the instmap_delta
- further specialisation makes the type-info become used
- recompute_instmap_delta doesn't add the type-info back into
	the instmap_delta
- crash

> (In what is probably another bug, you don't seem to be able to
> disable type-specialization, if a predicate has a type_spec pragma on
> it).

This needs to be done for exported procedures so that a procedure
with the expected interface is generated for callers compiled
with type specialization.

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