mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 18:29:09 +02:00
* the improved arm optimizer might move instructions around so the old hacky test if a label with its data has been already embedded into the code by checking if the offset is 0 does not work anymore so a new field for tai_label has been introduced for this purpose
git-svn-id: trunk@22345 -
This commit is contained in:
parent
7361e19799
commit
7840b4657a
@ -426,13 +426,13 @@ interface
|
|||||||
procedure derefimpl;override;
|
procedure derefimpl;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tai_ent = class(tai)
|
tai_ent = class(tai)
|
||||||
Name : string;
|
Name : string;
|
||||||
Constructor Create (const ProcName : String);
|
Constructor Create (const ProcName : String);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tai_ent_end = class(tai)
|
tai_ent_end = class(tai)
|
||||||
Name : string;
|
Name : string;
|
||||||
Constructor Create (const ProcName : String);
|
Constructor Create (const ProcName : String);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -446,8 +446,13 @@ interface
|
|||||||
|
|
||||||
{ Generates an assembler label }
|
{ Generates an assembler label }
|
||||||
tai_label = class(tai)
|
tai_label = class(tai)
|
||||||
is_global : boolean;
|
|
||||||
labsym : tasmlabel;
|
labsym : tasmlabel;
|
||||||
|
is_global : boolean;
|
||||||
|
{$ifdef arm}
|
||||||
|
{ set to true when the label has been moved by insertpcrelativedata to the correct location
|
||||||
|
so one label can be used multiple times }
|
||||||
|
moved : boolean;
|
||||||
|
{$endif arm}
|
||||||
constructor Create(_labsym : tasmlabel);
|
constructor Create(_labsym : tasmlabel);
|
||||||
constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
|
@ -818,6 +818,7 @@ implementation
|
|||||||
penalty,
|
penalty,
|
||||||
lastinspos,
|
lastinspos,
|
||||||
{ increased for every data element > 4 bytes inserted }
|
{ increased for every data element > 4 bytes inserted }
|
||||||
|
currentsize,
|
||||||
extradataoffset,
|
extradataoffset,
|
||||||
limit: longint;
|
limit: longint;
|
||||||
curop : longint;
|
curop : longint;
|
||||||
@ -851,8 +852,9 @@ implementation
|
|||||||
curdatatai:=tai(taicpu(curtai).oper[curop]^.ref^.symboldata);
|
curdatatai:=tai(taicpu(curtai).oper[curop]^.ref^.symboldata);
|
||||||
if assigned(curdatatai) and
|
if assigned(curdatatai) and
|
||||||
{ move only if we're at the first reference of a label }
|
{ move only if we're at the first reference of a label }
|
||||||
(taicpu(curtai).oper[curop]^.ref^.offset=0) then
|
not(tai_label(curdatatai).moved) then
|
||||||
begin
|
begin
|
||||||
|
tai_label(curdatatai).moved:=true;
|
||||||
{ check if symbol already used. }
|
{ check if symbol already used. }
|
||||||
{ if yes, reuse the symbol }
|
{ if yes, reuse the symbol }
|
||||||
hp:=tai(curdatatai.next);
|
hp:=tai(curdatatai.next);
|
||||||
|
Loading…
Reference in New Issue
Block a user