anchor.diff:  	    call_fun -> false;		% Calls closure
   	    enter_fun -> false;		% Calls closure
   	    #apply_N{} -> false;
  -	    _ -> leafness(Is, Leafness)	% Other primop calls are ok
  +	    _ -> leafness(Is, IsClosure, Leafness) % Other primop calls are ok
   	  end;
   	T when T =:= 'local' orelse T =:= 'remote' ->
   	  {M,F,A} = hipe_icode:call_fun(I),
   	  case erlang:is_builtin(M, F, A) of
  -	    true -> leafness(Is, Leafness);
  +	    true -> leafness(Is, IsClosure, Leafness);
   	    false -> false
   	  end
         end;
  
positive.code:        false -> Code3;
         true -> [mk_redtest()|Code3]
       end],
    IsClosure = get_closure_info(MFA, ClosureInfo) =/= not_a_closure,
    Code5 = hipe_icode:mk_icode(MFA, FunArgs, IsClosure, IsLeaf,
  			      remove_dead_code(Code4),
  			      hipe_gensym:var_range(icode),
  
negative.code:   case Leafness of
      true -> true;
      selfrec -> true;
      closure -> false;
      false -> false
    end.
  
  needs_redtest(Leafness) ->
    case Leafness of
      true -> false;
      %% A "leaf" closure may contain tailcalls to non-closures in addition to
      %% what other leaves may contain. Omitting the redtest is useful to generate
      %% shorter code for closures generated by (fun F/A), and is safe since
      %% control flow cannot return to a "leaf" closure again without a reduction
      %% being consumed. This is true since no function that can call a closure
      %% will ever have its redtest omitted.
      closure -> false;
      selfrec -> true;
      false -> true
    end.
  