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

* Make trgobj.uses_registers method return True when registers of appropriate type are specified in list of used registers (after assembler blocks), but not used otherwise. This is a missing piece of r30011, enabling code generator to actually save/restore such registers. Resolves #28421.

git-svn-id: trunk@32610 -
sergei 9 жил өмнө
parent
commit
c0eafe38aa
1 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 6 2
      compiler/rgobj.pas

+ 6 - 2
compiler/rgobj.pas

@@ -227,6 +227,7 @@ unit rgobj;
         constrained_moves : Tlinkedlist;
         extended_backwards,
         backwards_was_first : tbitset;
+        has_usedmarks: boolean;
 
         { Disposes of the reginfo array.}
         procedure dispose_reginfo;
@@ -522,7 +523,7 @@ unit rgobj;
 
     function trgobj.uses_registers:boolean;
       begin
-        result:=(maxreg>first_imaginary);
+        result:=(maxreg>first_imaginary) or has_usedmarks;
       end;
 
 
@@ -1733,7 +1734,10 @@ unit rgobj;
                           end;
                         ra_markused :
                           if (supreg<first_imaginary) then
-                            include(used_in_proc,supreg);
+                            begin
+                              include(used_in_proc,supreg);
+                              has_usedmarks:=true;
+                            end;
                       end;
                       { constraints needs always to be updated }
                       add_constraints(reg);