mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 09:09:30 +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,
|
||||
symtable,symconst,symsym,
|
||||
llvmsym,hlcgobj,
|
||||
defutil,blockutl,cgbase,paramgr;
|
||||
defutil,blockutl,cgbase,paramgr,
|
||||
cpubase;
|
||||
|
||||
|
||||
{******************************************************************
|
||||
@ -923,6 +924,7 @@ implementation
|
||||
retloc: pcgparalocation;
|
||||
usedef: tdef;
|
||||
valueext: tllvmvalueextension;
|
||||
paraslots,
|
||||
i: longint;
|
||||
sizeleft: asizeint;
|
||||
begin
|
||||
@ -983,7 +985,19 @@ implementation
|
||||
end
|
||||
end
|
||||
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);
|
||||
retloc:=retloc^.next;
|
||||
until not assigned(retloc);
|
||||
|
Loading…
Reference in New Issue
Block a user