]> git.sur5r.net Git - cc65/blobdiff - src/cc65/coptsub.c
New function ReplaceType
[cc65] / src / cc65 / coptsub.c
index 3b236b678b2b76ed03a37945bd794c8ee0c861c0..cbd09caa0a9bcb9eab9e69151bdeca4b04d2e1ac 100644 (file)
@@ -33,8 +33,6 @@
 
 
 
-#include <string.h>
-
 /* cc65 */
 #include "codeent.h"
 #include "codeinfo.h"
@@ -131,20 +129,16 @@ unsigned OptSub2 (CodeSeg* S)
 
        /* Check for the sequence */
                if (E->OPC == OP65_LDA                             &&
+           !CS_RangeHasLabel (S, I+1, 5)                  &&
            CS_GetEntries (S, L, I+1, 5)                   &&
                    L[0]->OPC == OP65_SEC                          &&
-           !CE_HasLabel (L[0])                            &&
                    L[1]->OPC == OP65_STA                          &&
            strcmp (L[1]->Arg, "tmp1") == 0                &&
-           !CE_HasLabel (L[1])                            &&
            L[2]->OPC == OP65_LDA                          &&
-                   !CE_HasLabel (L[2])                            &&
            L[3]->OPC == OP65_SBC                          &&
            strcmp (L[3]->Arg, "tmp1") == 0                &&
-                   !CE_HasLabel (L[3])                            &&
            L[4]->OPC == OP65_STA                          &&
-           strcmp (L[4]->Arg, L[2]->Arg) == 0             &&
-                   !CE_HasLabel (L[4])) {
+           strcmp (L[4]->Arg, L[2]->Arg) == 0) {
 
            /* Remove the store to tmp1 */
            CS_DelEntry (S, I+2);