* src/SDCCopt.c (killDeadCode): never convert ADDRESS_OF iCode to
DUMMY_READ_VOLATILE (fixed bug #886367)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3156
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-01-27 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * src/z80/gen.c (genMult): handle single byte result product
+ * src/SDCCopt.c (killDeadCode): never convert ADDRESS_OF iCode to
+ DUMMY_READ_VOLATILE (fixed bug #886367)
+
2004-01-27 Bernhard Held <bernhard AT bernhardheld.de>
* support/regression/tests/libmullong.c: fixed logic, on little endian
2004-01-27 Bernhard Held <bernhard AT bernhardheld.de>
* support/regression/tests/libmullong.c: fixed logic, on little endian
bool volRight = IS_SYMOP (IC_RIGHT (ic))
&& isOperandVolatile (IC_RIGHT (ic), FALSE);
bool volRight = IS_SYMOP (IC_RIGHT (ic))
&& isOperandVolatile (IC_RIGHT (ic), FALSE);
+ /* a dead address-of operation should die, even if volatile */
+ if (ic->op == ADDRESS_OF)
+ volLeft = FALSE;
+
if (ic->next && ic->seqPoint == ic->next->seqPoint
&& (ic->next->op == '+' || ic->next->op == '-'))
{
if (ic->next && ic->seqPoint == ic->next->seqPoint
&& (ic->next->op == '+' || ic->next->op == '-'))
{
int count, i;
/* If true then the final operation should be a subtract */
bool active = FALSE;
int count, i;
/* If true then the final operation should be a subtract */
bool active = FALSE;
/* Shouldn't occur - all done through function calls */
aopOp (IC_LEFT (ic), ic, FALSE, FALSE);
aopOp (IC_RIGHT (ic), ic, FALSE, FALSE);
aopOp (IC_RESULT (ic), ic, TRUE, FALSE);
/* Shouldn't occur - all done through function calls */
aopOp (IC_LEFT (ic), ic, FALSE, FALSE);
aopOp (IC_RIGHT (ic), ic, FALSE, FALSE);
aopOp (IC_RESULT (ic), ic, TRUE, FALSE);
+
+ byteResult = (AOP_SIZE (IC_RESULT (ic)) == 1);
if (AOP_SIZE (IC_LEFT (ic)) > 2 ||
AOP_SIZE (IC_RIGHT (ic)) > 2 ||
if (AOP_SIZE (IC_LEFT (ic)) > 2 ||
AOP_SIZE (IC_RIGHT (ic)) > 2 ||
if ( AOP_SIZE (IC_LEFT (ic)) == 1 && !SPEC_USIGN (getSpec (operandType ( IC_LEFT (ic)))))
{
emit2 ("ld e,%s", aopGet (AOP (IC_LEFT (ic)), LSB, FALSE));
if ( AOP_SIZE (IC_LEFT (ic)) == 1 && !SPEC_USIGN (getSpec (operandType ( IC_LEFT (ic)))))
{
emit2 ("ld e,%s", aopGet (AOP (IC_LEFT (ic)), LSB, FALSE));
- emit2 ("ld a,e");
- emit2 ("rlc a");
- emit2 ("sbc a,a");
- emit2 ("ld d,a");
+ if (!byteResult)
+ {
+ emit2 ("ld a,e");
+ emit2 ("rlc a");
+ emit2 ("sbc a,a");
+ emit2 ("ld d,a");
+ }
if (active == FALSE)
{
emit2 ("ld l,e");
if (active == FALSE)
{
emit2 ("ld l,e");
+ if (!byteResult)
+ emit2 ("ld h,d");
_G.stack.pushedDE = FALSE;
}
_G.stack.pushedDE = FALSE;
}
- commitPair ( AOP (IC_RESULT (ic)), PAIR_HL);
+ if (byteResult)
+ aopPut (AOP (IC_RESULT (ic)), _pairs[PAIR_HL].l, 0);
+ else
+ commitPair ( AOP (IC_RESULT (ic)), PAIR_HL);
freeAsmop (IC_LEFT (ic), NULL, ic);
freeAsmop (IC_RIGHT (ic), NULL, ic);
freeAsmop (IC_LEFT (ic), NULL, ic);
freeAsmop (IC_RIGHT (ic), NULL, ic);