* constantified hardcoded minimum stackframe size required by the (powerpc64/linux) ABI

git-svn-id: trunk@8567 -
This commit is contained in:
tom_at_work 2007-09-19 20:55:47 +00:00
parent b0bb3f94a7
commit 73b88f4d46
3 changed files with 7 additions and 5 deletions

View File

@ -1897,18 +1897,17 @@ begin
mtlr r0
blr
TODO: put "112" magic constant (minimum stack frame size on ppc64) into constant
}
list.concat(taicpu.op_reg(A_MFLR, NR_R0));
reference_reset_base(href, NR_STACK_POINTER_REG, 16);
list.concat(taicpu.op_reg_ref(A_STD, NR_R0, href));
reference_reset_base(href, NR_STACK_POINTER_REG, -112);
reference_reset_base(href, NR_STACK_POINTER_REG, -MINIMUM_STACKFRAME_SIZE);
list.concat(taicpu.op_reg_ref(A_STDU, NR_STACK_POINTER_REG, href));
list.concat(taicpu.op_sym(A_BL, current_asmdata.RefAsmSymbol(externalname)));
list.concat(taicpu.op_none(A_NOP));
list.concat(taicpu.op_reg_reg_const(A_ADDI, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, 112));
list.concat(taicpu.op_reg_reg_const(A_ADDI, NR_STACK_POINTER_REG, NR_STACK_POINTER_REG, MINIMUM_STACKFRAME_SIZE));
reference_reset_base(href, NR_STACK_POINTER_REG, LA_LR_ELF);
list.concat(taicpu.op_reg_ref(A_LD, NR_R0, href));

View File

@ -378,6 +378,9 @@ const
{ the size of the "red zone" which must not be changed by asynchronous calls
in the stack frame and can be used for storing temps }
RED_ZONE_SIZE = 288;
{ minimum size of the stack frame if one exists }
MINIMUM_STACKFRAME_SIZE = 112;
{*****************************************************************************
Helpers

View File

@ -74,8 +74,8 @@ begin
{ the ABI specification says that it is required to always allocate space for 8 * 8 bytes
for registers R3-R10 and stack header if there's a stack frame, but GCC doesn't do that,
so we don't that too. Uncomment the next three lines if this is required }
if (cs_profile in init_settings.moduleswitches) and (ofs < 112) then begin
ofs := 112;
if (cs_profile in init_settings.moduleswitches) and (ofs < MINIMUM_STACKFRAME_SIZE) then begin
ofs := MINIMUM_STACKFRAME_SIZE;
end;
tg.setfirsttemp(ofs);
end else begin