* patch by Jeppe Johansen to fix thumb2 epilog generation, resolves #18392

git-svn-id: trunk@17252 -
This commit is contained in:
florian 2011-04-05 19:25:20 +00:00
parent 0e74cea8ed
commit 8bff2a0de4
2 changed files with 10 additions and 2 deletions

View File

@ -3479,6 +3479,8 @@ unit cgcpu;
begin
{ restore int registers and return }
list.concat(taicpu.op_reg_reg(A_MOV, NR_STACK_POINTER_REG, NR_FRAME_POINTER_REG));
{ Add 4 to SP to make it point to an "imaginary PC" which the paramanager assumes is there(for normal ARM) }
list.concat(taicpu.op_reg_const(A_ADD, NR_STACK_POINTER_REG, 4));
reference_reset(ref,4);
ref.index:=NR_STACK_POINTER_REG;

View File

@ -77,12 +77,18 @@ asm
end;
{$ENDIF not INTERNAL_BACKTRACE}
{
Stack frame on Thumb2:
LR <- FP
Old FP
}
{$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
function get_caller_addr(framebp:pointer):pointer;assembler;
asm
movs r0,r0
beq .Lg_a_null
ldr r0,[r0,#-4]
ldr r0,[r0]
.Lg_a_null:
end;
@ -92,7 +98,7 @@ function get_caller_frame(framebp:pointer):pointer;assembler;
asm
movs r0,r0
beq .Lgnf_null
ldr r0,[r0,#-12]
ldr r0,[r0,#-4]
.Lgnf_null:
end;