OSDN Git Service

PR tree-optimization/16632
[pf3gnuchains/gcc-fork.git] / gcc / convert.c
index 36bae1c..005d3e2 100644 (file)
@@ -397,36 +397,15 @@ convert_to_integer (tree type, tree expr)
     case BOOLEAN_TYPE:
     case CHAR_TYPE:
       /* If this is a logical operation, which just returns 0 or 1, we can
-        change the type of the expression.  For some logical operations,
-        we must also change the types of the operands to maintain type
-        correctness.  */
+        change the type of the expression.  */
 
-      if (TREE_CODE_CLASS (ex_form) == '<')
+      if (TREE_CODE_CLASS (ex_form) == tcc_comparison)
        {
          expr = copy_node (expr);
          TREE_TYPE (expr) = type;
          return expr;
        }
 
-      else if (ex_form == TRUTH_AND_EXPR || ex_form == TRUTH_ANDIF_EXPR
-              || ex_form == TRUTH_OR_EXPR || ex_form == TRUTH_ORIF_EXPR
-              || ex_form == TRUTH_XOR_EXPR)
-       {
-         expr = copy_node (expr);
-         TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
-         TREE_OPERAND (expr, 1) = convert (type, TREE_OPERAND (expr, 1));
-         TREE_TYPE (expr) = type;
-         return expr;
-       }
-
-      else if (ex_form == TRUTH_NOT_EXPR)
-       {
-         expr = copy_node (expr);
-         TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
-         TREE_TYPE (expr) = type;
-         return expr;
-       }
-
       /* If we are widening the type, put in an explicit conversion.
         Similarly if we are not changing the width.  After this, we know
         we are truncating EXPR.  */