* src/mcs51/peeph.def: added 101.a,b (moves to int/long xdata)
[fw/sdcc] / src / SDCCast.c
index f57bc1489db9bd8de82c98f483d28b920f2a1b94..99582eef1a7bb8de13b71da86192976697a70a78 100644 (file)
@@ -2249,11 +2249,11 @@ addCast (ast *tree, RESULT_TYPE resultType, bool promote)
         newLink = newIntLink();
         upCasted = TRUE;
         break;
+      case RESULT_TYPE_IFX:
       case RESULT_TYPE_OTHER:
-        if (!promote)
-          return tree;
-        /* return type is long, float: promote char to int */
-        if (getSize (tree->etype) >= INTSIZE)
+        if (!promote ||
+            /* return type is ifx, long, float: promote char to int */
+            getSize (tree->etype) >= INTSIZE)
           return tree;
         newLink = newIntLink();
         upCasted = TRUE;