Explorar o código

* x86: Fixed bug where "aoc_ForceNewIteration" wouldn't update the registers properly in some circumstances

J. Gareth "Curious Kit" Moreton hai 5 meses
pai
achega
5536810075
Modificáronse 2 ficheiros con 36 adicións e 12 borrados
  1. 18 6
      compiler/i386/aoptcpu.pas
  2. 18 6
      compiler/x86_64/aoptcpu.pas

+ 18 - 6
compiler/i386/aoptcpu.pas

@@ -276,9 +276,15 @@ unit aoptcpu;
             if not Result then
               begin
                 if (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
+                  begin
+                    UpdateUsedRegs(p);
+                    p := tai(p.Next);
+                  end
+                else
+                  begin
+                    p := tai(p.Next);
+                    UpdateUsedRegs(p);
+                  end;
                 Result := True;
               end;
           end;
@@ -340,9 +346,15 @@ unit aoptcpu;
             if not Result then
               begin
                 if (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
+                  begin
+                    UpdateUsedRegs(p);
+                    p := tai(p.Next);
+                  end
+                else
+                  begin
+                    p := tai(p.Next);
+                    UpdateUsedRegs(p);
+                  end;
                 Result := True;
               end;
           end;

+ 18 - 6
compiler/x86_64/aoptcpu.pas

@@ -199,9 +199,15 @@ uses
             if not Result then
               begin
                 if (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
+                  begin
+                    UpdateUsedRegs(p);
+                    p := tai(p.Next);
+                  end
+                else
+                  begin
+                    p := tai(p.Next);
+                    UpdateUsedRegs(p);
+                  end;
                 Result := True;
               end;
           end;
@@ -259,9 +265,15 @@ uses
             if not Result then
               begin
                 if (p.typ in SkipInstr) then
-                  UpdateUsedRegs(p);
-
-                p := tai(p.Next);
+                  begin
+                    UpdateUsedRegs(p);
+                    p := tai(p.Next);
+                  end
+                else
+                  begin
+                    p := tai(p.Next);
+                    UpdateUsedRegs(p);
+                  end;
                 Result := True;
               end;
           end;