mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 18:19:16 +02:00
* type left-over parts of parameters as arrays of "stack slot alignment" if
they're an exact multiple of the ialignment size on LLVM. This prevents both overalignment (e.g. remainder of 8 individual bytes on ARM would be aligned to 8 bytes instead of 4 if typed as int64) and underalignment (e.g. 32 bytes remainder of a record that needs to be aligned to 8 bytes would be aligned to 1 or 4 bytes if types as array of resp. bytes or longints) git-svn-id: trunk@41444 -
This commit is contained in:
parent
bc77aad3d9
commit
e829596750
@ -118,7 +118,8 @@ implementation
|
|||||||
fmodule,
|
fmodule,
|
||||||
symtable,symconst,symsym,
|
symtable,symconst,symsym,
|
||||||
llvmsym,hlcgobj,
|
llvmsym,hlcgobj,
|
||||||
defutil,blockutl,cgbase,paramgr;
|
defutil,blockutl,cgbase,paramgr,
|
||||||
|
cpubase;
|
||||||
|
|
||||||
|
|
||||||
{******************************************************************
|
{******************************************************************
|
||||||
@ -923,6 +924,7 @@ implementation
|
|||||||
retloc: pcgparalocation;
|
retloc: pcgparalocation;
|
||||||
usedef: tdef;
|
usedef: tdef;
|
||||||
valueext: tllvmvalueextension;
|
valueext: tllvmvalueextension;
|
||||||
|
paraslots,
|
||||||
i: longint;
|
i: longint;
|
||||||
sizeleft: asizeint;
|
sizeleft: asizeint;
|
||||||
begin
|
begin
|
||||||
@ -983,7 +985,19 @@ implementation
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
retdeflist[i]:=retloc^.def;
|
begin
|
||||||
|
if retloc^.def.typ<>floatdef then
|
||||||
|
begin
|
||||||
|
paraslots:=sizeleft div cgpara.Alignment;
|
||||||
|
if (paraslots>1) and
|
||||||
|
((paraslots*cgpara.Alignment)=sizeleft) then
|
||||||
|
retdeflist[i]:=carraydef.getreusable(cgsize_orddef(int_cgsize(cgpara.Alignment)),paraslots)
|
||||||
|
else
|
||||||
|
retdeflist[i]:=retloc^.def;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
retdeflist[i]:=retloc^.def;
|
||||||
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
retloc:=retloc^.next;
|
retloc:=retloc^.next;
|
||||||
until not assigned(retloc);
|
until not assigned(retloc);
|
||||||
|
Loading…
Reference in New Issue
Block a user