X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcoptsub.c;h=cbd09caa0a9bcb9eab9e69151bdeca4b04d2e1ac;hb=c130e597b013e37c94afd6651be1e8859ba7e5ac;hp=3b236b678b2b76ed03a37945bd794c8ee0c861c0;hpb=21111ba235f184c962985fd79c4782eaa5990c83;p=cc65 diff --git a/src/cc65/coptsub.c b/src/cc65/coptsub.c index 3b236b678..cbd09caa0 100644 --- a/src/cc65/coptsub.c +++ b/src/cc65/coptsub.c @@ -33,8 +33,6 @@ -#include - /* 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);