mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-07 16:16:09 +02:00
* if si and di are allocated on i8086, using an index in references is not possible anymore
git-svn-id: trunk@38203 -
This commit is contained in:
parent
22df9cde3e
commit
e5ebc65cce
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11487,6 +11487,7 @@ tests/tbs/tb0633.pp svneol=native#text/pascal
|
|||||||
tests/tbs/tb0634.pp svneol=native#text/pascal
|
tests/tbs/tb0634.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0635.pp svneol=native#text/pascal
|
tests/tbs/tb0635.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0636.pp svneol=native#text/pascal
|
tests/tbs/tb0636.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0637.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb205.pp svneol=native#text/plain
|
tests/tbs/tb205.pp svneol=native#text/plain
|
||||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb613.pp svneol=native#text/plain
|
tests/tbs/tb613.pp svneol=native#text/plain
|
||||||
|
@ -2675,6 +2675,17 @@ unit cgx86;
|
|||||||
list.concat(taicpu.op_reg(A_POP,push_segment_size,NR_ES));
|
list.concat(taicpu.op_reg(A_POP,push_segment_size,NR_ES));
|
||||||
end;
|
end;
|
||||||
getcpuregister(list,REGSI);
|
getcpuregister(list,REGSI);
|
||||||
|
{$ifdef i8086}
|
||||||
|
{ at this point, si and di are allocated, so no register is available as index =>
|
||||||
|
compiler will hang/ie during spilling, so avoid that srcref has base and index }
|
||||||
|
if (srcref.base<>NR_NO) and (srcref.index<>NR_NO) then
|
||||||
|
begin
|
||||||
|
r:=getaddressregister(list);
|
||||||
|
a_op_reg_reg_reg(list,OP_ADD,OS_ADDR,srcref.base,srcref.index,r);
|
||||||
|
srcref.base:=r;
|
||||||
|
srcref.index:=NR_NO;
|
||||||
|
end;
|
||||||
|
{$endif i8086}
|
||||||
if ((source.segment=NR_NO) and (segment_regs_equal(NR_SS,NR_DS) or ((source.base<>NR_BP) and (source.base<>NR_SP)))) or
|
if ((source.segment=NR_NO) and (segment_regs_equal(NR_SS,NR_DS) or ((source.base<>NR_BP) and (source.base<>NR_SP)))) or
|
||||||
(is_segment_reg(source.segment) and segment_regs_equal(source.segment,NR_DS)) then
|
(is_segment_reg(source.segment) and segment_regs_equal(source.segment,NR_DS)) then
|
||||||
begin
|
begin
|
||||||
|
26
tests/tbs/tb0637.pp
Normal file
26
tests/tbs/tb0637.pp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE TP}
|
||||||
|
{$ENDIF}
|
||||||
|
program a;
|
||||||
|
|
||||||
|
type
|
||||||
|
rectyp = record
|
||||||
|
{ it doesn't crash if this is 0..5 }
|
||||||
|
f: array[0..6] of byte;
|
||||||
|
end;
|
||||||
|
prectyp = ^rectyp;
|
||||||
|
|
||||||
|
arrrec = array[0..1] of rectyp;
|
||||||
|
parrrectyp = ^arrrec;
|
||||||
|
|
||||||
|
var
|
||||||
|
arr: parrrectyp;
|
||||||
|
|
||||||
|
procedure xx(x: integer);
|
||||||
|
begin
|
||||||
|
{ crash here }
|
||||||
|
arr^[x]:=arr^[x+1];
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user