mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:09:33 +02:00
* fixed copying of unaligned value parameters
git-svn-id: trunk@3369 -
This commit is contained in:
parent
f72f9c70eb
commit
13493a5355
@ -1531,7 +1531,11 @@ unit cgcpu;
|
||||
|
||||
procedure tcgarm.g_concatcopy(list : TAsmList;const source,dest : treference;len : aint);
|
||||
begin
|
||||
g_concatcopy_internal(list,source,dest,len,true);
|
||||
if (source.alignment in [1..3]) or
|
||||
(dest.alignment in [1..3]) then
|
||||
g_concatcopy_internal(list,source,dest,len,false)
|
||||
else
|
||||
g_concatcopy_internal(list,source,dest,len,true);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -596,8 +596,8 @@ implementation
|
||||
{ Use unaligned copy when the offset is not aligned }
|
||||
len:=left.resulttype.def.size;
|
||||
if (right.location.reference.offset mod sizeof(aint)<>0) or
|
||||
(left.location.reference.offset mod sizeof(aint)<>0) or
|
||||
(right.resulttype.def.alignment<sizeof(aint)) then
|
||||
(left.location.reference.offset mod sizeof(aint)<>0) or
|
||||
(right.resulttype.def.alignment<sizeof(aint)) then
|
||||
cg.g_concatcopy_unaligned(current_asmdata.CurrAsmList,right.location.reference,left.location.reference,len)
|
||||
else
|
||||
cg.g_concatcopy(current_asmdata.CurrAsmList,right.location.reference,left.location.reference,len);
|
||||
|
@ -850,7 +850,11 @@ implementation
|
||||
cg.g_copyshortstring(list,href,localcopyloc.reference,tstringdef(tparavarsym(p).vartype.def).len)
|
||||
end
|
||||
else
|
||||
cg.g_concatcopy(list,href,localcopyloc.reference,tparavarsym(p).vartype.def.size);
|
||||
begin
|
||||
{ pass proper alignment info }
|
||||
localcopyloc.reference.alignment:=tparavarsym(p).vartype.def.alignment;
|
||||
cg.g_concatcopy(list,href,localcopyloc.reference,tparavarsym(p).vartype.def.size);
|
||||
end;
|
||||
{ update localloc of varsym }
|
||||
tg.Ungetlocal(list,tparavarsym(p).localloc.reference);
|
||||
tparavarsym(p).localloc:=localcopyloc;
|
||||
|
Loading…
Reference in New Issue
Block a user