|
@@ -52,7 +52,7 @@ implementation
|
|
aasmbase,aasmcpu,aasmtai,aasmdata,
|
|
aasmbase,aasmcpu,aasmtai,aasmdata,
|
|
defutil,
|
|
defutil,
|
|
cgbase,cgobj,hlcgobj,pass_2,procinfo,
|
|
cgbase,cgobj,hlcgobj,pass_2,procinfo,
|
|
- ncon,
|
|
|
|
|
|
+ ncon,nutils,
|
|
cpubase,
|
|
cpubase,
|
|
ncgutil,cgcpu,cgutils;
|
|
ncgutil,cgcpu,cgutils;
|
|
|
|
|
|
@@ -420,11 +420,14 @@ implementation
|
|
|
|
|
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,resultreg,numerator,divider));
|
|
current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,resultreg,numerator,divider));
|
|
|
|
|
|
- current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,divider,0));
|
|
|
|
- current_asmdata.getjumplabel(hl);
|
|
|
|
- current_asmdata.CurrAsmList.concat(taicpu.op_cond_sym(A_B,C_NE,hl));
|
|
|
|
- cg.a_call_name(current_asmdata.CurrAsmList,'FPC_DIVBYZERO',false);
|
|
|
|
- cg.a_label(current_asmdata.CurrAsmList,hl);
|
|
|
|
|
|
+ if not(node_not_zero(right)) then
|
|
|
|
+ begin
|
|
|
|
+ current_asmdata.CurrAsmList.concat(taicpu.op_reg_const(A_CMP,divider,0));
|
|
|
|
+ current_asmdata.getjumplabel(hl);
|
|
|
|
+ current_asmdata.CurrAsmList.concat(taicpu.op_cond_sym(A_B,C_NE,hl));
|
|
|
|
+ cg.a_call_name(current_asmdata.CurrAsmList,'FPC_DIVBYZERO',false);
|
|
|
|
+ cg.a_label(current_asmdata.CurrAsmList,hl);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
genOverflowCheck;
|
|
genOverflowCheck;
|