* 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 -
This commit is contained in:
Jonas Maebe 2014-08-10 19:40:06 +00:00
parent 082c81a191
commit 53e1d5c26f

View File

@ -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);