* config/pa/pa.c (reloc_needed): Use CASE_CONVERT.
* tree-cfg.c (verify_expr, verify_gimple_expr): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Likewise.
* c-common.c (c_common_truthvalue_conversion): Likewise.
* tree-object-size.c (compute_object_offset): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* varasm.c (const_hash_1, compare_constant, copy_constant)
(compute_reloc_for_constant, output_addressed_constants)
(initializer_constant_valid_p): Likewise.
* c-omp.c (check_omp_for_incr_expr): Likewise.
* gimplify.c (gimplify_expr): Likewise.
* c-typeck.c (c_finish_return): Likewise.
* tree-vectorizer.c (supportable_widening_operation)
(supportable_narrowing_operation): Likewise.
* c-pretty-print.c (pp_c_cast_expression, pp_c_expression):
Likewise.
* matrix-reorg.c (can_calculate_expr_before_stmt): Likewise.
* expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info)
(descr_info_loc): Likewise.
* tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.
* fold-const.c (operand_equal_p, make_range, extract_muldiv_1)
(fold_unary): Likewise.
* builtins.c (get_pointer_alignment): Likewise.
* tree-scalar-evolution.c (interpret_rhs_modify_stmt)
(instantiate_parameters_1): Likewise.
* tree.c (expr_align, stabilize_reference): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* tree-ssa-loop-niter.c (derive_constant_upper_bound): Likewise.
* convert.c (strip_float_extensions): Use CONVERT_EXPR_P.
* tree-ssa-threadedge.c (simplify_control_stmt_condition):
Likewise.
* config/alpha/alpha.c (va_list_skip_additions): Likewise.
* c-common.c (c_alignof_expr, check_function_arguments_recurse):
Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Likewise.
* varasm.c (initializer_constant_valid_p, output_constant):
Likewise.
* tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from)
(forward_propagate_addr_expr_1, forward_propagate_addr_expr)
(forward_propagate_comparison)
(tree_ssa_forward_propagate_single_use_vars): Likewise.
* cfgexpand.c (discover_nonconstant_array_refs_r): Likewise.
* emit-rtl.c (component_ref_for_mem_expr)
(set_mem_attributes_minus_bitpos): Likewise.
* tree-ssa-phiopt.c (conditional_replacement): Likewise.
* gimplify.c (gimplify_conversion, goa_lhs_expr_p,
gimplify_expr): Likewise.
* c-typeck.c (default_function_array_conversion,
build_indirect_ref)
(build_function_call, pointer_diff, build_compound_expr)
(c_finish_return): Likewise.
* tree-vect-analyze.c (vect_determine_vectorization_factor):
Likewise.
* matrix-reorg.c (get_inner_of_cast_expr,
may_flatten_matrices_1): Likewise.
* tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
* expr.c (is_aligning_offset): Likewise.
* tree-ssa-alias.c (is_escape_site): Likewise.
* tree-stdarg.c (va_list_counter_bump, check_va_list_escapes)
(check_all_va_list_escapes): Likewise.
* tree-ssa-loop-ivopts.c (determine_base_object)
(determine_common_wider_type): Likewise.
* dojump.c (do_jump): Likewise.
* tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
* tree-gimple.c (is_gimple_cast): Likewise.
* fold-const.c (decode_field_reference, )
(fold_sign_changed_comparison, fold_unary, fold_comparison)
(fold_binary): Likewise.
* tree-ssa-alias-warnings.c (find_alias_site_helper)
(already_warned_in_frontend_p): Likewise.
* builtins.c (get_memory_rtx, fold_builtin_next_arg): Likewise.
* tree.c (really_constant_p, get_unwidened): Likewise.
* tree-ssa-loop-niter.c (expand_simple_operations): Likewise.
* tree-ssa-loop-im.c (rewrite_bittest): Likewise.
* tree-vrp.c (register_edge_assert_for_2,
register_edge_assert_for_1): Likewise.
* tree.h (STRIP_NOPS, STRIP_SIGN_NOPS, STRIP_TYPE_NOPS): Use
CONVERT_EXPR_P.
(CONVERT_EXPR_P): Define.
(CASE_CONVERT): Define.
From-SVN: r135114
+2008-05-09 Tomas Bily <tbily@suse.cz>
+
+ * config/pa/pa.c (reloc_needed): Use CASE_CONVERT.
+ * tree-cfg.c (verify_expr, verify_gimple_expr): Likewise.
+ * tree-ssa-structalias.c (get_constraint_for): Likewise.
+ * c-common.c (c_common_truthvalue_conversion): Likewise.
+ * tree-object-size.c (compute_object_offset): Likewise.
+ * tree-inline.c (estimate_num_insns_1): Likewise.
+ * varasm.c (const_hash_1, compare_constant, copy_constant)
+ (compute_reloc_for_constant, output_addressed_constants)
+ (initializer_constant_valid_p): Likewise.
+ * c-omp.c (check_omp_for_incr_expr): Likewise.
+ * gimplify.c (gimplify_expr): Likewise.
+ * c-typeck.c (c_finish_return): Likewise.
+ * tree-vectorizer.c (supportable_widening_operation)
+ (supportable_narrowing_operation): Likewise.
+ * c-pretty-print.c (pp_c_cast_expression, pp_c_expression): Likewise.
+ * matrix-reorg.c (can_calculate_expr_before_stmt): Likewise.
+ * expr.c (highest_pow2_factor, expand_expr_real_1): Likewise.
+ * dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info)
+ (descr_info_loc): Likewise.
+ * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.
+ * fold-const.c (operand_equal_p, make_range, extract_muldiv_1)
+ (fold_unary): Likewise.
+ * builtins.c (get_pointer_alignment): Likewise.
+ * tree-scalar-evolution.c (interpret_rhs_modify_stmt)
+ (instantiate_parameters_1): Likewise.
+ * tree.c (expr_align, stabilize_reference): Likewise.
+ * tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
+ * tree-ssa-loop-niter.c (derive_constant_upper_bound): Likewise.
+ * convert.c (strip_float_extensions): Use CONVERT_EXPR_P.
+ * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
+ * config/alpha/alpha.c (va_list_skip_additions): Likewise.
+ * c-common.c (c_alignof_expr, check_function_arguments_recurse): Likewise.
+ * tree-ssa.c (tree_ssa_useless_type_conversion): Likewise.
+ * varasm.c (initializer_constant_valid_p, output_constant): Likewise.
+ * tree-ssa-forwprop.c (get_prop_source_stmt, can_propagate_from)
+ (forward_propagate_addr_expr_1, forward_propagate_addr_expr)
+ (forward_propagate_comparison)
+ (tree_ssa_forward_propagate_single_use_vars): Likewise.
+ * cfgexpand.c (discover_nonconstant_array_refs_r): Likewise.
+ * emit-rtl.c (component_ref_for_mem_expr)
+ (set_mem_attributes_minus_bitpos): Likewise.
+ * tree-ssa-phiopt.c (conditional_replacement): Likewise.
+ * gimplify.c (gimplify_conversion, goa_lhs_expr_p, gimplify_expr): Likewise.
+ * c-typeck.c (default_function_array_conversion, build_indirect_ref)
+ (build_function_call, pointer_diff, build_compound_expr)
+ (c_finish_return): Likewise.
+ * tree-vect-analyze.c (vect_determine_vectorization_factor): Likewise.
+ * matrix-reorg.c (get_inner_of_cast_expr, may_flatten_matrices_1): Likewise.
+ * tree-ssa-ifcombine.c (recognize_single_bit_test): Likewise.
+ * expr.c (is_aligning_offset): Likewise.
+ * tree-ssa-alias.c (is_escape_site): Likewise.
+ * tree-stdarg.c (va_list_counter_bump, check_va_list_escapes)
+ (check_all_va_list_escapes): Likewise.
+ * tree-ssa-loop-ivopts.c (determine_base_object)
+ (determine_common_wider_type): Likewise.
+ * dojump.c (do_jump): Likewise.
+ * tree-ssa-sccvn.c (simplify_unary_expression): Likewise.
+ * tree-gimple.c (is_gimple_cast): Likewise.
+ * fold-const.c (decode_field_reference, )
+ (fold_sign_changed_comparison, fold_unary, fold_comparison)
+ (fold_binary): Likewise.
+ * tree-ssa-alias-warnings.c (find_alias_site_helper)
+ (already_warned_in_frontend_p): Likewise.
+ * builtins.c (get_memory_rtx, fold_builtin_next_arg): Likewise.
+ * tree.c (really_constant_p, get_unwidened): Likewise.
+ * tree-ssa-loop-niter.c (expand_simple_operations): Likewise.
+ * tree-ssa-loop-im.c (rewrite_bittest): Likewise.
+ * tree-vrp.c (register_edge_assert_for_2, register_edge_assert_for_1): Likewise.
+ * tree.h (STRIP_NOPS, STRIP_SIGN_NOPS, STRIP_TYPE_NOPS): Use CONVERT_EXPR_P.
+ (CONVERT_EXPR_P): Define.
+ (CASE_CONVERT): Define.
+
2008-05-08 Kenneth Zadeck <zadeck@naturalbridge.com>
PR middle-end/36117
{
switch (TREE_CODE (exp))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
exp = TREE_OPERAND (exp, 0);
if (! POINTER_TYPE_P (TREE_TYPE (exp)))
return align;
/* Get an expression we can use to find the attributes to assign to MEM.
If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if
we can. First remove any nops. */
- while ((TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (exp)
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
exp = TREE_OPERAND (exp, 0);
tree inner = exp;
while (TREE_CODE (inner) == ARRAY_REF
- || TREE_CODE (inner) == NOP_EXPR
- || TREE_CODE (inner) == CONVERT_EXPR
+ || CONVERT_EXPR_P (inner)
|| TREE_CODE (inner) == VIEW_CONVERT_EXPR
|| TREE_CODE (inner) == SAVE_EXPR)
inner = TREE_OPERAND (inner, 0);
is not quite the same as STRIP_NOPS. It does more.
We must also strip off INDIRECT_EXPR for C++ reference
parameters. */
- while (TREE_CODE (arg) == NOP_EXPR
- || TREE_CODE (arg) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (arg)
|| TREE_CODE (arg) == INDIRECT_REF)
arg = TREE_OPERAND (arg, 0);
if (arg != last_parm)
c_common_truthvalue_conversion (TREE_OPERAND (expr, 1)),
c_common_truthvalue_conversion (TREE_OPERAND (expr, 2)));
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
/* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE,
since that affects how `default_conversion' will behave. */
if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE
tree best = t;
int bestalign = TYPE_ALIGN (TREE_TYPE (TREE_TYPE (t)));
- while ((TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (t)
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) == POINTER_TYPE)
{
int thisalign;
void *ctx, tree param,
unsigned HOST_WIDE_INT param_num)
{
- if ((TREE_CODE (param) == NOP_EXPR || TREE_CODE (param) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (param)
&& (TYPE_PRECISION (TREE_TYPE (param))
== TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (param, 0)))))
{
switch (TREE_CODE (exp))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
if (t != error_mark_node)
return fold_convert (TREE_TYPE (exp), t);
{
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
pp_c_type_cast (pp, TREE_TYPE (e));
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
break;
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
pp_c_cast_expression (pp, e);
break;
bool lvalue_array_p;
while ((TREE_CODE (exp.value) == NON_LVALUE_EXPR
- || TREE_CODE (exp.value) == NOP_EXPR
- || TREE_CODE (exp.value) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (exp.value))
&& TREE_TYPE (TREE_OPERAND (exp.value, 0)) == type)
{
if (TREE_CODE (exp.value) == NON_LVALUE_EXPR)
if (TREE_CODE (type) == POINTER_TYPE)
{
- if (TREE_CODE (pointer) == CONVERT_EXPR
- || TREE_CODE (pointer) == NOP_EXPR
+ if (CONVERT_EXPR_P (pointer)
|| TREE_CODE (pointer) == VIEW_CONVERT_EXPR)
{
/* If a warning is issued, mark it to avoid duplicates from
expression if necessary. This has the nice side-effect to prevent
the tree-inliner from generating invalid assignment trees which may
blow up in the RTL expander later. */
- if ((TREE_CODE (function) == NOP_EXPR
- || TREE_CODE (function) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (function)
&& TREE_CODE (tem = TREE_OPERAND (function, 0)) == ADDR_EXPR
&& TREE_CODE (tem = TREE_OPERAND (tem, 0)) == FUNCTION_DECL
&& !comptypes (fntype, TREE_TYPE (tem)))
different mode in place.)
So first try to find a common term here 'by hand'; we want to cover
at least the cases that occur in legal static initializers. */
- if ((TREE_CODE (op0) == NOP_EXPR || TREE_CODE (op0) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (op0)
&& (TYPE_PRECISION (TREE_TYPE (op0))
== TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (op0, 0)))))
con0 = TREE_OPERAND (op0, 0);
else
con0 = op0;
- if ((TREE_CODE (op1) == NOP_EXPR || TREE_CODE (op1) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (op1)
&& (TYPE_PRECISION (TREE_TYPE (op1))
== TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (op1, 0)))))
con1 = TREE_OPERAND (op1, 0);
if (warn_unused_value)
{
if (VOID_TYPE_P (TREE_TYPE (expr1))
- && (TREE_CODE (expr1) == NOP_EXPR
- || TREE_CODE (expr1) == CONVERT_EXPR))
+ && CONVERT_EXPR_P (expr1))
; /* (void) a, b */
else if (VOID_TYPE_P (TREE_TYPE (expr1))
&& TREE_CODE (expr1) == COMPOUND_EXPR
- && (TREE_CODE (TREE_OPERAND (expr1, 1)) == CONVERT_EXPR
- || TREE_CODE (TREE_OPERAND (expr1, 1)) == NOP_EXPR))
+ && CONVERT_EXPR_P (TREE_OPERAND (expr1, 1)))
; /* (void) a, (void) b, c */
else
warning (OPT_Wunused_value,
{
switch (TREE_CODE (inner))
{
- case NOP_EXPR: case NON_LVALUE_EXPR: case CONVERT_EXPR:
+ CASE_CONVERT: case NON_LVALUE_EXPR:
case PLUS_EXPR:
inner = TREE_OPERAND (inner, 0);
continue;
tree op1 = TREE_OPERAND (inner, 1);
while (!POINTER_TYPE_P (TREE_TYPE (op1))
- && (TREE_CODE (op1) == NOP_EXPR
- || TREE_CODE (op1) == NON_LVALUE_EXPR
- || TREE_CODE (op1) == CONVERT_EXPR))
+ && (CONVERT_EXPR_P (op1)
+ || TREE_CODE (op1) == NON_LVALUE_EXPR))
op1 = TREE_OPERAND (op1, 0);
if (POINTER_TYPE_P (TREE_TYPE (op1)))
|| TREE_CODE (t) == REALPART_EXPR
|| TREE_CODE (t) == IMAGPART_EXPR
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
- || TREE_CODE (t) == NOP_EXPR
- || TREE_CODE (t) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (t))
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
- if ((TREE_CODE (rhs) != NOP_EXPR
- && TREE_CODE (rhs) != CONVERT_EXPR
+ if (((!CONVERT_EXPR_P (rhs))
&& ((TREE_CODE (rhs) != PLUS_EXPR
&& TREE_CODE (rhs) != POINTER_PLUS_EXPR)
|| TREE_CODE (TREE_OPERAND (rhs, 1)) != INTEGER_CST
reloc |= reloc_needed (TREE_OPERAND (exp, 1));
break;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case NON_LVALUE_EXPR:
reloc = reloc_needed (TREE_OPERAND (exp, 0));
break;
return build_real (type, real_value_truncate (TYPE_MODE (type), orig));
}
- if (TREE_CODE (exp) != NOP_EXPR
- && TREE_CODE (exp) != CONVERT_EXPR)
+ if (!CONVERT_EXPR_P (exp))
return exp;
sub = TREE_OPERAND (exp, 0);
rtx set_label, clr_label;
/* Strip narrowing integral type conversions. */
- while ((TREE_CODE (exp0) == NOP_EXPR
- || TREE_CODE (exp0) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (exp0)
&& TREE_OPERAND (exp0, 0) != error_mark_node
&& TYPE_PRECISION (TREE_TYPE (exp0))
<= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (exp0, 0))))
case COMPOUND_EXPR:
return loc_descriptor_from_tree_1 (TREE_OPERAND (loc, 1), want_address);
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
case GIMPLE_MODIFY_STMT:
add_AT_unsigned (subrange_die, bound_attr, tree_low_cst (bound, 0));
break;
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
add_bound_info (subrange_die, bound_attr, TREE_OPERAND (bound, 0));
break;
switch (TREE_CODE (val))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
return descr_info_loc (TREE_OPERAND (val, 0), base_decl);
case INTEGER_CST:
if (host_integerp (val, 0))
{
/* Now remove any conversions: they don't change what the underlying
object is. Likewise for SAVE_EXPR. */
- while (TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (inner)
|| TREE_CODE (inner) == VIEW_CONVERT_EXPR
|| TREE_CODE (inner) == SAVE_EXPR)
inner = TREE_OPERAND (inner, 0);
/* Now remove any conversions: they don't change what the underlying
object is. Likewise for SAVE_EXPR. */
- while (TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (t)
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
|| TREE_CODE (t) == SAVE_EXPR)
t = TREE_OPERAND (t, 0);
}
break;
- case NOP_EXPR: case CONVERT_EXPR:
+ CASE_CONVERT:
case SAVE_EXPR:
return highest_pow2_factor (TREE_OPERAND (exp, 0));
return expand_call (exp, target, ignore);
case PAREN_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
if (TREE_OPERAND (exp, 0) == error_mark_node)
return const0_rtx;
is_aligning_offset (const_tree offset, const_tree exp)
{
/* Strip off any conversions. */
- while (TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
/* We must now have a BIT_AND_EXPR with a constant that is one less than
/* Look at the first operand of BIT_AND_EXPR and strip any conversion.
It must be NEGATE_EXPR. Then strip any more conversions. */
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
if (TREE_CODE (offset) != NEGATE_EXPR)
return 0;
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NOP_EXPR
- || TREE_CODE (offset) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (offset))
offset = TREE_OPERAND (offset, 0);
/* This must now be the address of EXP. */
/* Two conversions are equal only if signedness and modes match. */
switch (TREE_CODE (arg0))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case FIX_TRUNC_EXPR:
if (TYPE_UNSIGNED (TREE_TYPE (arg0))
!= TYPE_UNSIGNED (TREE_TYPE (arg1)))
/* We are interested in the bare arrangement of bits, so strip everything
that doesn't affect the machine mode. However, record the type of the
outermost expression if it may matter below. */
- if (TREE_CODE (exp) == NOP_EXPR
- || TREE_CODE (exp) == CONVERT_EXPR
+ if (CONVERT_EXPR_P (exp)
|| TREE_CODE (exp) == NON_LVALUE_EXPR)
outer_type = TREE_TYPE (exp);
STRIP_NOPS (exp);
exp = arg0;
continue;
- case NOP_EXPR: case NON_LVALUE_EXPR: case CONVERT_EXPR:
+ CASE_CONVERT: case NON_LVALUE_EXPR:
if (TYPE_PRECISION (arg0_type) > TYPE_PRECISION (exp_type))
break;
fold_convert (ctype, c), 0);
break;
- case CONVERT_EXPR: case NON_LVALUE_EXPR: case NOP_EXPR:
+ CASE_CONVERT: case NON_LVALUE_EXPR:
/* If op0 is an expression ... */
if ((COMPARISON_CLASS_P (op0)
|| UNARY_CLASS_P (op0)
tree arg0_inner;
tree inner_type, outer_type;
- if (TREE_CODE (arg0) != NOP_EXPR
- && TREE_CODE (arg0) != CONVERT_EXPR)
+ if (!CONVERT_EXPR_P (arg0))
return NULL_TREE;
outer_type = TREE_TYPE (arg0);
return NULL_TREE;
if (TREE_CODE (arg1) != INTEGER_CST
- && !((TREE_CODE (arg1) == NOP_EXPR
- || TREE_CODE (arg1) == CONVERT_EXPR)
+ && !(CONVERT_EXPR_P (arg1)
&& TREE_TYPE (TREE_OPERAND (arg1, 0)) == inner_type))
return NULL_TREE;
return fold_convert (type, op0);
return NULL_TREE;
- case NOP_EXPR:
+ CASE_CONVERT:
case FLOAT_EXPR:
- case CONVERT_EXPR:
case FIX_TRUNC_EXPR:
if (TREE_TYPE (op0) == type)
return op0;
TREE_OPERAND (op0, 1));
/* Handle cases of two conversions in a row. */
- if (TREE_CODE (op0) == NOP_EXPR
- || TREE_CODE (op0) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (op0))
{
tree inside_type = TREE_TYPE (TREE_OPERAND (op0, 0));
tree inter_type = TREE_TYPE (op0);
if (INTEGRAL_TYPE_P (type)
&& TREE_CODE (op0) == BIT_NOT_EXPR
&& INTEGRAL_TYPE_P (TREE_TYPE (op0))
- && (TREE_CODE (TREE_OPERAND (op0, 0)) == NOP_EXPR
- || TREE_CODE (TREE_OPERAND (op0, 0)) == CONVERT_EXPR)
+ && CONVERT_EXPR_P (TREE_OPERAND (op0, 0))
&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op0)))
{
tem = TREE_OPERAND (TREE_OPERAND (op0, 0), 0);
return fold_convert (type, op0);
/* Strip inner integral conversions that do not change the precision. */
- if ((TREE_CODE (op0) == NOP_EXPR
- || TREE_CODE (op0) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (op0)
&& (INTEGRAL_TYPE_P (TREE_TYPE (op0))
|| POINTER_TYPE_P (TREE_TYPE (op0)))
&& (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (op0, 0)))
}
if (TREE_CODE (TREE_TYPE (arg0)) == INTEGER_TYPE
- && (TREE_CODE (arg0) == NOP_EXPR
- || TREE_CODE (arg0) == CONVERT_EXPR))
+ && CONVERT_EXPR_P (arg0))
{
/* If we are widening one operand of an integer comparison,
see if the other operand is similarly being widened. Perhaps we
if ((code == LT_EXPR || code == GE_EXPR)
&& TYPE_UNSIGNED (TREE_TYPE (arg0))
- && (TREE_CODE (arg1) == NOP_EXPR
- || TREE_CODE (arg1) == CONVERT_EXPR)
+ && CONVERT_EXPR_P (arg1)
&& TREE_CODE (TREE_OPERAND (arg1, 0)) == LSHIFT_EXPR
&& integer_onep (TREE_OPERAND (TREE_OPERAND (arg1, 0), 0)))
return
gimplify_conversion (tree *expr_p)
{
tree tem;
- gcc_assert (TREE_CODE (*expr_p) == NOP_EXPR
- || TREE_CODE (*expr_p) == CONVERT_EXPR);
+ gcc_assert (CONVERT_EXPR_P (*expr_p));
/* Then strip away all but the outermost conversion. */
STRIP_SIGN_NOPS (TREE_OPERAND (*expr_p, 0));
/* If we still have a conversion at the toplevel,
then canonicalize some constructs. */
- if (TREE_CODE (*expr_p) == NOP_EXPR || TREE_CODE (*expr_p) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (*expr_p))
{
tree sub = TREE_OPERAND (*expr_p, 0);
/* Also include casts to other type variants. The C front end is fond
of adding these for e.g. volatile variables. This is like
STRIP_TYPE_NOPS but includes the main variant lookup. */
- while ((TREE_CODE (expr) == NOP_EXPR
- || TREE_CODE (expr) == CONVERT_EXPR
+ while ((CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == NON_LVALUE_EXPR)
&& TREE_OPERAND (expr, 0) != error_mark_node
&& (TYPE_MAIN_VARIANT (TREE_TYPE (expr))
{
expr = TREE_OPERAND (expr, 0);
while (expr != addr
- && (TREE_CODE (expr) == NOP_EXPR
- || TREE_CODE (expr) == CONVERT_EXPR
+ && (CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == NON_LVALUE_EXPR)
&& TREE_CODE (expr) == TREE_CODE (addr)
&& TYPE_MAIN_VARIANT (TREE_TYPE (expr))
ret = gimplify_va_arg_expr (expr_p, pre_p, post_p);
break;
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
if (IS_EMPTY_STMT (*expr_p))
{
ret = GS_ALL_DONE;
static tree
get_inner_of_cast_expr (tree t)
{
- while (TREE_CODE (t) == CONVERT_EXPR || TREE_CODE (t) == NOP_EXPR
+ while (CONVERT_EXPR_P (t)
|| TREE_CODE (t) == VIEW_CONVERT_EXPR)
t = TREE_OPERAND (t, 0);
{
case GIMPLE_MODIFY_STMT:
t = GIMPLE_STMT_OPERAND (stmt, 1);
- while (TREE_CODE (t) == CONVERT_EXPR || TREE_CODE (t) == NOP_EXPR)
+ while (CONVERT_EXPR_P (t))
{
if (TREE_TYPE (t) && POINTER_TYPE_P (TREE_TYPE (t)))
{
}
return res;
}
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
res = can_calculate_expr_before_stmt (TREE_OPERAND (expr, 0), visited);
if (res != NULL_TREE)
return build1 (TREE_CODE (expr), TREE_TYPE (expr), res);
case NON_LVALUE_EXPR:
gcc_unreachable ();
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case FIX_TRUNC_EXPR:
case FLOAT_EXPR:
case NEGATE_EXPR:
/* Special codes we cannot handle via their class. */
switch (TREE_CODE (expr))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
{
tree op = TREE_OPERAND (expr, 0);
if (!is_gimple_val (op))
bool
is_gimple_cast (tree t)
{
- return (TREE_CODE (t) == NOP_EXPR
- || TREE_CODE (t) == CONVERT_EXPR
+ return (CONVERT_EXPR_P (t)
|| TREE_CODE (t) == FIX_TRUNC_EXPR);
}
case BIND_EXPR:
case WITH_CLEANUP_EXPR:
case PAREN_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
case ADDR_EXPR:
break;
case REALPART_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
case NON_LVALUE_EXPR:
return compute_object_offset (TREE_OPERAND (expr, 0), var);
case FIXED_CONVERT_EXPR:
case FIX_TRUNC_EXPR:
case FLOAT_EXPR:
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
type = TREE_TYPE (node);
op0 = TREE_OPERAND (node, 0);
if (type != TREE_TYPE (op0))
case INDIRECT_REF:
case ADDR_EXPR:
case FLOAT_EXPR:
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case FIX_TRUNC_EXPR:
case TARGET_EXPR:
return 14;
at_stmt);
break;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
opnd10 = TREE_OPERAND (opnd1, 0);
chrec10 = analyze_scalar_evolution (loop, opnd10);
res = chrec_convert (type, chrec10, at_stmt);
}
return chrec;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
op0 = instantiate_parameters_1 (loop, TREE_OPERAND (chrec, 0),
flags, cache, size_expr);
if (op0 == chrec_dont_know)
tree rhs_pointer = get_rhs (stmt);
tree to_match = NULL_TREE;
- while (TREE_CODE (rhs_pointer) == NOP_EXPR
- || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (rhs_pointer)
|| TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
rhs_pointer = TREE_OPERAND (rhs_pointer, 0);
rhs_pointer = get_rhs (stmt);
- if ((TREE_CODE (rhs_pointer) == NOP_EXPR
- || TREE_CODE (rhs_pointer) == CONVERT_EXPR
+ if ((CONVERT_EXPR_P (rhs_pointer)
|| TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
&& TREE_NO_WARNING (rhs_pointer))
return true;
if (lhs == NULL_TREE)
return ESCAPE_UNKNOWN;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == NOP_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CONVERT_EXPR
+ if (CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (stmt, 1))
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VIEW_CONVERT_EXPR)
{
tree from
/* We can look through pointer conversions in the search
for a useful stmt for the comparison folding. */
rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
- if ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (rhs)
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (rhs))
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0))))
then we can not apply optimizations as some targets require function
pointers to be canonicalized and in this case this optimization could
eliminate a necessary canonicalization. */
- if ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (rhs)
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0)))
&& TREE_CODE (TREE_TYPE (TREE_TYPE
(TREE_OPERAND (rhs, 0)))) == FUNCTION_TYPE)
a conversion to def_rhs type separate, though. */
if (TREE_CODE (lhs) == SSA_NAME
&& (rhs == name
- || TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (rhs))
&& useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (def_rhs)))
{
/* Only recurse if we don't deal with a single use. */
if (result
&& TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME
&& (TREE_CODE (use_rhs) == SSA_NAME
- || ((TREE_CODE (use_rhs) == NOP_EXPR
- || TREE_CODE (use_rhs) == CONVERT_EXPR)
+ || (CONVERT_EXPR_P (use_rhs)
&& TREE_CODE (TREE_OPERAND (use_rhs, 0)) == SSA_NAME)))
{
block_stmt_iterator bsi = bsi_for_stmt (use_stmt);
/* Conversion of the condition result to another integral type. */
if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == CONVERT_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == NOP_EXPR
+ && (CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (use_stmt, 1))
|| COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (use_stmt, 1))
|| TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == TRUTH_NOT_EXPR)
&& INTEGRAL_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (use_stmt, 0))))
tree rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
/* We can propagate the condition into a conversion. */
- if (TREE_CODE (rhs) == CONVERT_EXPR
- || TREE_CODE (rhs) == NOP_EXPR)
+ if (CONVERT_EXPR_P (rhs))
{
/* Avoid using fold here as that may create a COND_EXPR with
non-boolean condition as canonical form. */
if (TREE_CODE (rhs) == ADDR_EXPR
/* Handle pointer conversions on invariant addresses
as well, as this is valid gimple. */
- || ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ || (CONVERT_EXPR_P (rhs)
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (rhs))))
{
if (TREE_CODE (t) != GIMPLE_MODIFY_STMT)
break;
t = GIMPLE_STMT_OPERAND (t, 1);
- if (TREE_CODE (t) == NOP_EXPR
- || TREE_CODE (t) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (t))
t = TREE_OPERAND (t, 0);
} while (TREE_CODE (t) == SSA_NAME);
/* There is a conversion in between possibly inserted by fold. */
t = GIMPLE_STMT_OPERAND (stmt1, 1);
- if (TREE_CODE (t) == NOP_EXPR
- || TREE_CODE (t) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (t))
{
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) != SSA_NAME
/* If this is a pointer casted to any type, we need to determine
the base object for the pointer; so handle conversions before
throwing away non-pointer expressions. */
- if (TREE_CODE (expr) == NOP_EXPR
- || TREE_CODE (expr) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (expr))
return determine_base_object (TREE_OPERAND (expr, 0));
if (!POINTER_TYPE_P (TREE_TYPE (expr)))
case ARRAY_RANGE_REF:
return may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
return true;
default:
tree suba, subb;
tree atype = TREE_TYPE (*a);
- if ((TREE_CODE (*a) == NOP_EXPR
- || TREE_CODE (*a) == CONVERT_EXPR))
+ if (CONVERT_EXPR_P (*a))
{
suba = TREE_OPERAND (*a, 0);
wider_type = TREE_TYPE (suba);
else
return atype;
- if ((TREE_CODE (*b) == NOP_EXPR
- || TREE_CODE (*b) == CONVERT_EXPR))
+ if (CONVERT_EXPR_P (*b))
{
subb = TREE_OPERAND (*b, 0);
if (TYPE_PRECISION (wider_type) != TYPE_PRECISION (TREE_TYPE (subb)))
e = GIMPLE_STMT_OPERAND (stmt, 1);
if (/* Casts are simple. */
- TREE_CODE (e) != NOP_EXPR
- && TREE_CODE (e) != CONVERT_EXPR
+ !CONVERT_EXPR_P (e)
/* Copies are simple. */
&& TREE_CODE (e) != SSA_NAME
/* Assignments of invariants are simple. */
case INTEGER_CST:
return tree_to_double_int (val);
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
op0 = TREE_OPERAND (val, 0);
subtype = TREE_TYPE (op0);
if (!TYPE_UNSIGNED (subtype)
/* Only "real" casts are OK here, not everything that is
acceptable to is_gimple_cast. Make sure we don't do
anything stupid here. */
- gcc_assert (TREE_CODE (cond) == NOP_EXPR
- || TREE_CODE (cond) == CONVERT_EXPR);
+ gcc_assert (CONVERT_EXPR_P (cond));
op0 = TREE_OPERAND (cond, 0);
tmp = create_tmp_var (TREE_TYPE (op0), NULL);
if (VN_INFO (op0)->has_constants)
op0 = valueize_expr (VN_INFO (op0)->expr);
- else if (TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR
+ else if (CONVERT_EXPR_P (rhs)
|| TREE_CODE (rhs) == REALPART_EXPR
|| TREE_CODE (rhs) == IMAGPART_EXPR
|| TREE_CODE (rhs) == VIEW_CONVERT_EXPR)
{
switch (TREE_CODE (t))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
{
tree op = TREE_OPERAND (t, 0);
fold_defer_overflow_warnings ();
cached_lhs = fold (COND_EXPR_COND (dummy_cond));
- 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 (is_gimple_min_invariant (cached_lhs),
the top of the RHS to the type of the LHS and the type conversion
is "safe", then strip away the type conversion so that we can
enter LHS = RHS into the const_and_copies table. */
- if (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR
+ if (CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == VIEW_CONVERT_EXPR
|| TREE_CODE (expr) == NON_LVALUE_EXPR)
/* FIXME: Use of GENERIC_TREE_TYPE here is a temporary measure to work
continue;
}
- if ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (rhs)
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
{
lhs = TREE_OPERAND (rhs, 0);
continue;
}
- if ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (rhs)
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
{
lhs = TREE_OPERAND (rhs, 0);
if (((TREE_CODE (rhs) == POINTER_PLUS_EXPR
|| TREE_CODE (rhs) == PLUS_EXPR)
&& TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- || TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (rhs))
rhs = TREE_OPERAND (rhs, 0);
if (TREE_CODE (rhs) != SSA_NAME
statements. */
if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
&& TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- || TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (rhs))
rhs = TREE_OPERAND (rhs, 0);
if (rhs == use)
scalar_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
operation = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (operation) == NOP_EXPR
- || TREE_CODE (operation) == CONVERT_EXPR
+ if (CONVERT_EXPR_P (operation)
|| TREE_CODE (operation) == WIDEN_MULT_EXPR
|| TREE_CODE (operation) == FLOAT_EXPR)
{
}
break;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
if (BYTES_BIG_ENDIAN)
{
c1 = VEC_UNPACK_HI_EXPR;
switch (code)
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
c1 = VEC_PACK_TRUNC_EXPR;
break;
/* Extract NAME2 from the (optional) sign-changing cast. */
if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == NOP_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == CONVERT_EXPR))
+ && CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (def_stmt, 1)))
{
tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
- if ((TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ if (CONVERT_EXPR_P (rhs)
&& ! TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (rhs, 0)))
&& (TYPE_PRECISION (TREE_TYPE (rhs))
== TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (rhs, 0)))))
/* Recurse through the copy. */
retval |= register_edge_assert_for_1 (rhs, code, e, bsi);
}
- else if (TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR)
+ else if (CONVERT_EXPR_P (rhs))
{
/* Recurse through the type conversion. */
retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0),
really_constant_p (const_tree exp)
{
/* This is not quite the same as STRIP_NOPS. It does more. */
- while (TREE_CODE (exp) == NOP_EXPR
- || TREE_CODE (exp) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (exp)
|| TREE_CODE (exp) == NON_LVALUE_EXPR)
exp = TREE_OPERAND (exp, 0);
return TREE_CONSTANT (exp);
switch (TREE_CODE (t))
{
- case NOP_EXPR: case CONVERT_EXPR: case NON_LVALUE_EXPR:
+ CASE_CONVERT: case NON_LVALUE_EXPR:
/* If we have conversions, we know that the alignment of the
object must meet each of the alignments of the types. */
align0 = expr_align (TREE_OPERAND (t, 0));
/* No action is needed in this case. */
return ref;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
result = build_nt (code, stabilize_reference (TREE_OPERAND (ref, 0)));
&& TYPE_UNSIGNED (type));
tree win = op;
- while (TREE_CODE (op) == NOP_EXPR
- || TREE_CODE (op) == CONVERT_EXPR)
+ while (CONVERT_EXPR_P (op))
{
int bitschange;
Let's avoid computing it if it does not affect WIN
and if UNS will not be needed again. */
if ((uns
- || TREE_CODE (op) == NOP_EXPR
- || TREE_CODE (op) == CONVERT_EXPR)
+ || CONVERT_EXPR_P (op))
&& TYPE_UNSIGNED (TREE_TYPE (op)))
{
uns = 1;
(TREE_CODE (NODE) == PHI_NODE ? PHI_CHAIN (NODE) : \
GIMPLE_STMT_P (NODE) ? NULL_TREE : TREE_CHAIN (NODE))
+/* Tests if expression is conversion expr (NOP_EXPRs or CONVERT_EXPRs). */
+
+#define CONVERT_EXPR_P(EXP) \
+ (TREE_CODE (EXP) == NOP_EXPR \
+ || TREE_CODE (EXP) == CONVERT_EXPR)
+
+/* Generate case for NOP_EXPR, CONVERT_EXPR. */
+
+#define CASE_CONVERT \
+ case NOP_EXPR: \
+ case CONVERT_EXPR
+
/* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs
that don't change the machine mode. */
#define STRIP_NOPS(EXP) \
- while ((TREE_CODE (EXP) == NOP_EXPR \
- || TREE_CODE (EXP) == CONVERT_EXPR \
+ while ((CONVERT_EXPR_P (EXP) \
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
/* Like STRIP_NOPS, but don't let the signedness change either. */
#define STRIP_SIGN_NOPS(EXP) \
- while ((TREE_CODE (EXP) == NOP_EXPR \
- || TREE_CODE (EXP) == CONVERT_EXPR \
+ while ((CONVERT_EXPR_P (EXP) \
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
/* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */
#define STRIP_TYPE_NOPS(EXP) \
- while ((TREE_CODE (EXP) == NOP_EXPR \
- || TREE_CODE (EXP) == CONVERT_EXPR \
+ while ((CONVERT_EXPR_P (EXP) \
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TREE_TYPE (EXP) \
return (const_hash_1 (TREE_OPERAND (exp, 0)) * 9
+ const_hash_1 (TREE_OPERAND (exp, 1)));
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
return const_hash_1 (TREE_OPERAND (exp, 0)) * 7 + 2;
default:
return (compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0))
&& compare_constant(TREE_OPERAND (t1, 1), TREE_OPERAND (t2, 1)));
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
return compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
copy_constant (TREE_OPERAND (exp, 0)),
copy_constant (TREE_OPERAND (exp, 1)));
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
return build1 (TREE_CODE (exp), TREE_TYPE (exp),
copy_constant (TREE_OPERAND (exp, 0)));
reloc |= reloc2;
break;
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
break;
output_addressed_constants (TREE_OPERAND (exp, 1));
/* Fall through. */
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case VIEW_CONVERT_EXPR:
output_addressed_constants (TREE_OPERAND (exp, 0));
break;
case NON_LVALUE_EXPR:
return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype);
- case CONVERT_EXPR:
- case NOP_EXPR:
+ CASE_CONVERT:
{
tree src;
tree src_type;
(int)(p1 - p2) to ((int)p1 - (int)p2) under the theory
that the narrower operation is cheaper. */
- while (TREE_CODE (op0) == NOP_EXPR
- || TREE_CODE (op0) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (op0)
|| TREE_CODE (op0) == NON_LVALUE_EXPR)
{
tree inner = TREE_OPERAND (op0, 0);
op0 = inner;
}
- while (TREE_CODE (op1) == NOP_EXPR
- || TREE_CODE (op1) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (op1)
|| TREE_CODE (op1) == NON_LVALUE_EXPR)
{
tree inner = TREE_OPERAND (op1, 0);
/* Eliminate any conversions since we'll be outputting the underlying
constant. */
- while (TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR
+ while (CONVERT_EXPR_P (exp)
|| TREE_CODE (exp) == NON_LVALUE_EXPR
|| TREE_CODE (exp) == VIEW_CONVERT_EXPR)
{