瀏覽代碼

* fix the value of the frame pointer for Thumb-2 after r14317
(patch by Jeppe Johansen, mantis #18025)

git-svn-id: trunk@16416 -

Jonas Maebe 14 年之前
父節點
當前提交
c44d79f3ba
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      compiler/arm/cgcpu.pas

+ 6 - 1
compiler/arm/cgcpu.pas

@@ -3333,7 +3333,12 @@ unit cgcpu;
               end;
 
             if current_procinfo.framepointer<>NR_STACK_POINTER_REG then
-              list.concat(taicpu.op_reg_reg(A_MOV,NR_FRAME_POINTER_REG,NR_R12));
+              begin
+                { the framepointer now points to the saved R15, so the saved
+                  framepointer is at R11-12 (for get_caller_frame) }
+                list.concat(taicpu.op_reg_reg_const(A_SUB,NR_FRAME_POINTER_REG,NR_R12,4));
+                a_reg_dealloc(list,NR_R12);
+              end;
 
             stackmisalignment:=stackmisalignment mod current_settings.alignment.localalignmax;
             if (LocalSize<>0) or