瀏覽代碼

* 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.

Yuriy Sydorov 3 年之前
父節點
當前提交
e04df465ef
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 2 2
      compiler/ncgflw.pas
  2. 3 1
      compiler/nflw.pas

+ 2 - 2
compiler/ncgflw.pas

@@ -516,8 +516,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}

+ 3 - 1
compiler/nflw.pas

@@ -2484,7 +2484,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(left) then
           firstpass(left);
@@ -2583,6 +2584,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));