From 3eef641833290cccc9412be73ddcb72dfa85f2ab Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 20 Nov 2016 18:00:01 +0000 Subject: [PATCH] * convert jmp into rjmp only of the target is not a function git-svn-id: trunk@34936 - --- compiler/avr/aasmcpu.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/avr/aasmcpu.pas b/compiler/avr/aasmcpu.pas index 675570bb74..69053cba43 100644 --- a/compiler/avr/aasmcpu.pas +++ b/compiler/avr/aasmcpu.pas @@ -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;