+2004-02-08 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * src/mcs51/gen.c (genNearPointerGet, genPagedPointerGet,
+ genFarPointerGet, genCodePointerGet, genGenPointerGet,
+ genNearPointerSet, genPagedPointerSet, genFarPointerSet,
+ genGenPointerSet),
+ * src/ds390/gen.c (genNearPointerGet, genPagedPointerGet,
+ genFarPointerGet, genCodePointerGet, genGenPointerGet,
+ genNearPointerSet, genPagedPointerSet, genFarPointerSet,
+ genGenPointerSet),
+ * src/pic16/gen.c (genNearPointerGet, genPagedPointerGet,
+ genFarPointerGet, genCodePointerGet, genGenPointerGet,
+ genNearPointerSet, genPagedPointerSet, genFarPointerSet,
+ genGenPointerSet),
+ * src/pic/gen.c (genNearPointerGet, genPagedPointerGet,
+ genFarPointerGet, genCodePointerGet, genGenPointerGet,
+ genNearPointerSet, genPagedPointerSet, genFarPointerSet,
+ genGenPointerSet): fixed bug #892400
+ * src/pic16/gen.c (genSkipz, AccRol): disabled functions with #if 0
+ to eliminate build warnings.
+ * src/SDCCast.c (processParms),
+ * src/SDCC.y (function_declarator2, declarator2_function_attributes):
+ fixed bug 751859
+ * support/valdiag/valdiag.py: added GCC to the list of defines active
+ when compiling with gcc
+
2004-02-07 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
* support/Util/SDCCerr.h,
: function_declarator2 { $$ = $1 ; }
| function_declarator2 function_attribute {
// copy the functionAttributes (not the args and hasVargs !!)
- sym_link *funcType=$1->etype;
- struct value *args=FUNC_ARGS(funcType);
- unsigned hasVargs=FUNC_HASVARARGS(funcType);
+ struct value *args;
+ unsigned hasVargs;
+ sym_link *funcType=$1->type;
- memcpy (&funcType->funcAttrs, &$2->funcAttrs,
- sizeof($2->funcAttrs));
-
- FUNC_ARGS(funcType)=args;
- FUNC_HASVARARGS(funcType)=hasVargs;
-
- // just to be sure
- memset (&$2->funcAttrs, 0,
- sizeof($2->funcAttrs));
+ while (funcType && !IS_FUNC(funcType))
+ funcType = funcType->next;
+
+ if (!funcType)
+ werror (E_FUNC_ATTR);
+ else
+ {
+ args=FUNC_ARGS(funcType);
+ hasVargs=FUNC_HASVARARGS(funcType);
+
+ memcpy (&funcType->funcAttrs, &$2->funcAttrs,
+ sizeof($2->funcAttrs));
+
+ FUNC_ARGS(funcType)=args;
+ FUNC_HASVARARGS(funcType)=hasVargs;
+
+ // just to be sure
+ memset (&$2->funcAttrs, 0,
+ sizeof($2->funcAttrs));
- addDecl ($1,0,$2);
+ addDecl ($1,0,$2);
+ }
}
;
| declarator2 '(' { NestLevel++ ; currBlockno++; }
parameter_type_list ')'
{
+ sym_link *funcType;
addDecl ($1,FUNCTION,NULL) ;
+
+ funcType = $1->type;
+ while (funcType && !IS_FUNC(funcType))
+ funcType = funcType->next;
- FUNC_HASVARARGS($1->type) = IS_VARG($4);
- FUNC_ARGS($1->type) = reverseVal($4);
+ assert (funcType);
+
+ FUNC_HASVARARGS(funcType) = IS_VARG($4);
+ FUNC_ARGS(funcType) = reverseVal($4);
/* nest level was incremented to take care of the parms */
NestLevel-- ;
currBlockno--;
// if this was a pointer (to a function)
- if (IS_PTR($1->type)) {
- // move the args and hasVargs to the function
- FUNC_ARGS($1->etype)=FUNC_ARGS($1->type);
- FUNC_HASVARARGS($1->etype)=FUNC_HASVARARGS($1->type);
- memset (&$1->type->funcAttrs, 0,
- sizeof($1->type->funcAttrs));
- // remove the symbol args (if any)
+ if (!IS_FUNC($1->type))
cleanUpLevel(SymbolTab,NestLevel+1);
- }
$$ = $1;
}
if (func->type != EX_VALUE && !IFFUNC_ISREENT (functype) && !options.stackAuto)
{
werror (W_NONRENT_ARGS);
+ fatalError++;
return 1;
}
aopOp (result, ic, FALSE, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
genUnpackBits (result, rname, POINTER);
else
{
aopOp (result, ic, FALSE, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
genUnpackBits (result, rname, PPOINTER);
else
{
aopOp (result, ic, FALSE, (AOP_INDPTRn(left) ? FALSE : TRUE));
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype)) {
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype)) {
if (AOP_INDPTRn(left)) {
genSetDPTR(AOP(left)->aopu.dptr);
}
aopOp (result, ic, FALSE, (AOP_INDPTRn(left) ? FALSE : TRUE));
/* if bit then unpack */
- if (IS_BITVAR (retype)) {
+ if (IS_BITFIELD (retype)) {
if (AOP_INDPTRn(left)) {
genSetDPTR(AOP(left)->aopu.dptr);
}
_G.bInUse--;
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
{
genUnpackBits (result, "dptr", GPOINTER);
}
aopOp (right, ic, FALSE, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, rname, POINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, rname, POINTER);
else
{
/* we have can just get the values */
aopOp (right, ic, FALSE, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, rname, PPOINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, rname, PPOINTER);
else
{
/* we have can just get the values */
aopOp (right, ic, FALSE, (AOP_INDPTRn(result) ? FALSE : TRUE));
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype)) {
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype)) {
if (AOP_INDPTRn(result)) {
genSetDPTR(AOP(result)->aopu.dptr);
}
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, "dptr", FPOINTER);
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, "dptr", FPOINTER);
if (AOP_INDPTRn(result)) {
genSetDPTR(0);
}
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
{
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, "dptr", GPOINTER);
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, "dptr", GPOINTER);
}
else
{
if (operandsEqu (IC_RESULT (ic), IC_RIGHT (ic)))
return;
- aopOp (right, ic, FALSE, FALSE);
+ aopOp (right, ic, FALSE, AOP_IS_STR (result));
aopOp (result, ic, FALSE, (AOP_TYPE(right) == AOP_DPTR));
/* if the result is a bit */
while (isspace (*lbp))
lbp++;
+ //printf ("%s\n", lb);
+
if (lbp && *lbp)
lineCurr = (lineCurr ?
connectLine (lineCurr, newLineNode (lb)) :
aopOp (result, ic, result?TRUE:FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype))
+ if (IS_BITFIELD (retype))
genUnpackBits (result, rname, POINTER);
else
{
aopOp (result, ic, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype))
+ if (IS_BITFIELD (retype))
genUnpackBits (result, rname, PPOINTER);
else
{
aopOp (result, ic, FALSE);
/* if bit then unpack */
- if (IS_BITVAR (retype))
+ if (IS_BITFIELD (retype))
genUnpackBits (result, "dptr", FPOINTER);
else
{
aopOp (result, ic, FALSE);
/* if bit then unpack */
- if (IS_BITVAR (retype))
+ if (IS_BITFIELD (retype))
genUnpackBits (result, "dptr", CPOINTER);
else
{
aopOp (result, ic, FALSE);
/* if bit then unpack */
- if (IS_BITVAR (retype))
+ if (IS_BITFIELD (retype))
genUnpackBits (result, "dptr", GPOINTER);
else
{
aopOp (right, ic, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, rname, POINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, rname, POINTER);
else
{
/* we have can just get the values */
aopOp (right, ic, FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, rname, PPOINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, rname, PPOINTER);
else
{
/* we have can just get the values */
aopOp (right, ic, FALSE);
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, "dptr", FPOINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, "dptr", FPOINTER);
else
{
size = AOP_SIZE (right);
aopOp (right, ic, FALSE);
/* if bit then unpack */
- if (IS_BITVAR (retype) || IS_BITVAR (letype))
- genPackBits ((IS_BITVAR (retype) ? retype : letype), right, "dptr", GPOINTER);
+ if (IS_BITFIELD (retype) || IS_BITFIELD (letype))
+ genPackBits ((IS_BITFIELD (retype) ? retype : letype), right, "dptr", GPOINTER);
else
{
size = AOP_SIZE (right);
aopOp (result,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits (result,rname,POINTER);
else {
/* we have can just get the values */
aopOp (result,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits (result,rname,PPOINTER);
else {
/* we have can just get the values */
aopOp(result,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits(result,"dptr",FPOINTER);
else {
size = AOP_SIZE(result);
aopOp(result,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits(result,"dptr",CPOINTER);
else {
size = AOP_SIZE(result);
/* so dptr know contains the address */
/* if bit then unpack */
- //if (IS_BITVAR(retype))
+ //if (IS_BITFIELD(retype))
// genUnpackBits(result,"dptr",GPOINTER);
release:
//if (AOP_TYPE(result) == AOP_IMMD &&
if (AOP_TYPE(result) == AOP_PCODE && //AOP_TYPE(result) == AOP_IMMD &&
DCL_TYPE(ptype) == POINTER &&
- !IS_BITVAR(retype)) {
+ !IS_BITFIELD(retype)) {
genDataPointerSet (right,result,ic);
freeAsmop(result,NULL,ic,TRUE);
return;
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype)) {
+ if (IS_BITFIELD(retype)) {
werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
"The programmer is obviously confused");
//genPackBits (retype,right,rname,POINTER);
aopOp (right,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits (retype,right,rname,PPOINTER);
else {
/* we have can just get the values */
aopOp(right,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits(retype,right,"dptr",FPOINTER);
else {
size = AOP_SIZE(right);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits(retype,right,"dptr",GPOINTER);
else {
size = AOP_SIZE(right);
rifx->generated = 1;
}
+#if 0
/*-----------------------------------------------------------------*/
/* genSkipz */
/*-----------------------------------------------------------------*/
pic16_emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
}
+#endif
+
/*-----------------------------------------------------------------*/
/* genSkipCond */
/*-----------------------------------------------------------------*/
pic16_freeAsmop(result,NULL,ic,TRUE);
}
+#if 0
/*-----------------------------------------------------------------*/
/* AccRol - rotate left accumulator by known count */
/*-----------------------------------------------------------------*/
break;
}
}
+#endif
/*-----------------------------------------------------------------*/
/* AccLsh - left shift accumulator by known count */
pic16_aopOp (result,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits (result,rname,POINTER);
else {
/* we have can just get the values */
pic16_aopOp (result,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits (result,rname,PPOINTER);
else {
/* we have can just get the values */
pic16_aopOp(result,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits(result,"dptr",FPOINTER);
else {
size = AOP_SIZE(result);
pic16_aopOp(result,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits(result,"dptr",CPOINTER);
else {
size = AOP_SIZE(result);
/* so dptr know contains the address */
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genUnpackBits(result,"BAD",GPOINTER);
release:
DEBUGpic16_emitcode ("; ***","%s %d",__FUNCTION__,__LINE__);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype)) {
+ if (IS_BITFIELD(retype)) {
werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
"The programmer is obviously confused");
// genPackBits (retype,right,"BAD",POINTER);
pic16_aopOp (right,ic,FALSE);
/* if bitfield then unpack the bits */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits (retype,right,rname,PPOINTER);
else {
/* we have can just get the values */
pic16_aopOp(right,ic,FALSE);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits(retype,right,"dptr",FPOINTER);
else {
size = AOP_SIZE(right);
/* if bit then unpack */
- if (IS_BITVAR(retype))
+ if (IS_BITFIELD(retype))
genPackBits(retype,right,"dptr",GPOINTER);
else {
size = AOP_SIZE(right);
"CCDEF":"-D",
"CCOUTPUT":"-o",
"defined": {
- "__GNUC__":"1"
+ "__GNUC__":"1",
+ "GCC":"1"
},
"ignoremsg": [
]