tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the tests
that check compiler error messages, expect the new line numbers.
browser/cterm.m:
browser/tree234_cc.m:
Import only one module per line.
tests/hard_coded/boyer.m:
Fix something I missed.
Estimated hours taken: 3
Branches: main
Fix a bug caught by the nightly tests. The cause of the bug is described
in the following comment in the cut down test case:
% This code is a cut down version of merge_key_ranges_2 in rl_key.m.
% It is a regression test; the 21 June 2004 version of the compiler got
% a compiler abort when compiling this code with deep profiling enabled.
%
% The problem had several causes that had all to be present.
%
% 1. The inlined code of less_or_equal contains a call. Deep profiling inserts
% prepare_for_normal_call before that call, making it impure.
%
% 2. The body of less_or_equal isn't a complete switch in any argument, so
% switch detection leaves a disjunction in it.
%
% 3. The inlining of less_or_equal in merge_key_ranges_2 *after* the initial
% semantic checks causes the second run of simplify to modify the code,
% removing the redundant check of the second argument of less_or_equal in
% the second clause. This causes simplify to rerun determinism analysis.
% (If the inlining is done in the source code, the simplification will have
% been done in the first run of simplify, and simplify won't find any
% improvements to do after the deep profiling transformation.)
%
% 4. When determinism analysis looks at the inlined disjunction, it disregards
% the fact that it has no outputs because it is impure.
%
% The original symptom required -O5 to inline the relevant call in rl_key.m.
% We mark the predicate with pragma inline to force the problem, if present,
% to appear also at lower optimization levels.
The fix is to alter the behavior of determinism analysis.
compiler/det_analysis.m:
When the new goal feature not_impure_for_determinism is present on a
goal, ignore the impurity of the goal when computing its determinism.
compiler/deep_profiling.m:
Add the new feature when making pure goals impure. For goals that were
impure to begin with, do not add the feature. In both cases, the goal
is to get determinism analysis to get the same result as it would get
without the deep profiling transformation.
compiler/hlds_goal.m:
Add the new goal feature, and add predicates for adding and removing
more than one feature at a time.
compiler/saved_vars.m:
Minor diff to handle the new feature.
tests/valid/impure_detism.m:
New regression test case for this bug.
tests/valid/Mmakefile:
tests/valid/Mercury.options:
Enable the new test case, and specify the test options.
Put test case lists into sorted order.