mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 16:40:25 +02:00
* x86: Fixed bug where flags register wasn't tracked during
long-range "AddMov2LeaAdd" and "SubMov2LeaSub" optimisations
This commit is contained in:
parent
5536810075
commit
b2dd980329
@ -15738,7 +15738,15 @@ unit aoptx86;
|
||||
(
|
||||
{ Instructions are guaranteed to be adjacent on -O2 and under }
|
||||
not (cs_opt_level3 in current_settings.optimizerswitches) or
|
||||
not RegUsedBetween(taicpu(hp1).oper[1]^.reg, p, hp1)
|
||||
(
|
||||
{ If the flags are used, don't make the optimisation,
|
||||
otherwise they will be scrambled. Fixes #41148 }
|
||||
(
|
||||
not RegInUsedRegs(NR_DEFAULTFLAGS, UsedRegs) or
|
||||
not RegUsedBetween(NR_DEFAULTFLAGS, p, hp1)
|
||||
) and
|
||||
not RegUsedBetween(taicpu(hp1).oper[1]^.reg, p, hp1)
|
||||
)
|
||||
) then
|
||||
begin
|
||||
TransferUsedRegs(TmpUsedRegs);
|
||||
@ -16003,7 +16011,15 @@ unit aoptx86;
|
||||
(
|
||||
{ Instructions are guaranteed to be adjacent on -O2 and under }
|
||||
not (cs_opt_level3 in current_settings.optimizerswitches) or
|
||||
not RegUsedBetween(taicpu(hp1).oper[1]^.reg, p, hp1)
|
||||
(
|
||||
{ If the flags are used, don't make the optimisation,
|
||||
otherwise they will be scrambled. Fixes #41148 }
|
||||
(
|
||||
not RegInUsedRegs(NR_DEFAULTFLAGS, UsedRegs) or
|
||||
not RegUsedBetween(NR_DEFAULTFLAGS, p, hp1)
|
||||
) and
|
||||
not RegUsedBetween(taicpu(hp1).oper[1]^.reg, p, hp1)
|
||||
)
|
||||
) then
|
||||
begin
|
||||
TransferUsedRegs(TmpUsedRegs);
|
||||
|
Loading…
Reference in New Issue
Block a user