* fixed integer typeconversion problems

This commit is contained in:
Jonas Maebe 2003-05-24 11:59:42 +00:00
parent 5cfedffb9e
commit 54cacc63a5
3 changed files with 29 additions and 9 deletions

View File

@ -93,18 +93,20 @@ interface
if (ressize<>leftsize) and
not is_void(left.resulttype.def) then
begin
location_copy(location,left.location);
{ reuse a loc_reference when the newsize is smaller than
than the original, else load it to a register }
if (location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) and
(ressize<leftsize) then
begin
location.size:=newsize;
left.location.size:=newsize;
if (target_info.endian = ENDIAN_BIG) then
inc(location.reference.offset,leftsize-ressize);
inc(left.location.reference.offset,leftsize-ressize);
end
else
location_force_reg(exprasmlist,location,newsize,false);
begin
location_force_reg(exprasmlist,left.location,newsize,false);
end;
location_copy(location,left.location);
end
else
begin
@ -511,7 +513,10 @@ end.
{
$Log$
Revision 1.40 2003-05-23 14:27:35 peter
Revision 1.41 2003-05-24 11:59:42 jonas
* fixed integer typeconversion problems
Revision 1.40 2003/05/23 14:27:35 peter
* remove some unit dependencies
* current_procinfo changes to store more info

View File

@ -452,7 +452,16 @@ implementation
if (TCGSize2Size[dst_size]<TCGSize2Size[l.size]) then
begin
if (l.loc in [LOC_REGISTER,LOC_CREGISTER]) then
l.register.number:=(l.register.number and not $ff) or cgsize2subreg(dst_size);
begin
{$ifndef i386}
hregisterhi := l.register;
{$endif not i386}
l.register.number:=(l.register.number and not $ff) or cgsize2subreg(dst_size);
{$ifndef i386}
{ necessary for all processors that do not have subregisters (JM) }
cg.a_load_reg_reg(list,l.size,dst_size,hregisterhi,l.register);
{$endif not i386}
end;
{ for big endian systems, the reference's offset must }
{ be increased in this case, since they have the }
{ MSB first in memory and e.g. byte(word_var) should }
@ -1827,7 +1836,10 @@ implementation
end.
{
$Log$
Revision 1.105 2003-05-23 14:27:35 peter
Revision 1.106 2003-05-24 11:59:42 jonas
* fixed integer typeconversion problems
Revision 1.105 2003/05/23 14:27:35 peter
* remove some unit dependencies
* current_procinfo changes to store more info

View File

@ -422,7 +422,7 @@ const
(tosize <> fromsize) and
not(fromsize in [OS_32,OS_S32])) then
begin
case fromsize of
case tosize of
OS_8:
list.concat(taicpu.op_reg_reg_const_const_const(A_RLWINM,
reg2,reg1,0,31-8+1,31));
@ -2442,7 +2442,10 @@ begin
end.
{
$Log$
Revision 1.95 2003-05-23 18:51:26 jonas
Revision 1.96 2003-05-24 11:59:42 jonas
* fixed integer typeconversion problems
Revision 1.95 2003/05/23 18:51:26 jonas
* fixed support for nested procedures and more parameters than those
which fit in registers (untested/probably not working: calling a
nested procedure from a deeper nested procedure)