1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-01 03:30:20 +00:00

At the end of the optimizer run, remove jump cascades again. fixes the

regression reported in #1652
This commit is contained in:
mrdudz 2022-05-08 13:22:10 +02:00
parent 5813fd81d3
commit 43af562ce1

View File

@ -117,6 +117,7 @@ static OptFunc DOptBNegAX3 = { OptBNegAX3, "OptBNegAX3", 100, 0,
static OptFunc DOptBNegAX4 = { OptBNegAX4, "OptBNegAX4", 100, 0, 0, 0, 0, 0 };
static OptFunc DOptBoolTrans = { OptBoolTrans, "OptBoolTrans", 100, 0, 0, 0, 0, 0 };
static OptFunc DOptBranchDist = { OptBranchDist, "OptBranchDist", 0, 0, 0, 0, 0, 0 };
static OptFunc DOptBranchDist2 = { OptBranchDist2, "OptBranchDist2", 0, 0, 0, 0, 0, 0 };
static OptFunc DOptCmp1 = { OptCmp1, "OptCmp1", 42, 0, 0, 0, 0, 0 };
static OptFunc DOptCmp2 = { OptCmp2, "OptCmp2", 85, 0, 0, 0, 0, 0 };
static OptFunc DOptCmp3 = { OptCmp3, "OptCmp3", 75, 0, 0, 0, 0, 0 };
@ -222,6 +223,7 @@ static OptFunc* OptFuncs[] = {
&DOptBNegAX4,
&DOptBoolTrans,
&DOptBranchDist,
&DOptBranchDist2,
&DOptCmp1,
&DOptCmp2,
&DOptCmp3,
@ -849,6 +851,10 @@ static unsigned RunOptGroup7 (CodeSeg* S)
/* Replace JSR followed by RTS to JMP */
C += RunOptFunc (S, &DOptRTS, 1);
/* Replace JMP/BRA to JMP by direct JMP */
C += RunOptFunc (S, &DOptJumpCascades, 1);
C += RunOptFunc (S, &DOptBranchDist2, 1);
Changes += C;
/* If we had changes, we must run dead code elimination again,
** since the changes may have introduced dead code.