浏览代码

* fixed optimised form of a_cmp_const_reg_label(): when inverting the branch, we still
have to emit the label we originally allocated for the fallthrough path (otherwise
the branch is not inverted at all, and moreover the caller will also emit the
original target label somewhere so it will be doubly defined)

git-svn-id: branches/hlcgllvm@28367 -

Jonas Maebe 11 年之前
父节点
当前提交
53e1d5c26f
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compiler/llvm/hlcgllvm.pas

+ 3 - 2
compiler/llvm/hlcgllvm.pas

@@ -769,7 +769,7 @@ implementation
     var
       tmpreg : tregister;
       invert: boolean;
-      falselab, tmplab: tasmlabel;
+      fallthroughlab, falselab, tmplab: tasmlabel;
     begin
       { since all comparisons return their results in a register, we'll often
         get comparisons against true/false -> optimise }
@@ -783,6 +783,7 @@ implementation
               invert:=a=1;
             end;
           current_asmdata.getjumplabel(falselab);
+          fallthroughlab:=falselab;
           if invert then
             begin
               tmplab:=l;
@@ -790,7 +791,7 @@ implementation
               falselab:=tmplab;
             end;
           list.concat(taillvm.op_size_reg_lab_lab(la_br,pasbool8type,reg,l,falselab));
-          a_label(list,falselab);
+          a_label(list,fallthroughlab);
           exit;
         end;
       tmpreg:=getregisterfordef(list,size);