* patch by Christo Crause: prevent that the compiler converts breq into jmp in inline assembler blocks, resolves #32949

git-svn-id: trunk@38088 -
This commit is contained in:
florian 2018-01-31 18:34:42 +00:00
parent d580402916
commit 0662b611ca
3 changed files with 28 additions and 6 deletions

1
.gitattributes vendored
View File

@ -14335,6 +14335,7 @@ tests/webtbf/tw3267.pp svneol=native#text/plain
tests/webtbf/tw3275.pp svneol=native#text/plain tests/webtbf/tw3275.pp svneol=native#text/plain
tests/webtbf/tw32906.pp svneol=native#text/plain tests/webtbf/tw32906.pp svneol=native#text/plain
tests/webtbf/tw3294.pp svneol=native#text/plain tests/webtbf/tw3294.pp svneol=native#text/plain
tests/webtbf/tw32949.pp svneol=native#text/pascal
tests/webtbf/tw3331.pp svneol=native#text/plain tests/webtbf/tw3331.pp svneol=native#text/plain
tests/webtbf/tw3337.pp svneol=native#text/plain tests/webtbf/tw3337.pp svneol=native#text/plain
tests/webtbf/tw3342.pp svneol=native#text/plain tests/webtbf/tw3342.pp svneol=native#text/plain

View File

@ -447,6 +447,10 @@ implementation
A_BRxx: A_BRxx:
if (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>64) or if (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset>64) or
(taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-63) then (taicpu(curtai).InsOffset-taicpu(curtai).oper[0]^.ref^.symbol.offset<-63) then
begin
if inasmblock then
Message(asmw_e_short_jmp_out_of_range)
else
begin begin
current_asmdata.getjumplabel(l); current_asmdata.getjumplabel(l);
list.insertafter(tai_label.create(l),curtai); list.insertafter(tai_label.create(l),curtai);
@ -455,6 +459,7 @@ implementation
taicpu(curtai).condition:=inverse_cond(taicpu(curtai).condition); taicpu(curtai).condition:=inverse_cond(taicpu(curtai).condition);
again:=true; again:=true;
end; end;
end;
A_JMP: A_JMP:
{ replace JMP by RJMP? ... { replace JMP by RJMP? ...
... but do not mess with asm block } ... but do not mess with asm block }

16
tests/webtbf/tw32949.pp Normal file
View File

@ -0,0 +1,16 @@
{ %CPU=avr }
{ %fail }
{$goto on}
program test;
label lbl;
begin
asm
lbl:
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop; nop; nop; nop; nop; nop; nop; nop;
nop; nop; nop;
breq lbl
end;
end.