Browse Source

* don't load a spilled register between mov lr,pc mov pc,<reg>

git-svn-id: trunk@6273 -
florian 18 năm trước cách đây
mục cha
commit
b16b9d5251
1 tập tin đã thay đổi với 14 bổ sung0 xóa
  1. 14 0
      compiler/arm/rgcpu.pas

+ 14 - 0
compiler/arm/rgcpu.pas

@@ -58,6 +58,20 @@ unit rgcpu;
         l : tasmlabel;
         hreg : tregister;
       begin
+        { don't load spilled register between
+          mov lr,pc
+          mov pc,r4
+          but befure the mov lr,pc
+        }
+        if assigned(pos.previous) and
+          (pos.typ=ait_instruction) and
+          (taicpu(pos).opcode=A_MOV) and
+          (taicpu(pos).oper[0]^.typ=top_reg) and
+          (taicpu(pos).oper[0]^.reg=NR_R14) and
+          (taicpu(pos).oper[1]^.typ=top_reg) and
+          (taicpu(pos).oper[1]^.reg=NR_PC) then
+          pos:=tai(pos.previous);
+
         if abs(spilltemp.offset)>4095 then
           begin
             helplist:=TAsmList.create;