* src/SDCCast.c (decorateType): fixed bug #857753 (need to be careful
with valFromType if type might be a pointer and host is big endian).
* src/SDCCast.c (decorateType): unary plus compatible with all arithmetic
types, not just integer types.
* src/SDCCsymt.c (addSymChain): clarified error message when symbol is
multiply defined with mismatching "at" address.
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3050
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2003-12-13 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+ * src/SDCCicode.c (geniCodeAdd),
+ * src/SDCCast.c (decorateType): fixed bug #857753 (need to be careful
+ with valFromType if type might be a pointer and host is big endian).
+ * src/SDCCast.c (decorateType): unary plus compatible with all arithmetic
+ types, not just integer types.
+ * src/SDCCsymt.c (addSymChain): clarified error message when symbol is
+ multiply defined with mismatching "at" address.
+
2003-12-12 Erik Petrich <epetrich@ivorytower.norman.ok.us>
* src/ds390/main.c (PORT tininative_port): fixed bug #858416
2003-12-12 Erik Petrich <epetrich@ivorytower.norman.ok.us>
* src/ds390/main.c (PORT tininative_port): fixed bug #858416
/* if unary plus */
if (!tree->right)
{
/* if unary plus */
if (!tree->right)
{
- if (!IS_INTEGRAL (LTYPE (tree)))
+ if (!IS_ARITHMETIC (LTYPE (tree)))
{
werror (E_UNARY_OP, '+');
goto errorTreeReturn;
{
werror (E_UNARY_OP, '+');
goto errorTreeReturn;
tree->opval.val = valCastLiteral (
LTYPE (tree),
element->offset
tree->opval.val = valCastLiteral (
LTYPE (tree),
element->offset
- + floatFromVal (valFromType (RETYPE (tree->right->left->left)))
+ + floatFromVal (valFromType (RTYPE (tree->right->left->left)))
);
TTYPE (tree) = tree->opval.val->type;
);
TTYPE (tree) = tree->opval.val->type;
sym->cdef = 1;
sym->isref = 1;
SPEC_STAT (sym->etype) = 1;
sym->cdef = 1;
sym->isref = 1;
SPEC_STAT (sym->etype) = 1;
- SPEC_ADDR(sym->etype) = floatFromVal (valFromType (RETYPE (tree)));
+ SPEC_ADDR(sym->etype) = floatFromVal (valFromType (RTYPE (tree)));
SPEC_ABSA(sym->etype) = 1;
addSym (SymbolTab, sym, sym->name, 0, 0, 0);
allocGlobal (sym);
SPEC_ABSA(sym->etype) = 1;
addSym (SymbolTab, sym, sym->name, 0, 0, 0);
allocGlobal (sym);
tree->type = EX_VALUE;
tree->opval.val =
valCastLiteral (LTYPE (tree),
tree->type = EX_VALUE;
tree->opval.val =
valCastLiteral (LTYPE (tree),
- floatFromVal (valFromType (RETYPE (tree))));
+ floatFromVal (valFromType (RTYPE (tree))));
TTYPE (tree) = tree->opval.val->type;
tree->left = NULL;
tree->right = NULL;
TTYPE (tree) = tree->opval.val->type;
tree->left = NULL;
tree->right = NULL;
IS_LITERAL (LTYPE (tree)))
{
tree->type = EX_VALUE;
IS_LITERAL (LTYPE (tree)))
{
tree->type = EX_VALUE;
- tree->opval.val = valLogicAndOr (valFromType (LETYPE (tree)),
- valFromType (RETYPE (tree)),
+ tree->opval.val = valLogicAndOr (valFromType (LTYPE (tree)),
+ valFromType (RTYPE (tree)),
tree->opval.op);
tree->right = tree->left = NULL;
TETYPE (tree) = getSpec (TTYPE (tree) =
tree->opval.op);
tree->right = tree->left = NULL;
TETYPE (tree) = getSpec (TTYPE (tree) =
if (compareType (LTYPE (tree), RTYPE (tree)) == 0)
{
werror (E_COMPARE_OP);
if (compareType (LTYPE (tree), RTYPE (tree)) == 0)
{
werror (E_COMPARE_OP);
- fprintf (stderr, "comparring type ");
+ fprintf (stderr, "comparing type ");
printTypeChain (LTYPE (tree), stderr);
fprintf (stderr, "to type ");
printTypeChain (RTYPE (tree), stderr);
printTypeChain (LTYPE (tree), stderr);
fprintf (stderr, "to type ");
printTypeChain (RTYPE (tree), stderr);
/* if the right side is LITERAL zero */
/* return the left side */
/* if the right side is LITERAL zero */
/* return the left side */
- if (IS_LITERAL (retype) && right->isLiteral && !floatFromVal (valFromType (retype)))
+ if (IS_LITERAL (retype) && right->isLiteral && !floatFromVal (valFromType (rtype)))
return left;
/* if left is literal zero return right */
return left;
/* if left is literal zero return right */
- if (IS_LITERAL (letype) && left->isLiteral && !floatFromVal (valFromType (letype)))
+ if (IS_LITERAL (letype) && left->isLiteral && !floatFromVal (valFromType (ltype)))
return right;
/* if left is a pointer then size */
return right;
/* if left is a pointer then size */
/* if they are both literals then we know */
if (IS_LITERAL (letype) && IS_LITERAL (retype)
&& left->isLiteral && right->isLiteral)
/* if they are both literals then we know */
if (IS_LITERAL (letype) && IS_LITERAL (retype)
&& left->isLiteral && right->isLiteral)
- return operandFromValue (valPlus (valFromType (letype),
- valFromType (retype)));
+ return operandFromValue (valPlus (valFromType (ltype),
+ valFromType (rtype)));
ic = newiCode ('+', left, right);
ic = newiCode ('+', left, right);
DCL_ELEM(csym->type) = DCL_ELEM(sym->type);
}
DCL_ELEM(csym->type) = DCL_ELEM(sym->type);
}
+ #if 0
+ /* If only one of the definitions used the "at" keyword, copy */
+ /* the address to the other. */
+ if (IS_SPEC(csym->etype) && SPEC_ABSA(csym->etype)
+ && IS_SPEC(sym->etype) && !SPEC_ABSA(sym->etype))
+ {
+ SPEC_ABSA (sym->etype) = 1;
+ SPEC_ADDR (sym->etype) = SPEC_ADDR (csym->etype);
+ }
+ if (IS_SPEC(csym->etype) && !SPEC_ABSA(csym->etype)
+ && IS_SPEC(sym->etype) && SPEC_ABSA(sym->etype))
+ {
+ SPEC_ABSA (csym->etype) = 1;
+ SPEC_ADDR (csym->etype) = SPEC_ADDR (sym->etype);
+ }
+ #endif
+
error = 0;
if (csym->ival && sym->ival)
error = 1;
error = 0;
if (csym->ival && sym->ival)
error = 1;
werror (E_EXTERN_MISMATCH, sym->name);
else
werror (E_DUPLICATE, sym->name);
werror (E_EXTERN_MISMATCH, sym->name);
else
werror (E_DUPLICATE, sym->name);
- printFromToType (csym->type, sym->type);
+ fprintf (stderr, "from type '");
+ printTypeChain (csym->type, stderr);
+ if (IS_SPEC (csym->etype) && SPEC_ABSA (csym->etype))
+ fprintf(stderr, " at 0x%x", SPEC_ADDR (csym->etype));
+ fprintf (stderr, "'\nto type '");
+ printTypeChain (sym->type, stderr);
+ if (IS_SPEC (sym->etype) && SPEC_ABSA (sym->etype))
+ fprintf(stderr, " at 0x%x", SPEC_ADDR (sym->etype));
+ fprintf (stderr, "'\n");