mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-25 21:06:16 +02:00
* CallRet2Jmp works with PIC
git-svn-id: trunk@43371 -
This commit is contained in:
parent
3487c34ed9
commit
6842c5784d
@ -4244,19 +4244,16 @@ unit aoptx86;
|
|||||||
by
|
by
|
||||||
jmp procname
|
jmp procname
|
||||||
|
|
||||||
this should never hurt except when pic is used, not sure
|
|
||||||
how to handle it then
|
|
||||||
|
|
||||||
but do it only on level 4 because it destroys stack back traces
|
but do it only on level 4 because it destroys stack back traces
|
||||||
}
|
}
|
||||||
if (cs_opt_level4 in current_settings.optimizerswitches) and
|
if (cs_opt_level4 in current_settings.optimizerswitches) and
|
||||||
not(cs_create_pic in current_settings.moduleswitches) and
|
|
||||||
GetNextInstruction(p, hp1) and
|
GetNextInstruction(p, hp1) and
|
||||||
MatchInstruction(hp1,A_RET,[S_NO]) and
|
MatchInstruction(hp1,A_RET,[S_NO]) and
|
||||||
(taicpu(hp1).ops=0) then
|
(taicpu(hp1).ops=0) then
|
||||||
begin
|
begin
|
||||||
taicpu(p).opcode := A_JMP;
|
taicpu(p).opcode := A_JMP;
|
||||||
taicpu(p).is_jmp := true;
|
taicpu(p).is_jmp := true;
|
||||||
|
DebugMsg(SPeepholeOptimization + 'CallRet2Jmp done',p);
|
||||||
asml.remove(hp1);
|
asml.remove(hp1);
|
||||||
hp1.free;
|
hp1.free;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
|
Loading…
Reference in New Issue
Block a user