]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCcse.c
Added some pointer pre inc/dec optimization
[fw/sdcc] / src / SDCCcse.c
index c5ee399c31398416581139b1998dc0b32f3aeb3c..52efaef7754eb3b3381cc4e22c0572234d8074a5 100644 (file)
@@ -1134,6 +1134,14 @@ int cseBBlock ( eBBlock *ebb, int computeOnly,
        if (SKIP_IC2(ic))
            continue ;
 
+       /* if this is an assignment from true symbol
+          to a temp then do pointer post inc/dec optimzation */
+       if (ic->op == '=' && !POINTER_SET(ic) &&
+           IS_TRUE_SYMOP(IC_RIGHT(ic)) && IS_ITEMP(IC_RESULT(ic)) &&
+           IS_PTR(operandType(IC_RESULT(ic)))) {
+           ptrPostIncDecOpt(ic);
+       }
+
        /* clear the def & use chains for the operands involved */
        /* in this operation . since it can change due to opts  */
        unsetDefsAndUses (ic);