Browse Source

* OP_SUB must set always the flags in case of case

git-svn-id: trunk@5400 -
florian 18 years ago
parent
commit
3f0dfdcba4
1 changed files with 9 additions and 1 deletions
  1. 9 1
      compiler/arm/narmset.pas

+ 9 - 1
compiler/arm/narmset.pas

@@ -142,7 +142,9 @@ implementation
                     cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_EQ,0,hregister,blocklabel(t^.blockid))
                     cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList, opsize, OC_EQ,0,hregister,blocklabel(t^.blockid))
                   else
                   else
                     begin
                     begin
+                      tcgarm(cg).cgsetflags:=true;
                       cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low-last), hregister);
                       cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low-last), hregister);
+                      tcgarm(cg).cgsetflags:=false;
                       cg.a_jmp_flags(current_asmdata.CurrAsmList,F_EQ,blocklabel(t^.blockid));
                       cg.a_jmp_flags(current_asmdata.CurrAsmList,F_EQ,blocklabel(t^.blockid));
                     end;
                     end;
                   last:=t^._low;
                   last:=t^._low;
@@ -157,7 +159,11 @@ implementation
                     begin
                     begin
                        { have we to ajust the first value ? }
                        { have we to ajust the first value ? }
                        if (t^._low>get_min_value(left.resultdef)) then
                        if (t^._low>get_min_value(left.resultdef)) then
-                         cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low), hregister);
+                         begin
+                           tcgarm(cg).cgsetflags:=true;
+                           cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low), hregister);
+                           tcgarm(cg).cgsetflags:=false;
+                         end;
                     end
                     end
                   else
                   else
                     begin
                     begin
@@ -165,7 +171,9 @@ implementation
                       { present label then the lower limit can be checked    }
                       { present label then the lower limit can be checked    }
                       { immediately. else check the range in between:       }
                       { immediately. else check the range in between:       }
 
 
+                      tcgarm(cg).cgsetflags:=true;
                       cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low-last), hregister);
                       cg.a_op_const_reg(current_asmdata.CurrAsmList, OP_SUB, opsize, aint(t^._low-last), hregister);
+                      tcgarm(cg).cgsetflags:=false;
                       { no jump necessary here if the new range starts at }
                       { no jump necessary here if the new range starts at }
                       { at the value following the previous one           }
                       { at the value following the previous one           }
                       if ((t^._low-last) <> 1) or
                       if ((t^._low-last) <> 1) or