]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codeopt.c
Track usage of the sreg and several other zero page registers and remove
[cc65] / src / cc65 / codeopt.c
index 7b4928e51c57523484b28609f6723f910848d4fa..7be0efb9c0f6725cf1a6e7f7514f9d0cf249110a 100644 (file)
@@ -697,7 +697,7 @@ static unsigned OptAdd2 (CodeSeg* S)
            L[6]->OPC == OP65_JSR               &&
                    strcmp (L[6]->Arg, "addeqysp") == 0 &&
            !CE_HasLabel (L[6])                 &&
-           (GetRegInfo (S, I+7) & REG_AX) == 0) {
+           (GetRegInfo (S, I+7, REG_AX) & REG_AX) == 0) {
 
            char Buf [20];
            CodeEntry* X;
@@ -2580,6 +2580,7 @@ static OptFunc OptFuncs [] = {
     OptEntry (OptTest1, optMain),
     /* Remove unused loads */
     OptEntry (OptUnusedLoads, optMain),
+    OptEntry (OptUnusedStores, optMain),
     OptEntry (OptDuplicateLoads, optMain),
     OptEntry (OptStoreLoad, optMain),
     OptEntry (OptTransfers, optMain),