[m-rev.] for review: fix tests/hard_coded/ho_and_type_spec
Simon Taylor
staylr at gmail.com
Wed May 2 16:04:24 AEST 2007
On 02-May-2007, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>
> On Tue, 1 May 2007, Simon Taylor wrote:
>
> >Estimated hours taken: 10
> >Branches: main
> >
> >Fix a compiler abort on tests/hard_coded/ho_and_type_spec.
>
> s/hard_coded/valid/.
Done.
> >This also fixes problems compiling compiler/mode_robdd.tfeirn.m
> >and compiler/mode_robdd.implications.m, but the flags to reduce
> >optimization for those files can't be removed until this change
> >is installed.
> >
> >The sequence of events leading to the abort was:
> >1. higher_order.construct_higher_order_terms builds a construction
> >unification for a type-info which isn't yet used.
> >2. quantification works out that the type-info isn't used and
> >removes it from the instmap_delta.
> >3. further specialization makes the type-info become used.
> >4. recompute_instmap_delta doesn't put it back in the instmap_delta.
> >5. crash.
>
> It seems to me that the real problem here is that during higher_order
> the HLDS gets into an inconsistent state. Is this something that could
> be changed?
Most optimisation passes put the HLDS into an inconsistent state which
needs to be fixed by requantifying and recomputing instmap_deltas. In
this case, the compiler wasn't recomputing enough information. At the
end of the first pass of optimisation it is not possible to know which
type-infos will eventually become used.
Keeping the quantification and instmap_deltas correct during an
optimisation pass is very easy to get subtley wrong.
> >+cons_id_to_shared_inst(_, cons(_, _), _) = no.
> >+cons_id_to_shared_inst(_, ConsId @ int_const(_), _) =
> >+ yes(bound(shared, [bound_functor(ConsId, [])])).
> >+cons_id_to_shared_inst(_, ConsId @ float_const(_), _) =
> >+ yes(bound(shared, [bound_functor(ConsId, [])])).
> >+cons_id_to_shared_inst(_, ConsId @ string_const(_), _) =
> >+ yes(bound(shared, [bound_functor(ConsId, [])])).
>
> Is there a reason that constructions of builtins other than type-info
> related ones and predicate constants are being added to the instmap
> delta? (It appears that is what this code would do.)
The code to handle those cases is trivial so there was no reason not to.
Simon.
--------------------------------------------------------------------------
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