* align stack properly if no stack frame is generated, should resolve #8986

git-svn-id: trunk@7611 -
This commit is contained in:
florian 2007-06-09 18:46:35 +00:00
parent 10341eabaa
commit fe69d19f9c
2 changed files with 5 additions and 3 deletions

View File

@ -1899,12 +1899,14 @@ unit cgx86;
{ allocate stackframe space }
if (localsize<>0) or
((target_info.system in [system_i386_darwin,system_x86_64_win64]) and
((target_info.system in [system_i386_darwin,
system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd]) and
(stackmisalignment <> 0) and
((pi_do_call in current_procinfo.flags) or
(po_assembler in current_procinfo.procdef.procoptions))) then
begin
if (target_info.system in [system_i386_darwin,system_x86_64_win64]) then
if (target_info.system in [system_i386_darwin,
system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd]) then
localsize := align(localsize+stackmisalignment,16)-stackmisalignment;
cg.g_stackpointer_alloc(list,localsize);
if current_procinfo.framepointer=NR_STACK_POINTER_REG then

View File

@ -137,7 +137,7 @@ unit cgcpu;
if (current_procinfo.framepointer=NR_STACK_POINTER_REG) then
begin
stacksize:=current_procinfo.calc_stackframe_size;
if (target_info.system = system_x86_64_win64) and
if (target_info.system in [system_x86_64_win64,system_x86_64_linux,system_x86_64_freebsd]) and
((stacksize <> 0) or
(pi_do_call in current_procinfo.flags) or
{ can't detect if a call in this case -> use nostackframe }