mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 00:11:20 +02:00
patch by J. Gareth Moreton: GetNextInstructionUsingReg drops out earlier, second part of #37526
git-svn-id: trunk@46976 -
This commit is contained in:
parent
eec51afadd
commit
bb92fbafa0
@ -170,18 +170,26 @@ Implementation
|
|||||||
|
|
||||||
function TARMAsmOptimizer.GetNextInstructionUsingReg(Current: tai;
|
function TARMAsmOptimizer.GetNextInstructionUsingReg(Current: tai;
|
||||||
Out Next: tai; reg: TRegister): Boolean;
|
Out Next: tai; reg: TRegister): Boolean;
|
||||||
|
var
|
||||||
|
gniResult: Boolean;
|
||||||
begin
|
begin
|
||||||
Next:=Current;
|
Next:=Current;
|
||||||
|
Result := False;
|
||||||
repeat
|
repeat
|
||||||
Result:=GetNextInstruction(Next,Next);
|
|
||||||
until not (Result) or
|
gniResult:=GetNextInstruction(Next,Next);
|
||||||
not(cs_opt_level3 in current_settings.optimizerswitches) or
|
if gniResult and RegInInstruction(reg,Next) then
|
||||||
(Next.typ<>ait_instruction) or
|
{ Found something }
|
||||||
RegInInstruction(reg,Next) or
|
Exit(True);
|
||||||
is_calljmp(taicpu(Next).opcode)
|
|
||||||
|
until not gniResult or
|
||||||
|
not(cs_opt_level3 in current_settings.optimizerswitches) or
|
||||||
|
(Next.typ<>ait_instruction) or
|
||||||
|
is_calljmp(taicpu(Next).opcode)
|
||||||
{$ifdef ARM}
|
{$ifdef ARM}
|
||||||
or RegModifiedByInstruction(NR_PC,Next);
|
or RegModifiedByInstruction(NR_PC,Next)
|
||||||
{$endif ARM}
|
{$endif ARM}
|
||||||
|
;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user