diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 33 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/tree.c | 4 | ||||
-rw-r--r-- | gcc/expr.c | 2 | ||||
-rw-r--r-- | gcc/fold-const.c | 4 | ||||
-rw-r--r-- | gcc/gimple.c | 3 | ||||
-rw-r--r-- | gcc/gimple.h | 3 | ||||
-rw-r--r-- | gcc/matrix-reorg.c | 3 | ||||
-rw-r--r-- | gcc/tree-data-ref.c | 3 | ||||
-rw-r--r-- | gcc/tree-inline.c | 6 | ||||
-rw-r--r-- | gcc/tree-sra.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-ccp.c | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-dom.c | 9 | ||||
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 12 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-threadedge.c | 3 | ||||
-rw-r--r-- | gcc/tree-stdarg.c | 2 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 8 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 9 | ||||
-rw-r--r-- | gcc/tree.c | 9 | ||||
-rw-r--r-- | gcc/tree.h | 4 |
23 files changed, 79 insertions, 60 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1088b379f7d..36e15f2e217 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,36 @@ +2008-08-18 Tomas Bily <tbily@suse.cz> + + * tree.h (IS_CONVERT_EXPR_CODE_P): Renamed to CONVERT_EXPR_CODE_P. + * tree-ssa-threadedge.c (simplify_control_stmt_condition): Use + CONVERT_EXPR_P. + * tree-data-ref.c (split_constant_offset_1): Likewise. + * tree-inline.c (estimate_operator_cost): Use CASE_CONVERT. + * tree-sra.c (sra_walk_expr): Likewise. + * matrix-reorg.c (ssa_accessed_in_assign_rhs): Likewise. + * tree-ssa-loop-niter.c (expand_simple_operations): Likewise. + * gimple.h (gimple_assign_cast_p): Use CONVERT_EXPR_CODE_P. + * tree-ssa-structalias.c (find_func_aliases, find_func_aliases): + Likewise. + * gimple.c (gimple_assign_unary_nop_p): Likewise. + * tree-vect-transform.c (vectorizable_type_demotion) + (vectorizable_type_promotion): Likewise. + * tree-inline.c (expand_call_inline): + * tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from) + (forward_propagate_addr_expr_1, forward_propagate_comparison) + (tree_ssa_forward_propagate_single_use_vars): Likewise. + * expr.c (expand_expr_real_1): Likewise. + * tree-ssa-dom.c (hashable_expr_equal_p, iterative_hash_hashable_expr) + (gimple_assign_unary_useless_conversion_p): Likewise. + * tree-stdarg.c (execute_optimize_stdarg): Likewise. + * tree-ssa-ccp.c (ccp_fold, fold_gimple_assign): Likewise. + * fold-const.c (fold_unary): Likewise. + * tree.h (CONVERT_EXPR_P): Likewise. + * tree.c (simple_cst_equal, iterative_hash_expr): Likewise. + * tree-ssa-loop-im.c (rewrite_bittest): Likewise. + * tree-vrp.c: + (register_edge_assert_for_2, extract_range_from_unary_expr) + (register_edge_assert_for_1): Likewise. + 2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * real.h (dconst_e, dconst_third, dconst_sqrt2, dconst_e_ptr, diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 436804f5a8b..a684338d654 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2008-08-18 Tomas Bily <tbily@suse.cz> + + * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P. + 2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * typeck.c: Update all callers of permerror. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index ff19cd69d8b..81682974da0 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1739,12 +1739,12 @@ cp_tree_equal (tree t1, tree t2) return false; for (code1 = TREE_CODE (t1); - code1 == NOP_EXPR || code1 == CONVERT_EXPR + CONVERT_EXPR_CODE_P (code1) || code1 == NON_LVALUE_EXPR; code1 = TREE_CODE (t1)) t1 = TREE_OPERAND (t1, 0); for (code2 = TREE_CODE (t2); - code2 == NOP_EXPR || code2 == CONVERT_EXPR + CONVERT_EXPR_CODE_P (code2) || code1 == NON_LVALUE_EXPR; code2 = TREE_CODE (t2)) t2 = TREE_OPERAND (t2, 0); diff --git a/gcc/expr.c b/gcc/expr.c index 1d994c55b08..908d5641953 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -7153,7 +7153,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, unsignedp = TYPE_UNSIGNED (type); ignore = (target == const0_rtx - || ((code == NOP_EXPR || code == CONVERT_EXPR + || ((CONVERT_EXPR_CODE_P (code) || code == COND_EXPR || code == VIEW_CONVERT_EXPR) && TREE_CODE (type) == VOID_TYPE)); diff --git a/gcc/fold-const.c b/gcc/fold-const.c index eac31ef1a79..cba88267565 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7625,7 +7625,7 @@ fold_unary (enum tree_code code, tree type, tree op0) arg0 = op0; if (arg0) { - if (code == NOP_EXPR || code == CONVERT_EXPR + if (CONVERT_EXPR_CODE_P (code) || code == FLOAT_EXPR || code == ABS_EXPR) { /* Don't use STRIP_NOPS, because signedness of argument type @@ -7674,7 +7674,7 @@ fold_unary (enum tree_code code, tree type, tree op0) so we don't get into an infinite recursion loop taking the conversion out and then back in. */ - if ((code == NOP_EXPR || code == CONVERT_EXPR + if ((CONVERT_EXPR_CODE_P (code) || code == NON_LVALUE_EXPR) && TREE_CODE (tem) == COND_EXPR && TREE_CODE (TREE_OPERAND (tem, 1)) == code diff --git a/gcc/gimple.c b/gcc/gimple.c index 6e8971f4ec1..9e7d92155b0 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1899,8 +1899,7 @@ bool gimple_assign_unary_nop_p (gimple gs) { return (gimple_code (gs) == GIMPLE_ASSIGN - && (gimple_assign_rhs_code (gs) == NOP_EXPR - || gimple_assign_rhs_code (gs) == CONVERT_EXPR + && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs)) || gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR) && gimple_assign_rhs1 (gs) != error_mark_node && (TYPE_MODE (TREE_TYPE (gimple_assign_lhs (gs))) diff --git a/gcc/gimple.h b/gcc/gimple.h index 2f6af03117e..7072edfb1b5 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1853,8 +1853,7 @@ gimple_assign_cast_p (gimple s) if (is_gimple_assign (s)) { enum tree_code sc = gimple_assign_rhs_code (s); - return sc == NOP_EXPR - || sc == CONVERT_EXPR + return CONVERT_EXPR_CODE_P (sc) || sc == VIEW_CONVERT_EXPR || sc == FIX_TRUNC_EXPR; } diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c index 66145518f53..2299c4ed3f2 100644 --- a/gcc/matrix-reorg.c +++ b/gcc/matrix-reorg.c @@ -658,8 +658,7 @@ ssa_accessed_in_assign_rhs (gimple stmt, struct ssa_acc_in_tree *a) case SSA_NAME: case INDIRECT_REF: - case CONVERT_EXPR: - case NOP_EXPR: + CASE_CONVERT: case VIEW_CONVERT_EXPR: ssa_accessed_in_tree (gimple_assign_rhs1 (stmt), a); break; diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 1b5e92b5af3..85d0977bce9 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -581,8 +581,7 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1, To compute that ARRAY_REF's element size TYPE_SIZE_UNIT, which possibly no longer appears in current GIMPLE, might resurface. This perhaps could run - if (TREE_CODE (var0) == NOP_EXPR - || TREE_CODE (var0) == CONVERT_EXPR) + if (CONVERT_EXPR_P (var0)) { gimplify_conversion (&var0); // Attempt to fill in any within var0 found ARRAY_REF's diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index ef9e75c88c6..2f06d22db3f 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2632,10 +2632,9 @@ estimate_operator_cost (enum tree_code code, eni_weights *weights) /* These are "free" conversions, or their presumed cost is folded into other operations. */ case RANGE_EXPR: - case CONVERT_EXPR: + CASE_CONVERT: case COMPLEX_EXPR: case PAREN_EXPR: - case NOP_EXPR: return 0; /* Assign cost of 1 to usual operations. @@ -3346,8 +3345,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) if (is_gimple_assign (stmt)) { gcc_assert (gimple_assign_single_p (stmt) - || gimple_assign_rhs_code (stmt) == NOP_EXPR - || gimple_assign_rhs_code (stmt) == CONVERT_EXPR); + || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))); TREE_USED (gimple_assign_rhs1 (stmt)) = 1; } diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 85217ece07a..abe0c9f530d 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -881,8 +881,7 @@ sra_walk_expr (tree *expr_p, gimple_stmt_iterator *gsi, bool is_output, outer element, to which walk_tree will bring us next. */ goto use_all; - case NOP_EXPR: - case CONVERT_EXPR: + CASE_CONVERT: /* Similarly, a nop explicitly wants to look at an object in a type other than the one we've scalarized. */ goto use_all; diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 2e34bd99d6b..ad6012e8ffc 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -988,7 +988,7 @@ ccp_fold (gimple stmt) useless_type_conversion_p places for pointer type conversions do not apply here. Substitution later will only substitute to allowed places. */ - if (IS_CONVERT_EXPR_CODE_P (subcode) + if (CONVERT_EXPR_CODE_P (subcode) && POINTER_TYPE_P (TREE_TYPE (lhs)) && POINTER_TYPE_P (TREE_TYPE (op0)) /* Do not allow differences in volatile qualification @@ -2781,8 +2781,7 @@ fold_gimple_assign (gimple_stmt_iterator *si) if (valid_gimple_rhs_p (result)) return result; } - else if ((gimple_assign_rhs_code (stmt) == NOP_EXPR - || gimple_assign_rhs_code (stmt) == CONVERT_EXPR) + else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) && POINTER_TYPE_P (gimple_expr_type (stmt)) && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))) { diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 4e7a390d91e..cd7defa869c 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -381,8 +381,7 @@ hashable_expr_equal_p (const struct hashable_expr *expr0, if (expr0->ops.unary.op != expr1->ops.unary.op) return false; - if ((expr0->ops.unary.op == NOP_EXPR - || expr0->ops.unary.op == CONVERT_EXPR + if ((CONVERT_EXPR_CODE_P (expr0->ops.unary.op) || expr0->ops.unary.op == NON_LVALUE_EXPR) && TYPE_UNSIGNED (expr0->type) != TYPE_UNSIGNED (expr1->type)) return false; @@ -460,8 +459,7 @@ iterative_hash_hashable_expr (const struct hashable_expr *expr, hashval_t val) Don't hash the type, that can lead to having nodes which compare equal according to operand_equal_p, but which have different hash codes. */ - if (expr->ops.unary.op == NOP_EXPR - || expr->ops.unary.op == CONVERT_EXPR + if (CONVERT_EXPR_CODE_P (expr->ops.unary.op) || expr->ops.unary.op == NON_LVALUE_EXPR) val += TYPE_UNSIGNED (expr->type); @@ -1929,8 +1927,7 @@ static bool gimple_assign_unary_useless_conversion_p (gimple gs) { if (is_gimple_assign (gs) - && (gimple_assign_rhs_code (gs) == NOP_EXPR - || gimple_assign_rhs_code (gs) == CONVERT_EXPR + && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs)) || gimple_assign_rhs_code (gs) == VIEW_CONVERT_EXPR || gimple_assign_rhs_code (gs) == NON_LVALUE_EXPR)) { diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 6c5c6cabc46..64eb2d8dcf6 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -232,7 +232,7 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p) /* We can look through pointer conversions in the search for a useful stmt for the comparison folding. */ rhs = gimple_assign_rhs1 (def_stmt); - if (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)) + if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)) && TREE_CODE (rhs) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (def_stmt))) && POINTER_TYPE_P (TREE_TYPE (rhs))) @@ -282,7 +282,7 @@ can_propagate_from (gimple def_stmt) function pointers to be canonicalized and in this case this optimization could eliminate a necessary canonicalization. */ if (is_gimple_assign (def_stmt) - && (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))) + && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)))) { tree rhs = gimple_assign_rhs1 (def_stmt); if (POINTER_TYPE_P (TREE_TYPE (rhs)) @@ -689,7 +689,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, a conversion to def_rhs type separate, though. */ if (TREE_CODE (lhs) == SSA_NAME && ((rhs_code == SSA_NAME && rhs == name) - || IS_CONVERT_EXPR_CODE_P (rhs_code)) + || CONVERT_EXPR_CODE_P (rhs_code)) && useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (def_rhs))) { /* Only recurse if we don't deal with a single use. */ @@ -928,7 +928,7 @@ forward_propagate_comparison (gimple stmt) /* Conversion of the condition result to another integral type. */ if (is_gimple_assign (use_stmt) - && (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)) + && (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt)) || TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt)) == tcc_comparison || gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR) @@ -937,7 +937,7 @@ forward_propagate_comparison (gimple stmt) tree lhs = gimple_assign_lhs (use_stmt); /* We can propagate the condition into a conversion. */ - if (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))) + if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (use_stmt))) { /* Avoid using fold here as that may create a COND_EXPR with non-boolean condition as canonical form. */ @@ -1138,7 +1138,7 @@ tree_ssa_forward_propagate_single_use_vars (void) if (gimple_assign_rhs_code (stmt) == ADDR_EXPR /* Handle pointer conversions on invariant addresses as well, as this is valid gimple. */ - || (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) + || (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) && TREE_CODE (rhs) == ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (lhs)))) { diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 4c85c878e6c..527b810e335 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -819,8 +819,7 @@ rewrite_bittest (gimple_stmt_iterator *bsi) return stmt; /* There is a conversion in between possibly inserted by fold. */ - if (gimple_assign_rhs_code (stmt1) == NOP_EXPR - || gimple_assign_rhs_code (stmt1) == CONVERT_EXPR) + if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt1))) { t = gimple_assign_rhs1 (stmt1); if (TREE_CODE (t) != SSA_NAME diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 1eedf7544af..33aacae83b5 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1451,8 +1451,7 @@ expand_simple_operations (tree expr) switch (code) { - case NOP_EXPR: - case CONVERT_EXPR: + CASE_CONVERT: /* Casts are simple. */ ee = expand_simple_operations (e); return fold_build1 (code, TREE_TYPE (expr), ee); diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 4198498800b..7ed37a59762 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3852,7 +3852,7 @@ find_func_aliases (gimple origt) if (gimple_assign_rhs_code (t) == POINTER_PLUS_EXPR) get_constraint_for_ptr_offset (gimple_assign_rhs1 (t), gimple_assign_rhs2 (t), &rhsc); - else if ((IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t)) + else if ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t)) && !(POINTER_TYPE_P (gimple_expr_type (t)) && !POINTER_TYPE_P (TREE_TYPE (rhsop)))) || gimple_assign_single_p (t)) @@ -3908,7 +3908,7 @@ find_func_aliases (gimple origt) else if (stmt_escape_type == ESCAPE_BAD_CAST) { gcc_assert (is_gimple_assign (t)); - gcc_assert (IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t)) + gcc_assert (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t)) || gimple_assign_rhs_code (t) == VIEW_CONVERT_EXPR); make_escape_constraint (gimple_assign_rhs1 (t)); } diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 6a821611800..a193d94b010 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -483,8 +483,7 @@ simplify_control_stmt_condition (edge e, cached_lhs = fold_binary (cond_code, boolean_type_node, op0, op1); if (cached_lhs) - while (TREE_CODE (cached_lhs) == NOP_EXPR - || TREE_CODE (cached_lhs) == CONVERT_EXPR) + while (CONVERT_EXPR_P (cached_lhs)) cached_lhs = TREE_OPERAND (cached_lhs, 0); fold_undefer_overflow_warnings ((cached_lhs diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 96a72fad08e..00fce82e750 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -811,7 +811,7 @@ execute_optimize_stdarg (void) if ((gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR && TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST) - || IS_CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) + || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) || (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)) == GIMPLE_SINGLE_RHS)) check_va_list_escapes (&si, lhs, rhs); diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index eb370775cba..29f52b645c2 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -4341,7 +4341,7 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi, return false; code = gimple_assign_rhs_code (stmt); - if (code != NOP_EXPR && code != CONVERT_EXPR) + if (!CONVERT_EXPR_CODE_P (code)) return false; op0 = gimple_assign_rhs1 (stmt); @@ -4366,7 +4366,7 @@ vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi, && INTEGRAL_TYPE_P (TREE_TYPE (op0))) || (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest)) && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0)) - && (code == NOP_EXPR || code == CONVERT_EXPR)))) + && CONVERT_EXPR_CODE_P (code)))) return false; /* Check the operands of the operation. */ @@ -4534,7 +4534,7 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi, return false; code = gimple_assign_rhs_code (stmt); - if (code != NOP_EXPR && code != CONVERT_EXPR + if (!CONVERT_EXPR_CODE_P (code) && code != WIDEN_MULT_EXPR) return false; @@ -4559,7 +4559,7 @@ vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi, && INTEGRAL_TYPE_P (TREE_TYPE (op0))) || (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest)) && SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0)) - && (code == CONVERT_EXPR || code == NOP_EXPR)))) + && CONVERT_EXPR_CODE_P (code)))) return false; /* Check the operands of the operation. */ diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index af4060c6a1e..383beb1c23a 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2483,8 +2483,7 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code, } /* Handle unary expressions on integer ranges. */ - if ((code == NOP_EXPR - || code == CONVERT_EXPR) + if (CONVERT_EXPR_CODE_P (code) && INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op0))) { @@ -3944,8 +3943,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi, /* Extract NAME2 from the (optional) sign-changing cast. */ if (gimple_assign_cast_p (def_stmt)) { - if ((gimple_assign_rhs_code (def_stmt) == NOP_EXPR - || gimple_assign_rhs_code (def_stmt) == CONVERT_EXPR) + if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt)) && ! TYPE_UNSIGNED (TREE_TYPE (gimple_assign_rhs1 (def_stmt))) && (TYPE_PRECISION (gimple_expr_type (def_stmt)) == TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))) @@ -4098,8 +4096,7 @@ register_edge_assert_for_1 (tree op, enum tree_code code, retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def), code, e, bsi); } - else if (gimple_assign_rhs_code (op_def) == NOP_EXPR - || gimple_assign_rhs_code (op_def) == CONVERT_EXPR) + else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def))) { /* Recurse through the type conversion. */ retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def), diff --git a/gcc/tree.c b/gcc/tree.c index c92beef74ca..4441bc0abe4 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5022,16 +5022,16 @@ simple_cst_equal (const_tree t1, const_tree t2) code1 = TREE_CODE (t1); code2 = TREE_CODE (t2); - if (code1 == NOP_EXPR || code1 == CONVERT_EXPR || code1 == NON_LVALUE_EXPR) + if (CONVERT_EXPR_CODE_P (code1) || code1 == NON_LVALUE_EXPR) { - if (code2 == NOP_EXPR || code2 == CONVERT_EXPR + if (CONVERT_EXPR_CODE_P (code2) || code2 == NON_LVALUE_EXPR) return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); else return simple_cst_equal (TREE_OPERAND (t1, 0), t2); } - else if (code2 == NOP_EXPR || code2 == CONVERT_EXPR + else if (CONVERT_EXPR_CODE_P (code2) || code2 == NON_LVALUE_EXPR) return simple_cst_equal (t1, TREE_OPERAND (t2, 0)); @@ -5338,8 +5338,7 @@ iterative_hash_expr (const_tree t, hashval_t val) /* Don't hash the type, that can lead to having nodes which compare equal according to operand_equal_p, but which have different hash codes. */ - if (code == NOP_EXPR - || code == CONVERT_EXPR + if (CONVERT_EXPR_CODE_P (code) || code == NON_LVALUE_EXPR) { /* Make sure to include signness in the hash computation. */ diff --git a/gcc/tree.h b/gcc/tree.h index 3f8065da736..656fb0a7acf 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -962,11 +962,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777) /* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */ -#define IS_CONVERT_EXPR_CODE_P(CODE) \ +#define CONVERT_EXPR_CODE_P(CODE) \ ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR) /* Similarly, but accept an expressions instead of a tree code. */ -#define CONVERT_EXPR_P(EXP) IS_CONVERT_EXPR_CODE_P (TREE_CODE (EXP)) +#define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP)) /* Generate case for NOP_EXPR, CONVERT_EXPR. */ |