Browse Source

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

git-svn-id: trunk@40721 -
florian 6 years ago
parent
commit
a2cee252e8
2 changed files with 2 additions and 2 deletions
  1. 1 1
      compiler/ncgset.pas
  2. 1 1
      compiler/x86/nx86set.pas

+ 1 - 1
compiler/ncgset.pas

@@ -739,7 +739,7 @@ implementation
                     begin
                     begin
                       scratch_reg:=hlcg.getintregister(current_asmdata.CurrAsmList,opsize);
                       scratch_reg:=hlcg.getintregister(current_asmdata.CurrAsmList,opsize);
                       gensub(tcgint(hp^._low.svalue));
                       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;
                 end;
                 end;
               hlcg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);
               hlcg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);

+ 1 - 1
compiler/x86/nx86set.pas

@@ -330,7 +330,7 @@ implementation
                     else
                     else
                       begin
                       begin
                         cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opcgsize, tcgint(hp^._low.svalue), hregister);
                         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;
                   end;
                   end;
                 cg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);
                 cg.a_jmp_always(current_asmdata.CurrAsmList,elselabel);