* patch by Jeppe Johansen to avoid corruption of frame/stack pointer by pre/post indexed operations, resolves #19679

git-svn-id: trunk@18234 -
This commit is contained in:
florian 2011-08-16 22:43:30 +00:00
parent 2eb39c8843
commit d6ad7721e6

View File

@ -62,6 +62,8 @@ unit rgcpu;
procinfo;
procedure trgintcputhumb2.add_cpu_interferences(p: tai);
var
r : tregister;
begin
if p.typ=ait_instruction then
begin
@ -95,6 +97,27 @@ unit rgcpu;
end;
end;
end;
A_LDRB,
A_STRB,
A_STR,
A_LDR,
A_LDRH,
A_STRH,
A_LDRSB,
A_LDRSH,
A_LDRD,
A_STRD:
{ don't mix up the framepointer and stackpointer with pre/post indexed operations }
if (taicpu(p).oper[1]^.typ=top_ref) and
(taicpu(p).oper[1]^.ref^.addressmode in [AM_PREINDEXED,AM_POSTINDEXED]) then
begin
add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),getsupreg(current_procinfo.framepointer));
{ FIXME: temp variable r is needed here to avoid Internal error 20060521 }
{ while compiling the compiler. }
r:=NR_STACK_POINTER_REG;
if current_procinfo.framepointer<>r then
add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),getsupreg(r));
end;
end;
end;
end;