]> git.gag.com Git - fw/sdcc/commitdiff
added avr to makefile.in & fixed a bug in cse.c
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 21 Mar 2000 18:47:20 +0000 (18:47 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 21 Mar 2000 18:47:20 +0000 (18:47 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@194 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/Makefile.in
src/SDCCcse.c

index eee05f8d6085aac95d1ff479cd3e1c0eedb18ce4..4792bfaa2e0cf872d0fb8bc71b9315652545b3a3 100644 (file)
@@ -6,7 +6,7 @@ PRJDIR          = ..
 
 include $(PRJDIR)/Makefile.common
 
-PORTS          = mcs51 z80
+PORTS          = mcs51 z80 avr
 PORT_LIBS      = $(PORTS:%=%/port.a)
 
 LIBS           = -lgc @LIBS@
index d84c007d02a1a715ea8a4eddf04ce1091301e4cd..c5ee399c31398416581139b1998dc0b32f3aeb3c 100644 (file)
@@ -88,6 +88,35 @@ void replaceAllSymBySym (iCode *ic, operand *from , operand *to)
     for (lic = ic ; lic ; lic = lic->next ) {
        int siaddr ;
 
+       /* do the special cases first */
+       if (lic->op == IFX) {
+               if (IS_SYMOP(to) &&
+                   IC_COND(lic)->key == from->key) {
+                       
+                       bitVectUnSetBit (OP_USES(from),lic->key);
+                       OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+                       siaddr = IC_COND(lic)->isaddr ;
+                       IC_COND(lic) = operandFromOperand(to);
+                       IC_COND(lic)->isaddr = siaddr ;
+                       
+               }
+               continue ;
+       }
+
+       if (lic->op == JUMPTABLE) {
+               if (IS_SYMOP(to) &&
+                   IC_JTCOND(lic)->key == from->key) {
+                       
+                       bitVectUnSetBit (OP_USES(from),lic->key);
+                       OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+                       siaddr = IC_COND(lic)->isaddr ;
+                       IC_JTCOND(lic) = operandFromOperand(to);
+                       IC_JTCOND(lic)->isaddr = siaddr ;
+                       
+               }
+               continue ;
+       }
+
        if (IC_RESULT(lic) && IC_RESULT(lic)->key == from->key ) {
            /* maintain du chains */
            if (POINTER_SET(lic)) {