summaryrefslogtreecommitdiff
path: root/compiler/aoptobj.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-10 19:20:48 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-04-10 19:20:48 +0000
commit160cc1e115eeb75638dce6effdd16b2bc810ddb4 (patch)
treeb791a95695a7cf674e61a6153139c6f9c6c491fa /compiler/aoptobj.pas
parent3843727e74b31bbf2a34e7e3b89ee422269f770e (diff)
parent413a6aa6469e6c297780217a27ca91363c637944 (diff)
downloadfpc-avr.tar.gz
* rebase to trunk@17295avr
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/avr@17296 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/aoptobj.pas')
-rw-r--r--compiler/aoptobj.pas8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas
index 703a12b030..63a4edfd44 100644
--- a/compiler/aoptobj.pas
+++ b/compiler/aoptobj.pas
@@ -991,6 +991,7 @@ Unit AoptObj;
strpnew('next label reused'))));
{$endif finaldestdebug}
l.increfs;
+ tasmlabel(hp.oper[0]^.ref^.symbol).decrefs;
hp.oper[0]^.ref^.symbol := l;
if not GetFinalDestination(hp,succ(level)) then
exit;
@@ -1037,6 +1038,12 @@ Unit AoptObj;
(hp1.typ <> ait_label) do
if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then
begin
+ if (hp1.typ = ait_instruction) and
+ taicpu(hp1).is_jmp and
+ (taicpu(hp1).oper[0]^.typ = top_ref) and
+ assigned(taicpu(hp1).oper[0]^.ref^.symbol) and
+ (taicpu(hp1).oper[0]^.ref^.symbol is TAsmLabel) then
+ TAsmLabel(taicpu(hp1).oper[0]^.ref^.symbol).decrefs;
asml.remove(hp1);
hp1.free;
end
@@ -1051,6 +1058,7 @@ Unit AoptObj;
begin
hp2:=tai(hp1.next);
asml.remove(p);
+ tasmlabel(taicpu(p).oper[0]^.ref^.symbol).decrefs;
p.free;
p:=hp2;
continue;