2) icode.c fixed the &array[n] problem
3) lrange.c fixed name for used before def
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@148
4a8a32a2-be11-0410-ad9d-
d568d2c75423
IC_RESULT(lic)->isaddr = siaddr ;
}
IC_RESULT(lic)->isaddr = siaddr ;
}
- if (IC_RIGHT(lic) && IC_RIGHT(lic)->key == from->key ) {
+ if (IS_SYMOP(to) &&
+ IC_RIGHT(lic) && IC_RIGHT(lic)->key == from->key ) {
bitVectUnSetBit (OP_USES(from),lic->key);
OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
siaddr = IC_RIGHT(lic)->isaddr ;
bitVectUnSetBit (OP_USES(from),lic->key);
OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
siaddr = IC_RIGHT(lic)->isaddr ;
IC_RIGHT(lic)->isaddr = siaddr ;
}
IC_RIGHT(lic)->isaddr = siaddr ;
}
- if (IC_LEFT(lic) && IC_LEFT(lic)->key == from->key ) {
+ if (IS_SYMOP(to) &&
+ IC_LEFT(lic) && IC_LEFT(lic)->key == from->key ) {
bitVectUnSetBit (OP_USES(from),lic->key);
OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
siaddr = IC_LEFT(lic)->isaddr ;
bitVectUnSetBit (OP_USES(from),lic->key);
OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
siaddr = IC_LEFT(lic)->isaddr ;
if (IS_PTR(optype))
setOClass(optype,retype);
if (IS_PTR(optype))
setOClass(optype,retype);
/* This block moved here from its original location
* ten lines later by KV, 2/27/2000.
*
/* This block moved here from its original location
* ten lines later by KV, 2/27/2000.
*
IS_CHAR(rtype) ||
IS_FLOAT(rtype) );
IS_CHAR(rtype) ||
IS_FLOAT(rtype) );
/* Moved upwards */
if (!lvaluereq)
op = geniCodeRValue(op,TRUE);
/* Moved upwards */
if (!lvaluereq)
op = geniCodeRValue(op,TRUE);
tree->opval.op != INLINEASM ) {
if (IS_ASSIGN_OP(tree->opval.op) ||
IS_DEREF_OP(tree) ||
tree->opval.op != INLINEASM ) {
if (IS_ASSIGN_OP(tree->opval.op) ||
IS_DEREF_OP(tree) ||
+ (tree->opval.op == '&' && !tree->right) ||
tree->opval.op == PTR_OP) {
lvaluereq++;
left = operandFromAst(tree->left);
tree->opval.op == PTR_OP) {
lvaluereq++;
left = operandFromAst(tree->left);
} else {
left = operandFromAst(tree->left);
}
} else {
left = operandFromAst(tree->left);
}
- if (tree->opval.op == INC_OP || tree->opval.op == DEC_OP) {
+ if (tree->opval.op == INC_OP ||
+ tree->opval.op == DEC_OP) {
lvaluereq++;
right= operandFromAst(tree->right);
lvaluereq--;
lvaluereq++;
right= operandFromAst(tree->right);
lvaluereq--;
ic->op != ADDRESS_OF &&
!IS_STATIC(etype) ) {
ic->op != ADDRESS_OF &&
!IS_STATIC(etype) ) {
-/* if (OP_SYMBOL(op)->isreqv && !OP_SYMBOL(op)->_isparm){ */
-
-/* if (SPIL_LOC(op) && */
-/* bitVectIsZero(SPIL_LOC(op)->defs)) { */
-/* OP_SYMBOL(op)->isspilt = 1; */
-/* werror(W_LOCAL_NOINIT, */
-/* SPIL_LOC(op)->name, */
-/* ic->filename,ic->lineno); */
-/* } */
-/* } else { */
-
- if (bitVectIsZero(op->usesDefs)) {
+ if (bitVectIsZero(op->usesDefs)) {
OP_SYMBOL(op)->isspilt = 1;
OP_SYMBOL(op)->isspilt = 1;
- werror(W_LOCAL_NOINIT,
- OP_SYMBOL(op)->name,
- ic->filename,ic->lineno);
- }
-/* } */
+
+ if (OP_SYMBOL(op)->isreqv &&
+ !OP_SYMBOL(op)->_isparm && SPIL_LOC(op) ) {
+
+ werror(W_LOCAL_NOINIT,
+ SPIL_LOC(op)->name,
+ ic->filename,ic->lineno);
+ } else {
+
+ werror(W_LOCAL_NOINIT,
+ OP_SYMBOL(op)->name,
+ ic->filename,ic->lineno);
+ }
+ }