From 17475724ba3b307a3dd40764f224d4031666f6f2 Mon Sep 17 00:00:00 2001 From: MaartenBrock Date: Fri, 13 Jul 2007 21:10:11 +0000 Subject: [PATCH] * src/mcs51/gen.c (genDataPointerSet): use max of size of right and result git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4883 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 +- src/mcs51/gen.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a053bc9f..7b4a91e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ * src/SDCCicode.h: made operand.aggr2ptr 2 bits wide, added operandSize prototype * src/mcs51/gen.c (aopOp): use operandSize to fix bug 868103, - (genDataPointerSet): use size of result, + (genDataPointerSet): use max of size of right and result, (gencjne): added parameter useCarry for optimization, (genCmpEq): use carry if appropriate, (genXor): check if operand already in carry diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index dd0eb5a8..cb42cdeb 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -7455,7 +7455,7 @@ genXor (iCode * ic, iCode * ifx) if (AOP_TYPE (right) == AOP_CRY) { // c = bit ^ bit; - if (IS_SYMOP (left) && OP_SYMBOL (left) && OP_SYMBOL (left)->accuse) + if (IS_OP_ACCUSE (left)) {// left already is in the carry operand *tmp = right; right = left; @@ -7463,7 +7463,7 @@ genXor (iCode * ic, iCode * ifx) } else { - emitcode ("mov", "c,%s", AOP (right)->aopu.aop_dir); + toCarry (right); } } else @@ -10535,7 +10535,7 @@ genDataPointerSet (operand * right, l = aopGet (result, 0, FALSE, TRUE); l++; //remove # - size = AOP_SIZE (result); + size = max (AOP_SIZE (right), AOP_SIZE (result)); while (size--) { if (offset) @@ -10551,7 +10551,7 @@ genDataPointerSet (operand * right, } /*-----------------------------------------------------------------*/ -/* genNearPointerSet - emitcode for near pointer put */ +/* genNearPointerSet - emitcode for near pointer put */ /*-----------------------------------------------------------------*/ static void genNearPointerSet (operand * right, -- 2.39.5