aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-01-31 10:43:58 +0100
committerBjörn Gustavsson <[email protected]>2018-02-14 08:33:25 +0100
commit54b76b437c9008b3aedbf3fd75526ad4719bde7d (patch)
treef16f48e712a90a2f2df7a510abbd585930a85d50
parentbf0d03bd6f393b6a4f7836c5203e9a83caf457e8 (diff)
downloadotp-54b76b437c9008b3aedbf3fd75526ad4719bde7d.tar.gz
otp-54b76b437c9008b3aedbf3fd75526ad4719bde7d.tar.bz2
otp-54b76b437c9008b3aedbf3fd75526ad4719bde7d.zip
Disable CSE for floating point operations
As a preparation for combining blocks before running beam_block for the second time, disable CSE for floating point operations because it will generate invalid code.
-rw-r--r--lib/compiler/src/beam_block.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_block.erl b/lib/compiler/src/beam_block.erl
index 7183381334..a4380a9314 100644
--- a/lib/compiler/src/beam_block.erl
+++ b/lib/compiler/src/beam_block.erl
@@ -628,7 +628,13 @@ cse_find(Expr, Es) ->
end.
cse_expr({set,[D],Ss,{bif,N,_}}) ->
- {ok,D,{{bif,N},Ss}};
+ case D of
+ {fr,_} ->
+ %% There are too many things that can go wrong.
+ none;
+ _ ->
+ {ok,D,{{bif,N},Ss}}
+ end;
cse_expr({set,[D],Ss,{alloc,_,{gc_bif,N,_}}}) ->
{ok,D,{{gc_bif,N},Ss}};
cse_expr({set,[D],Ss,put_list}) ->