ソースを参照

* handle pc relative offsets in ldf/stf correctly

git-svn-id: trunk@6115 -
florian 18 年 前
コミット
c16c124562
2 ファイル変更9 行追加3 行削除
  1. 8 2
      compiler/arm/cgcpu.pas
  2. 1 1
      compiler/arm/cpubase.pas

+ 8 - 2
compiler/arm/cgcpu.pas

@@ -683,6 +683,12 @@ unit cgcpu;
                 tmpref.symbol:=l;
                 tmpref.base:=NR_R15;
                 list.concat(taicpu.op_reg_ref(A_LDR,tmpreg,tmpref));
+
+                { in case of LDF/STF, we got rid of the NR_R15 }
+                if is_pc(ref.base) then
+                  ref.base:=NR_NO;
+                if is_pc(ref.index) then
+                  ref.index:=NR_NO;
               end
             else
               a_load_const_reg(list,OS_ADDR,ref.offset,tmpreg);
@@ -947,7 +953,7 @@ unit cgcpu;
            so.shiftimm:=shiftimm;
            list.concat(taicpu.op_reg_reg_shifterop(A_MOV,reg2,reg,so));
          end;
-       
+
        function do_conv(size : tcgsize) : boolean;
          begin
            result:=true;
@@ -972,7 +978,7 @@ unit cgcpu;
            end;
            conv_done:=result;
          end;
-     
+
        var
          instr: taicpu;
        begin

+ 1 - 1
compiler/arm/cpubase.pas

@@ -134,7 +134,7 @@ unit cpubase;
 
     const
       cgsize2fpuoppostfix : array[OS_NO..OS_F128] of toppostfix = (
-        PF_E,
+        PF_None,
         PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,PF_None,
         PF_S,PF_D,PF_E,PF_None,PF_None);