2
0
Эх сурвалжийг харах

* Do not use stack parameter location for spilling if its size is less than the register size for all CPU targets except x86.

git-svn-id: trunk@46801 -
yury 4 жил өмнө
parent
commit
e159c92967
1 өөрчлөгдсөн 11 нэмэгдсэн , 1 устгасан
  1. 11 1
      compiler/ncgutil.pas

+ 11 - 1
compiler/ncgutil.pas

@@ -625,8 +625,18 @@ implementation
           regtype:=getregtype(reg);
           while true do
             begin
-              cg.rg[regtype].set_reg_initial_location(reg,loc.reference);
               regsize:=tcgsize2size[reg_cgsize(reg)];
+{$ifndef x86}
+              { The size of the stack parameter must be not less than
+                the size of the register because the spilling code for
+                most CPU targets spills whole registers.
+                
+                Spilling of sub registers is supported for x86.
+              }
+              if regsize>tcgsize2size[paraloc^.Size] then
+                break;
+{$endif x86}
+              cg.rg[regtype].set_reg_initial_location(reg,loc.reference);
               dec(size,regsize);
               if size<=0 then
                 break;