+2003-10-30 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+ Fixed a number of problems revealed by bug #827883.
+ * src/SDCCloop.c (loopInvariants): Spill location of the
+ result operand should be recomputed if extracted from
+ a loop. Also, don't extract assignments of an iTemp
+ from a literal.
+ * src/SDCCast.c (isConformingBody): loop reversal should
+ not occur if the control variable is involved with a
+ relational operator.
+
2003-10-28 Bernhard Held <bernhard@bernhardheld.de>
* .version: bumped to 2.3.6 to reflect the big improvements
case '?':
case ':':
case SIZEOF: /* evaluate wihout code generation */
+
+ if (IS_AST_SYM_VALUE (pbody->left) &&
+ isSymbolEqual (AST_SYMBOL (pbody->left), sym))
+ return FALSE;
+
+ if (IS_AST_SYM_VALUE (pbody->right) &&
+ isSymbolEqual (AST_SYMBOL (pbody->right), sym))
+ return FALSE;
return isConformingBody (pbody->left, sym, body) &&
isConformingBody (pbody->right, sym, body);
if (SKIP_IC (ic) || POINTER_SET (ic) || ic->op == IFX)
continue;
+
+ /* iTemp assignment from a literal may be invariant, but it
+ will needlessly increase register pressure if the
+ iCode(s) that use this iTemp are not also invariant */
+ if (ic->op=='=' && IS_ITEMP (IC_RESULT (ic))
+ && IS_OP_LITERAL (IC_RIGHT (ic)))
+ continue;
/* if result is volatile then skip */
if (IC_RESULT (ic) &&
applyToSet (theLoop->regBlocks, hasNonPtrUse, IC_LEFT (ic)))
continue;
- /* if both the left & right are invariants : then check that */
+
+ /* if both the left & right are invariants : then check that */
/* this definition exists in the out definition of all the */
/* blocks, this will ensure that this is not assigned any */
/* other value in the loop , and not used in this block */
eBBlock *sBlock;
set *lSet = setFromSet (theLoop->regBlocks);
- /* if this block does not dominate all exists */
+ /* if this block does not dominate all exits */
/* make sure this defintion is not used anywhere else */
if (!domsAllExits)
{
/* now we know it is a true invariant */
/* remove it from the insts chain & put */
/* in the invariant set */
- OP_SYMBOL (IC_RESULT (ic))->isinvariant = 1;
+
+ OP_SYMBOL (IC_RESULT (ic))->isinvariant = 1;
+ SPIL_LOC (IC_RESULT (ic)) = NULL;
remiCodeFromeBBlock (lBlock, ic);
/* maintain the data flow */