Bladeren bron

* write variable locations of 64 bit integer values on 32 bit targets correctly
* when transforming imag. register variable locations into real ones, take care of the register type

git-svn-id: trunk@18958 -

florian 14 jaren geleden
bovenliggende
commit
6211a83865
2 gewijzigde bestanden met toevoegingen van 27 en 14 verwijderingen
  1. 7 4
      compiler/ncgutil.pas
  2. 20 10
      compiler/rgobj.pas

+ 7 - 4
compiler/ncgutil.pas

@@ -2942,19 +2942,22 @@ implementation
               internalerror(2006090920);
           end;
 
-        if assigned(rr.sym) then
-          list.concat(tai_varloc.create(rr.sym,rr.new));
-
         { now that we've change the loadn/temp, also change the node result location }
       {$ifndef cpu64bitalu}
         if (n.location.size in [OS_64,OS_S64]) then
           begin
             n.location.register64.reglo := rr.new;
             n.location.register64.reghi := rr.newhi;
+            if assigned(rr.sym) then
+              list.concat(tai_varloc.create64(rr.sym,rr.new,rr.newhi));
           end
         else
       {$endif not cpu64bitalu}
-          n.location.register := rr.new;
+          begin
+            n.location.register := rr.new;
+            if assigned(rr.sym) then
+              list.concat(tai_varloc.create(rr.sym,rr.new));
+          end;
       end;
 
 

+ 20 - 10
compiler/rgobj.pas

@@ -1678,18 +1678,28 @@ unit rgobj;
                   end;
               ait_varloc:
                 begin
-                  if cs_asm_source in current_settings.globalswitches then
+                  if (getregtype(tai_varloc(p).newlocation)=regtype) then
                     begin
-                      setsupreg(tai_varloc(p).newlocation,reginfo[getsupreg(tai_varloc(p).newlocation)].colour);
-                      hp:=Tai_comment.Create(strpnew('Var '+tai_varloc(p).varsym.realname+' located in register '+
-                        std_regname(tai_varloc(p).newlocation)));
-                      list.insertafter(hp,p);
+                      if (cs_asm_source in current_settings.globalswitches) then
+                        begin
+                          setsupreg(tai_varloc(p).newlocation,reginfo[getsupreg(tai_varloc(p).newlocation)].colour);
+                          if tai_varloc(p).newlocationhi<>NR_NO then
+                            begin
+                              setsupreg(tai_varloc(p).newlocationhi,reginfo[getsupreg(tai_varloc(p).newlocationhi)].colour);
+                                hp:=Tai_comment.Create(strpnew('Var '+tai_varloc(p).varsym.realname+' located in register '+
+                                  std_regname(tai_varloc(p).newlocationhi)+':'+std_regname(tai_varloc(p).newlocation)));
+                            end
+                          else
+                            hp:=Tai_comment.Create(strpnew('Var '+tai_varloc(p).varsym.realname+' located in register '+
+                              std_regname(tai_varloc(p).newlocation)));
+                          list.insertafter(hp,p);
+                        end;
+                      q:=tai(p.next);
+                      list.remove(p);
+                      p.free;
+                      p:=q;
+                      continue;
                     end;
-                  q:=tai(p.next);
-                  list.remove(p);
-                  p.free;
-                  p:=q;
-                  continue;
                 end;
 
               ait_instruction: