mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 14:05:58 +02:00
* x86: "StcClcSet(c)2Mov" optimisation now checks to see if the destination register is in use
This commit is contained in:
parent
74e47ccff6
commit
7c5847bc70
@ -9578,7 +9578,13 @@ unit aoptx86;
|
||||
IsJumpToLabel(taicpu(hp1_dist)) and
|
||||
not (taicpu(hp1_dist).condition in [C_AE, C_NB, C_NC, C_B, C_C, C_NAE, C_BE, C_NA]) and
|
||||
{ This works if hp1_dist or both are regular JMP instructions }
|
||||
condition_in(taicpu(hp1).condition, taicpu(hp1_dist).condition) then
|
||||
condition_in(taicpu(hp1).condition, taicpu(hp1_dist).condition) and
|
||||
(
|
||||
(taicpu(p_dist).oper[0]^.typ <> top_reg) or
|
||||
{ Make sure the register isn't still in use, otherwise it
|
||||
may get corrupted (fixes #40659) }
|
||||
not RegUsedBetween(taicpu(p_dist).oper[0]^.reg, p, p_dist)
|
||||
) then
|
||||
begin
|
||||
taicpu(p).allocate_oper(2);
|
||||
taicpu(p).ops := 2;
|
||||
|
Loading…
Reference in New Issue
Block a user