* fixed a_param_ref for source sizes < 8 bytes

git-svn-id: trunk@10505 -
This commit is contained in:
Jonas Maebe 2008-03-18 20:10:22 +00:00
parent dd38ec2d36
commit a6b9b3e00a

View File

@ -109,15 +109,32 @@ unit cgcpu;
tmpref, ref: treference;
location: pcgparalocation;
sizeleft: aint;
sourcesize: tcgsize;
begin
location := paraloc.location;
tmpref := r;
sizeleft := paraloc.intsize;
{ make sure we handle passing a 32 bit value in memory to a }
{ 64 bit register location etc. correctly }
if (size<>OS_NO) and
(tcgsize2size[size]<paraloc.intsize) then
begin
paraloc.check_simple_location;
if not(location^.loc in [LOC_REGISTER,LOC_CREGISTER]) then
internalerror(2008031801);
sizeleft:=tcgsize2size[size]
end
else
sizeleft:=paraloc.intsize;
while assigned(location) do
begin
case location^.loc of
LOC_REGISTER,LOC_CREGISTER:
a_load_ref_reg(list,location^.size,location^.size,tmpref,location^.register);
begin
sourcesize:=int_cgsize(sizeleft);
if (sourcesize=OS_NO) then
sourcesize:=location^.size;
a_load_ref_reg(list,sourcesize,location^.size,tmpref,location^.register);
end;
LOC_REFERENCE:
begin
reference_reset_base(ref,location^.reference.index,location^.reference.offset);