[m-rev.] diff: Do not optimize tailcalls for Erlang

Paul Bone paul at bone.id.au
Fri Nov 27 18:05:20 AEDT 2015


Do not optimize tailcalls for Erlang

Erlang implementations already perform LCO.  We should not try to attempt to
optimize tailcalls for the Erlang backend.

compiler/handle_options.m:
    As above.
---
 compiler/handle_options.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/handle_options.m b/compiler/handle_options.m
index 3f45a3a..d5b7edc 100644
--- a/compiler/handle_options.m
+++ b/compiler/handle_options.m
@@ -911,6 +911,8 @@ convert_options_to_globals(OptionTable0, OpMode, Target,
     %   - can-compare-compound-values
     %   - lexically-compare-constructors
     %   - no library grade installation check with `mmc --make'
+    %   - --no-optimize-tailcalls because Erlang implementations perform
+    %     LCO.
 
     (
         Target = target_erlang,
@@ -930,6 +932,7 @@ convert_options_to_globals(OptionTable0, OpMode, Target,
         globals.set_option(lexically_order_constructors, bool(yes),
             !Globals),
         globals.set_option(libgrade_install_check, bool(no), !Globals),
+        globals.set_option(optimize_tailcalls, bool(no), !Globals),
 
         % The following options do not directly affect the Erlang backend,
         % however we need to ensure they are set to values that are consistent
-- 
2.6.2




More information about the reviews mailing list