Procházet zdrojové kódy

+ tempinfo flag ti_no_final_regsync which prevents that the final reg. sync. is emitted

git-svn-id: trunk@34787 -
florian před 8 roky
rodič
revize
82e6e1eb34
2 změnil soubory, kde provedl 12 přidání a 8 odebrání
  1. 6 2
      compiler/nbas.pas
  2. 6 6
      compiler/ncgbas.pas

+ 6 - 2
compiler/nbas.pas

@@ -159,12 +159,16 @@ interface
              that temp is not deallocated until this temp is deleted (since
              that temp is not deallocated until this temp is deleted (since
              otherwise the assigned value may be freed before the last use of
              otherwise the assigned value may be freed before the last use of
              the temp) }
              the temp) }
-         ti_const
+         ti_const,
+         { the temp. needs no final sync instruction if it is located in a register,
+           so there are no loops involved in the usage of the temp.
+         }
+         ti_no_final_regsync
          );
          );
        ttempinfoflags = set of ttempinfoflag;
        ttempinfoflags = set of ttempinfoflag;
 
 
      const
      const
-       tempinfostoreflags = [ti_may_be_in_reg,ti_addr_taken,ti_reference,ti_readonly];
+       tempinfostoreflags = [ti_may_be_in_reg,ti_addr_taken,ti_reference,ti_readonly,ti_no_final_regsync];
 
 
      type
      type
        { to allow access to the location by temp references even after the temp has }
        { to allow access to the location by temp references even after the temp has }

+ 6 - 6
compiler/ncgbas.pas

@@ -567,8 +567,8 @@ interface
           LOC_CREGISTER,
           LOC_CREGISTER,
           LOC_REGISTER:
           LOC_REGISTER:
             begin
             begin
-              if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_label in current_procinfo.flags) then
+              if (not(cs_opt_regvar in current_settings.optimizerswitches) or
+                 (pi_has_label in current_procinfo.flags)) and not(ti_no_final_regsync in tempflags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }
                   { register e.g. in the middle of a loop              }
@@ -632,8 +632,8 @@ interface
           LOC_CFPUREGISTER,
           LOC_CFPUREGISTER,
           LOC_FPUREGISTER:
           LOC_FPUREGISTER:
             begin
             begin
-              if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_label in current_procinfo.flags) then
+              if (not(cs_opt_regvar in current_settings.optimizerswitches) or
+                 (pi_has_label in current_procinfo.flags)) and not(ti_no_final_regsync in tempflags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }
                   { register e.g. in the middle of a loop              }
@@ -647,8 +647,8 @@ interface
           LOC_CMMREGISTER,
           LOC_CMMREGISTER,
           LOC_MMREGISTER:
           LOC_MMREGISTER:
             begin
             begin
-              if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_label in current_procinfo.flags) then
+              if (not(cs_opt_regvar in current_settings.optimizerswitches) or
+                 (pi_has_label in current_procinfo.flags)) and not(ti_no_final_regsync in tempflags) then
                 begin
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }
                   { register e.g. in the middle of a loop              }