From: johanknol Date: Wed, 26 Mar 2003 09:32:28 +0000 (+0000) Subject: catched symbol abuse X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=bc04edccb1ca8d1dafb8ae5c96b047005029b866;p=fw%2Fsdcc catched symbol abuse git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2418 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 845eb11c..b433a159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-03-26 + + * src/mcs51/gen.c (saveRegisters): catched symbol abuse + * src/ds390/gen.c (saveRegisters): catched symbol abuse + * src/SDCCast.c (decorateType): fixed " -v < 3" + 2003-03-23 Bernhard Held * doc/cdbfile.html: removed, replaced by cdbfileformat.lyx diff --git a/src/ds390/gen.c b/src/ds390/gen.c index aba719c5..d472def1 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -2034,11 +2034,14 @@ saveRegisters (iCode * lic) /* if the registers have been saved already then do nothing */ - if (ic->regsSaved || IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT(ic)))) return ; + if (ic->regsSaved || + (IS_SYMOP(IC_LEFT(ic)) && IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT(ic))))) + return ; /* special case if DPTR alive across a function call then must save it even though callee saves */ - if (IFFUNC_CALLEESAVES(OP_SYMBOL (IC_LEFT (ic))->type)) { + if (IS_SYMOP(IC_LEFT(ic)) && + IFFUNC_CALLEESAVES(OP_SYMBOL (IC_LEFT (ic))->type)) { int i; rsave = newBitVect(ic->rMask->size); for (i = DPL_IDX ; i <= B_IDX ; i++ ) { diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 5c7693f7..0dbce03e 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -1548,10 +1548,13 @@ saveRegisters (iCode * lic) /* if the registers have been saved already or don't need to be then do nothing */ - if (ic->regsSaved || IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type) || - IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic)))) + if (ic->regsSaved) return; - + if (IS_SYMOP(IC_LEFT(ic)) && + (IFFUNC_CALLEESAVES(OP_SYMBOL(IC_LEFT(ic))->type) || + IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic))))) + return; + /* safe the registers in use at this time but skip the ones for the result */ rsave = bitVectCplAnd (bitVectCopy (ic->rMask),