* src/mcs51/ralloc.c (packRegsForAssign): fixed bug #930931, fixed check for bitfields
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Apr 2004 21:00:36 +0000 (21:00 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Apr 2004 21:00:36 +0000 (21:00 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3286 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/mcs51/ralloc.c

index 1961f6f3726dd9cb5449857a6fb73df40e700051..d133523bb598dd921a88ba9a78dd41fed6e3124d 100644 (file)
--- 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 <bernhard AT bernhardheld.de>
 
index b949106e1c56a2d2a779ceda7a1d32ee4504e12c..c81c2158f936d2bedde3858c3a8e060df9f9ac66 100644 (file)
@@ -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 ||