diff: liveness bug fix
Fergus Henderson
fjh at cs.mu.oz.au
Sun Aug 24 06:29:39 AEST 1997
Estimated hours taken: 16
Fix a bug which caused the code generator to fail on certain
examples involving predicates with determinism `erroneous'.
compiler/inst_match.m:
Change `inst_is_bound' so that it succeeds for `not_reached' insts.
This change is so that the behaviour of the predicate matches
the documentation, and so that it is consistent with the behaviour
of `inst_is_ground'.
compiler/liveness.m:
When computing the value-giving occurrences, check explicitly
for unreachable instmaps. This is necessary to handle the above
change to `inst_is_bound'.
Fix a bug in detect_deadness: it was applying the deaths before
the births, but it should be done in the other order.
Normally deaths must be applied before births, but in detect_deadness
we are traversing the goal backwards, so we must apply births first
and then deaths.
The old solution of just cancelling out any vars that occur in
both the post-death and post-birth set was not quite right;
instead we just need to apply them in the correct order.
compiler/code_info.m:
Change the code so that it applies the pre/post deaths
before applying the corresponding births.
compiler/live_vars.m:
compiler/store_alloc.m:
compiler/hlds_goal.m:
Add some comments about making sure we always apply the deaths
before applying the births. (The code here was already correct,
I just added some documentation.)
compiler/hlds_out.m:
Print out the pre/post deaths before the pre/post births, so
that the order that they are printed out in matches the order
in which they should be applied.
tests/hard_coded/Mmake:
tests/hard_coded/erroneous_liveness.m:
tests/hard_coded/erroneous_liveness.exp:
tests/hard_coded/erroneous_liveness.inp:
Regression test for the above-mentioned bug fix.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list