+2008-03-30 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCCloop.c (loopInvariants): applied fix for bug 1717943, thanks
+ Robert Larice
+ * support/regression/tests/bug1717943.c: new, added
+
2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
- * src/z80/gen.c (assignResultValue):
- Reverted reversal of order of bytewise return value assignments introduced in last commit.
+ * src/z80/gen.c (assignResultValue): Reverted reversal of order of bytewise
+ return value assignments introduced in last commit.
2008-03-30 Philipp Klaus Krause <pkk AT spth.de>
- * src/z80/gen.c (emitDebug, assignResultValue, genPlus, genMinus, genMult, genJumpTab):
+ * src/z80/gen.c (emitDebug, assignResultValue, genPlus, genMinus, genMult,
+ genJumpTab):
Use 16-bit instructions for addition in some additional cases,
implemented RFEs #1914251, #1914245, #1922090, #1921382, #1918323.
elementsInSet (theLoop->exits));
/* find out if we have a function call in this block */
- for (ic = lBlock->sch, fCallsInBlock=0; ic; ic = ic->next) {
- if (SKIP_IC(ic)) {
- fCallsInBlock++;
+ for (ic = lBlock->sch, fCallsInBlock=0; ic; ic = ic->next)
+ {
+ if (SKIP_IC(ic))
+ {
+ fCallsInBlock++;
+ }
}
- }
/* now we go thru the instructions of this block and */
/* collect those instructions with invariant operands */
here and the definition, but I am too lazy to do that now */
/* if there are function calls in this block */
- if (fCallsInBlock) {
+ if (fCallsInBlock)
+ {
+ /* if this is a pointer get */
+ if (POINTER_GET(ic))
+ {
+ continue;
+ }
- /* if this is a pointer get */
- if (POINTER_GET(ic)) {
- continue;
- }
+ /* if this is an assignment from a global */
+ if (ic->op=='=' && isOperandGlobal(IC_RIGHT(ic)))
+ {
+ continue;
+ }
- /* if this is an assignment from a global */
- if (ic->op=='=' && isOperandGlobal(IC_RIGHT(ic))) {
- continue;
+ /* Bug 1717943,
+ * if this is an assignment to a global */
+ if (ic->op=='=' && isOperandGlobal(IC_RESULT(ic)))
+ {
+ continue;
+ }
}
- }
if (SKIP_IC (ic) || POINTER_SET (ic) || ic->op == IFX)
continue;
if (ic->op == ADDRESS_OF &&
IS_SYMOP (IC_LEFT (ic)) &&
IS_AGGREGATE (operandType (IC_LEFT (ic))))
- lin++;
- else {
- /* check if left operand is an invariant */
- if ((lin = isOperandInvariant (IC_LEFT (ic), theLoop, lInvars)))
- /* if this is a pointer get then make sure
- that the pointer set does not exist in
- any of the blocks */
- if (POINTER_GET (ic) &&
- (applyToSet (theLoop->regBlocks,
- pointerAssigned, IC_LEFT (ic))))
- lin = 0;
- }
+ {
+ lin++;
+ }
+ else
+ {
+ /* check if left operand is an invariant */
+ if ((lin = isOperandInvariant (IC_LEFT (ic), theLoop, lInvars)) &&
+ /* if this is a pointer get then make sure
+ that the pointer set does not exist in
+ any of the blocks */
+ POINTER_GET (ic) &&
+ applyToSet (theLoop->regBlocks, pointerAssigned, IC_LEFT (ic)))
+ {
+ lin = 0;
+ }
+ }
/* do the same for right */
rin = isOperandInvariant (IC_RIGHT (ic), theLoop, lInvars);