mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-21 08:09:22 +02:00
* r6498 for ppc64
git-svn-id: trunk@6502 -
This commit is contained in:
parent
10ff422d90
commit
9c9684b3a3
@ -1451,7 +1451,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ create stack frame }
|
{ create stack frame }
|
||||||
if (not nostackframe) and (localsize > 0) then begin
|
if (not nostackframe) and (localsize > 0) and
|
||||||
|
tppcprocinfo(current_procinfo).needstackframe then begin
|
||||||
if (localsize <= high(smallint)) then begin
|
if (localsize <= high(smallint)) then begin
|
||||||
reference_reset_base(href, NR_STACK_POINTER_REG, -localsize);
|
reference_reset_base(href, NR_STACK_POINTER_REG, -localsize);
|
||||||
a_load_store(list, A_STDU, NR_STACK_POINTER_REG, href);
|
a_load_store(list, A_STDU, NR_STACK_POINTER_REG, href);
|
||||||
@ -1580,7 +1581,8 @@ begin
|
|||||||
{ CR register not supported }
|
{ CR register not supported }
|
||||||
|
|
||||||
{ restore stack pointer }
|
{ restore stack pointer }
|
||||||
if (not nostackframe) and (localsize > 0) then begin
|
if (not nostackframe) and (localsize > 0) and
|
||||||
|
tppcprocinfo(current_procinfo).needstackframe then begin
|
||||||
if (localsize <= high(smallint)) then begin
|
if (localsize <= high(smallint)) then begin
|
||||||
list.concat(taicpu.op_reg_reg_const(A_ADDI, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, localsize));
|
list.concat(taicpu.op_reg_reg_const(A_ADDI, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, localsize));
|
||||||
end else begin
|
end else begin
|
||||||
|
@ -33,6 +33,8 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
tppcprocinfo = class(tcgprocinfo)
|
tppcprocinfo = class(tcgprocinfo)
|
||||||
|
needstackframe: boolean;
|
||||||
|
|
||||||
{ offset where the frame pointer from the outer procedure is stored. }
|
{ offset where the frame pointer from the outer procedure is stored. }
|
||||||
parent_framepointer_offset: longint;
|
parent_framepointer_offset: longint;
|
||||||
constructor create(aparent: tprocinfo); override;
|
constructor create(aparent: tprocinfo); override;
|
||||||
@ -100,9 +102,13 @@ begin
|
|||||||
if (pi_do_call in flags) or (tg.lasttemp <> tg.firsttemp) or
|
if (pi_do_call in flags) or (tg.lasttemp <> tg.firsttemp) or
|
||||||
(result > RED_ZONE_SIZE) {or (cs_profile in init_settings.moduleswitches)} then begin
|
(result > RED_ZONE_SIZE) {or (cs_profile in init_settings.moduleswitches)} then begin
|
||||||
result := align(result + tg.lasttemp, ELF_STACK_ALIGN);
|
result := align(result + tg.lasttemp, ELF_STACK_ALIGN);
|
||||||
end;
|
needstackframe:=true;
|
||||||
end else
|
end else
|
||||||
|
needstackframe:=false;
|
||||||
|
end else begin
|
||||||
result := align(tg.lasttemp, ELF_STACK_ALIGN);
|
result := align(tg.lasttemp, ELF_STACK_ALIGN);
|
||||||
|
needstackframe:=result<>0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user