* src/SDCCcse.c (ReplaceOpWithCheaperOp): minor fix for debugging only
[fw/sdcc] / src / ds390 / ralloc.c
index 3e39ee755ef144c49bc10ec9a805493c3ecadecb..f91a0c63a8fa5f60382cbdae39c85c36d90533b4 100644 (file)
@@ -2114,6 +2114,20 @@ 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 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 ||