Browse Source

* x86: Bug fix where aoc_ForceNewIteration was
checked in the wrong pass.

J. Gareth "Curious Kit" Moreton 3 years ago
parent
commit
9432a550e1
2 changed files with 29 additions and 30 deletions
  1. 15 15
      compiler/i386/aoptcpu.pas
  2. 14 15
      compiler/x86_64/aoptcpu.pas

+ 15 - 15
compiler/i386/aoptcpu.pas

@@ -244,6 +244,21 @@ unit aoptcpu;
           else
             ;
         end;
+        { If this flag is set, force another run of pass 1 even if p wasn't
+          changed }
+        if aoc_ForceNewIteration in OptsToCheck then
+          begin
+            Exclude(OptsToCheck, aoc_ForceNewIteration);
+
+            if not Result then
+              begin
+                if not (p.typ in SkipInstr) then
+                  UpdateUsedRegs(p);
+
+                p := tai(p.Next);
+                Result := True;
+              end;
+          end;
       end;
 
 
@@ -283,21 +298,6 @@ unit aoptcpu;
           else
             ;
         end;
-        { If this flag is set, force another run of pass 1 even if p wasn't
-          changed }
-        if aoc_ForceNewIteration in OptsToCheck then
-          begin
-            Exclude(OptsToCheck, aoc_ForceNewIteration);
-
-            if not Result then
-              begin
-                if not (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
-                Result := True;
-              end;
-          end;
       end;
 
 

+ 14 - 15
compiler/x86_64/aoptcpu.pas

@@ -166,7 +166,21 @@ uses
           else
             ;
         end;
+        { If this flag is set, force another run of pass 1 even if p wasn't
+          changed }
+        if aoc_ForceNewIteration in OptsToCheck then
+          begin
+            Exclude(OptsToCheck, aoc_ForceNewIteration);
 
+            if not Result then
+              begin
+                if not (p.typ in SkipInstr) then
+                  UpdateUsedRegs(p);
+
+                p := tai(p.Next);
+                Result := True;
+              end;
+          end;
       end;
 
 
@@ -202,21 +216,6 @@ uses
           else
             ;
         end;
-        { If this flag is set, force another run of pass 1 even if p wasn't
-          changed }
-        if aoc_ForceNewIteration in OptsToCheck then
-          begin
-            Exclude(OptsToCheck, aoc_ForceNewIteration);
-
-            if not Result then
-              begin
-                if not (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
-                Result := True;
-              end;
-          end;
       end;