Browse Source

* live_registers must be restored after the spilling store code
is generate to add correct conflicts for extra temporary registers

peter 21 years ago
parent
commit
eaf46c4fb1
1 changed files with 11 additions and 5 deletions
  1. 11 5
      compiler/rgobj.pas

+ 11 - 5
compiler/rgobj.pas

@@ -1944,10 +1944,6 @@ unit rgobj;
                 end;
                 end;
             end;
             end;
 
 
-        { we are now at the original instruction, restore live registers }
-        live_registers.done;
-        live_registers:=oldlive_registers;
-
         { store the spilled registers }
         { store the spilled registers }
         storepos:=tai(instr.next);
         storepos:=tai(instr.next);
         for counter := 0 to pred(regindex) do
         for counter := 0 to pred(regindex) do
@@ -1960,6 +1956,12 @@ unit rgobj;
                 end;
                 end;
             end;
             end;
 
 
+        { now all spilling code is generated we can restore the live registers. This
+          must be done after the store because the store can need an extra register
+          that also needs to conflict with the registers of the instruction }
+        live_registers.done;
+        live_registers:=oldlive_registers;
+
         { substitute registers }
         { substitute registers }
         for counter:=0 to instr.ops-1 do
         for counter:=0 to instr.ops-1 do
          with instr.oper[counter]^ do
          with instr.oper[counter]^ do
@@ -1994,7 +1996,11 @@ unit rgobj;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.139  2004-10-05 20:41:01  peter
+  Revision 1.140  2004-10-06 20:14:08  peter
+    * live_registers must be restored after the spilling store code
+      is generate to add correct conflicts for extra temporary registers
+
+  Revision 1.139  2004/10/05 20:41:01  peter
     * more spilling rewrites
     * more spilling rewrites
 
 
   Revision 1.138  2004/10/04 20:46:22  peter
   Revision 1.138  2004/10/04 20:46:22  peter