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

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


I posted that one a moment too soon.  After thinking about the problem
a bit harder, I realized that the same issue arises with ordinary
intermodule optimization.  Hence the following changes.

On 05-Feb-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 
> 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.
  Likewise `.opt' files are
  not supposed to depend on other `.opt' files, so the same
  problem arises for `--intermodule-optimization'.

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

diff -u compiler/handle_options.m compiler/handle_options.m
--- compiler/handle_options.m
+++ compiler/handle_options.m
@@ -343,17 +343,21 @@
 	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.
+	% When building the `.opt' files, we need to disable intermodule
+	% optimization and transitive optimization -- we must not read the
+	% other `.opt' files, or the `.trans_opt' files,
+	% since the `.opt' files are not allowed to depend them. 
+	% So --make-opt-int implies --no-intermodule-optimization and
+	% --no-trans-intermod-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
+	% the `.opt' files and 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, intermodule_optimization,
+		bool(no)),
 	option_implies(make_optimization_interface, transitive_optimization,
 		bool(no)),
 	option_implies(make_transitive_opt_interface, transitive_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