From 81e197d1d0da88bcf5d9d8c4298b78dee730cbbe Mon Sep 17 00:00:00 2001 From: sandeep Date: Fri, 25 Feb 2000 23:35:19 +0000 Subject: [PATCH] was generating bad code for situations like a & b (a and b both ints sizeof() > 1) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@128 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/mcs51/ralloc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 0f01e758..45c9e18d 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1456,13 +1456,12 @@ static int packRegsForAssign (iCode *ic,eBBlock *ebp) { iCode *dic, *sic; - if ( -/* !IS_TRUE_SYMOP(IC_RESULT(ic)) || */ - !IS_ITEMP(IC_RIGHT(ic)) || - OP_LIVETO(IC_RIGHT(ic)) > ic->seq || - OP_SYMBOL(IC_RIGHT(ic))->isind) + if (!IS_ITEMP(IC_RIGHT(ic)) || + OP_SYMBOL(IC_RIGHT(ic))->isind || + OP_LIVETO(IC_RIGHT(ic)) > ic->seq) { return 0; - + } + /* if the true symbol is defined in far space or on stack then we should not since this will increase register pressure */ if (isOperandInFarSpace(IC_RESULT(ic))) { @@ -1881,6 +1880,10 @@ static void packRegsForAccUse (iCode *ic) getSize(operandType(IC_RESULT(ic))) > 1)) return ; + if (IS_BITWISE_OP(ic) && + getSize(operandType(IC_RESULT(ic))) > 1) + return ; + /* has only one definition */ if (bitVectnBitsOn(OP_DEFS(IC_RESULT(ic))) > 1) -- 2.47.2