From 51c7e590e470cb2aa8d09ac8f56a659e272d88b4 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 18 Nov 2013 11:49:58 +0100 Subject: Properly let floating-point instructions through in the BEAM compiler The compiler shouldn't crash when fed an already-optimised BEAM assembly file. --- lib/compiler/src/beam_type.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/compiler/src/beam_type.erl') diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl index 3ec57a67da..58c0f765ae 100644 --- a/lib/compiler/src/beam_type.erl +++ b/lib/compiler/src/beam_type.erl @@ -142,6 +142,12 @@ simplify_float(Is0, Ts0) -> throw:not_possible -> not_possible end. +simplify_float_1([{set,[],[],fclearerror}|Is], Ts, Rs, Acc) -> + simplify_float_1(Is, Ts, Rs, clearerror(Acc)); +simplify_float_1([{set,[],[],fcheckerror}|Is], Ts, Rs, Acc) -> + simplify_float_1(Is, Ts, Rs, checkerror(Acc)); +simplify_float_1([{set,[{fr,_}],_,_}=I|Is], Ts, Rs, Acc) -> + simplify_float_1(Is, Ts, Rs, [I|Acc]); simplify_float_1([{set,[D0],[A0],{alloc,_,{gc_bif,'-',{f,0}}}}=I|Is]=Is0, Ts0, Rs0, Acc0) -> case tdb_find(A0, Ts0) of -- cgit v1.2.3