* convert jmp into rjmp only of the target is not a function

git-svn-id: trunk@34936 -
This commit is contained in:
florian 2016-11-20 18:00:01 +00:00
parent 0882c13cb7
commit 3eef641833

View File

@ -457,7 +457,10 @@ implementation
{ replace JMP by RJMP? ...
... but do not mess with asm block }
if not(inasmblock) and (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<=2048) and
(taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>=-2047) then
(taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>=-2047) and
{ jmps to function go outside the currently considered scope, so do not mess with them.
Those are generated by the peephole optimizer from call/ret sequences }
not(taicpu(curtai).oper[0]^.ref^.symbol.typ=AT_FUNCTION) then
begin
taicpu(curtai).opcode:=A_RJMP;
again:=true;