Browse Source

* do not location_force_reg in tcgshlshrnode.second_integer if left is already in a register

git-svn-id: trunk@26797 -
florian 11 years ago
parent
commit
3dddd01309
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/ncgmat.pas

+ 4 - 1
compiler/ncgmat.pas

@@ -478,7 +478,10 @@ implementation
              end;
              end;
 {$endif cpunodefaultint}
 {$endif cpunodefaultint}
 
 
-         hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,opdef,true);
+         if not(left.location.loc in [LOC_CREGISTER,LOC_REGISTER]) or
+           { location_force_reg can be also used to change the size of a register }
+           (left.location.size<>opsize) then
+           hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,opdef,true);
          location_reset(location,LOC_REGISTER,opsize);
          location_reset(location,LOC_REGISTER,opsize);
          location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
          location.register:=cg.getintregister(current_asmdata.CurrAsmList,opsize);