mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 17:47:56 +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;
|
||||
Out Next: tai; reg: TRegister): Boolean;
|
||||
var
|
||||
gniResult: Boolean;
|
||||
begin
|
||||
Next:=Current;
|
||||
Result := False;
|
||||
repeat
|
||||
Result:=GetNextInstruction(Next,Next);
|
||||
until not (Result) or
|
||||
not(cs_opt_level3 in current_settings.optimizerswitches) or
|
||||
(Next.typ<>ait_instruction) or
|
||||
RegInInstruction(reg,Next) or
|
||||
is_calljmp(taicpu(Next).opcode)
|
||||
|
||||
gniResult:=GetNextInstruction(Next,Next);
|
||||
if gniResult and RegInInstruction(reg,Next) then
|
||||
{ Found something }
|
||||
Exit(True);
|
||||
|
||||
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}
|
||||
or RegModifiedByInstruction(NR_PC,Next);
|
||||
or RegModifiedByInstruction(NR_PC,Next)
|
||||
{$endif ARM}
|
||||
;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user