disabled the fix for bug #604575
[fw/sdcc] / src / SDCCicode.c
index a94d664f9d2e9aaea0fdbd3e9d4971d3be984a30..9dde59a1a8856cee8eada9086a2db63caab71173 100644 (file)
@@ -1521,10 +1521,13 @@ operandFromAst (ast * tree,int lvl)
 
     case EX_LINK:
       return operandFromLink (tree->opval.lnk);
-    }
+      break;
 
-  assert (0);
-  /*  Just to keep the comiler happy */
+    default:
+      assert (0);
+    }
+  
+  /*  Just to keep the compiler happy */
   return (operand *) 0;
 }
 
@@ -3541,9 +3544,25 @@ ast2iCode (ast * tree,int lvl)
     case RIGHT_OP:
       return geniCodeRightShift (geniCodeRValue (left, FALSE),
                                 geniCodeRValue (right, FALSE));
-    case CAST:
+    case CAST: 
+#if 0 // this indeed needs a second thought
+      {
+       operand *op;
+       
+       // let's keep this simple: get the rvalue we need
+       op=geniCodeRValue (right, FALSE);
+       // now cast it to whatever we want
+       op=geniCodeCast (operandType(left), op, FALSE);
+       // if this is going to be used as an lvalue, make it so
+       if (tree->lvalue) {
+         op->isaddr=1;
+       }
+       return op;
+      }
+#else // bug #604575, is it a bug ????
       return geniCodeCast (operandType (left),
                           geniCodeRValue (right, FALSE), FALSE);
+#endif
 
     case '~':
     case '!':