]> git.gag.com Git - fw/sdcc/commitdiff
Fix Johan's latest finds
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Jan 2001 23:32:19 +0000 (23:32 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Jan 2001 23:32:19 +0000 (23:32 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@546 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/ds390/gen.c

index c56f9c822ce329295fef979e8b7284a395e9ba4c..033a20aab3c2ff30d99fc6dbfd1f5f97e853f662 100644 (file)
@@ -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));
index 6d86b60dfeda5982e878a4acbf3c10dfc5bedacf..13459ab01b28e91feefc1249104eddcb04723092 100644 (file)
@@ -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);
 }