Browse Source

+ EXTTEMPREGDEBUG code added

pierre 26 years ago
parent
commit
088f2ba6cc
2 changed files with 20 additions and 3 deletions
  1. 13 2
      compiler/tgeni386.pas
  2. 7 1
      compiler/tree.pas

+ 13 - 2
compiler/tgeni386.pas

@@ -368,7 +368,11 @@ implementation
 {$ifdef TEMPREGDEBUG}
 {$ifdef TEMPREGDEBUG}
                 if (r in unused) then
                 if (r in unused) then
 {$ifdef EXTTEMPREGDEBUG}
 {$ifdef EXTTEMPREGDEBUG}
-                  internalerror(10)
+                  begin
+                    Comment(V_Debug,'register freed twice '+reg2str(r));
+                    testregisters32;
+                    exit;
+                  end
 {$else EXTTEMPREGDEBUG}
 {$else EXTTEMPREGDEBUG}
                   exit
                   exit
 {$endif EXTTEMPREGDEBUG}
 {$endif EXTTEMPREGDEBUG}
@@ -483,6 +487,10 @@ implementation
          if curptree^^.usableregs-usablereg32>curptree^^.registers32 then
          if curptree^^.usableregs-usablereg32>curptree^^.registers32 then
            internalerror(10);
            internalerror(10);
 {$endif TEMPREGDEBUG}
 {$endif TEMPREGDEBUG}
+{$ifdef EXTTEMPREGDEBUG}
+         if curptree^^.usableregs-usablereg32>curptree^^.reallyusedregs then
+           curptree^^.reallyusedregs:=curptree^^.usableregs-usablereg32;
+{$endif EXTTEMPREGDEBUG}
          if R_EAX in unused then
          if R_EAX in unused then
            begin
            begin
               unused:=unused-[R_EAX];
               unused:=unused-[R_EAX];
@@ -606,7 +614,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.33  1999-08-25 12:00:06  jonas
+  Revision 1.34  1999-08-27 10:38:32  pierre
+   + EXTTEMPREGDEBUG code added
+
+  Revision 1.33  1999/08/25 12:00:06  jonas
     * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
     * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
 
 
   Revision 1.32  1999/08/23 23:25:58  pierre
   Revision 1.32  1999/08/23 23:25:58  pierre

+ 7 - 1
compiler/tree.pas

@@ -201,6 +201,9 @@ unit tree;
 {$ifdef TEMPREGDEBUG}
 {$ifdef TEMPREGDEBUG}
           usableregs : longint;
           usableregs : longint;
 {$endif TEMPREGDEBUG}
 {$endif TEMPREGDEBUG}
+{$ifdef EXTTEMPREGDEBUG}
+          reallyusedregs : longint;
+{$endif EXTTEMPREGDEBUG}
 {$ifdef TEMPS_NOT_PUSH}
 {$ifdef TEMPS_NOT_PUSH}
           temp_offset : longint;
           temp_offset : longint;
 {$endif TEMPS_NOT_PUSH}
 {$endif TEMPS_NOT_PUSH}
@@ -1753,7 +1756,10 @@ unit tree;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.92  1999-08-26 21:10:08  peter
+  Revision 1.93  1999-08-27 10:38:31  pierre
+   + EXTTEMPREGDEBUG code added
+
+  Revision 1.92  1999/08/26 21:10:08  peter
     * better error recovery for case
     * better error recovery for case
 
 
   Revision 1.91  1999/08/23 23:26:00  pierre
   Revision 1.91  1999/08/23 23:26:00  pierre