* I hope it's proper fix for r10688.

git-svn-id: trunk@10690 -
This commit is contained in:
yury 2008-04-18 10:51:56 +00:00
parent e71d631c24
commit b70bf05ad5
6 changed files with 25 additions and 10 deletions

View File

@ -198,8 +198,9 @@ implementation
begin
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size/sign? Then we have to sign/zero-extend }
if (newsize<>left.location.size) then
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;

View File

@ -172,8 +172,9 @@ implementation
begin
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size/sign? Then we have to sign/zero-extend }
if (newsize<>left.location.size) then
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;

View File

@ -2516,6 +2516,16 @@ implementation
(left.resultdef.size=resultdef.size) and
(left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then
exit;
{ when converting 64bit int to C-ctyle boolean, first convert to a 32bit int and then }
{ convert to a boolean (only necessary for 32bit processors) }
if (left.resultdef.size > sizeof(aint)) and (left.resultdef.size<>resultdef.size)
and is_cbool(resultdef) then
begin
result := ctypeconvnode.create_internal(left,s32inttype);
left := nil;
firstpass(result);
exit;
end;
expectloc:=LOC_REGISTER;
end;

View File

@ -93,8 +93,9 @@ implementation
begin
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size/sign? Then we have to sign/zero-extend }
if (newsize<>left.location.size) then
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;

View File

@ -241,8 +241,9 @@ implementation
begin
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size/sign? Then we have to sign/zero-extend }
if (newsize<>left.location.size) then
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;

View File

@ -110,8 +110,9 @@ implementation
begin
location_copy(location,left.location);
newsize:=def_cgsize(resultdef);
{ change of size/sign? Then we have to sign/zero-extend }
if (newsize<>left.location.size) then
{ change of size? change sign only if location is LOC_(C)REGISTER? Then we have to sign/zero-extend }
if (tcgsize2size[newsize]<>tcgsize2size[left.location.size]) or
((newsize<>left.location.size) and (location.loc in [LOC_REGISTER,LOC_CREGISTER])) then
location_force_reg(current_asmdata.CurrAsmList,location,newsize,true)
else
location.size:=newsize;