diff --git a/compiler/globtype.pas b/compiler/globtype.pas index f73a32e36e..0c992b7cba 100644 --- a/compiler/globtype.pas +++ b/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) } diff --git a/compiler/ncgbas.pas b/compiler/ncgbas.pas index c7d7c9651c..d926f25f57 100644 --- a/compiler/ncgbas.pas +++ b/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 } diff --git a/compiler/ncgflw.pas b/compiler/ncgflw.pas index 268e41edb6..02ca76420a 100644 --- a/compiler/ncgflw.pas +++ b/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 diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 40985db710..8e3a90f598 100644 --- a/compiler/ncgutil.pas +++ b/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 diff --git a/compiler/nflw.pas b/compiler/nflw.pas index 93455a7591..1bf262c7c5 100644 --- a/compiler/nflw.pas +++ b/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 diff --git a/compiler/psub.pas b/compiler/psub.pas index 689e9eae66..42f93a906a 100644 --- a/compiler/psub.pas +++ b/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;