mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 02:09:43 +02:00
* when removing the STP FP,LR and MOV FP,SP instructions, also remove the corresponding SEH directives if available
This commit is contained in:
parent
b67415d1a8
commit
bb27442b19
@ -525,7 +525,7 @@ Implementation
|
|||||||
|
|
||||||
function TCpuAsmOptimizer.OptPass1STP(var p : tai): boolean;
|
function TCpuAsmOptimizer.OptPass1STP(var p : tai): boolean;
|
||||||
var
|
var
|
||||||
hp1, hp2, hp3, hp4: tai;
|
hp1, hp2, hp3, hp4, tmp1 : tai;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
{
|
{
|
||||||
@ -576,6 +576,22 @@ Implementation
|
|||||||
MatchInstruction(hp4, A_RET, [C_None], [PF_None]) and
|
MatchInstruction(hp4, A_RET, [C_None], [PF_None]) and
|
||||||
(taicpu(hp4).ops = 0) then
|
(taicpu(hp4).ops = 0) then
|
||||||
begin
|
begin
|
||||||
|
{ remove the SEH instruction for the STP FP,LR }
|
||||||
|
if GetNextInstruction(p,tmp1,[ait_seh_directive]) and
|
||||||
|
(tmp1.typ=ait_seh_directive) and
|
||||||
|
(tai_seh_directive(tmp1).kind=ash_savefplr_x) then
|
||||||
|
begin
|
||||||
|
asml.Remove(tmp1);
|
||||||
|
tmp1.free;
|
||||||
|
end;
|
||||||
|
{ remove the SEH instruction for the MOV FP,SP }
|
||||||
|
if GetNextInstruction(hp1,tmp1,[ait_seh_directive]) and
|
||||||
|
(tmp1.typ=ait_seh_directive) and
|
||||||
|
(tai_seh_directive(tmp1).kind=ash_setfp) then
|
||||||
|
begin
|
||||||
|
asml.Remove(tmp1);
|
||||||
|
tmp1.free;
|
||||||
|
end;
|
||||||
asml.Remove(p);
|
asml.Remove(p);
|
||||||
asml.Remove(hp1);
|
asml.Remove(hp1);
|
||||||
asml.Remove(hp3);
|
asml.Remove(hp3);
|
||||||
|
Loading…
Reference in New Issue
Block a user