[m-dev.] diff: fix transitive intermodule optimization bug

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 5 01:08:53 AEDT 2001


This is for both the release branch and the main branch.

----------

Estimated hours taken: 1

Fix a bug: if `--trans-intermod-opt' was included in MCFLAGS,
then mmake would pass `--make-opt-int --trans-intermod-opt' to
mmc when creating the `.opt' files, and this would cause the
compiler to read the `.trans_opt' files when creating the `.opt'
files.  That's a bug, since the `.opt' files are not supposed to
depend on the `.trans_opt' files.

compiler/handle_options.m:
	Make `--make-opt-int' imply `--no-trans-intermod-opt'.
	Also add some comments.

Workspace: /home/venus/fjh/ws-venus2/mercury
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.100
diff -u -d -r1.100 handle_options.m
--- compiler/handle_options.m	2001/01/29 01:54:13	1.100
+++ compiler/handle_options.m	2001/02/04 13:35:41
@@ -335,10 +335,27 @@
 	% --no-gcc-nested-functions implies --no-gcc-local-labels
 	option_neg_implies(gcc_nested_functions, gcc_local_labels, bool(no)),
 
+	% --verbose-check-termination implies --check-termination,
+	% and the latter implies both --termination and
+	% --warn-missing-trans-opt-files.
 	option_implies(verbose_check_termination, check_termination,bool(yes)),
 	option_implies(check_termination, termination, bool(yes)),
 	option_implies(check_termination, warn_missing_trans_opt_files,
 		bool(yes)),
+
+	% When building the `.opt' files, we need to disable transitive
+	% optimization -- we must not read the `.trans_opt' files,
+	% since the `.opt' files are not allowed to depend on the
+	% `.trans_opt' files.  So --make-opt-int implies --no-trans-opt.
+	% But when building the `.trans_opt' files, we do want to read
+	% the earlier `.trans_opt' files, so --make-trans-opt-int
+	% implies --trans-intermod-opt.
+	% Also, when doing transitive intermodule optimization, we also
+	% do ordinary intermodule optimization, so
+	% --trans-intermod-opt implies --intermodule-optimization,
+	% and likewise --use-trans-opt-files implies --use-opt-files.
+	option_implies(make_optimization_interface, transitive_optimization,
+		bool(no)),
 	option_implies(make_transitive_opt_interface, transitive_optimization,
 		bool(yes)),
 	option_implies(transitive_optimization, intermodule_optimization,

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list