anchor.diff:              end
       end.
   
  -float_need_flush(#b_blk{is=Is}, #fs{s=cleared}) ->
  +float_maybe_flush(Blk0, #fs{s=cleared,fail=Fail,bs=Blocks}=Fs0, Count0) ->
  +    #b_blk{last=#b_br{bool=#b_var{},succ=Succ}=Br} = Blk0,
  +    #b_blk{is=Is} = maps:get(Succ, Blocks),
       case Is of
           [#b_set{anno=#{float_op:=_}}|_] ->
  -            false;
  +            %% The next operation is also a floating point operation.
  +            %% No flush needed.
  +            {[],Blk0,Fs0,Count0};
           _ ->
  -            true
  -    end;
  -float_need_flush(_, _) -> false.
  +            %% Flush needed.
  +            {Bool0,Count1} = new_reg('@ssa_bool', Count0),
  +            Bool = #b_var{name=Bool0},
  +
  +            %% Allocate block numbers.
  +            CheckL = Count1,              %For checkerror.
  +            FlushL = Count1 + 1,          %For flushing of float regs.
  +            Count = Count1 + 2,
  +            Blk = Blk0#b_blk{last=Br#b_br{succ=CheckL}},
  +
  +            %% Build the block with the checkerror instruction.
  +            CheckIs = [#b_set{op={float,checkerror},dst=Bool}],
  +            CheckBr = #b_br{bool=Bool,succ=FlushL,fail=Fail},
  +            CheckBlk = #b_blk{is=CheckIs,last=CheckBr},
  +
  +            %% Build the block that flushes all registers.
  +            FlushIs = float_flush_regs(Fs0),
  +            FlushBr = #b_br{bool=#b_literal{val=true},succ=Succ,fail=Succ},
  +            FlushBlk = #b_blk{is=FlushIs,last=FlushBr},
  +
  +            %% Update state and blocks.
  +            Fs = Fs0#fs{s=undefined,regs=#{},fail=none},
  +            FlushBs = [{CheckL,CheckBlk},{FlushL,FlushBlk}],
  +            {FlushBs,Blk,Fs,Count}
  +    end;
  +float_maybe_flush(Blk, Fs, Count) ->
  +    {[],Blk,Fs,Count}.
   
   float_opt_is([#b_set{op=succeeded,args=[Src]}=I0],
                #fs{regs=Rs}=Fs, Count, Acc) ->
  
positive.code:         {s=undefined :: 'undefined' | 'cleared',
           regs=#{} :: #{beam_ssa:b_var():=beam_ssa:b_var()},
           fail=none :: 'none' | beam_ssa:label(),
           ren=#{} :: #{beam_ssa:label():=beam_ssa:label()},
           non_guards :: gb_sets:set(beam_ssa:label())
          }).
  
  ssa_opt_float(#st{ssa=Linear0,cnt=Count0}=St) ->
      NonGuards0 = float_non_guards(Linear0),
      NonGuards = gb_sets:from_list(NonGuards0),
      Fs = #fs{non_guards=NonGuards},
      {Linear,Count} = float_opt(Linear0, Count0, Fs),
      St#st{ssa=Linear,cnt=Count}.
  
  
negative.code: new_reg(Base, Count) ->
      Fr = {Base,Count},
      {Fr,Count+1}.
  
  float_fail_label(#b_blk{last=Last}, Fs) ->
      case Last of
  