mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 23:14:02 +02:00
* 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:
parent
d580402916
commit
0662b611ca
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||||
|
@ -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
16
tests/webtbf/tw32949.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user