Fix a bug reported by Samrith, which is that some of the files in

Estimated hours taken: 1
Branches: main

Fix a bug reported by Samrith, which is that some of the files in
benchmarks/progs/icfp2000, e.g. eval.m, got a compiler abort when compiled
with -O0 --optimize-repeat=0 --optimize-saved-vars. This was because
--optimize-saved-vars relied on jump optimization being done, but
--optimize-repeat=0 disables jump optimization.

compiler/handle_options.m:
	Make --optimize-repeat at least one if some other optimization
	requires the optimizations controlled by --optimize-repeat.

compiler/optimize.m:
compiler/use_local_vars.m:
	Rename some predicates to make their unqualified names more meaningful.

	Delete unnecessary module qualifications. Switch to using . instead of
	__ as module qualifier.

compiler/mercury_compile.m:
	Conform to the change to optimize.m.

compiler/modules.m:
	Rename a predicate to avoid a confusing overloading.

compiler/compile_target_code.m:
	Conform to the change to modules.m.

tests/valid/eval.m:
	New test case to check the fix.

tests/valid/Mmakefile:
	Enable the new test case.
This commit is contained in:
Zoltan Somogyi
2006-01-31 05:20:45 +00:00
parent 550cdc1bf3
commit 9736a7c600
8 changed files with 275 additions and 190 deletions

View File

@@ -1,7 +1,7 @@
%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2005 The University of Melbourne.
% Copyright (C) 2002-2006 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -865,7 +865,7 @@ make_init_file(ErrorStream, MainModuleName, AllModules, Succeeded, !IO) :-
io__close_output(InitFileStream, !IO),
module_name_to_file_name(MainModuleName, ".init", yes, InitFileName,
!IO),
update_interface(InitFileName, Succeeded1, !IO),
update_interface_return_succeeded(InitFileName, Succeeded1, !IO),
Succeeded = Succeeded0 `and` Succeeded1
;
InitFileRes = error(Error),
@@ -1071,7 +1071,7 @@ make_init_obj_file(ErrorStream, MustCompile, ModuleName, ModuleNames, Result,
maybe_report_stats(Stats, !IO),
(
MkInitOK0 = yes,
update_interface(InitCFileName, MkInitOK1, !IO),
update_interface_return_succeeded(InitCFileName, MkInitOK1, !IO),
(
MkInitOK1 = yes,
(