fixed bug #479725
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 11 Nov 2001 21:57:07 +0000 (21:57 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 11 Nov 2001 21:57:07 +0000 (21:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1571 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCicode.c

index ff0aba4884ce7254e6abf9bb80061c1b8d036ce6..f04159bf769a4457798c72c09477863d213ba711 100644 (file)
@@ -662,20 +662,7 @@ processParms (ast * func,
          return 0;
        }
 
-      /* The ternary ('?') operator is weird: the ftype of the 
-       * operator is the type of the condition, but it will return a 
-       * (possibly) different type. 
-       */
-      if (IS_TERNARY_OP(actParm))
-      {
-          assert(IS_COLON_OP(actParm->right));
-          assert(actParm->right->left);
-          ftype = actParm->right->left->ftype;
-      }
-      else
-      {
-          ftype = actParm->ftype;
-      }
+      ftype = actParm->ftype;
           
       /* If it's a small integer, upcast to int. */
       if (IS_INTEGRAL (ftype)
@@ -2856,7 +2843,7 @@ decorateType (ast * tree)
              return tree->right->right ;
          }
       } else {
-         TTYPE (tree) = RTYPE(tree); // #HACK LTYPE(tree).
+         TTYPE (tree) = RTYPE(tree);
          TETYPE (tree) = getSpec (TTYPE (tree));
       }
       return tree;
index db9a777ff62bdc9213e3dc82d62a1281452cafd7..ee41b1c2ec355a91c3ca15c488a305877e621fcf 100644 (file)
@@ -2292,10 +2292,6 @@ geniCodeBitwise (operand * left, operand * right,
 {
   iCode *ic;
 
-  // bitwise operations must be done unsigned
-  // WHY ? causes very bad things to happen with CSE
-  //  SPEC_USIGN(resType)=1;
-
   left = geniCodeCast (resType, left, TRUE);
   right = geniCodeCast (resType, right, TRUE);
 
@@ -2569,7 +2565,7 @@ geniCodeConditional (ast * tree,int lvl)
   true = ast2iCode (tree->right->left,lvl+1);
 
   /* move the value to a new Operand */
-  result = newiTempOperand (operandType (true), 0);
+  result = newiTempOperand (tree->right->ftype, 0);
   geniCodeAssign (result, geniCodeRValue (true, FALSE), 0);
 
   /* generate an unconditional goto */