From cd81e1479c7ce38b89e5622cfc1101cef3e07ebd Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Mon, 12 Apr 2004 21:00:36 +0000 Subject: [PATCH] * src/mcs51/ralloc.c (packRegsForAssign): fixed bug #930931, fixed check for bitfields git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3286 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 ++ src/mcs51/ralloc.c | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1961f6f3..d133523b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * src/SDCCast.c (decorateType): fixed bug #898889, cast result of a literal complement too + * src/mcs51/ralloc.c (packRegsForAssign): fixed bug #930931, + fixed check for bitfields 2004-04-11 Bernhard Held diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index b949106e..c81c2158 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1988,6 +1988,21 @@ packRegsForAssign (iCode * ic, eBBlock * ebp) if (!dic) return 0; /* did not find */ + /* if assignment then check that right is not a bit */ + if (ASSIGNMENT (ic) && !POINTER_SET (ic)) + { + sym_link *etype = operandType (IC_RESULT (dic)); + if (IS_BITFIELD (etype)) + { + /* if result is a bit too then it's ok */ + etype = operandType (IC_RESULT (ic)); + if (!IS_BITFIELD (etype)) + { + return 0; + } + } + } +#if 0 /* if assignment then check that right is not a bit */ if (ASSIGNMENT (dic) && !POINTER_SET (dic)) { @@ -1995,11 +2010,12 @@ packRegsForAssign (iCode * ic, eBBlock * ebp) if (IS_BITFIELD (etype)) { /* if result is a bit too then it's ok */ - etype = operandType (IC_RESULT (dic)); + etype = operandType (IC_RESULT (dic)); if (!IS_BITFIELD (etype)) - return 0; - } + return 0; + } } +#endif /* if the result is on stack or iaccess then it must be the same atleast one of the operands */ if (OP_SYMBOL (IC_RESULT (ic))->onStack || -- 2.30.2