case SYMBOL:
#define REGA 1
-#if REGA
+//#if REGA /* { */
+ if(REGA && !getenv("PRINT_SHORT_OPERANDS")) {
fprintf (file, "%s [k%d lr%d:%d so:%d]{ ia%d a2p%d re%d rm%d nos%d ru%d dp%d}", /*{ar%d rm%d ru%d p%d a%d u%d i%d au%d k%d ks%d}" , */
(OP_SYMBOL (op)->rname[0] ? OP_SYMBOL (op)->rname : OP_SYMBOL (op)->name),
op->key,
fprintf (file, "]");
}
}
-#else
-
+//#else /* } else { */
+ } else {
+ /* (getenv("PRINT_SHORT_OPERANDS") != NULL) */
fprintf (file, "%s ", (OP_SYMBOL (op)->rname[0] ? OP_SYMBOL (op)->rname : OP_SYMBOL (op)->name));
-#if 0
-
- fprintf (file, "[lr%d:%d so:%d]",
+ if(getenv("PRINT_SHORT_OPERANDS")[0] < '1')
+ {
+ fprintf (file, "[lr%d:%d so:%d]",
OP_LIVEFROM (op), OP_LIVETO (op),
- OP_SYMBOL (op)->stack
- );
-#endif
-
-#if 1
- {
- fprintf (file, "{");
- printTypeChain (operandType (op), file);
- if (SPIL_LOC (op) && IS_ITEMP (op))
- fprintf (file, "}{ sir@ %s", SPIL_LOC (op)->rname);
- fprintf (file, "}");
+ OP_SYMBOL (op)->stack);
+ }
- }
-#endif
+ if(getenv("PRINT_SHORT_OPERANDS")[0] < '2')
+ {
+ fprintf (file, "{");
+ printTypeChain (operandType (op), file);
+ if (SPIL_LOC (op) && IS_ITEMP (op))
+ fprintf (file, "}{ sir@ %s", SPIL_LOC (op)->rname);
+ fprintf (file, "}");
+ }
/* if assigned to registers */
if (OP_SYMBOL (op)->nRegs)
fprintf (file, "]");
}
}
-
-#endif
+//#endif /* } */
+ }
break;
case TYPE:
if (s)
{
- itmplbl = newSymbol (s, 1);
+ itmplbl = newSymbol (s, 1);
}
else
{
if(IS_PTR(ltype))
{
int size = getSize(ltype);
- return(IS_GENPTR(ltype)?(size-1):size);
+ return((IS_GENPTR(ltype) && GPTRSIZE > FPTRSIZE) ? (size-1) : size);
}
if(IS_ARRAY(ltype))
case FUNCTION:
return (FPTRSIZE);
case GPOINTER:
- return (GPTRSIZE-1);
+ if (GPTRSIZE > FPTRSIZE)
+ return (GPTRSIZE-1);
+ else
+ return (FPTRSIZE);
default:
return (FPTRSIZE);
// if not a pointer to a function
if (!(IS_CODEPTR(type) && IS_FUNC(type->next) && IS_FUNC(optype))) {
if (implicit) { // if not to generic, they have to match
- if ((!IS_GENPTR(type) && (DCL_TYPE(optype) != DCL_TYPE(type)))) {
+ if (!IS_GENPTR(type) &&
+ !((DCL_TYPE(optype) == DCL_TYPE(type)) ||
+ ((DCL_TYPE(optype) == POINTER) && (DCL_TYPE(type) == IPOINTER))
+ )
+ )
+ {
werror(E_INCOMPAT_PTYPES);
errors++;
}
static void
geniCodeReceive (value * args)
{
+ unsigned char paramByteCounter = 0;
+
/* for all arguments that are passed in registers */
while (args)
{
first = 0;
}
IC_RESULT (ic) = opr;
+
+ /* misuse of parmBytes (normally used for functions)
+ * to save estimated stack position of this argument.
+ * Normally this should be zero for RECEIVE iCodes.
+ * No idea if this causes side effects on other ports. - dw
+ */
+ ic->parmBytes = paramByteCounter;
+
+ /* what stack position do we have? */
+ paramByteCounter += getSize (sym->type);
+
ADDTOCHAIN (ic);
}
}
}
- /* If cond is volatile, it might change after the boundary */
- /* conditions are tested to an out of bounds value, causing */
- /* a jump to a location outside of the jump table. To avoid */
- /* this possibility, use a non-volatile copy of it instead. */
- if (IS_OP_VOLATILE (cond))
- {
- operand * newcond;
- iCode * ic;
-
- newcond = newiTempOperand (operandType (cond), TRUE);
- newcond->isvolatile = 0;
- ic = newiCode ('=', NULL, cond);
- IC_RESULT (ic) = newcond;
- ADDTOCHAIN (ic);
- cond = newcond;
- }
-
/* first we rule out the boundary conditions */
/* if only optimization says so */
if (needRangeCheck)
}
goto defaultOrBreak;
}
+
+ /* If cond is volatile, it might change while we are trying to */
+ /* find the matching case. To avoid this possibility, make a */
+ /* non-volatile copy to use instead. */
+ if (IS_OP_VOLATILE (cond))
+ {
+ operand * newcond;
+ iCode * ic;
+
+ newcond = newiTempOperand (operandType (cond), TRUE);
+ newcond->isvolatile = 0;
+ ic = newiCode ('=', NULL, cond);
+ IC_RESULT (ic) = newcond;
+ ADDTOCHAIN (ic);
+ cond = newcond;
+ }
/* if we can make this a jump table */
if (geniCodeJumpTable (cond, caseVals, tree))