From 6a39d372f105dff37cf99e41deb38fcc989a59d0 Mon Sep 17 00:00:00 2001 From: sandeep Date: Tue, 21 Mar 2000 18:47:20 +0000 Subject: [PATCH] added avr to makefile.in & fixed a bug in cse.c git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@194 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/Makefile.in | 2 +- src/SDCCcse.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Makefile.in b/src/Makefile.in index eee05f8d..4792bfaa 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -6,7 +6,7 @@ PRJDIR = .. include $(PRJDIR)/Makefile.common -PORTS = mcs51 z80 +PORTS = mcs51 z80 avr PORT_LIBS = $(PORTS:%=%/port.a) LIBS = -lgc @LIBS@ diff --git a/src/SDCCcse.c b/src/SDCCcse.c index d84c007d..c5ee399c 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -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)) { -- 2.47.2