aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-10-24 06:32:20 +0200
committerBjörn Gustavsson <[email protected]>2016-10-24 06:41:59 +0200
commit8052922d105d236c6cf071333107181fc82c191d (patch)
tree306089b8b77743e1f9fcff4d96f3fc880dc00ded /lib/compiler
parent055b1b09537b8900489d28ba37078edd7be57d04 (diff)
downloadotp-8052922d105d236c6cf071333107181fc82c191d.tar.gz
otp-8052922d105d236c6cf071333107181fc82c191d.tar.bz2
otp-8052922d105d236c6cf071333107181fc82c191d.zip
Don't let inline_list_funcs degrade optimizations
83199af0263 refactored sys_core_fold to break out the code for the inline_lists_funcs option to its own module. Unfortunately, it also accidentally turned off compile-time evaluation of calls to BIFs with wholly or partial constant arguments. For example, the code for the following funtion gets much worse when inline_list_funcs is used: b() -> R0 = #r{}, R1 = setelement(1+2, R0, "deux"), R2 = setelement(1+3, R1, "trois"), R3 = setelement(1+5, R2, "cinq"), R4 = setelement(1+2, R3, "DEUX"), R4. ERL-285
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/sys_core_fold.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 08b02101a6..5e1602cb5b 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -734,7 +734,7 @@ call(#c_call{args=As}=Call, #c_literal{val=M}=M0, #c_literal{val=N}=N0, Sub) ->
false ->
case sys_core_fold_lists:call(Call, M, N, As) of
none ->
- call_1(Call, M, N, As, Sub);
+ call_1(Call, M0, N0, As, Sub);
Core ->
expr(Core, Sub)
end