aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/expr.c2
-rw-r--r--gcc/gimple-expr.c2
-rw-r--r--gcc/gimple-fold.c8
-rw-r--r--gcc/tree-if-conv.c2
5 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b78857c..701b759 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
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.
* gimplify.c (gimplify_modify_expr_rhs): Likewise.
diff --git a/gcc/expr.c b/gcc/expr.c
index e91383f..cf33808 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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);
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index efc93b7..4d683d6 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -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));
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 4bef350..c91f218 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -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)))
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 49ff458..a85c7a2 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -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);