varA = (varB > CONSTANT); Was not compiling correctly.
authorsdattalo <sdattalo@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 27 Jul 2002 14:50:55 +0000 (14:50 +0000)
committersdattalo <sdattalo@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 27 Jul 2002 14:50:55 +0000 (14:50 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2047 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/pic/gen.c
src/pic/pcode.c

index 78a8fcc0266935cd7e72b323bc81a730e3b57f2c..0df7a930dbbcc249d223c1cb5a312d455afbb377 100644 (file)
@@ -3763,6 +3763,8 @@ static void genCmp (operand *left,operand *right,
   truelbl  = newiTempLabel(NULL);
   size = max(AOP_SIZE(left),AOP_SIZE(right));
 
+  DEBUGpic14_AopType(__LINE__,left,right,result);
+
 #define _swapp
 
   /* if literal is on the right then swap with left */
@@ -4040,7 +4042,8 @@ static void genCmp (operand *left,operand *right,
 
 
     }
-#endif
+#endif  // _swapp
+
     if(AOP_TYPE(left) == AOP_LIT) {
       //symbol *lbl = newiTempLabel(NULL);
 
@@ -4116,12 +4119,18 @@ static void genCmp (operand *left,operand *right,
            emitpcode(POC_SUBFW, popGet(AOP(right),0));
            DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
            rFalseIfx.condition ^= 1;
-           genSkipc(&rFalseIfx);
+           if (AOP_TYPE(result) == AOP_CRY)
+             genSkipc(&rFalseIfx);
+           else {
+             emitpcode(POC_CLRF, popGet(AOP(result),0));
+             emitpcode(POC_RLF, popGet(AOP(result),0));
+           }         
            break;
          }
        }
 
        if(ifx) ifx->generated = 1;
+       //goto check_carry;
        return;
 
       } else {
@@ -4371,15 +4380,26 @@ static void genCmp (operand *left,operand *right,
     emitpLabel(lbl->key);
 
     DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    genSkipc(&rFalseIfx);
+    if ((AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) || 
+       (AOP_TYPE(result) == AOP_REG)) {
+      emitpcode(POC_CLRF, popGet(AOP(result),0));
+      emitpcode(POC_RLF, popGet(AOP(result),0));
+    } else {
+      genSkipc(&rFalseIfx);
+    }        
+    //genSkipc(&rFalseIfx);
     if(ifx) ifx->generated = 1;
+
     return;
 
   }
 
+ check_carry:
   if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
+    DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     pic14_outBitC(result);
   } else {
+    DEBUGpic14_emitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* if the result is used in the next
        ifx conditional branch then generate
        code a little differently */
index 3dcb4748ae08af43ea1155c28713a7cf4faaa34f..808aeaaa81d03cb8a642d5cb42d0e48ae0614eab 100644 (file)
@@ -75,7 +75,7 @@ static pBlock *pb_dead_pcodes = NULL;
 /* Hardcoded flags to change the behavior of the PIC port */
 static int peepOptimizing = 1;        /* run the peephole optimizer if nonzero */
 static int functionInlining = 1;      /* inline functions if nonzero */
-int debug_verbose = 0;                /* Set true to inundate .asm file */
+int debug_verbose = 1;                /* Set true to inundate .asm file */
 
 static int GpCodeSequenceNumber = 1;
 int GpcFlowSeq = 1;