Bläddra i källkod

* better fix for previous revision
* also applied to x86 and m68k

git-svn-id: trunk@5512 -

Jonas Maebe 18 år sedan
förälder
incheckning
05a07a7dd2

+ 2 - 0
compiler/m68k/n68kcnv.pas

@@ -135,6 +135,8 @@ implementation
            internalerror(20020814);
 
         location.register:=cg.getfpuregister(current_asmdata.CurrAsmList,opsize);
+        if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
+          location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false);
         case left.location.loc of
           LOC_REGISTER, LOC_CREGISTER:
             begin

+ 1 - 1
compiler/powerpc/nppccnv.pas

@@ -169,7 +169,7 @@ implementation
           internalerror(200110011);
 
         if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
-          location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false);
+          location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,false);
         case left.location.loc of
           LOC_REGISTER:
             begin

+ 1 - 1
compiler/powerpc64/nppccnv.pas

@@ -149,7 +149,7 @@ begin
   end;
 
   if not(left.location.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_REFERENCE,LOC_CREFERENCE]) then
-    location_force_reg(current_asmdata.CurrAsmList,left.location,OS_INT,false);
+    location_force_reg(current_asmdata.CurrAsmList,left.location,left.location.size,false);
   case left.location.loc of
     // the conversion algorithm does not modify the input register, so it can
     // be used for both LOC_REGISTER and LOC_CREGISTER

+ 3 - 3
compiler/x86/nx86cnv.pas

@@ -205,6 +205,9 @@ implementation
          hreg : tregister;
          op : tasmop;
       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);
+
 {$ifdef x86_64}
         if use_sse(resultdef) then
           begin
@@ -226,9 +229,6 @@ implementation
             location_reset(location,LOC_MMREGISTER,def_cgsize(resultdef));
             location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef));
 
-            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);
-
             case torddef(left.resultdef).ordtype of
               u64bit:
                 begin