From 761d00b7dc873b74bb7c99a2be716098ee1e0f0a Mon Sep 17 00:00:00 2001 From: acqn Date: Mon, 31 Aug 2020 06:16:28 +0800 Subject: [PATCH] Ignore running removed old optimization steps. Neither list them in help info. --- src/cc65/codeopt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cc65/codeopt.c b/src/cc65/codeopt.c index 498aa0ff2..b3b0d064b 100644 --- a/src/cc65/codeopt.c +++ b/src/cc65/codeopt.c @@ -1029,7 +1029,9 @@ void ListOptSteps (FILE* F) fprintf (F, "any\n"); for (I = 0; I < OPTFUNC_COUNT; ++I) { - fprintf (F, "%s\n", OptFuncs[I]->Name); + if (OptFuncs[I]->Func != 0) { + fprintf (F, "%s\n", OptFuncs[I]->Name); + } } } @@ -1190,10 +1192,10 @@ static unsigned RunOptFunc (CodeSeg* S, OptFunc* F, unsigned Max) { unsigned Changes, C; - /* Don't run the function if it is disabled or if it is prohibited by the + /* Don't run the function if it is removed, disabled or prohibited by the ** code size factor */ - if (F->Disabled || F->CodeSizeFactor > S->CodeSizeFactor) { + if (F->Func == 0 || F->Disabled || F->CodeSizeFactor > S->CodeSizeFactor) { return 0; }