mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +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/tw32906.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/tw3337.pp svneol=native#text/plain
|
||||
tests/webtbf/tw3342.pp svneol=native#text/plain
|
||||
|
@ -448,12 +448,17 @@ implementation
|
||||
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
|
||||
begin
|
||||
current_asmdata.getjumplabel(l);
|
||||
list.insertafter(tai_label.create(l),curtai);
|
||||
list.insertafter(taicpu.op_sym(A_JMP,taicpu(curtai).oper[0]^.ref^.symbol),curtai);
|
||||
taicpu(curtai).oper[0]^.ref^.symbol:=l;
|
||||
taicpu(curtai).condition:=inverse_cond(taicpu(curtai).condition);
|
||||
again:=true;
|
||||
if inasmblock then
|
||||
Message(asmw_e_short_jmp_out_of_range)
|
||||
else
|
||||
begin
|
||||
current_asmdata.getjumplabel(l);
|
||||
list.insertafter(tai_label.create(l),curtai);
|
||||
list.insertafter(taicpu.op_sym(A_JMP,taicpu(curtai).oper[0]^.ref^.symbol),curtai);
|
||||
taicpu(curtai).oper[0]^.ref^.symbol:=l;
|
||||
taicpu(curtai).condition:=inverse_cond(taicpu(curtai).condition);
|
||||
again:=true;
|
||||
end;
|
||||
end;
|
||||
A_JMP:
|
||||
{ replace JMP by RJMP? ...
|
||||
|
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