mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 08:50:19 +02:00
* x86: Fixed bug where redirected jump has its condition changed (fixes i39851)
This commit is contained in:
parent
99074a5578
commit
b1e65ca49f
@ -6671,12 +6671,12 @@ unit aoptx86;
|
|||||||
j(c1) @lbl1
|
j(c1) @lbl1
|
||||||
...
|
...
|
||||||
@lbl:
|
@lbl:
|
||||||
cmp ###.### (same comparison as above)
|
cmp ###,### (same comparison as above)
|
||||||
j(c2) @lbl2
|
j(c2) @lbl2
|
||||||
|
|
||||||
If c1 is a subset of c2, change to:
|
If c1 is a subset of c2, change to:
|
||||||
cmp ###,###
|
cmp ###,###
|
||||||
j(c2) @lbl2
|
j(c1) @lbl2
|
||||||
(@lbl1 may become a dead label as a result)
|
(@lbl1 may become a dead label as a result)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6716,7 +6716,6 @@ unit aoptx86;
|
|||||||
JumpLabel.DecRefs;
|
JumpLabel.DecRefs;
|
||||||
|
|
||||||
DebugMsg(SPeepholeOptimization + 'CMP/Jcc/@Lbl/CMP/Jcc -> CMP/Jcc, redirecting first jump', p_jump);
|
DebugMsg(SPeepholeOptimization + 'CMP/Jcc/@Lbl/CMP/Jcc -> CMP/Jcc, redirecting first jump', p_jump);
|
||||||
taicpu(p_jump).condition := taicpu(hp1_dist).condition;
|
|
||||||
taicpu(p_jump).loadref(0, taicpu(hp1_dist).oper[0]^.ref^);
|
taicpu(p_jump).loadref(0, taicpu(hp1_dist).oper[0]^.ref^);
|
||||||
Result := True;
|
Result := True;
|
||||||
{ Don't exit yet. Since p and p_jump haven't actually been
|
{ Don't exit yet. Since p and p_jump haven't actually been
|
||||||
|
Loading…
Reference in New Issue
Block a user