diff --git a/compiler/aggas.pas b/compiler/aggas.pas index d27519569a..5d6c387c40 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -1303,12 +1303,14 @@ implementation ait_label : begin - if (tai_label(hp).labsym.is_used) then - begin {$ifdef DEBUG_LABEL} writer.AsmWrite(asminfo^.comment); writer.AsmWriteLn('References = ' + tostr(tai_label(hp).labsym.getrefs)); + if tai_label(hp).labsym.getrefs=0 then + writer.AsmWriteln(asminfo^.comment+'Optimized out label '+tai_label(hp).labsym.name); {$endif DEBUG_LABEL} + if (tai_label(hp).labsym.is_used) then + begin if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then begin if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then