* fixed copying of unaligned value parameters

git-svn-id: trunk@3369 -
This commit is contained in:
florian 2006-04-29 20:13:57 +00:00
parent f72f9c70eb
commit 13493a5355
3 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;