diff options
author | tomby <tomby@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-09 14:57:39 +0000 |
---|---|---|
committer | tomby <tomby@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-09 14:57:39 +0000 |
commit | 72dd6141f8392ad7ea6ba9490dfbe69b13605a77 (patch) | |
tree | 915acaa0ac91d36f503d63fe89c4932a2091a76a /gcc/tree-ssa-forwprop.c | |
parent | 0b7b55ea48b51334493b005bfa4f3ecec49b0be5 (diff) | |
download | gcc-72dd6141f8392ad7ea6ba9490dfbe69b13605a77.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 31322b65791..cf6cf04ac1b 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -234,8 +234,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_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)))) @@ -299,8 +298,7 @@ can_propagate_from (tree def_stmt) 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) @@ -586,8 +584,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt, 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. */ @@ -792,8 +789,7 @@ forward_propagate_addr_expr (tree name, tree rhs) 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); @@ -832,8 +828,7 @@ forward_propagate_comparison (tree cond, tree 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)))) @@ -842,8 +837,7 @@ forward_propagate_comparison (tree cond, tree stmt) 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. */ @@ -1033,8 +1027,7 @@ tree_ssa_forward_propagate_single_use_vars (void) 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)))) { |