* The label which is generated by traisenode is not a jump target. Mark

this label as nf_internal, which means the label does not impact the
  code flow. This leads to a much better register allocation.

(cherry picked from commit e04df465ef)
This commit is contained in:
Yuriy Sydorov 2021-11-02 13:01:44 +02:00 committed by florian
parent fb672fe645
commit 41c9661d6d
2 changed files with 5 additions and 3 deletions

View File

@ -512,8 +512,8 @@ implementation
procedure tcglabelnode.pass_generate_code;
begin
location_reset(location,LOC_VOID,OS_NO);
include(flowcontrol,fc_gotolabel);
if not (nf_internal in flags) then
include(flowcontrol,fc_gotolabel);
{$ifdef OLDREGVARS}
load_all_regvars(current_asmdata.CurrAsmList);
{$endif OLDREGVARS}

View File

@ -2118,7 +2118,8 @@ implementation
result:=nil;
expectloc:=LOC_VOID;
include(current_procinfo.flags,pi_has_label);
if not (nf_internal in flags) then
include(current_procinfo.flags,pi_has_label);
if assigned(labsym) and labsym.nonlocal then
begin
@ -2223,6 +2224,7 @@ implementation
begin
third:=cinlinenode.create(in_get_frame,false,nil);
current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
current_addr.toggleflag(nf_internal);
addstatement(statements,current_addr);
right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
end;