Explorar o código

* renamed pi_has_goto into pi_has_label because the problematic thing is if a procedure has a label as target and not if it has some goto
* moved inclusion of pi_has_label to tlabelnode.pass_1

git-svn-id: trunk@15712 -

florian %!s(int64=15) %!d(string=hai) anos
pai
achega
ad23569cf1
Modificáronse 6 ficheiros con 14 adicións e 12 borrados
  1. 2 2
      compiler/globtype.pas
  2. 3 3
      compiler/ncgbas.pas
  3. 2 2
      compiler/ncgflw.pas
  4. 3 3
      compiler/ncgutil.pas
  5. 3 1
      compiler/nflw.pas
  6. 1 1
      compiler/psub.pas

+ 2 - 2
compiler/globtype.pas

@@ -417,8 +417,8 @@ interface
          pi_uses_static_symtable,
          { set if the procedure has to push parameters onto the stack }
          pi_has_stackparameter,
-         { set if the procedure has at least one got }
-         pi_has_goto,
+         { set if the procedure has at least one label }
+         pi_has_label,
          { calls itself recursive }
          pi_is_recursive,
          { stack frame optimization not possible (only on x86 probably) }

+ 3 - 3
compiler/ncgbas.pas

@@ -492,7 +492,7 @@ interface
           LOC_REGISTER:
             begin
               if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_goto in current_procinfo.flags) then
+                 (pi_has_label in current_procinfo.flags) then
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }
@@ -515,7 +515,7 @@ interface
           LOC_FPUREGISTER:
             begin
               if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_goto in current_procinfo.flags) then
+                 (pi_has_label in current_procinfo.flags) then
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }
@@ -530,7 +530,7 @@ interface
           LOC_MMREGISTER:
             begin
               if not(cs_opt_regvar in current_settings.optimizerswitches) or
-                 (pi_has_goto in current_procinfo.flags) then
+                 (pi_has_label in current_procinfo.flags) then
                 begin
                   { make sure the register allocator doesn't reuse the }
                   { register e.g. in the middle of a loop              }

+ 2 - 2
compiler/ncgflw.pas

@@ -108,7 +108,7 @@ implementation
     procedure tcgwhilerepeatnode.sync_regvars(checkusedregvars: boolean);
       begin
          if (cs_opt_regvar in current_settings.optimizerswitches) and
-            not(pi_has_goto in current_procinfo.flags) then
+            not(pi_has_label in current_procinfo.flags) then
            begin
              if checkusedregvars then
                begin
@@ -390,7 +390,7 @@ implementation
     procedure tcgfornode.sync_regvars(checkusedregvars: boolean);
       begin
          if (cs_opt_regvar in current_settings.optimizerswitches) and
-            not(pi_has_goto in current_procinfo.flags) then
+            not(pi_has_label in current_procinfo.flags) then
            begin
              if checkusedregvars then
                begin

+ 3 - 3
compiler/ncgutil.pas

@@ -1775,7 +1775,7 @@ implementation
       begin
         if allocreg then
           gen_alloc_regloc(list,sym.initialloc);
-        if (pi_has_goto in current_procinfo.flags) then
+        if (pi_has_label in current_procinfo.flags) then
           begin
             { Allocate register already, to prevent first allocation to be
               inside a loop }
@@ -2905,7 +2905,7 @@ implementation
                       in the parent procedures }
                     case localloc.loc of
                       LOC_CREGISTER :
-                        if (pi_has_goto in current_procinfo.flags) then
+                        if (pi_has_label in current_procinfo.flags) then
 {$ifndef cpu64bitalu}
                           if def_cgsize(vardef) in [OS_64,OS_S64] then
                             begin
@@ -2917,7 +2917,7 @@ implementation
                             cg.a_reg_sync(list,localloc.register);
                       LOC_CFPUREGISTER,
                       LOC_CMMREGISTER:
-                        if (pi_has_goto in current_procinfo.flags) then
+                        if (pi_has_label in current_procinfo.flags) then
                           cg.a_reg_sync(list,localloc.register);
                       LOC_REFERENCE :
                         begin

+ 3 - 1
compiler/nflw.pas

@@ -1684,7 +1684,6 @@ implementation
       begin
         result:=nil;
         expectloc:=LOC_VOID;
-        include(current_procinfo.flags,pi_has_goto);
 
         { The labelnode can already be set when
           this node was copied }
@@ -1828,6 +1827,9 @@ implementation
       begin
         result:=nil;
         expectloc:=LOC_VOID;
+
+        include(current_procinfo.flags,pi_has_label);
+
         if assigned(left) then
           firstpass(left);
         if (m_iso in current_settings.modeswitches) and

+ 1 - 1
compiler/psub.pas

@@ -948,7 +948,7 @@ implementation
         if (cs_opt_loopstrength in current_settings.optimizerswitches)
           { our induction variable strength reduction doesn't like
             for loops with more than one entry }
-          and not(pi_has_goto in current_procinfo.flags) then
+          and not(pi_has_label in current_procinfo.flags) then
           begin
             {RedoDFA:=}OptimizeInductionVariables(code);
           end;