Преглед изворни кода

* Fixed the detection wether the first check of a for loop can be skipped

daniel пре 23 година
родитељ
комит
3d7430e270
1 измењених фајлова са 12 додато и 5 уклоњено
  1. 12 5
      compiler/nflw.pas

+ 12 - 5
compiler/nflw.pas

@@ -639,10 +639,14 @@ implementation
 
 
          {Can we spare the first comparision?}
          {Can we spare the first comparision?}
          if (right.nodetype=ordconstn) and (Tassignmentnode(left).right.nodetype=ordconstn) then
          if (right.nodetype=ordconstn) and (Tassignmentnode(left).right.nodetype=ordconstn) then
-            if not(((nf_backward in flags) and
-             (Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value))
-             or (not(nf_backward in flags) and
-             (Tordconstnode(Tassignmentnode(left).right).value<=Tordconstnode(right).value))) then
+            if (
+                (nf_backward in flags) and 
+                (Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value)
+               )
+             or not(
+                    (nf_backward in flags) and
+                    (Tordconstnode(Tassignmentnode(left).right).value<=Tordconstnode(right).value)
+                   ) then
                 exclude(flags,nf_testatbegin);
                 exclude(flags,nf_testatbegin);
 
 
          { save counter var }
          { save counter var }
@@ -1361,7 +1365,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.47  2002-08-19 19:36:43  peter
+  Revision 1.48  2002-08-22 15:15:20  daniel
+   * Fixed the detection wether the first check of a for loop can be skipped
+
+  Revision 1.47  2002/08/19 19:36:43  peter
     * More fixes for cross unit inlining, all tnodes are now implemented
     * More fixes for cross unit inlining, all tnodes are now implemented
     * Moved pocall_internconst to po_internconst because it is not a
     * Moved pocall_internconst to po_internconst because it is not a
       calling type at all and it conflicted when inlining of these small
       calling type at all and it conflicted when inlining of these small