* Do not use stack parameter location for spilling if its size is less than the register size for all CPU targets except x86.

git-svn-id: trunk@46801 -
This commit is contained in:
yury 2020-09-08 18:50:58 +00:00
parent 93eef547ae
commit e159c92967

View File

@ -625,8 +625,18 @@ implementation
regtype:=getregtype(reg);
while true do
begin
cg.rg[regtype].set_reg_initial_location(reg,loc.reference);
regsize:=tcgsize2size[reg_cgsize(reg)];
{$ifndef x86}
{ The size of the stack parameter must be not less than
the size of the register because the spilling code for
most CPU targets spills whole registers.
Spilling of sub registers is supported for x86.
}
if regsize>tcgsize2size[paraloc^.Size] then
break;
{$endif x86}
cg.rg[regtype].set_reg_initial_location(reg,loc.reference);
dec(size,regsize);
if size<=0 then
break;