Browse Source

+ tcgx86.a_load_reg_ref cuts data if the ref. size is smaller than the reg. size

git-svn-id: trunk@36953 -
florian 8 years ago
parent
commit
dba1761a76
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compiler/x86/cgx86.pas

+ 5 - 0
compiler/x86/cgx86.pas

@@ -952,6 +952,11 @@ unit cgx86;
       begin
       begin
         tmpref:=ref;
         tmpref:=ref;
         make_simple_ref(list,tmpref);
         make_simple_ref(list,tmpref);
+        if TCGSize2Size[fromsize]>TCGSize2Size[tosize] then
+          begin
+            fromsize:=tosize;
+            reg:=makeregsize(list,reg,fromsize);
+          end;
         check_register_size(fromsize,reg);
         check_register_size(fromsize,reg);
         sizes2load(fromsize,tosize,op,s);
         sizes2load(fromsize,tosize,op,s);
         case s of
         case s of