Răsfoiți Sursa

* tried to restore old set behaviour for big endian targets

git-svn-id: trunk@6702 -
florian 18 ani în urmă
părinte
comite
efb025310d
4 a modificat fișierele cu 13 adăugiri și 8 ștergeri
  1. 5 2
      compiler/defutil.pas
  2. 5 3
      compiler/nadd.pas
  3. 1 1
      compiler/ncgcon.pas
  4. 2 2
      compiler/powerpc/nppcadd.pas

+ 5 - 2
compiler/defutil.pas

@@ -1019,7 +1019,7 @@ implementation
     {# returns true, if the type passed is a varset }
     {# returns true, if the type passed is a varset }
     function is_varset(p : tdef) : boolean;
     function is_varset(p : tdef) : boolean;
       begin
       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])
           result:=(p.typ=setdef) and not(p.size in [1,2,4])
         else
         else
           result:=false;
           result:=false;
@@ -1028,7 +1028,10 @@ implementation
 
 
     function is_normalset(p : tdef) : boolean;
     function is_normalset(p : tdef) : boolean;
       begin
       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;
       end;
 
 
 
 

+ 5 - 3
compiler/nadd.pas

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

+ 1 - 1
compiler/ncgcon.pas

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

+ 2 - 2
compiler/powerpc/nppcadd.pas

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