mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 03:43:51 +00:00
Branches: main Revert my previous change to avoid making some bad indirect reuse calls, which supposed that the verification of calls to reuse procedures was wrong. It seems to be correct, as far as it goes. There were actually a few separate problems elsewhere: 1. `reuse_conditions_add_condition' didn't add a condition to a set if the set already contains another condition which subsumes it. However, the problem in the `bad_indirect_reuse' test case was due to discarding such a condition, making the reuse conditions on a reuse procedure too weak. For now, keep all non-duplicate reuse conditions so this doesn't happen. 2. `livedata_init_at_goal' was missing quite a lot of code that was in the old reuse branch, so the set of known live data at each call site was too small. Port over the missing code from the reuse branch. This fixes the `bad_indirect_reuse2' test case. 3. Although a call might satisfy all the reuse conditions of the callee individually, we weren't checking that two input arguments didn't have sharing between them. Port over code from the old reuse branch to check this. This fixes the `bad_indirect_reuse3' test case. compiler/ctgc.livedata.m: Fix problem 2. Revert my previous change. compiler/structure_reuse.domain.m: Work around problem 1. Fix problem 3. compiler/structure_reuse.indirect.m: compiler/structure_sharing.domain.m: Revert my previous change. compiler/ctgc.datastruct.m: Add a utility predicate. tests/hard_coded/Mercury.options: tests/hard_coded/Mmakefile: tests/hard_coded/bad_indirect_reuse2b.exp: tests/hard_coded/bad_indirect_reuse2b.m: Add a simpler version of bad_indirect_reuse2.
3 lines
26 B
Plaintext
3 lines
26 B
Plaintext
hide(foo(1, 2))
|
|
foo(2, 1)
|