Browse Source

* move flag allocation item

git-svn-id: trunk@22202 -
florian 13 years ago
parent
commit
70009e8ed1
1 changed files with 12 additions and 1 deletions
  1. 12 1
      compiler/arm/aoptcpu.pas

+ 12 - 1
compiler/arm/aoptcpu.pas

@@ -382,8 +382,19 @@ Implementation
                 (taicpu(hp2).condition in [C_EQ,C_NE])) and
                 (taicpu(hp2).condition in [C_EQ,C_NE])) and
                assigned(FindRegDealloc(NR_DEFAULTFLAGS,tai(hp2.Next))) then
                assigned(FindRegDealloc(NR_DEFAULTFLAGS,tai(hp2.Next))) then
              begin
              begin
-               taicpu(p).oppostfix:=PF_S;
                asml.insertbefore(tai_comment.Create(strpnew('Peephole OpCmp2OpS done')), p);
                asml.insertbefore(tai_comment.Create(strpnew('Peephole OpCmp2OpS done')), p);
+
+               taicpu(p).oppostfix:=PF_S;
+
+               { move flag allocation if possible }
+               GetLastInstruction(hp1, hp2);
+               hp2:=FindRegAlloc(NR_DEFAULTFLAGS,tai(hp2.Next));
+               if assigned(hp2) then
+                 begin
+                   asml.Remove(hp2);
+                   asml.insertbefore(hp2, p);
+                 end;
+
                asml.remove(hp1);
                asml.remove(hp1);
                hp1.free;
                hp1.free;
              end
              end