Files
mercury/tests/debugger/loopcheck.exp
Simon Taylor a3819d359c Fix the handling of purity in the optimization and tabling passes.
Estimated hours taken: 15
Branches: main

Fix the handling of purity in the optimization and tabling passes.
Without this change tests/tabling/unused_args.m fails with
inter-module optimization.

compiler/purity.m:
compiler/post_typecheck.m:
	Allow purity checking to be rerun on a single procedure
	without requiring an io__state. If the purity is worse
	(due to inlining a predicate with a `:- pragma promise_pure'
	declaration), add `promised_pure' or `promised_semipure'
	to the pred_info.

compiler/hlds_out.m:
compiler/hlds_pred.m:
compiler/intermod.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/purity.m:
doc/reference_manual.texi:
NEWS:
	Implement `:- pragma promise_semipure'. This is needed if
	an predicate marked `promised_pure' which calls impure
	predicates is inlined into  a semipure predicate.

compiler/inlining.m:
	Make sure the purity markers on the goal_infos are correct
	after inlining predicates which are promised pure.

	Export a predicate inlining__can_inline_proc which is used
	by deforestation to determine whether inlining a procedure
	will change the semantics or will break code generator invariants.

compiler/deforest.m:
	Use the same method as inlining.m to work out whether
	a procedure can be inlined. Don't inline predicates which
	are promised pure because the extra impurity which
	will be propagated through the goal will stop deforestation
	working on the goal.

compiler/simplify.m:
	Make sure the goal_info resulting from converting a singleton
	switch into a conjunction has the correct purity.

compiler/table_gen.m:
	Make sure the purity markers on the generated goal_infos are
	correct.

	Make sure that call_table_gen goal features cannot be removed
	by optimization passes.

	Don't put unnecessary `impure' markers on calls to error/1.

tests/debugger/loopcheck.exp:
tests/debugger/retry.exp:
	Adjust the expected output. The change to ensure that
	`call_table_gen' goal features can't be removed alters
	the goal paths slightly.

tests/invalid/impure_method_impl.m:
	Adjust the expected output now that predicates can
	be promised semipure.
2001-03-27 05:23:23 +00:00

29 lines
1.4 KiB
Plaintext

1: 1 1 CALL pred loopcheck:main/2-0 (det) loopcheck.m:13
mdb> echo on
Command echo enabled.
mdb> context nextline
Contexts will be printed on the next line.
mdb> continue -a
2: 2 2 CALL pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:14)
3: 2 2 ELSE pred loopcheck:loop/1-0 (erroneous) c2;e;
loopcheck.m:21
4: 2 2 ELSE pred loopcheck:loop/1-0 (erroneous) c2;e;e;
loopcheck.m:21
5: 3 3 CALL pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:21)
6: 3 3 ELSE pred loopcheck:loop/1-0 (erroneous) c2;e;
loopcheck.m:21
7: 3 3 THEN pred loopcheck:loop/1-0 (erroneous) c2;e;t;
loopcheck.m:21
8: 3 3 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:21)
9: 2 2 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:14)
10: 1 1 EXCP pred loopcheck:main/2-0 (det)
loopcheck.m:14
Uncaught exception:
Software Error: detected infinite recursion in pred loopcheck:loop/1
Last trace event was event #10.
Last trace event before the unhandled exception was event #7.