* tried to restore old set behaviour for big endian targets

git-svn-id: trunk@6702 -
This commit is contained in:
florian 2007-03-03 17:52:55 +00:00
parent 29f201c10b
commit efb025310d
4 changed files with 13 additions and 8 deletions

View File

@ -1019,7 +1019,7 @@ implementation
{# returns true, if the type passed is a varset }
function is_varset(p : tdef) : boolean;
begin
if (target_info.endian = endian_little) then
if target_info.endian=endian_little then
result:=(p.typ=setdef) and not(p.size in [1,2,4])
else
result:=false;
@ -1028,7 +1028,10 @@ implementation
function is_normalset(p : tdef) : boolean;
begin
result:=(p.typ=setdef) and (tsetdef(p).settype = normset);
if target_info.endian=endian_big then
result:=(p.typ=setdef) and (tsetdef(p).size=32)
else
result:=false;
end;

View File

@ -1097,7 +1097,7 @@ implementation
if (rd.typ=setdef) and
not(equal_defs(ld,rd)) then
begin
if is_varset(rd) then
if is_varset(rd) or is_normalset(rd) then
inserttypeconv(left,right.resultdef)
else
inserttypeconv(right,left.resultdef);
@ -1760,7 +1760,9 @@ implementation
newstatement : tstatementnode;
temp : ttempcreatenode;
begin
if is_varset(left.resultdef) or is_varset(right.resultdef) then
if (is_varset(left.resultdef) or is_varset(right.resultdef)) and
not(is_normalset(left.resultdef)) and
not(is_normalset(right.resultdef)) then
begin
case nodetype of
equaln,unequaln,lten,gten:
@ -2410,7 +2412,7 @@ implementation
else array constructor can be seen as array of char (PFV) }
else if (ld.typ=setdef) then
begin
if not(is_varset(ld)) then
if not(is_varset(ld)) and not(is_normalset(ld)) then
begin
if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
expectloc:=LOC_FLAGS

View File

@ -524,7 +524,7 @@ implementation
else
indexadjust := 3;
{ small sets are loaded as constants }
if not(is_varset(resultdef)) then
if not(is_varset(resultdef)) and not(is_normalset(resultdef)) then
begin
location_reset(location,LOC_CONSTANT,int_cgsize(resultdef.size));
location.value:=pLongint(value_set)^;

View File

@ -778,7 +778,7 @@ interface
begin
{ normalsets are already handled in pass1 }
if (tsetdef(left.resultdef).settype<>smallset) then
internalerror(200109041);
internalerror(200109042);
second_addsmallset;
exit;
end;
@ -822,7 +822,7 @@ interface
checkoverflow:=
(nodetype in [addn,subn,muln]) and
(cs_check_overflow in current_settings.localswitches) and
(left.resultdef.typ<>pointerdef) and
(left.resultdef.typ<>pointerdef) and
(right.resultdef.typ<>pointerdef);
load_left_right(cmpop, checkoverflow);