Added heap support functions
[fw/sdcc] / src / SDCCicode.c
index 8506e9b6540c6f0d6a534d8ef21a5b26dd360524..7dca929a28cb09708a605048325f32af70359385 100644 (file)
@@ -1658,13 +1658,7 @@ geniCodeCast (sym_link * type, operand * op, bool implicit)
     }
   }
   if (errors) {
-    /* fprintf (stderr, "%s%s %d: ", op->operand.symOperand->name,
-       implicit?"(implicit)":"", errors); */
-    fprintf (stderr, "from type '");
-    printTypeChain (optype, stderr);
-    fprintf (stderr, "' to type '");
-    printTypeChain (type, stderr);
-    fprintf (stderr, "'\n");
+    printFromToType (optype, type);
   }
 
   /* if they are the same size create an assignment */
@@ -2620,7 +2614,7 @@ geniCodeAssign (operand * left, operand * right, int nosupdate)
 
   /* first check the type for pointer assignement */
   if (left->isaddr && IS_PTR (ltype) && IS_ITEMP (left) &&
-      compareType (ltype, rtype) < 0)
+      compareType (ltype, rtype) <= 0)
     {
       if (compareType (ltype->next, rtype) < 0)
        right = geniCodeCast (ltype->next, right, TRUE);
@@ -2710,11 +2704,6 @@ geniCodeParms (ast * parms, value *argVals, int *stack,
     argVals=FUNC_ARGS(func->type);
   }
 
-  if (parms->argSym || 
-      (parms->type!=EX_OP && parms->type!=EX_OPERAND)) {
-    fprintf (stderr, "What the fuck??\n");
-  }
-
   /* if this is a param node then do the left & right */
   if (parms->type == EX_OP && parms->opval.op == PARAM)
     {
@@ -2743,8 +2732,7 @@ geniCodeParms (ast * parms, value *argVals, int *stack,
     }
 
   /* if register parm then make it a send */
-  if ((parms->argSym && IS_REGPARM(parms->argSym->etype)) ||
-      (IS_REGPARM (parms->etype) && !IFFUNC_HASVARARGS(func->type)))
+  if (IS_REGPARM (parms->etype) && !IFFUNC_HASVARARGS(func->type))
     {
       ic = newiCode (SEND, pval, NULL);
       ADDTOCHAIN (ic);
@@ -2962,14 +2950,14 @@ geniCodeIfx (ast * tree,int lvl)
          if (tree->trueLabel)
            geniCodeGoto (tree->trueLabel);
          else
-           assert (1);
+           assert (0);
        }
       else
        {
          if (tree->falseLabel)
            geniCodeGoto (tree->falseLabel);
          else
-           assert (1);
+           assert (0);
        }
       goto exit;
     }