projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/mcs51/gen.c (genPlus): replaced "mov b,acc" by "mov b,a" Fiorenzo D. Ramaglia...
[fw/sdcc]
/
src
/
SDCCicode.c
diff --git
a/src/SDCCicode.c
b/src/SDCCicode.c
index dd8dca5fb4a8f53bf6075bea9f3a63f4e7f3a597..390c6c7263f33389ae5e651191d0c7a50a4d5c10 100644
(file)
--- a/
src/SDCCicode.c
+++ b/
src/SDCCicode.c
@@
-1080,7
+1080,7
@@
operandOperation (operand * left, operand * right,
break;
case RIGHT_OP: {
double lval = operandLitValue(left), rval = operandLitValue(right);
break;
case RIGHT_OP: {
double lval = operandLitValue(left), rval = operandLitValue(right);
- double res;
+ double res
=0
;
switch ((SPEC_USIGN(let) ? 2 : 0) + (SPEC_USIGN(ret) ? 1 : 0))
{
case 0: // left=unsigned right=unsigned
switch ((SPEC_USIGN(let) ? 2 : 0) + (SPEC_USIGN(ret) ? 1 : 0))
{
case 0: // left=unsigned right=unsigned
@@
-1617,6
+1617,7
@@
usualBinaryConversions (operand ** op1, operand ** op2)
sym_link *ltype = operandType (*op1);
ctype = computeType (ltype, rtype);
sym_link *ltype = operandType (*op1);
ctype = computeType (ltype, rtype);
+
*op1 = geniCodeCast (ctype, *op1, TRUE);
*op2 = geniCodeCast (ctype, *op2, TRUE);
*op1 = geniCodeCast (ctype, *op1, TRUE);
*op2 = geniCodeCast (ctype, *op2, TRUE);
@@
-2048,9
+2049,11
@@
geniCodeAdd (operand * left, operand * right, int lvl)
int isarray = 0;
LRTYPE;
int isarray = 0;
LRTYPE;
+#if 0
/* if left is an array then array access */
if (IS_ARRAY (ltype))
return geniCodeArray (left, right,lvl);
/* if left is an array then array access */
if (IS_ARRAY (ltype))
return geniCodeArray (left, right,lvl);
+#endif
/* if the right side is LITERAL zero */
/* return the left side */
/* if the right side is LITERAL zero */
/* return the left side */
@@
-2062,7
+2065,7
@@
geniCodeAdd (operand * left, operand * right, int lvl)
return right;
/* if left is a pointer then size */
return right;
/* if left is a pointer then size */
- if (IS_PTR (ltype))
+ if (IS_PTR (ltype)
|| IS_ARRAY(ltype)
)
{
isarray = left->isaddr;
// there is no need to multiply with 1
{
isarray = left->isaddr;
// there is no need to multiply with 1
@@
-2798,7
+2801,8
@@
geniCodeSEParms (ast * parms,int lvl)
geniCodeRValue (ast2iCode (parms,lvl+1), FALSE);
parms->type = EX_OPERAND;
geniCodeRValue (ast2iCode (parms,lvl+1), FALSE);
parms->type = EX_OPERAND;
- AST_ARGREG(parms) = SPEC_ARGREG(parms->etype);
+ AST_ARGREG(parms) = parms->etype ? SPEC_ARGREG(parms->etype) :
+ SPEC_ARGREG(parms->ftype);
}
/*-----------------------------------------------------------------*/
}
/*-----------------------------------------------------------------*/