瀏覽代碼

Merged revisions 6975 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

r6975 (florian)
* better insert of pc relative data

git-svn-id: branches/fixes_2_2@6976 -

florian 18 年之前
父節點
當前提交
b8fcf488d6
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      compiler/arm/aasmcpu.pas

+ 7 - 1
compiler/arm/aasmcpu.pas

@@ -643,12 +643,14 @@ implementation
         curdatatai,hp,hp2 : tai;
         curdata : TAsmList;
         l : tasmlabel;
+        doinsert,
         removeref : boolean;
       begin
         curdata:=TAsmList.create;
         lastpos:=-1;
         curpos:=0;
         curtai:=tai(list.first);
+        doinsert:=false;
         while assigned(curtai) do
           begin
             { instruction? }
@@ -729,8 +731,11 @@ implementation
             else
               penalty:=0;
 
+            { don't miss an insert }
+            doinsert:=doinsert or (curpos-lastpos+penalty>1016);
+
             { split only at real instructions else the test below fails }
-            if ((curpos-lastpos+penalty)>1016) and (curtai.typ=ait_instruction) and
+            if doinsert and (curtai.typ=ait_instruction) and
               (
                 { don't split loads of pc to lr and the following move }
                 not(
@@ -743,6 +748,7 @@ implementation
               ) then
               begin
                 lastpos:=curpos;
+                doinsert:=false;
                 hp:=tai(curtai.next);
                 current_asmdata.getjumplabel(l);
                 curdata.insert(taicpu.op_sym(A_B,l));