Explorar o código

* fixes for temp type patch

peter %!s(int64=22) %!d(string=hai) anos
pai
achega
6b90162c5a
Modificáronse 3 ficheiros con 28 adicións e 11 borrados
  1. 6 3
      compiler/ncgcal.pas
  2. 8 3
      compiler/ncgutil.pas
  3. 14 5
      compiler/tgobj.pas

+ 6 - 3
compiler/ncgcal.pas

@@ -685,7 +685,7 @@ implementation
             not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) and
             not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) and
             not assigned(funcretnode) then
             not assigned(funcretnode) then
            begin
            begin
-             tg.gettemptyped(exprasmlist,resulttype.def,tt_persistent,refcountedtemp);
+             tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
              cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
              cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
            end;
            end;
 
 
@@ -1008,7 +1008,7 @@ implementation
          if resulttype.def.needs_inittable and
          if resulttype.def.needs_inittable and
             not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
             not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
            begin
            begin
-             tg.gettemptyped(exprasmlist,resulttype.def,tt_persistent,refcountedtemp);
+             tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
              cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
              cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
            end;
            end;
 
 
@@ -1133,7 +1133,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.136  2003-11-04 15:35:13  peter
+  Revision 1.137  2003-11-04 19:03:54  peter
+    * fixes for temp type patch
+
+  Revision 1.136  2003/11/04 15:35:13  peter
     * fix for referencecounted temps
     * fix for referencecounted temps
 
 
   Revision 1.135  2003/10/30 17:12:49  peter
   Revision 1.135  2003/10/30 17:12:49  peter

+ 8 - 3
compiler/ncgutil.pas

@@ -903,7 +903,8 @@ implementation
         hp:=tg.templist;
         hp:=tg.templist;
         while assigned(hp) do
         while assigned(hp) do
          begin
          begin
-           if assigned(hp^.def) then
+           if assigned(hp^.def) and
+              hp^.def.needs_inittable then
             begin
             begin
               if (cs_implicit_exceptions in aktmoduleswitches) then
               if (cs_implicit_exceptions in aktmoduleswitches) then
                 include(current_procinfo.flags,pi_needs_implicit_finally);
                 include(current_procinfo.flags,pi_needs_implicit_finally);
@@ -925,7 +926,8 @@ implementation
         hp:=tg.templist;
         hp:=tg.templist;
         while assigned(hp) do
         while assigned(hp) do
          begin
          begin
-           if assigned(hp^.def) then
+           if assigned(hp^.def) and
+              hp^.def.needs_inittable then
             begin
             begin
               reference_reset_base(href,current_procinfo.framepointer,hp^.pos);
               reference_reset_base(href,current_procinfo.framepointer,hp^.pos);
               cg.g_finalize(list,hp^.def,href,false);
               cg.g_finalize(list,hp^.def,href,false);
@@ -1943,7 +1945,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.163  2003-11-04 15:35:13  peter
+  Revision 1.164  2003-11-04 19:03:50  peter
+    * fixes for temp type patch
+
+  Revision 1.163  2003/11/04 15:35:13  peter
     * fix for referencecounted temps
     * fix for referencecounted temps
 
 
   Revision 1.162  2003/10/25 11:34:02  florian
   Revision 1.162  2003/10/25 11:34:02  florian

+ 14 - 5
compiler/tgobj.pas

@@ -380,10 +380,13 @@ unit tgobj;
                { Update tempfreelist }
                { Update tempfreelist }
                if assigned(hprevfree) then
                if assigned(hprevfree) then
                 begin
                 begin
-                  { Connect With previous tt_free block? }
+                  { Concat blocks when the previous block is free and
+                    there is no block assigned for a tdef }
                   if assigned(hprev) and
                   if assigned(hprev) and
                      (hp^.temptype=tt_free) and
                      (hp^.temptype=tt_free) and
-                     (hprev^.temptype=tt_free) then
+                     not assigned(hp^.def) and
+                     (hprev^.temptype=tt_free) and
+                     not assigned(hprev^.def) then
                    begin
                    begin
                      inc(hprev^.size,hp^.size);
                      inc(hprev^.size,hp^.size);
                      if direction=1 then
                      if direction=1 then
@@ -401,11 +404,14 @@ unit tgobj;
 
 
                   tempfreelist:=hp;
                   tempfreelist:=hp;
                 end;
                 end;
-               { Next block tt_free ? Yes, then concat }
+               { Concat blocks when the next block is free and
+                 there is no block assigned for a tdef }
                hnext:=hp^.next;
                hnext:=hp^.next;
                if assigned(hnext) and
                if assigned(hnext) and
                   (hp^.temptype=tt_free) and
                   (hp^.temptype=tt_free) and
-                  (hnext^.temptype=tt_free) then
+                  not assigned(hp^.def) and
+                  (hnext^.temptype=tt_free) and
+                  not assigned(hnext^.def) then
                 begin
                 begin
                   inc(hp^.size,hnext^.size);
                   inc(hp^.size,hnext^.size);
                   if direction=1 then
                   if direction=1 then
@@ -557,7 +563,10 @@ unit tgobj;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  2003-11-04 15:35:13  peter
+  Revision 1.42  2003-11-04 19:03:54  peter
+    * fixes for temp type patch
+
+  Revision 1.41  2003/11/04 15:35:13  peter
     * fix for referencecounted temps
     * fix for referencecounted temps
 
 
   Revision 1.40  2003/10/01 20:34:49  peter
   Revision 1.40  2003/10/01 20:34:49  peter