mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-08 09:01:32 +01:00
* x86_64: warn only on negative offsets if rsp is involed, second part of #40113
+ tests
This commit is contained in:
parent
b5763eb412
commit
5598ffc210
@ -854,7 +854,7 @@ begin
|
||||
;
|
||||
end;
|
||||
|
||||
if memoffset < 0 then
|
||||
if ((operands[i].opr.ref.base=NR_ESP) or (operands[i].opr.ref.index=NR_ESP)) and (memoffset < 0) then
|
||||
begin
|
||||
Message2(asmr_w_check_mem_operand_negative_offset,
|
||||
//std_op2str[opcode],
|
||||
|
||||
17
tests/webtbf/tw40113c.pp
Normal file
17
tests/webtbf/tw40113c.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %cpu=x86_64 }
|
||||
{ %opt=-Sew }
|
||||
{ %fail }
|
||||
|
||||
{$asmmode intel}
|
||||
begin
|
||||
asm
|
||||
movss xmm0, dword ptr [rsp-8] // (2)
|
||||
lea rax, @table[rip]
|
||||
lea rsp, [rsp+32]
|
||||
jmp @next
|
||||
db 0, 1, 2, 3, 4, 5, 6, 7
|
||||
@table:
|
||||
db 8, 9, 10
|
||||
@next:
|
||||
end ['rax', 'xmm0'];
|
||||
end.
|
||||
17
tests/webtbs/tw40113d.pp
Normal file
17
tests/webtbs/tw40113d.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %cpu=x86_64 }
|
||||
{ %opt=-Sew }
|
||||
{ %norun }
|
||||
|
||||
{$asmmode intel}
|
||||
begin
|
||||
asm
|
||||
movss xmm0, dword ptr [rax-8] // (2)
|
||||
lea rax, @table[rip]
|
||||
lea rsp, [rsp+32]
|
||||
jmp @next
|
||||
db 0, 1, 2, 3, 4, 5, 6, 7
|
||||
@table:
|
||||
db 8, 9, 10
|
||||
@next:
|
||||
end ['rax', 'xmm0'];
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user