Browse Source

* handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in
unaryminus code (a.o., fixes compiler crash with test/terecs6 on
darwin/ppc32 under certain circumstances:
http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=74027&run2id=74101&testfileid=3838 )

git-svn-id: trunk@16650 -

Jonas Maebe 14 years ago
parent
commit
5175a5ee07
2 changed files with 4 additions and 0 deletions
  1. 2 0
      compiler/powerpc/nppcmat.pas
  2. 2 0
      compiler/powerpc64/nppcmat.pas

+ 2 - 0
compiler/powerpc/nppcmat.pas

@@ -576,6 +576,8 @@ end;
            end
            end
          else
          else
            begin
            begin
+              if left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF] then
+                location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
               location_copy(location,left.location);
               location_copy(location,left.location);
               location.loc:=LOC_REGISTER;
               location.loc:=LOC_REGISTER;
               case left.location.loc of
               case left.location.loc of

+ 2 - 0
compiler/powerpc64/nppcmat.pas

@@ -316,6 +316,8 @@ var
 begin
 begin
   secondpass(left);
   secondpass(left);
   begin
   begin
+    if left.location.loc in [LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF] then
+      location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,true);
     location_copy(location, left.location);
     location_copy(location, left.location);
     location.loc := LOC_REGISTER;
     location.loc := LOC_REGISTER;
     case left.location.loc of
     case left.location.loc of