From: kvigor Date: Mon, 29 Jan 2001 23:32:19 +0000 (+0000) Subject: Fix Johan's latest finds X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=37117ab83620a9768dbe381bdc326ef70ba9a1cc;p=fw%2Fsdcc Fix Johan's latest finds git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@546 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index c56f9c82..033a20aa 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -613,7 +613,7 @@ int processParms (ast *func, value *defParm, DCL_TYPE(newType->opval.lnk) = GPOINTER; } - if (newType) + if (0 && newType) { /* cast required; change this op to a cast. */ ast *parmCopy = resolveSymbols(copyAst(actParm)); @@ -622,7 +622,7 @@ int processParms (ast *func, value *defParm, actParm->opval.op = CAST; actParm->left = newType; actParm->right= parmCopy; - decorateType(actParm); + decorateType(actParm); } return 0; @@ -665,6 +665,7 @@ int processParms (ast *func, value *defParm, } /* actParm->argSym = resolveFromTable(defParm)->sym ; */ + actParm->argSym = defParm->sym; /* make a copy and change the regparm type to the defined parm */ actParm->etype = getSpec(actParm->ftype = copyLinkChain(actParm->ftype)); @@ -2783,7 +2784,7 @@ ast *decorateType (ast *tree) /* if there is going to be a casing required then add it */ if (checkType(currFunc->type->next,RTYPE(tree)) < 0 ) { -#ifdef DEMAND_INTEGER_PROMOTION +#if 0 && defined DEMAND_INTEGER_PROMOTION if (IS_INTEGRAL(currFunc->type->next)) { pushTypeCastToLeaves(currFunc->type->next, tree->right, &(tree->right)); diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 6d86b60d..13459ab0 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -4226,7 +4226,7 @@ static void genCmpEq (iCode *ic, iCode *ifx) D(emitcode(";", "genCmpEq ");); - AOP_OP_3(ic); + AOP_OP_2(ic); AOP_SET_LOCALS(ic); #if 0 aopOp((left=IC_LEFT(ic)),ic,FALSE, FALSE); @@ -4244,7 +4244,10 @@ static void genCmpEq (iCode *ic, iCode *ifx) IC_LEFT(ic) = t; } - if(ifx && !AOP_SIZE(result)){ + if (ifx && /* !AOP_SIZE(result) */ + OP_SYMBOL(result) && + OP_SYMBOL(result)->regType == REG_CND) + { symbol *tlbl; /* if they are both bit variables */ if (AOP_TYPE(left) == AOP_CRY && @@ -4294,7 +4297,10 @@ static void genCmpEq (iCode *ic, iCode *ifx) } /* mark the icode as generated */ ifx->generated = 1; - goto release ; + + freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + return ; } /* if they are both bit variables */ @@ -4318,6 +4324,12 @@ static void genCmpEq (iCode *ic, iCode *ifx) emitcode("cpl","c"); emitcode("","%05d$:",(lbl->key+100)); } + + freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + + aopOp(result,ic,TRUE, FALSE); + /* c = 1 if egal */ if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)){ outBitC(result); @@ -4331,7 +4343,13 @@ static void genCmpEq (iCode *ic, iCode *ifx) then put the result in place */ outBitC(result); } else { - gencjne(left,right,newiTempLabel(NULL)); + gencjne(left,right,newiTempLabel(NULL)); + + freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); + + aopOp(result,ic,TRUE, FALSE); + if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) { aopPut(AOP(result),"a",0); goto release ; @@ -4348,8 +4366,6 @@ static void genCmpEq (iCode *ic, iCode *ifx) } release: - freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); - freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE)); freeAsmop(result,NULL,ic,TRUE); }