expr.c (expand_cond_expr_using_cmove): Use COMPARISON_CLASS_P.
authorMarek Polacek <polacek@redhat.com>
Wed, 20 May 2015 11:46:00 +0000 (11:46 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 20 May 2015 11:46:00 +0000 (11:46 +0000)
* expr.c (expand_cond_expr_using_cmove): Use COMPARISON_CLASS_P.
* gimple-expr.c (gimple_cond_get_ops_from_tree): Likewise.
* gimple-fold.c (canonicalize_bool): Likewise.
(same_bool_result_p): Likewise.
* tree-if-conv.c (parse_predicate): Likewise.

From-SVN: r223441

gcc/ChangeLog
gcc/expr.c
gcc/gimple-expr.c
gcc/gimple-fold.c
gcc/tree-if-conv.c

index b78857c55dc21b8bd901300deb9a95e206ce47fa..701b7590c415191c08b9d66decb314b47499bc84 100644 (file)
@@ -1,3 +1,11 @@
+2015-05-20  Marek Polacek  <polacek@redhat.com>
+
+       * expr.c (expand_cond_expr_using_cmove): Use COMPARISON_CLASS_P.
+       * gimple-expr.c (gimple_cond_get_ops_from_tree): Likewise.
+       * gimple-fold.c (canonicalize_bool): Likewise.
+       (same_bool_result_p): Likewise.
+       * tree-if-conv.c (parse_predicate): Likewise.
+
 2015-05-20  Marek Polacek  <polacek@redhat.com>
 
        * gimple-fold.c (fold_const_aggregate_ref_1): Use DECL_P.
index e91383f905586c410924b769663fc64bc0287a6c..cf3380858589128e7b750f236fc7dbd3085c0faf 100644 (file)
@@ -8073,7 +8073,7 @@ expand_cond_expr_using_cmove (tree treeop0 ATTRIBUTE_UNUSED,
       unsignedp = TYPE_UNSIGNED (type);
       comparison_code = convert_tree_comp_to_rtx (cmpcode, unsignedp);
     }
-  else if (TREE_CODE_CLASS (TREE_CODE (treeop0)) == tcc_comparison)
+  else if (COMPARISON_CLASS_P (treeop0))
     {
       tree type = TREE_TYPE (TREE_OPERAND (treeop0, 0));
       enum tree_code cmpcode = TREE_CODE (treeop0);
index efc93b7a55fbe5d4b732e883bf2466115c449879..4d683d6d7e4e66e29a8e623663a90807cc5233b6 100644 (file)
@@ -607,7 +607,7 @@ void
 gimple_cond_get_ops_from_tree (tree cond, enum tree_code *code_p,
                                tree *lhs_p, tree *rhs_p)
 {
-  gcc_assert (TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison
+  gcc_assert (COMPARISON_CLASS_P (cond)
              || TREE_CODE (cond) == TRUTH_NOT_EXPR
              || is_gimple_min_invariant (cond)
              || SSA_VAR_P (cond));
index 4bef3502dfd97bec98528f72598fb381d22f3beb..c91f218c218ca4a90d1b9ef403f0a7ae1b2908ee 100644 (file)
@@ -3846,7 +3846,7 @@ canonicalize_bool (tree expr, bool invert)
       else if (TREE_CODE (expr) == SSA_NAME)
        return fold_build2 (EQ_EXPR, boolean_type_node, expr,
                            build_int_cst (TREE_TYPE (expr), 0));
-      else if (TREE_CODE_CLASS (TREE_CODE (expr)) == tcc_comparison)
+      else if (COMPARISON_CLASS_P (expr))
        return fold_build2 (invert_tree_comparison (TREE_CODE (expr), false),
                            boolean_type_node,
                            TREE_OPERAND (expr, 0),
@@ -3865,7 +3865,7 @@ canonicalize_bool (tree expr, bool invert)
       else if (TREE_CODE (expr) == SSA_NAME)
        return fold_build2 (NE_EXPR, boolean_type_node, expr,
                            build_int_cst (TREE_TYPE (expr), 0));
-      else if (TREE_CODE_CLASS (TREE_CODE (expr)) == tcc_comparison)
+      else if (COMPARISON_CLASS_P (expr))
        return fold_build2 (TREE_CODE (expr),
                            boolean_type_node,
                            TREE_OPERAND (expr, 0),
@@ -3946,12 +3946,12 @@ same_bool_result_p (const_tree op1, const_tree op2)
   /* Check the cases where at least one of the operands is a comparison.
      These are a bit smarter than operand_equal_p in that they apply some
      identifies on SSA_NAMEs.  */
-  if (TREE_CODE_CLASS (TREE_CODE (op2)) == tcc_comparison
+  if (COMPARISON_CLASS_P (op2)
       && same_bool_comparison_p (op1, TREE_CODE (op2),
                                 TREE_OPERAND (op2, 0),
                                 TREE_OPERAND (op2, 1)))
     return true;
-  if (TREE_CODE_CLASS (TREE_CODE (op1)) == tcc_comparison
+  if (COMPARISON_CLASS_P (op1)
       && same_bool_comparison_p (op2, TREE_CODE (op1),
                                 TREE_OPERAND (op1, 0),
                                 TREE_OPERAND (op1, 1)))
index 49ff4588f12c08bd6af6699f4a0c27c295aa49dd..a85c7a24180d0701109ee8f5f619172ad49352d1 100644 (file)
@@ -339,7 +339,7 @@ parse_predicate (tree cond, tree *op0, tree *op1)
       return ERROR_MARK;
     }
 
-  if (TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison)
+  if (COMPARISON_CLASS_P (cond))
     {
       *op0 = TREE_OPERAND (cond, 0);
       *op1 = TREE_OPERAND (cond, 1);