* when optimizing range checks in case nodes, unsigned comparisions must be used, resolves #34782

git-svn-id: trunk@40721 -
This commit is contained in:
florian 2019-01-01 01:11:13 +00:00
parent 635a6c7ef8
commit a2cee252e8
2 changed files with 2 additions and 2 deletions

View File

@ -739,7 +739,7 @@ implementation
begin
scratch_reg:=hlcg.getintregister(current_asmdata.CurrAsmList,opsize);
gensub(tcgint(hp^._low.svalue));
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, jmp_le, tcgint(hp^._high.svalue-hp^._low.svalue), hregister, blocklabel(hp^.blockid))
hlcg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_BE, tcgint(hp^._high.svalue-hp^._low.svalue), hregister, blocklabel(hp^.blockid))
end;
end;
hlcg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);

View File

@ -330,7 +330,7 @@ implementation
else
begin
cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, tcgint(hp^._low.svalue), hregister);
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opcgsize, jmp_le, tcgint(hp^._high.svalue - hp^._low.svalue), hregister,blocklabel(hp^.blockid));
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opcgsize, OC_BE, tcgint(hp^._high.svalue - hp^._low.svalue), hregister,blocklabel(hp^.blockid));
end;
end;
cg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);