Merge gimple-tuples-branch into mainline.
From-SVN: r119546
This commit is contained in:
parent
3b8aab767b
commit
07beea0df3
734
gcc/ChangeLog
734
gcc/ChangeLog
@ -1,3 +1,737 @@
|
||||
2006-12-05 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
Merge from gimple-tuples-branch.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* config/s390/s390.c (s390_va_start): Replace MODIFY_EXPR with
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(s390_gimplify_va_arg): Same.
|
||||
* config/sparc/sparc.c (sparc_gimplify_va_arg): Same.
|
||||
* config/sh/sh.c (sh_va_start): Same.
|
||||
(sh_gimplify_va_arg_expr): Same.
|
||||
* config/xtensa/xtensa.c (xtensa_va_start): Same.
|
||||
(xtensa_gimplify_va_arg_expr): Same.
|
||||
* config/ia64/ia64.c (ia64_gimplify_va_arg): Same.
|
||||
* config/pa/pa.c (hppa_gimplify_va_arg_expr): Same.
|
||||
* config/mips/mips.c (mips_va_start): Same.
|
||||
(mips_gimplify_va_arg_expr): Same.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* Merge from mainline at revision 119445.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* config/spu/spu.c (spu_va_start): Change MODIFY_EXPR to
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(spu_gimplify_va_arg_expr): Same.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
|
||||
Change uses of MODIFY_EXPR to GIMPLE_MODIFY_STMT.
|
||||
(xstormy16_expand_builtin_va_arg): Same.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* config/frv/frv.c (frv_expand_builtin_va_start): Change MODIFY_EXPR
|
||||
to GIMPLE_MODIFY_STMT.
|
||||
|
||||
2006-12-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* config/alpha/alpha.c (va_list_skip_additions): Change all
|
||||
occurrences of MODIFY_EXPR to GIMPLE_MODIFY_STMT.
|
||||
(alpha_va_start): Same.
|
||||
(alpha_gimplify_va_arg_1): Same.
|
||||
(alpha_gimplify_va_arg): Same.
|
||||
|
||||
2006-12-01 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* gimplify.c (gimplify_modify_expr): Remove FIXME comment.
|
||||
|
||||
2006-12-01 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-ssa-loop-im.c: Rename all PROTECTED_TREE_OPERAND to
|
||||
GENERIC_TREE_OPERAND, and all PROTECTED_TREE_TYPE to
|
||||
GENERIC_TREE_TYPE.
|
||||
* tree-complex.c: Same.
|
||||
* tree-pretty-print.c: Same.
|
||||
* tree.c: Same.
|
||||
* tree.h: Same.
|
||||
* builtins.c: Same.
|
||||
* fold-const.c: Same.
|
||||
* tree-ssa-dom.c: Same.
|
||||
* tree-ssa-propagate.c: Same.
|
||||
* tree-ssa-alias.c: Same.
|
||||
* gimple-low.c: Same.
|
||||
* dwarf2out.c: Same.
|
||||
* c-pretty-print.c: Same.
|
||||
* gimplify.c: Same.
|
||||
* tree-inline.c: Same.
|
||||
* tree-outof-ssa.c: Same.
|
||||
* tree-ssa-structalias.c: Same.
|
||||
* tree-ssa-reassoc.c: Same.
|
||||
* stmt.c: Same.
|
||||
|
||||
2006-11-16 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree.c (build2_stat): Fix comment.
|
||||
|
||||
2006-11-13 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-ssa-propagate.c (get_rhs): Use GIMPLE_MODIFY_STMT and
|
||||
TREE_OPERAND when appropriate.
|
||||
|
||||
2006-11-04 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* java/java-tree.h (lang_tree_node): Handle gimple tuples.
|
||||
(EXPR_WFL_EMIT_LINE_NOTE): Look inside base.
|
||||
(EXPR_WFL_LINECOL): Use EXPR_LOCUS macro instead of exp.locus.
|
||||
* java/java-gimplify.c (java_gimplify_expr): Comment on why we do
|
||||
not handle GIMPLE_MODIFY_STMT in the switch statement.
|
||||
(java_gimplify_modify_expr): Call build2 with GIMPLE_MODIFY_STMT.
|
||||
(java_gimplify_new_array_init): Same.
|
||||
|
||||
2006-11-03 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* gimplify.c (gimplify_omp_for): Allow gimple statements.
|
||||
* tree-outof-ssa.c (check_replaceable): Use PROTECTED_TREE_OPERAND.
|
||||
* fold-const.c (fold_binary): Allow gimple statements.
|
||||
(fold): Same.
|
||||
* fortran/trans-array.c (gfc_conv_descriptor_data_set_internal):
|
||||
Rename from gfc_conv_descriptor_data_set.
|
||||
Call gfc_add_modify instead of gfc_add_modify_expr.
|
||||
* fortran/trans-array.h (gfc_conv_descriptor_data_set_internal):
|
||||
Rename from gfc_conv_descriptor_data_set.
|
||||
(gfc_conv_descriptor_data_set): New macro.
|
||||
(gfc_conv_descriptor_data_set_tuples): New macros.
|
||||
* fortran/trans-openmp.c (gfc_omp_clause_default_ctor): Call
|
||||
gfc_conv_descriptor_data_set_tuples.
|
||||
* fortran/trans.c (gfc_add_modify): Rename from gfc_add_modify_expr.
|
||||
Generate GIMPLE_MODIFY_STMT when appropriate.
|
||||
* fortran/trans.h (gfc_add_modify): Rename from gfc_add_modify_expr.
|
||||
(gfc_add_modify_expr): New macro.
|
||||
(gfc_add_modify_stmt): New macro.
|
||||
* fortran/f95-lang.c (lang_tree_node): Handle gimple statements.
|
||||
|
||||
2006-11-02 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* ada/ada-tree.h (lang_tree_node): Handle gimple tuples.
|
||||
* ada/trans.c (gnat_gimplify_expr): Replace MODIFY_EXPR with
|
||||
GIMPLE_MODIFY_STMT.
|
||||
|
||||
2006-11-01 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* Merge from mainline at revision 118200.
|
||||
|
||||
2006-10-09 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-inline.c (copy_bb): Check for GIMPLE_MODIFY_STMT, and adjust
|
||||
accordingly.
|
||||
|
||||
2006-10-09 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree.h (TREE_CHAIN, TREE_TYPE): Add versions for non GCC or not
|
||||
enable checking.
|
||||
Also, add __extension__ to GCC versions.
|
||||
* tree-mudflap.c (mf_xform_derefs_1): Add parentheses around TREE_TYPE.
|
||||
* tree-inline.c (copy_tree_r): Initialize chain to assuage the warning
|
||||
patrol.
|
||||
|
||||
2006-10-05 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-complex.c (expand_complex_libcall): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(expand_complex_comparison): Same.
|
||||
* tree-pretty-print.c (dump_generic_node): Is_expr should include
|
||||
GIMPLE_STMT_P statements.
|
||||
* value-prof.c (tree_divmod_fixed_value_transform): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(tree_mod_pow2_value_transform): Same.
|
||||
(tree_mod_subtract_transform): Same.
|
||||
* tree.c (build2_stat): Check for gimplified function in cfun.
|
||||
* tree.h (DECL_GIMPLIFIED): Delete.
|
||||
(struct tree_function_decl): Remove gimplified_flag.
|
||||
* omp-low.c (lower_omp_for): Adjust for GIMPLE_MODIFY_STMT.
|
||||
* cp/cp-gimplify.c (cp_gimplify_expr): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(cxx_omp_clause_apply_fn): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(cxx_omp_clause_copy_ctor): Same.
|
||||
(cxx_omp_clause_assign_op): Same.
|
||||
* c-pretty-print.c (pp_c_conditional_expression): Same.
|
||||
(pp_c_expression): Same.
|
||||
* langhooks.c (lhd_omp_predetermined_sharing): Same.
|
||||
* function.h (struct function): Add gimplified field.
|
||||
* tree-if-conv.c (add_to_dst_predicate_list): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(find_phi_replacement_condition): Same.
|
||||
* gimplify.c (gimplify_modify_expr_to_memcpy): Same.
|
||||
(gimplify_modify_expr_to_memset): Same.
|
||||
(gimplify_init_ctor_eval_range): Same.
|
||||
(gimplify_modify_expr_complex_part): Same.
|
||||
(tree_to_gimple_tuple): Same.
|
||||
(gimplify_modify_expr): Same.
|
||||
(gimple_push_cleanup): Same.
|
||||
(gimplify_omp_for): Same.
|
||||
(gimplify_omp_atomic_pipeline): Same.
|
||||
(gimplify_omp_atomic_mutex): Same.
|
||||
(gimplify_expr): Same.
|
||||
(gimplify_one_sizepos): Same.
|
||||
(gimplify_function_tree): Same.
|
||||
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Same.
|
||||
(vect_recog_widen_sum_pattern): Same.
|
||||
* tree-vect-transform.c (get_initial_def_for_reduction): Same.
|
||||
(vect_create_epilog_for_reduction): Same.
|
||||
(vectorizable_reduction): Same.
|
||||
|
||||
2006-09-28 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-ssa-math-opts.c (replace_reciprocal): Use GIMPLE_STMT_OPERAND.
|
||||
* tree-if-conv.c (if_convertible_gimple_modify_stmt_p): Same.
|
||||
(ifc_temp_var): Same.
|
||||
* tree-vect-analyze.c (vect_determine_vectorization_factor): Check
|
||||
for gimple statements.
|
||||
(vect_analyze_operations): Same.
|
||||
(exist_non_indexing_operands_for_use_p): Use GIMPLE_STMT_OPERAND.
|
||||
* gimplify.c (gimplify_return_expr): Handle gimple statements.
|
||||
* lambda-code.c (can_put_in_inner_loop): Same.
|
||||
(can_put_after_inner_loop): Same.
|
||||
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Same.
|
||||
(vect_create_data_ref_ptr): Same.
|
||||
(vect_init_vector): Same.
|
||||
(vect_get_vec_def_for_operand): Same.
|
||||
(vect_create_epilog_for_reduction): Same.
|
||||
(vectorizable_reduction): Same.
|
||||
(vectorizable_assignment): Same.
|
||||
(vectorizable_operation): Same.
|
||||
(vectorizable_load): Same.
|
||||
(vectorizable_condition): Same.
|
||||
* config/rs6000/rs6000.c (rs6000_va_start): Do not create MODIFY_EXPRs.
|
||||
(rs6000_gimplify_va_arg): Same.
|
||||
|
||||
2006-09-25 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-vrp.c (simplify_div_or_mod_using_ranges): Use
|
||||
GIMPLE_STMT_OPERAND.
|
||||
(simplify_abs_using_ranges): Same.
|
||||
* tree-complex.c (expand_complex_operations_1): Use
|
||||
PROTECTED_TREE_OPERAND.
|
||||
* tree-ssa-loop-niter.c (simplify_replace_tree): Check for gimple
|
||||
stmt.
|
||||
(get_val_for): Use GIMPLE_STMT_OPERAND.
|
||||
* tree-tailcall.c (adjust_accumulator_values): Same.
|
||||
(adjust_return_value): Same.
|
||||
* tree.c (walk_tree): Use IS_GIMPLE_STMT_CODE_CLASS on default
|
||||
case. Remove special case for tcc_gimple_stmt.
|
||||
* tree.h (CAN_HAVE_LOCATION_P): New.
|
||||
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Check for
|
||||
GIMPLE_STMT_P.
|
||||
* tree-stdarg.c (va_list_counter_bump): Use GIMPLE_STMT_OPERAND.
|
||||
* tree-ssa-dom.c (propagate_rhs_into_lhs): Same.
|
||||
* tree-nrv.c (execute_return_slot_opt): Same.
|
||||
* tree-ssa-alias.c (count_uses_and_derefs): Check for GIMPLE_STMT_P.
|
||||
* tree-vn.c (set_value_handle): Same.
|
||||
(get_value_handle): Same.
|
||||
* c-decl.c (add_stmt): Use CAN_HAVE_LOCATION_P.
|
||||
* tree-vectorizer.c (find_loop_location): Same.
|
||||
* c-typeck.c (c_process_expr_stmt): Same.
|
||||
(c_finish_stmt_expr): Same.
|
||||
* gimplify.c (should_carry_locus_p): Same.
|
||||
(tree_to_gimple_tuple): Delete definition and use of unecessary
|
||||
variable save_tree_block.
|
||||
* tree-ssa-pre.c (phi_translate): Check for GIMPLE_STMT_P.
|
||||
(create_expression_by_pieces): Use GIMPLE_STMT_OPERAND.
|
||||
(realify_fake_stores): Same.
|
||||
* tree-ssa-forwprop.c (forward_propagate_addr_into_variable_arr):
|
||||
Use TREE_OPERAND.
|
||||
* tree-inline.c (copy_body_r): Check for EXPR_P and GIMPLE_STMT_P.
|
||||
(copy_tree_r): Check for IS_GIMPLE_STMT_CODE_CLASS.
|
||||
* tree-cfg.c (move_stmt_r): Use EXPR_P. Check for GIMPLE_STMT_P.
|
||||
* c-parser.c (c_parser_typeof_specifier): Use CAN_HAVE_LOCATION_P.
|
||||
(c_parser_statement_after_labels): Same.
|
||||
(c_parser_paren_condition): Same.
|
||||
(c_parser_for_statement): Same.
|
||||
(c_parser_omp_for_loop): Same.
|
||||
* tree-ssa-reassoc.c (linearize_expr): Use GIMPLE_STMT_OPERAND.
|
||||
(linearize_expr_tree): Same.
|
||||
* dwarf2out.c (reference_to_unused): Check for GIMPLE_STMT_P.
|
||||
* function.c (instantiate_expr): Same.
|
||||
|
||||
2006-09-22 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree.c (expr_location): Use GIMPLE_STMT_LOCUS.
|
||||
(set_expr_location): Same.
|
||||
(expr_locus): Same.
|
||||
(set_expr_locus): Same.
|
||||
(expr_filename): Same.
|
||||
(expr_lineno): Same.
|
||||
(tree_block): Use GIMPLE_STMT_BLOCK.
|
||||
(protected_tree_operand): Use GIMPLE_STMT_OPERAND.
|
||||
* tree.h (struct gimple_stmt): Remove prev and next.
|
||||
(GIMPLE_STMT_OPERAND_CHECK): New.
|
||||
(TREE_TO_GIMPLE_STMT): Delete.
|
||||
(GIMPLE_STMT_TO_TREE): Delete.
|
||||
(GIMPLE_STMT_OPERAND): Use union, not cast.
|
||||
(GIMPLE_STMT_LOCUS): New.
|
||||
(GIMPLE_STMT_BLOCK): New.
|
||||
* gimplify.c (tree_to_gimple_tuple): Use union. Do not cast
|
||||
to tree_base.
|
||||
* tree-cfg.c (verify_gimple_tuples_1): Call gcc_unreachable.
|
||||
|
||||
2006-09-21 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-into-ssa.c (REGISTER_DEFS_IN_STMT): Change common.base
|
||||
to base.
|
||||
* tree-tailcall.c (adjust_return_value): Same.
|
||||
* tree.c (tree_code_size): Remove GIMPLE_STATEMENT_LIST case.
|
||||
(copy_node_stat): Change common.base to base.
|
||||
(tree_node_structure): Return TS_GIMPLE_STATEMENT for tcc_gimple_stmt.
|
||||
Remove GIMPLE_STATEMENT_LIST case.
|
||||
* tree.h (struct gimple_stmt): Make operands of type tree.
|
||||
(TREE_CODE, TREE_SET_CODE, TREE_ADDRESSABLE, CALL_EXPR_TAILCALL,
|
||||
CASE_LOW_SEEN, TREE_STATIC, CLEANUP_EH_ONLY, CASE_HIGH_SEEN,
|
||||
TREE_NO_WARNING, TREE_CONSTANT_OVERFLOW, TREE_SYMBOL_REFERENCED,
|
||||
TYPE_REF_CAN_ALIAS_ALL, TREE_OVERFLOW, TREE_PUBLIC,
|
||||
TYPE_CACHED_VALUES_P, TREE_SIDE_EFFECTS, FORCED_LABEL,
|
||||
TREE_THIS_VOLATILE, TREE_THIS_NOTRAP, TREE_READONLY,
|
||||
TREE_CONSTANT, TYPE_SIZES_GIMPLIFIED, DECL_UNSIGNED,
|
||||
BIT_FIELD_REF_UNSIGNED, TYPE_UNSIGNED, TREE_ASM_WRITTEN, TREE_USED,
|
||||
TREE_NOTHROW, CALL_EXPR_RETURN_SLOT_OPT, DECL_BY_REFERENCE,
|
||||
CALL_FROM_THUNK_P, TYPE_ALIGN_OK, TREE_PRIVATE, TREE_PROTECTED,
|
||||
TREE_DEPRECATED, IDENTIFIER_TRANSPARENT_ALIAS, TREE_INVARIANT,
|
||||
TREE_LANG_FLAG_*, SSA_NAME_OCCURS_IN_ABNORMAL_PHI,
|
||||
SSA_NAME_IN_FREE_LIST, TYPE_VOLATILE, TYPE_READONLY, BINFO_VIRTUAL_P):
|
||||
Change common.base to base.
|
||||
(GIMPLE_STATEMENT_LIST*): Remove.
|
||||
(union tree_node): Add base. Remove gimple_statement_list.
|
||||
Remove pointer from gstmt.
|
||||
* tree-ssa-propagate.c (set_rhs): Change common.base to base.
|
||||
* treestruct.def: Add TS_BASE. Remove TS_GIMPLE_STATEMENT_LIST.
|
||||
* tree-vn.c (vn_compute): Change common.base to base.
|
||||
* tree-eh.c (verify_eh_throw_stmt_node): Same.
|
||||
* tree-flow-inline.h (var_ann): Same.
|
||||
(function_ann): Same.
|
||||
(stmt_ann): Same.
|
||||
(mark_non_addressable): Same.
|
||||
* gimplify.c (tree_to_gimple_tuple): Same.
|
||||
* tree.def (DEFTREECODE): Remove GIMPLE_STATEMENT_LIST.
|
||||
* tree-dfa.c (create_var_ann): Change common.base to base.
|
||||
(create_function_ann): Same.
|
||||
(create_stmt_ann): Same.
|
||||
(create_tree_ann): Same.
|
||||
(collect_dfa_stats_r): Same.
|
||||
* tree-ssa-pre.c (NECESSARY): Change common.base to base.
|
||||
* tree-ssa-dce.c (NECESSARY): Same.
|
||||
* tree-ssa.c (delete_tree_ssa): Same.
|
||||
* tree-optimize.c (execute_free_cfg_annotations): Same.
|
||||
* tree-flow.h: Same.
|
||||
|
||||
2006-09-19 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree.c (tree_code_size): Handle GIMPLE_STATEMENT_LIST.
|
||||
(tree_node_structure): Handle GIMPLE_STATEMENT_LIST and
|
||||
GIMPLE_MODIFY_STMT.
|
||||
* tree.h (struct gimple_stmt): Add prev and next fields.
|
||||
(GIMPLE_STMT_TO_TREE): Cast, do not call GIMPLE_STMT_CHECK.
|
||||
(GIMPLE_STATEMENT_LIST_HEAD): New.
|
||||
(GIMPLE_STATEMENT_LIST_TAIL): New.
|
||||
(struct gimple_statement_list): New.
|
||||
(union tree_node): Add gimple_stmt_list and gstmt.
|
||||
* treestruct.def: Add TS_GIMPLE_STATEMENT_LIST, TS_GIMPLE_STATEMENT.
|
||||
* tree.def: Add GIMPLE_STATEMENT_LIST.
|
||||
|
||||
2006-09-06 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-dump.c (dequeue_and_dump): Handle GIMPLE_MODIFY_STMT.
|
||||
* tree-vrp.c (build_assert_expr_for): Change uses of
|
||||
MODIFY_EXPR to GIMPLE_MODIFY_STMT and adjust accordingly.
|
||||
(find_assert_locations): Same.
|
||||
(remove_range_assertions): Same.
|
||||
(stmt_interesting_for_vrp): Same.
|
||||
(vrp_visit_assignment): Same.
|
||||
(vrp_visit_stmt): Same.
|
||||
(simplify_cond_using_ranges): Same.
|
||||
* tree-into-ssa.c (REGISTER_DEFS_IN_THIS_STMT): Adjust for new
|
||||
tree structure.
|
||||
* tree-ssa-loop-im.c (movement_possibility): Change uses of
|
||||
MODIFY_EXPR to GIMPLE_MODIFY_STMT and adjust accordingly.
|
||||
(stmt_cost): Same.
|
||||
(determine_invariantness_stmt): Same.
|
||||
(schedule_sm): Same.
|
||||
(gather_mem_refs_stmt): Same.
|
||||
* tree-complex.c (init_dont_simulate_again): Same.
|
||||
(complex_visit_stmt): Same.
|
||||
(set_component_ssa_name): Same.
|
||||
(expand_complex_move): Same.
|
||||
(expand_complex_div_wide): Same.
|
||||
(expand_complex_comparison): Same.
|
||||
(expand_complex_operations_1): Same.
|
||||
* tree-ssa-loop-niter.c (expand_simple_operations): Same.
|
||||
(chain_of_csts_start): Same.
|
||||
(infer_loop_bounds_from_undefined): Same.
|
||||
* tree-pretty-print.c (dump_generic_node): Same.
|
||||
(op_prio): Same.
|
||||
(op_symbol_1): Same.
|
||||
* tree-ssa-loop-manip.c (create_iv): Same.
|
||||
* value-prof.c (tree_divmod_fixed_value): Same.
|
||||
(tree_divmod_fixed_value_transform): Same.
|
||||
(tree_mod_pow2): Same.
|
||||
(tree_mod_pow2_value_transform): Same.
|
||||
(tree_mod_subtract): Same.
|
||||
(tree_mod_subtract_transform): Same.
|
||||
(tree_divmod_values_to_profile): Same.
|
||||
* tree-tailcall.c (process_assignment): Same.
|
||||
(find_tail_calls): Same.
|
||||
(adjust_accumulator_values): Same.
|
||||
(adjust_return_value): Same.
|
||||
(eliminate_tail_call): Same.
|
||||
* tree.c (tree_code_size): Handle tcc_gimple_stmt.
|
||||
(make_node_stat): Same.
|
||||
(copy_node_stat): Handle gimple tuples.
|
||||
(expr_align): Handle GIMPLE_MODIFY_STMT. Abort on MODIFY_EXPR.
|
||||
(tree_node_structure): Handle tcc_gimple_stmt.
|
||||
(build2_stat): Abort on MODIFY_EXPR after gimplification. Handle
|
||||
tcc_gimple_stmt.
|
||||
(build2_gimple_stat): New.
|
||||
(expr_location): New.
|
||||
(set_expr_location): New.
|
||||
(expr_has_location): New.
|
||||
(expr_locus): New.
|
||||
(set_expr_locus): New.
|
||||
(expr_filename): New.
|
||||
(expr_lineno): New.
|
||||
(walk_tree): Handle tcc_gimple_stmt.
|
||||
(tree_block): New.
|
||||
(protected_tree_operand): New.
|
||||
(protected_tree_type): New.
|
||||
(tree_code_kind): Add gimple statements.
|
||||
* tree.h (tree_code_class): Add tcc_gimple_stmt.
|
||||
(IS_GIMPLE_STMT_CODE_CLASS): New.
|
||||
(struct tree_base): New.
|
||||
(struct tree_common): Shrink.
|
||||
(struct gimple_stmt): New.
|
||||
(struct gimple_expr): New.
|
||||
(TREE_SET_CODE, TREE_ADDRESSABLE, CALL_EXPR_TAILCALL,
|
||||
CASE_LOW_SEEN, TREE_STATIC, CLEANUP_EH_ONLY, CASE_HIGH_SEEN,
|
||||
TREE_NO_WARNING, TREE_CONSTANT_OVERFLOW, TREE_SYMBOL_REFERENCED,
|
||||
TYPE_REF_CAN_ALIAS_ALL, TREE_OVERFLOW, TREE_PUBLIC,
|
||||
TYPE_CACHED_VALUES_P, SAVE_EXPR_RESOLVED_P, TREE_SIDE_EFFECTS,
|
||||
FORCED_LABEL, TREE_THIS_VOLATILE, TREE_THIS_NOTRAP, TREE_READONLY,
|
||||
TREE_CONSTANT, TYPE_SIZES_GIMPLIFIED, DECL_UNSIGNED,
|
||||
BIT_FIELD_REF_UNSIGNED, TYPE_UNSIGNED, TREE_ASM_WRITTEN,
|
||||
TREE_USED, TREE_NOTHROW, CALL_EXPR_RETURN_SLOT_OPT,
|
||||
DECL_BY_REFERENCE, CALL_FROM_THUNK_P, TYPE_ALIGN_OK,
|
||||
TREE_PRIVATE, TREE_PROTECTED, TREE_DEPRECATED,
|
||||
IDENTIFIER_TRANSPARENT_ALIAS, TREE_INVARIANT,
|
||||
TREE_LANG_FLAG_[0-6], SSA_NAME_CHECK, SSA_NAME_IN_FREE_LIST,
|
||||
TYPE_VOLATILE, TYPE_READONLY, TREE_VISITED, BINFO_VIRTUAL_P):
|
||||
Adjust for new `common' layout.
|
||||
(struct tree_function_decl): Add gimplified_flag.
|
||||
(DECL_GIMPLIFIED): NEW.
|
||||
(EXPR_LOCATION, SET_EXPR_LOCUS, EXPR_FILENAME, EXPR_LOCUS,
|
||||
SET_EXPR_LOCUS, SET_EXPR_LOCATION, EXPR_LINENO,
|
||||
EXPR_HAS_LOCATION): Call corresponding function.
|
||||
(GIMPLE_STMT_CHECK): New.
|
||||
(TREE_OPERAND_CHECK, TREE_TYPE, TREE_CHAIN): Abort on gimple tuples.
|
||||
(TREE_BLOCK): Call tree_block.
|
||||
(GIMPLE_STMT_P): New.
|
||||
(GIMPLE_TUPLE_P): New.
|
||||
(TREE_TO_GIMPLE_STMT): New.
|
||||
(GIMPLE_STMT_TO_TREE): New.
|
||||
(GIMPLE_STMT_OPERAND): New.
|
||||
(GIMPLE_TUPLE_HAS_LOCUS_P): New.
|
||||
(PROTECTED_TREE_OPERAND): New.
|
||||
(PROTECTED_TREE_TYPE): New.
|
||||
(build2_gimple_stat): Protoize.
|
||||
(build2_gimple): New.
|
||||
(expr_location): Protoize.
|
||||
(set_expr_location): Protoize.
|
||||
(expr_has_location): Protoize.
|
||||
(expr_locus): Protoize.
|
||||
(set_expr_locus): Protoize.
|
||||
(expr_filename): Protoize.
|
||||
(expr_lineno): Protoize.
|
||||
(tree_block): Protoize.
|
||||
(protected_tree_operand): Protoize.
|
||||
(protected_tree_type): Protoize.
|
||||
(enum tree_node_kind): Add gimple_stmt_kind.
|
||||
* c-decl.c (union lang_tree_node): Tuples do not have a
|
||||
TREE_CHAIN.
|
||||
* ipa-cp.c (constant_val_insert): Change uses of MODIFY_EXPR to
|
||||
GIMPLE_MODIFY_STMT and adjust accordingly.
|
||||
* tree-scalar-evolution.c (follow_ssa_edge): Same.
|
||||
(interpret_condition_phi): Same.
|
||||
(pointer_used_p): Same.
|
||||
(analyze_scalar_evolution_1): Same.
|
||||
(scev_const_prop): Same.
|
||||
(interpret_rhs_modify_stmt): Rename from
|
||||
interpret_rhs_modify_expr.
|
||||
* builtins.c (std_expand_builtin_va_start): Change uses of
|
||||
MODIFY_EXPR to GIMPLE_MODIFY_STMT and adjust accordingly.
|
||||
(std_gimplify_va_arg_expr): Same.
|
||||
(expand_builtin_va_copy): Same.
|
||||
(integer_valued_real_p): Same.
|
||||
* fold-const.c (maybe_lvalue_p): Same.
|
||||
(fold_unary): Same.
|
||||
(tree_expr_nonnegative_p): Same.
|
||||
(tree_expr_nonzero_p): Same.
|
||||
* omp-low.c (extract_omp_for_data): Same.
|
||||
(lower_rec_input_clauses): Same.
|
||||
(lower_reduction_clauses): Same.
|
||||
(lower_copyprivate_clauses): Same.
|
||||
(lower_send_clauses): Same.
|
||||
(lower_send_shared_vars): Same.
|
||||
(expand_parallel_call): Same.
|
||||
(expand_omp_parallel): Same.
|
||||
(expand_omp_for_generic): Same.
|
||||
(expand_omp_for_static_nochunk): Same.
|
||||
(expand_omp_for_static_chunk): Same.
|
||||
(expand_omp_sections): Same.
|
||||
(lower_omp_single_copy): Same.
|
||||
(lower_omp_parallel): Same.
|
||||
* tree-ssa-dse.c (memory_address_same): Same.
|
||||
(dse_optimize_stmt): Same.
|
||||
* ipa-reference.c (scan_for_static_refs): Same.
|
||||
* tree-gimple.c (is_gimple_reg_rhs): Same.
|
||||
(get_call_expr_in): Same.
|
||||
(recalculate_side_effects): Same.
|
||||
* cgraphunit.c (cgraph_create_edges): Same.
|
||||
* tree-ssa-copyrename.c (rename_ssa_copies): Same.
|
||||
* tree-ssa-ccp.c (get_default_value): Same.
|
||||
(likely_value): Same.
|
||||
(visit_assignment): Same.
|
||||
(ccp_visit_stmt): Same.
|
||||
(get_maxval_strlen): Same.
|
||||
(ccp_fold_builtin): Same.
|
||||
* tree-ssa-loop-ivopts.c (find_givs_in_stmt_scev): Same.
|
||||
(find_givs_in_stmt): Same.
|
||||
(find_interesting_uses_op): Same.
|
||||
(find_interesting_uses_stmt): Same.
|
||||
(rewrite_use_nonlinear_expr): Same.
|
||||
* ipa-pure-const.c (scan_function): Same.
|
||||
* tree-stdarg.c (va_list_counter_bump): Same.
|
||||
(check_all_va_list_escapes): Same.
|
||||
(execute_optimize_stdarg): Same.
|
||||
* tree-ssa-math-opts.c (compute_merit): Same.
|
||||
(insert_reciprocals): Same.
|
||||
(execute_cse_reciprocals): Same.
|
||||
* tree-ssa-dom.c (initialize_hash_element): Same.
|
||||
(simple_iv_increment_p): Same.
|
||||
(record_equivalences_from_stmt): Same.
|
||||
(optimize_stmt): Same.
|
||||
(remove_stmt_or_phi): Same.
|
||||
(get_rhs_or_phi_arg): Same.
|
||||
(get_lhs_or_phi_result): Same.
|
||||
(propagate_rhs_into_lhs): Same.
|
||||
* tree-nrv.c (tree_nrv): Same.
|
||||
(execute_return_slot_opt): Same.
|
||||
* tree-ssa-propagate.c (get_rhs): Same.
|
||||
(set_rhs): Same.
|
||||
(stmt_makes_single_load): Same.
|
||||
(stmt_makes_single_store): Same.
|
||||
(replace_vuses_in): Same.
|
||||
(fold_predicate_in): Same.
|
||||
(substitute_and_fold): Same.
|
||||
* tree-ssa-alias.c (compute_call_clobbered): Same.
|
||||
(recalculate_used_alone): Same.
|
||||
(count_uses_and_derefs): Same.
|
||||
(is_escape_site): Same.
|
||||
(find_used_portions): Same.
|
||||
* gimple-low.c (lower_stmt): Same.
|
||||
(block_may_fallthru): Same.
|
||||
(lower_return_expr): Same.
|
||||
* tree-ssa-sink.c (is_hidden_global_store): Same.
|
||||
(statement_sink_location): Same.
|
||||
* dwarf2out.c (loc_descriptor_from_tree_1): Same.
|
||||
* expr.c (safe_from_p): Same.
|
||||
(expand_expr_real): Same.
|
||||
(expand_expr_real_1): Same.
|
||||
* tree-ssa-loop-ivcanon.c (empty_loop_p): Same.
|
||||
* predict.c (expr_expected_value): Same.
|
||||
(strip_builtin_expect): Same.
|
||||
(apply_return_prediction): Same.
|
||||
(tree_bb_level_predictions): Same.
|
||||
(tree_estimate_probability): Same.
|
||||
* tree-vn.c (vn_compute): Same.
|
||||
* tree-eh.c (add_stmt_to_eh_region_fn): Same.
|
||||
(remove_stmt_from_eh_region_fn): Same.
|
||||
(do_return_redirection): Same.
|
||||
(honor_protect_cleanup_actions): Same.
|
||||
(lower_try_finally_switch): Same.
|
||||
(lower_eh_constructs_1): Same.
|
||||
(tree_could_throw_p): Same.
|
||||
(verify_eh_throw_stmt_node): Same.
|
||||
* function.c (gimplify_parameters): Same.
|
||||
* tree-vectorizer.c (vect_is_simple_use): Same.
|
||||
(vect_is_simple_reduction): Same.
|
||||
* ipa-type-escape.c (scan_for_refs): Same.
|
||||
* tree-if-conv.c (tree_if_conversion): Same.
|
||||
(tree_if_convert_stmt): Same.
|
||||
(if_convertible_gimplify_modify_stmt_p): Rename from
|
||||
if_convertible_modify_expr_p.
|
||||
(if_convertible_stmt_p): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(ifc_temp_var): Same.
|
||||
(replace_phi_with_cond_modify_stmt): Rename from
|
||||
replace_phi_with_cond_modify_expr.
|
||||
(process_phi_nodes): Call replace_phi_with_cond_modify_stmt.
|
||||
* tree.def (DEFTREECODE): Add GIMPLE_MODIFY_STMT.
|
||||
* tree-data-ref.c (find_data_references_in_loop): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
* tree-flow-inline.h (var_ann): Same.
|
||||
(function_ann): Same.
|
||||
(stmt_ann): Same.
|
||||
(mark_non_addressable): Same.
|
||||
* tree-vect-analyze.c (vect_determine_vectorization_factor): Same.
|
||||
* gimplify.c (tree_to_gimple_tuple): New.
|
||||
(build_stack_save_restore): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(gimplify_return_expr): Same.
|
||||
(gimplify_decl_expr): Same.
|
||||
(gimplify_self_mod_expr): Same.
|
||||
(gimplify_cond_expr): Same.
|
||||
(gimplify_init_constructor): Same.
|
||||
(gimplify_modify_expr): Same.
|
||||
(gimplify_expr): Same.
|
||||
(gimplify_function_tree): Same.
|
||||
(force_gimple_operand): Same.
|
||||
* tree-ssa-phiopt.c (conditional_replacement): Same.
|
||||
(minmax_replacement): Same.
|
||||
(abs_replacement): Same.
|
||||
* tree-dfa.c (create_var_ann): Same.
|
||||
(create_function_ann): Same.
|
||||
(create_stmt_ann): Same.
|
||||
(create_tree_ann): Same.
|
||||
(collect_dfa_stats_r): Same.
|
||||
* tree-ssa-pre.c (find_or_generate_expression): Same.
|
||||
(create_expression_by_pieces): Same.
|
||||
(try_look_through_load): Same.
|
||||
(insert_fake_stores): Same.
|
||||
(realify_fake_stores): Same.
|
||||
(compute_avail): Same.
|
||||
(eliminate): Same.
|
||||
(init_pre): Same.
|
||||
(poolify_modify_stmt): Rename from poolify_modify_stmt.
|
||||
Adjust for GIMPLE_MODIFY_STMT.
|
||||
(NECESSARY): Adjust for new `common' layout.
|
||||
* tree-ssa-live.c (build_tree_conflict_graph): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
* tree-sra.c (sra_walk_modify_stmt): Rename from
|
||||
sra_walk_modify_expr.
|
||||
(sra_walk_function): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(generate_copy_inout): Same.
|
||||
(generate_element_copy): Same.
|
||||
(generate_element_zero): Same.
|
||||
(scalarize_copy): Same.
|
||||
* tree-mudflap.c (mf_decl_cache_locals): Same.
|
||||
(mf_build_check_statement_for): Same.
|
||||
(mf_xform_derefs): Same.
|
||||
* ipa-prop.c (ipa_method_modify_stmt): Same.
|
||||
* print-tree.c (print_node): Handle gimple tuples.
|
||||
Add case for tcc_gimple_stmt.
|
||||
* tree-ssa-copy.c (stmt_may_generate_copy): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(copy_prop_visit_assignment): Same.
|
||||
(copy_prop_visit_stmt): Same.
|
||||
(init_copy_prop): Same.
|
||||
* tree-ssa-forwprop.c (ssa_name_defined_by_comparison_p): Same.
|
||||
(forward_propagate_into_cond_1): Same.
|
||||
(find_equivalent_equality_comparison): Same.
|
||||
(tidy_after_forward_propagate_addr): Same.
|
||||
(forward_propagate_addr_expr_1): Same.
|
||||
(simplify_not_neg_expr): Same.
|
||||
(simplify_switch_expr): Same.
|
||||
* tree-ssa-dce.c (find_pdom): Same.
|
||||
(mark_stmt_if_obviously_necessary): Same.
|
||||
(NECESSARY): Adjust for new `common' layout.
|
||||
* tree-flow.h: Same.
|
||||
* tree-vect-patterns.c (widened_name_p): Adjust for
|
||||
GIMPLE_MODIFY_STMT.
|
||||
(vect_recog_dot_prod_pattern): Same.
|
||||
(vect_recog_widen_sum_pattern): Same.
|
||||
(vect_pattern_recog_1): Same.
|
||||
* tree-nested.c (init_tmp_var): Same.
|
||||
(save_tmp_var): Same.
|
||||
(walk_stmts): Same.
|
||||
(convert_call_expr): Same.
|
||||
(finalize_nesting_tree_1): Same.
|
||||
* tree-ssa.c (verify_ssa): Same.
|
||||
(delete_tree_ssa): Same.
|
||||
* lambda-code.c (lbv_to_gcc_expression): Same.
|
||||
(lle_to_gcc_expression): Same.
|
||||
(lambda_loopnest_to_gcc_loopnest): Same.
|
||||
(can_put_in_inner_loop): Same.
|
||||
(can_convert_to_perfect_nest): Same.
|
||||
(perfect_nestify): Same.
|
||||
* tree-ssa-loop-prefetch.c (gather_memory_references): Same.
|
||||
* tree-inline.c (copy_body_r): Same.
|
||||
(setup_one_parameter): Same.
|
||||
(initialize_inlined_parameters): Same.
|
||||
(estimate_num_insns_1): Same.
|
||||
(expand_call_inline): Same.
|
||||
(gimple_expand_calls_inline): Same.
|
||||
(copy_tree_r): Same.
|
||||
* tree-optimize.c (execute_free_cfg_annotations): Same.
|
||||
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Same.
|
||||
(vect_align_data_ref): Same.
|
||||
(vect_create_data_ref_ptr): Same.
|
||||
(vect_init_vector): Same.
|
||||
(vect_create_epilog_for_reduction): Same.
|
||||
(vectorizable_reduction): Same.
|
||||
(vectorizable_assignment): Same.
|
||||
(vectorizable_operation): Same.
|
||||
(vectorizable_store): Same.
|
||||
(vectorizable_load): Same.
|
||||
(vectorizable_live_operation): Same.
|
||||
(vectorizable_condition): Same.
|
||||
(vect_generate_tmps_on_preheader): Same.
|
||||
(vect_create_cond_for_align_checks): Same.
|
||||
* tree-object-size.c (collect_object_sizes_for): Same.
|
||||
(check_for_plus_in_loops_1): Same.
|
||||
(check_for_plus_in_loops): Same.
|
||||
* tree-outof-ssa.c (insert_copy_on_edge): Same.
|
||||
(replace_use_variable): Same.
|
||||
(check_replaceable): Same.
|
||||
(rewrite_trees): Same.
|
||||
(identical_copies_p): Same.
|
||||
(insert_backedge_copies): Same.
|
||||
* tree-profile.c (tree_gen_edge_profiler): Same.
|
||||
* tree-vect-generic.c (expand_vector_operations_1): Same.
|
||||
* tree-ssa-structalias.c (update_alias_info): Same.
|
||||
(find_func_aliases): Same.
|
||||
* tree-cfg.c (factor_computed_gotos): Same.
|
||||
(make_edges): Same.
|
||||
(make_goto_expr_edges): Same.
|
||||
(tree_merge_blocks): Same.
|
||||
(remove_useless_stmts_cond): Same.
|
||||
(remove_useless_stmts_1): Same.
|
||||
(tree_find_edge_insert_loc): Same.
|
||||
(verify_expr): Same.
|
||||
(gimplify_val): Same.
|
||||
(verify_gimple_tuples_1): New.
|
||||
(verify_gimple_tuples): New.
|
||||
(verify_stmts): Call verify_gimple_tuples.
|
||||
* tree-ssa-reassoc.c (get_rank): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(get_unary_op): Same.
|
||||
(linearize_expr): Same.
|
||||
(get_single_immediate_use): Same.
|
||||
(negate_value): Same.
|
||||
(should_break_up_subtract): Same.
|
||||
(break_up_subtract): Same.
|
||||
(repropagate_negates): Same.
|
||||
(break_up_subtract_bb): Same.
|
||||
(reassociate_bb): Same.
|
||||
* config/i386/i386.c (ix86_va_start): Same.
|
||||
(ix86_gimplify_va_arg): Same.
|
||||
* stmt.c (expand_expr_stmt): Same.
|
||||
(warn_if_unused_value): Same.
|
||||
(expand_return): Same.
|
||||
* tree-ssanames.c (make_ssa_name): Same.
|
||||
* tree-ssa-threadedge.c (lhs_of_dominating_assert): Same.
|
||||
* tree-ssa-operands.c (finalize_ssa_defs): Same.
|
||||
(add_virtual_operand): Same.
|
||||
(get_expr_operands): Same.
|
||||
(parse_ssa_operands): Same.
|
||||
(get_modify_stmt_operands): Rename from get_modify_expr_operands.
|
||||
|
||||
2006-12-05 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config.host: Remove extra blank line.
|
||||
|
@ -36,7 +36,8 @@ enum gnat_tree_code {
|
||||
/* Ada uses the lang_decl and lang_type fields to hold a tree. */
|
||||
union lang_tree_node
|
||||
GTY((desc ("0"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.t)")))
|
||||
chain_next ("(GIMPLE_STMT_P (&%h.t) ? (union lang_tree_node *) 0 : (union lang_tree_node *)TREE_CHAIN (&%h.t))")))
|
||||
|
||||
{
|
||||
union tree_node GTY((tag ("0"))) t;
|
||||
};
|
||||
|
@ -4840,7 +4840,7 @@ gnat_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
|
||||
&& TREE_CODE_CLASS (TREE_CODE (op)) != tcc_constant)
|
||||
{
|
||||
tree new_var = create_tmp_var (TREE_TYPE (op), "A");
|
||||
tree mod = build2 (MODIFY_EXPR, TREE_TYPE (op), new_var, op);
|
||||
tree mod = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (op), new_var, op);
|
||||
|
||||
TREE_ADDRESSABLE (new_var) = 1;
|
||||
|
||||
|
@ -4319,7 +4319,7 @@ std_expand_builtin_va_start (tree valist, rtx nextarg)
|
||||
{
|
||||
tree t;
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist,
|
||||
make_tree (ptr_type_node, nextarg));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
|
||||
@ -4390,12 +4390,12 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
&& !integer_zerop (TYPE_SIZE (type)))
|
||||
{
|
||||
t = fold_convert (TREE_TYPE (valist), size_int (boundary - 1));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist_tmp,
|
||||
build2 (PLUS_EXPR, TREE_TYPE (valist), valist_tmp, t));
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = fold_convert (TREE_TYPE (valist), size_int (-boundary));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist_tmp,
|
||||
build2 (BIT_AND_EXPR, TREE_TYPE (valist), valist_tmp, t));
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
@ -4434,7 +4434,7 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
/* Compute new value for AP. */
|
||||
t = fold_convert (TREE_TYPE (valist), rounded_size);
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (valist), valist_tmp, t);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
addr = fold_convert (build_pointer_type (type), addr);
|
||||
@ -4599,7 +4599,7 @@ expand_builtin_va_copy (tree arglist)
|
||||
|
||||
if (TREE_CODE (va_list_type_node) != ARRAY_TYPE)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, va_list_type_node, dst, src);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, va_list_type_node, dst, src);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -6738,9 +6738,9 @@ integer_valued_real_p (tree t)
|
||||
return integer_valued_real_p (TREE_OPERAND (t, 0));
|
||||
|
||||
case COMPOUND_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case BIND_EXPR:
|
||||
return integer_valued_real_p (TREE_OPERAND (t, 1));
|
||||
return integer_valued_real_p (GENERIC_TREE_OPERAND (t, 1));
|
||||
|
||||
case PLUS_EXPR:
|
||||
case MINUS_EXPR:
|
||||
@ -8096,7 +8096,7 @@ fold_builtin_memset (tree arglist, tree type, bool ignore)
|
||||
}
|
||||
|
||||
ret = build_int_cst_type (TREE_TYPE (var), cval);
|
||||
ret = build2 (MODIFY_EXPR, TREE_TYPE (var), var, ret);
|
||||
ret = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), var, ret);
|
||||
if (ignore)
|
||||
return ret;
|
||||
|
||||
@ -8251,7 +8251,7 @@ fold_builtin_memory_op (tree arglist, tree type, bool ignore, int endp)
|
||||
expr = fold_convert (TREE_TYPE (destvar), srcvar);
|
||||
else
|
||||
expr = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (destvar), srcvar);
|
||||
expr = build2 (MODIFY_EXPR, TREE_TYPE (destvar), destvar, expr);
|
||||
expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (destvar), destvar, expr);
|
||||
}
|
||||
|
||||
if (ignore)
|
||||
@ -9474,7 +9474,7 @@ fold_builtin (tree fndecl, tree arglist, bool ignore)
|
||||
tree exp = fold_builtin_1 (fndecl, arglist, ignore);
|
||||
if (exp && !ignore)
|
||||
{
|
||||
exp = build1 (NOP_EXPR, TREE_TYPE (exp), exp);
|
||||
exp = build1 (NOP_EXPR, GENERIC_TREE_TYPE (exp), exp);
|
||||
TREE_NO_WARNING (exp) = 1;
|
||||
}
|
||||
|
||||
@ -11704,9 +11704,11 @@ do_mpfr_sincos (tree arg, tree arg_sinp, tree arg_cosp)
|
||||
&& TYPE_MAIN_VARIANT (TREE_TYPE (arg_cosp)) == TYPE_MAIN_VARIANT (type))
|
||||
{
|
||||
/* Set the values. */
|
||||
result_s = fold_build2 (MODIFY_EXPR, type, arg_sinp, result_s);
|
||||
result_s = fold_build2 (GIMPLE_MODIFY_STMT, type, arg_sinp,
|
||||
result_s);
|
||||
TREE_SIDE_EFFECTS (result_s) = 1;
|
||||
result_c = fold_build2 (MODIFY_EXPR, type, arg_cosp, result_c);
|
||||
result_c = fold_build2 (GIMPLE_MODIFY_STMT, type, arg_cosp,
|
||||
result_c);
|
||||
TREE_SIDE_EFFECTS (result_c) = 1;
|
||||
/* Combine the assignments into a compound expr. */
|
||||
result = non_lvalue (fold_build2 (COMPOUND_EXPR, type,
|
||||
|
@ -256,7 +256,7 @@ extern char C_SIZEOF_STRUCT_LANG_IDENTIFIER_isnt_accurate
|
||||
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : (union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
|
||||
chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : (GIMPLE_TUPLE_P (&%h.generic) ? (union lang_tree_node *) 0 : (union lang_tree_node *) TREE_CHAIN (&%h.generic))")))
|
||||
{
|
||||
union tree_node GTY ((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)")))
|
||||
@ -434,7 +434,7 @@ add_stmt (tree t)
|
||||
{
|
||||
enum tree_code code = TREE_CODE (t);
|
||||
|
||||
if (EXPR_P (t) && code != LABEL_EXPR)
|
||||
if (CAN_HAVE_LOCATION_P (t) && code != LABEL_EXPR)
|
||||
{
|
||||
if (!EXPR_HAS_LOCATION (t))
|
||||
SET_EXPR_LOCATION (t, input_location);
|
||||
|
@ -2172,7 +2172,7 @@ c_parser_typeof_specifier (c_parser *parser)
|
||||
if (DECL_P (e) || CONSTANT_CLASS_P (e))
|
||||
e = build1 (NOP_EXPR, void_type_node, e);
|
||||
|
||||
if (EXPR_P (e))
|
||||
if (CAN_HAVE_LOCATION_P (e))
|
||||
SET_EXPR_LOCATION (e, input_location);
|
||||
|
||||
add_stmt (e);
|
||||
@ -3817,7 +3817,7 @@ c_parser_statement_after_labels (c_parser *parser)
|
||||
(recursively) all of the component statements should already have
|
||||
line numbers assigned. ??? Can we discard no-op statements
|
||||
earlier? */
|
||||
if (stmt && EXPR_P (stmt))
|
||||
if (stmt && CAN_HAVE_LOCATION_P (stmt))
|
||||
SET_EXPR_LOCATION (stmt, loc);
|
||||
}
|
||||
|
||||
@ -3836,7 +3836,7 @@ c_parser_paren_condition (c_parser *parser)
|
||||
loc = c_parser_peek_token (parser)->location;
|
||||
cond = c_objc_common_truthvalue_conversion
|
||||
(c_parser_expression_conv (parser).value);
|
||||
if (EXPR_P (cond))
|
||||
if (CAN_HAVE_LOCATION_P (cond))
|
||||
SET_EXPR_LOCATION (cond, loc);
|
||||
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>");
|
||||
return cond;
|
||||
@ -4073,7 +4073,7 @@ c_parser_for_statement (c_parser *parser)
|
||||
{
|
||||
tree ocond = c_parser_expression_conv (parser).value;
|
||||
cond = c_objc_common_truthvalue_conversion (ocond);
|
||||
if (EXPR_P (cond))
|
||||
if (CAN_HAVE_LOCATION_P (cond))
|
||||
SET_EXPR_LOCATION (cond, loc);
|
||||
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
|
||||
}
|
||||
@ -7424,7 +7424,7 @@ c_parser_omp_for_loop (c_parser *parser)
|
||||
{
|
||||
cond = c_parser_expression_conv (parser).value;
|
||||
cond = c_objc_common_truthvalue_conversion (cond);
|
||||
if (EXPR_P (cond))
|
||||
if (CAN_HAVE_LOCATION_P (cond))
|
||||
SET_EXPR_LOCATION (cond, input_location);
|
||||
}
|
||||
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
|
||||
|
@ -1795,13 +1795,15 @@ pp_c_conditional_expression (c_pretty_printer *pp, tree e)
|
||||
static void
|
||||
pp_c_assignment_expression (c_pretty_printer *pp, tree e)
|
||||
{
|
||||
if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
|
||||
if (TREE_CODE (e) == MODIFY_EXPR
|
||||
|| TREE_CODE (e) == GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (e) == INIT_EXPR)
|
||||
{
|
||||
pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
|
||||
pp_c_unary_expression (pp, GENERIC_TREE_OPERAND (e, 0));
|
||||
pp_c_whitespace (pp);
|
||||
pp_equal (pp);
|
||||
pp_space (pp);
|
||||
pp_c_expression (pp, TREE_OPERAND (e, 1));
|
||||
pp_c_expression (pp, GENERIC_TREE_OPERAND (e, 1));
|
||||
}
|
||||
else
|
||||
pp_c_conditional_expression (pp, e);
|
||||
@ -1942,6 +1944,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case INIT_EXPR:
|
||||
pp_assignment_expression (pp, e);
|
||||
break;
|
||||
|
@ -7450,7 +7450,7 @@ c_process_expr_stmt (tree expr)
|
||||
if (DECL_P (expr) || CONSTANT_CLASS_P (expr))
|
||||
expr = build1 (NOP_EXPR, TREE_TYPE (expr), expr);
|
||||
|
||||
if (EXPR_P (expr))
|
||||
if (CAN_HAVE_LOCATION_P (expr))
|
||||
SET_EXPR_LOCATION (expr, input_location);
|
||||
|
||||
return expr;
|
||||
@ -7587,7 +7587,7 @@ c_finish_stmt_expr (tree body)
|
||||
{
|
||||
/* Do not warn if the return value of a statement expression is
|
||||
unused. */
|
||||
if (EXPR_P (last))
|
||||
if (CAN_HAVE_LOCATION_P (last))
|
||||
TREE_NO_WARNING (last) = 1;
|
||||
return last;
|
||||
}
|
||||
|
@ -591,8 +591,8 @@ cgraph_create_edges (struct cgraph_node *node, tree body)
|
||||
bb->loop_depth);
|
||||
walk_tree (&TREE_OPERAND (call, 1),
|
||||
record_reference, node, visited_nodes);
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
walk_tree (&TREE_OPERAND (stmt, 0),
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
walk_tree (&GIMPLE_STMT_OPERAND (stmt, 0),
|
||||
record_reference, node, visited_nodes);
|
||||
}
|
||||
else
|
||||
|
@ -5921,11 +5921,11 @@ va_list_skip_additions (tree lhs)
|
||||
if (TREE_CODE (stmt) == PHI_NODE)
|
||||
return stmt;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
|| TREE_OPERAND (stmt, 0) != lhs)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
|| GIMPLE_STMT_OPERAND (stmt, 0) != lhs)
|
||||
return lhs;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
|
||||
rhs = TREE_OPERAND (rhs, 0);
|
||||
|
||||
@ -6184,7 +6184,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
{
|
||||
nextarg = plus_constant (nextarg, offset);
|
||||
nextarg = plus_constant (nextarg, NUM_ARGS * UNITS_PER_WORD);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist,
|
||||
make_tree (ptr_type_node, nextarg));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
|
||||
@ -6203,12 +6203,13 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, t,
|
||||
build_int_cst (NULL_TREE, offset));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (base_field), base_field, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base_field), base_field, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
t = build_int_cst (NULL_TREE, NUM_ARGS * UNITS_PER_WORD);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (offset_field), offset_field, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (offset_field),
|
||||
offset_field, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -6224,7 +6225,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p)
|
||||
if (targetm.calls.must_pass_in_stack (TYPE_MODE (type), type))
|
||||
{
|
||||
t = build_int_cst (TREE_TYPE (offset), 6*8);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (offset), offset,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (offset), offset,
|
||||
build2 (MAX_EXPR, TREE_TYPE (offset), offset, t));
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
@ -6278,7 +6279,7 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p)
|
||||
t = size_binop (MULT_EXPR, t, size_int (8));
|
||||
}
|
||||
t = fold_convert (TREE_TYPE (offset), t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, offset,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, offset,
|
||||
build2 (PLUS_EXPR, TREE_TYPE (offset), offset, t));
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
@ -6318,7 +6319,7 @@ alpha_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
r = alpha_gimplify_va_arg_1 (type, base, offset, pre_p);
|
||||
|
||||
/* Stuff the offset temporary back into its field. */
|
||||
t = build2 (MODIFY_EXPR, void_type_node, offset_field,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, offset_field,
|
||||
fold_convert (TREE_TYPE (offset_field), offset));
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
|
@ -2203,7 +2203,7 @@ frv_expand_builtin_va_start (tree valist, rtx nextarg)
|
||||
debug_rtx (nextarg);
|
||||
}
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist,
|
||||
make_tree (ptr_type_node, nextarg));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
|
||||
|
@ -4522,7 +4522,7 @@ ix86_va_start (tree valist, rtx nextarg)
|
||||
if (cfun->va_list_gpr_size)
|
||||
{
|
||||
type = TREE_TYPE (gpr);
|
||||
t = build2 (MODIFY_EXPR, type, gpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, type, gpr,
|
||||
build_int_cst (type, n_gpr * 8));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -4531,7 +4531,7 @@ ix86_va_start (tree valist, rtx nextarg)
|
||||
if (cfun->va_list_fpr_size)
|
||||
{
|
||||
type = TREE_TYPE (fpr);
|
||||
t = build2 (MODIFY_EXPR, type, fpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, type, fpr,
|
||||
build_int_cst (type, n_fpr * 16 + 8*REGPARM_MAX));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -4543,7 +4543,7 @@ ix86_va_start (tree valist, rtx nextarg)
|
||||
if (words != 0)
|
||||
t = build2 (PLUS_EXPR, type, t,
|
||||
build_int_cst (type, words * UNITS_PER_WORD));
|
||||
t = build2 (MODIFY_EXPR, type, ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, type, ovf, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -4553,7 +4553,7 @@ ix86_va_start (tree valist, rtx nextarg)
|
||||
Prologue of the function save it right above stack frame. */
|
||||
type = TREE_TYPE (sav);
|
||||
t = make_tree (type, frame_pointer_rtx);
|
||||
t = build2 (MODIFY_EXPR, type, sav, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, type, sav, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -4690,7 +4690,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
/* int_addr = gpr + sav; */
|
||||
t = fold_convert (ptr_type_node, gpr);
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, sav, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, int_addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, int_addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
if (needed_sseregs)
|
||||
@ -4698,7 +4698,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
/* sse_addr = fpr + sav; */
|
||||
t = fold_convert (ptr_type_node, fpr);
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, sav, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, sse_addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, sse_addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
if (need_temp)
|
||||
@ -4708,7 +4708,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
|
||||
/* addr = &temp; */
|
||||
t = build1 (ADDR_EXPR, build_pointer_type (type), temp);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
for (i = 0; i < XVECLEN (container, 0); i++)
|
||||
@ -4742,7 +4742,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
size_int (INTVAL (XEXP (slot, 1)))));
|
||||
dest = build_va_arg_indirect_ref (dest_addr);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, dest, src);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, src);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
}
|
||||
@ -4751,14 +4751,14 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
{
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr,
|
||||
build_int_cst (TREE_TYPE (gpr), needed_intregs * 8));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
if (needed_sseregs)
|
||||
{
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (fpr), fpr,
|
||||
build_int_cst (TREE_TYPE (fpr), needed_sseregs * 16));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
|
||||
@ -4785,12 +4785,12 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
}
|
||||
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
|
||||
|
||||
t2 = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t2 = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t2, pre_p);
|
||||
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (t), t,
|
||||
build_int_cst (TREE_TYPE (t), rsize * UNITS_PER_WORD));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
if (container)
|
||||
|
@ -4324,7 +4324,7 @@ ia64_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
build_int_cst (NULL_TREE, 2 * UNITS_PER_WORD - 1));
|
||||
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
|
||||
build_int_cst (NULL_TREE, -2 * UNITS_PER_WORD));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
|
||||
|
@ -4278,12 +4278,12 @@ mips_va_start (tree valist, rtx nextarg)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (ovfl), t,
|
||||
build_int_cst (NULL_TREE,
|
||||
cum->stack_words * UNITS_PER_WORD));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovfl), ovfl, t);
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
/* Emit code to initialize GTOP, the top of the GPR save area. */
|
||||
t = make_tree (TREE_TYPE (gtop), virtual_incoming_args_rtx);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (gtop), gtop, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gtop), gtop, t);
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
/* Emit code to initialize FTOP, the top of the FPR save area.
|
||||
@ -4295,18 +4295,18 @@ mips_va_start (tree valist, rtx nextarg)
|
||||
if (fpr_offset)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (ftop), t,
|
||||
build_int_cst (NULL_TREE, -fpr_offset));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ftop), ftop, t);
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
/* Emit code to initialize GOFF, the offset from GTOP of the
|
||||
next GPR argument. */
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (goff), goff,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (goff), goff,
|
||||
build_int_cst (NULL_TREE, gpr_save_area_size));
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
/* Likewise emit code to initialize FOFF, the offset from FTOP
|
||||
of the next FPR argument. */
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (foff), foff,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (foff), foff,
|
||||
build_int_cst (NULL_TREE, fpr_save_area_size));
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -4427,7 +4427,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
/* [1] Emit code for: off &= -rsize. */
|
||||
t = build2 (BIT_AND_EXPR, TREE_TYPE (off), off,
|
||||
build_int_cst (NULL_TREE, -rsize));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (off), off, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (off), off, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
osize = rsize;
|
||||
@ -4466,7 +4466,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
u = fold_convert (TREE_TYPE (ovfl),
|
||||
build_int_cst (NULL_TREE, -osize));
|
||||
t = build2 (BIT_AND_EXPR, TREE_TYPE (ovfl), t, u);
|
||||
align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
|
||||
align = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovfl), ovfl, t);
|
||||
}
|
||||
else
|
||||
align = NULL;
|
||||
|
@ -5891,7 +5891,7 @@ hppa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
u = build_int_cst (valist_type, (size > 4 ? -8 : -4));
|
||||
t = build2 (BIT_AND_EXPR, valist_type, t, u);
|
||||
|
||||
t = build2 (MODIFY_EXPR, valist_type, valist, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, valist_type, valist, t);
|
||||
|
||||
ofs = (8 - size) % 4;
|
||||
if (ofs != 0)
|
||||
|
@ -6013,7 +6013,7 @@ rs6000_va_start (tree valist, rtx nextarg)
|
||||
|
||||
if (cfun->va_list_gpr_size)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr,
|
||||
build_int_cst (NULL_TREE, n_gpr));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -6021,7 +6021,7 @@ rs6000_va_start (tree valist, rtx nextarg)
|
||||
|
||||
if (cfun->va_list_fpr_size)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr,
|
||||
build_int_cst (NULL_TREE, n_fpr));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -6032,7 +6032,7 @@ rs6000_va_start (tree valist, rtx nextarg)
|
||||
if (words != 0)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t,
|
||||
build_int_cst (NULL_TREE, words * UNITS_PER_WORD));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -6049,7 +6049,7 @@ rs6000_va_start (tree valist, rtx nextarg)
|
||||
if (cfun->machine->varargs_save_offset)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (sav), t,
|
||||
build_int_cst (NULL_TREE, cfun->machine->varargs_save_offset));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (sav), sav, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -6182,7 +6182,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
u = build2 (MULT_EXPR, integer_type_node, u, size_int (sav_scale));
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, t, u);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (GOTO_EXPR, void_type_node, lab_over);
|
||||
@ -6195,7 +6195,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
{
|
||||
/* Ensure that we don't find any more args in regs.
|
||||
Alignment has taken care of the n_reg == 2 gpr case. */
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (reg), reg, size_int (8));
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (reg), reg, size_int (8));
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
}
|
||||
@ -6212,11 +6212,11 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
}
|
||||
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
|
||||
|
||||
u = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
u = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (u, pre_p);
|
||||
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
if (lab_over)
|
||||
|
@ -7931,7 +7931,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
|
||||
if (cfun->va_list_gpr_size)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr,
|
||||
build_int_cst (NULL_TREE, n_gpr));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -7939,7 +7939,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
|
||||
if (cfun->va_list_fpr_size)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr,
|
||||
build_int_cst (NULL_TREE, n_fpr));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
@ -7959,7 +7959,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t, build_int_cst (NULL_TREE, off));
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -7972,7 +7972,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (sav), t,
|
||||
build_int_cst (NULL_TREE, -RETURN_REGNUM * UNITS_PER_WORD));
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (sav), sav, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -8105,7 +8105,7 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
|
||||
fold_convert (TREE_TYPE (reg), size_int (sav_scale)));
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, t, fold_convert (ptr_type_node, u));
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (GOTO_EXPR, void_type_node, lab_over);
|
||||
@ -8124,12 +8124,12 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
|
||||
|
||||
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
|
||||
|
||||
u = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
u = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (u, pre_p);
|
||||
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, t,
|
||||
fold_convert (ptr_type_node, size_int (size)));
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, ovf, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, ovf, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (LABEL_EXPR, void_type_node, lab_over);
|
||||
|
@ -7117,7 +7117,7 @@ sh_va_start (tree valist, rtx nextarg)
|
||||
|
||||
/* Call __builtin_saveregs. */
|
||||
u = make_tree (ptr_type_node, expand_builtin_saveregs ());
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, next_fp, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -7128,11 +7128,11 @@ sh_va_start (tree valist, rtx nextarg)
|
||||
nfp = 0;
|
||||
u = fold_build2 (PLUS_EXPR, ptr_type_node, u,
|
||||
build_int_cst (NULL_TREE, UNITS_PER_WORD * nfp));
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_limit, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, next_o, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_o, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -7143,12 +7143,12 @@ sh_va_start (tree valist, rtx nextarg)
|
||||
nint = 0;
|
||||
u = fold_build2 (PLUS_EXPR, ptr_type_node, u,
|
||||
build_int_cst (NULL_TREE, UNITS_PER_WORD * nint));
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_o_limit, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
u = make_tree (ptr_type_node, nextarg);
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, next_stack, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_stack, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -7268,10 +7268,10 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
bool is_double = size == 8 && TREE_CODE (eff_type) == REAL_TYPE;
|
||||
|
||||
tmp = build1 (ADDR_EXPR, pptr_type_node, next_fp);
|
||||
tmp = build2 (MODIFY_EXPR, void_type_node, addr, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, next_fp_tmp, valist);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_tmp, valist);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
tmp = next_fp_limit;
|
||||
if (size > 4 && !is_double)
|
||||
@ -7290,7 +7290,8 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
tmp = fold_convert (ptr_type_node, size_int (UNITS_PER_WORD));
|
||||
tmp = build2 (BIT_AND_EXPR, ptr_type_node, next_fp_tmp, tmp);
|
||||
tmp = build2 (PLUS_EXPR, ptr_type_node, next_fp_tmp, tmp);
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, next_fp_tmp, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node,
|
||||
next_fp_tmp, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
}
|
||||
if (is_double)
|
||||
@ -7323,12 +7324,12 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
|
||||
tmp = build2 (MODIFY_EXPR, void_type_node, addr, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, next_fp_tmp, valist);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_tmp, valist);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, valist, next_fp_tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, valist, next_fp_tmp);
|
||||
gimplify_and_add (tmp, post_p);
|
||||
valist = next_fp_tmp;
|
||||
}
|
||||
@ -7343,7 +7344,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build1 (ADDR_EXPR, pptr_type_node, next_o);
|
||||
tmp = build2 (MODIFY_EXPR, void_type_node, addr, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
|
||||
@ -7354,12 +7355,13 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
|
||||
if (size > 4 && ! TARGET_SH4)
|
||||
{
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, next_o, next_o_limit);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node,
|
||||
next_o, next_o_limit);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
}
|
||||
|
||||
tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
|
||||
tmp = build2 (MODIFY_EXPR, void_type_node, addr, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
}
|
||||
|
||||
@ -7376,7 +7378,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
tmp = std_gimplify_va_arg_expr (valist, type, pre_p, NULL);
|
||||
if (result)
|
||||
{
|
||||
tmp = build2 (MODIFY_EXPR, void_type_node, result, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, result, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
tmp = build1 (LABEL_EXPR, void_type_node, lab_over);
|
||||
|
@ -5716,7 +5716,7 @@ sparc_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
|
||||
addr = fold_convert (ptrtype, addr);
|
||||
|
||||
incr = fold (build2 (PLUS_EXPR, ptr_type_node, incr, ssize_int (rsize)));
|
||||
incr = build2 (MODIFY_EXPR, ptr_type_node, valist, incr);
|
||||
incr = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, valist, incr);
|
||||
gimplify_and_add (incr, post_p);
|
||||
|
||||
return build_va_arg_indirect_ref (addr);
|
||||
|
@ -2801,7 +2801,7 @@ spu_va_start (tree valist, rtx nextarg)
|
||||
if (current_function_pretend_args_size > 0)
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (args), t,
|
||||
build_int_cst (integer_type_node, -STACK_POINTER_OFFSET));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (args), args, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (args), args, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -2811,7 +2811,7 @@ spu_va_start (tree valist, rtx nextarg)
|
||||
build_int_cst (integer_type_node,
|
||||
(current_function_pretend_args_size
|
||||
- STACK_POINTER_OFFSET)));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (skip), skip, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (skip), skip, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -2876,12 +2876,12 @@ spu_gimplify_va_arg_expr (tree valist, tree type, tree * pre_p,
|
||||
build2 (PLUS_EXPR, ptr_type_node, skip,
|
||||
fold_convert (ptr_type_node, size_int (32))), args);
|
||||
|
||||
tmp = build2 (MODIFY_EXPR, ptr_type_node, addr, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, addr, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
/* update VALIST.__args */
|
||||
tmp = build2 (PLUS_EXPR, ptr_type_node, addr, paddedsize);
|
||||
tmp = build2 (MODIFY_EXPR, TREE_TYPE (args), args, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (args), args, tmp);
|
||||
gimplify_and_add (tmp, pre_p);
|
||||
|
||||
addr = fold_convert (build_pointer_type (type), addr);
|
||||
|
@ -1375,11 +1375,11 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
t = make_tree (TREE_TYPE (base), virtual_incoming_args_rtx);
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (base), t,
|
||||
build_int_cst (NULL_TREE, INCOMING_FRAME_SP_OFFSET));
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (base), base, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base), base, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (count), count,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (count), count,
|
||||
build_int_cst (NULL_TREE,
|
||||
current_function_args_info * UNITS_PER_WORD));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
@ -1434,7 +1434,7 @@ xstormy16_expand_builtin_va_arg (tree valist, tree type, tree *pre_p,
|
||||
|
||||
t = fold_convert (ptr_type_node, count_tmp);
|
||||
t = build2 (PLUS_EXPR, ptr_type_node, base, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (GOTO_EXPR, void_type_node, lab_gotaddr);
|
||||
@ -1453,7 +1453,7 @@ xstormy16_expand_builtin_va_arg (tree valist, tree type, tree *pre_p,
|
||||
tree r, u;
|
||||
|
||||
r = size_int (NUM_ARGUMENT_REGISTERS * UNITS_PER_WORD);
|
||||
u = build2 (MODIFY_EXPR, void_type_node, count_tmp, r);
|
||||
u = build2 (GIMPLE_MODIFY_STMT, void_type_node, count_tmp, r);
|
||||
|
||||
t = fold_convert (TREE_TYPE (count), r);
|
||||
t = build2 (GE_EXPR, boolean_type_node, count_tmp, t);
|
||||
@ -1469,7 +1469,7 @@ xstormy16_expand_builtin_va_arg (tree valist, tree type, tree *pre_p,
|
||||
fold_convert (TREE_TYPE (count), size_tree));
|
||||
t = fold_convert (TREE_TYPE (base), fold (t));
|
||||
t = build2 (MINUS_EXPR, TREE_TYPE (base), base, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (LABEL_EXPR, void_type_node, lab_gotaddr);
|
||||
@ -1477,7 +1477,7 @@ xstormy16_expand_builtin_va_arg (tree valist, tree type, tree *pre_p,
|
||||
|
||||
t = fold_convert (TREE_TYPE (count), size_tree);
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (count), count_tmp, t);
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (count), count, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (count), count, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
addr = fold_convert (build_pointer_type (type), addr);
|
||||
|
@ -2102,7 +2102,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
|
||||
/* Call __builtin_saveregs; save the result in __va_reg */
|
||||
u = make_tree (ptr_type_node, expand_builtin_saveregs ());
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, reg, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, reg, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -2110,7 +2110,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
|
||||
u = fold_build2 (PLUS_EXPR, ptr_type_node, u,
|
||||
build_int_cst (NULL_TREE, -32));
|
||||
t = build2 (MODIFY_EXPR, ptr_type_node, stk, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, stk, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
@ -2120,7 +2120,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
|
||||
if (arg_words >= MAX_ARGS_IN_REGISTERS)
|
||||
arg_words += 2;
|
||||
u = build_int_cst (NULL_TREE, arg_words * UNITS_PER_WORD);
|
||||
t = build2 (MODIFY_EXPR, integer_type_node, ndx, u);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, u);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -2189,7 +2189,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
build_int_cst (NULL_TREE, align - 1));
|
||||
t = build2 (BIT_AND_EXPR, integer_type_node, t,
|
||||
build_int_cst (NULL_TREE, -align));
|
||||
t = build2 (MODIFY_EXPR, integer_type_node, orig_ndx, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, orig_ndx, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
}
|
||||
|
||||
@ -2200,7 +2200,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
|
||||
t = fold_convert (integer_type_node, va_size);
|
||||
t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, t);
|
||||
t = build2 (MODIFY_EXPR, integer_type_node, ndx, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
|
||||
@ -2225,7 +2225,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
NULL_TREE);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, array, reg);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, array, reg);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (GOTO_EXPR, void_type_node, lab_over);
|
||||
@ -2257,13 +2257,13 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
|
||||
|
||||
t = size_binop (PLUS_EXPR, va_size, size_int (32));
|
||||
t = fold_convert (integer_type_node, t);
|
||||
t = build2 (MODIFY_EXPR, integer_type_node, ndx, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build1 (LABEL_EXPR, void_type_node, lab_false2);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, array, stk);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, array, stk);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
if (lab_over)
|
||||
|
@ -1,3 +1,20 @@
|
||||
2006-12-05 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
Merge from gimple-tuples-branch.
|
||||
|
||||
2006-10-05 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* cp-gimplify.c (cp_gimplify_expr): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(cxx_omp_clause_apply_fn): Adjust for GIMPLE_MODIFY_STMT.
|
||||
(cxx_omp_clause_copy_ctor): Same.
|
||||
(cxx_omp_clause_assign_op): Same.
|
||||
|
||||
2006-09-28 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* cp-tree.h (union lang_tree_node): Gimple statements do not
|
||||
have a TREE_CHAIN.
|
||||
(TREE_INDIRECT_USING): Look in base.
|
||||
|
||||
2006-12-04 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* cp-objcp-common.c (cp_expr_size): Return NULL in the case
|
||||
|
@ -483,7 +483,7 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
|
||||
ret = GS_OK;
|
||||
break;
|
||||
|
||||
/* We used to do this for MODIFY_EXPR as well, but that's unsafe; the
|
||||
/* We used to do this for GIMPLE_MODIFY_STMT as well, but that's unsafe; the
|
||||
LHS of an assignment might also be involved in the RHS, as in bug
|
||||
25979. */
|
||||
case INIT_EXPR:
|
||||
@ -784,13 +784,13 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
|
||||
end1 = build2 (PLUS_EXPR, TREE_TYPE (start1), start1, end1);
|
||||
|
||||
p1 = create_tmp_var (TREE_TYPE (start1), NULL);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, p1, start1);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, start1);
|
||||
append_to_statement_list (t, &ret);
|
||||
|
||||
if (arg2)
|
||||
{
|
||||
p2 = create_tmp_var (TREE_TYPE (start2), NULL);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, p2, start2);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, start2);
|
||||
append_to_statement_list (t, &ret);
|
||||
}
|
||||
|
||||
@ -812,14 +812,14 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
|
||||
|
||||
t = fold_convert (TREE_TYPE (p1), TYPE_SIZE_UNIT (inner_type));
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (p1), p1, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, p1, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, t);
|
||||
append_to_statement_list (t, &ret);
|
||||
|
||||
if (arg2)
|
||||
{
|
||||
t = fold_convert (TREE_TYPE (p2), TYPE_SIZE_UNIT (inner_type));
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (p2), p2, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, p2, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, t);
|
||||
append_to_statement_list (t, &ret);
|
||||
}
|
||||
|
||||
@ -870,7 +870,7 @@ cxx_omp_clause_copy_ctor (tree clause, tree dst, tree src)
|
||||
if (info)
|
||||
ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src);
|
||||
if (ret == NULL)
|
||||
ret = build2 (MODIFY_EXPR, void_type_node, dst, src);
|
||||
ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -886,7 +886,7 @@ cxx_omp_clause_assign_op (tree clause, tree dst, tree src)
|
||||
if (info)
|
||||
ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src);
|
||||
if (ret == NULL)
|
||||
ret = build2 (MODIFY_EXPR, void_type_node, dst, src);
|
||||
ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ enum cp_tree_node_structure_enum {
|
||||
|
||||
/* The resulting tree type. */
|
||||
union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
chain_next ("(GIMPLE_STMT_P (&%h.generic) ? (union lang_tree_node *) 0 : (union lang_tree_node *)TREE_CHAIN (&%h.generic))")))
|
||||
{
|
||||
union tree_node GTY ((tag ("TS_CP_GENERIC"),
|
||||
desc ("tree_node_structure (&%h)"))) generic;
|
||||
@ -2067,7 +2067,7 @@ struct lang_decl GTY(())
|
||||
|
||||
/* In a TREE_LIST concatenating using directives, indicate indirect
|
||||
directives */
|
||||
#define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0)
|
||||
#define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->base.lang_flag_0)
|
||||
|
||||
extern tree decl_shadowed_for_var_lookup (tree);
|
||||
extern void decl_shadowed_for_var_insert (tree, tree);
|
||||
|
@ -9266,8 +9266,9 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
|
||||
case NON_LVALUE_EXPR:
|
||||
case VIEW_CONVERT_EXPR:
|
||||
case SAVE_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
return loc_descriptor_from_tree_1 (TREE_OPERAND (loc, 0), want_address);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
return loc_descriptor_from_tree_1 (GENERIC_TREE_OPERAND (loc, 0),
|
||||
want_address);
|
||||
|
||||
case COMPONENT_REF:
|
||||
case BIT_FIELD_REF:
|
||||
@ -10040,7 +10041,7 @@ static tree
|
||||
reference_to_unused (tree * tp, int * walk_subtrees,
|
||||
void * data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (! EXPR_P (*tp) && ! CONSTANT_CLASS_P (*tp))
|
||||
if (! EXPR_P (*tp) && ! GIMPLE_STMT_P (*tp) && ! CONSTANT_CLASS_P (*tp))
|
||||
*walk_subtrees = 0;
|
||||
|
||||
if (DECL_P (*tp) && ! TREE_PUBLIC (*tp) && ! TREE_USED (*tp)
|
||||
|
27
gcc/expr.c
27
gcc/expr.c
@ -6247,6 +6247,9 @@ safe_from_p (rtx x, tree exp, int top_p)
|
||||
case tcc_type:
|
||||
/* Should never get a type here. */
|
||||
gcc_unreachable ();
|
||||
|
||||
case tcc_gimple_stmt:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* If we have an rtl, find any enclosed object. Then see if we conflict
|
||||
@ -6667,7 +6670,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
|
||||
|
||||
/* Handle ERROR_MARK before anybody tries to access its type. */
|
||||
if (TREE_CODE (exp) == ERROR_MARK
|
||||
|| TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK)
|
||||
|| (!GIMPLE_TUPLE_P (exp) && TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK))
|
||||
{
|
||||
ret = CONST0_RTX (tmode);
|
||||
return ret ? ret : const0_rtx;
|
||||
@ -6737,7 +6740,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|
||||
enum expand_modifier modifier, rtx *alt_rtl)
|
||||
{
|
||||
rtx op0, op1, temp, decl_rtl;
|
||||
tree type = TREE_TYPE (exp);
|
||||
tree type;
|
||||
int unsignedp;
|
||||
enum machine_mode mode;
|
||||
enum tree_code code = TREE_CODE (exp);
|
||||
@ -6752,8 +6755,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|
||||
type) \
|
||||
: (expr))
|
||||
|
||||
mode = TYPE_MODE (type);
|
||||
unsignedp = TYPE_UNSIGNED (type);
|
||||
if (GIMPLE_STMT_P (exp))
|
||||
{
|
||||
type = void_type_node;
|
||||
mode = VOIDmode;
|
||||
unsignedp = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
type = TREE_TYPE (exp);
|
||||
mode = TYPE_MODE (type);
|
||||
unsignedp = TYPE_UNSIGNED (type);
|
||||
}
|
||||
if (lang_hooks.reduce_bit_field_operations
|
||||
&& TREE_CODE (type) == INTEGER_TYPE
|
||||
&& GET_MODE_PRECISION (mode) > TYPE_PRECISION (type))
|
||||
@ -8563,10 +8576,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|
||||
target = expand_vec_cond_expr (exp, target);
|
||||
return target;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree lhs = TREE_OPERAND (exp, 0);
|
||||
tree rhs = TREE_OPERAND (exp, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (exp, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (exp, 1);
|
||||
|
||||
gcc_assert (ignore);
|
||||
|
||||
|
@ -41,7 +41,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
|
||||
force_fit_type takes a constant, an overflowable flag and prior
|
||||
overflow indicators. It forces the value to fit the type and sets
|
||||
TREE_OVERFLOW and TREE_CONSTANT_OVERFLOW as appropriate. */
|
||||
TREE_OVERFLOW and TREE_CONSTANT_OVERFLOW as appropriate.
|
||||
|
||||
Note: Since the folders get called on non-gimple code as well as
|
||||
gimple code, we need to handle GIMPLE tuples as well as their
|
||||
corresponding tree equivalents. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
@ -2181,6 +2185,7 @@ maybe_lvalue_p (tree x)
|
||||
case WITH_CLEANUP_EXPR:
|
||||
case COMPOUND_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case TARGET_EXPR:
|
||||
case COND_EXPR:
|
||||
case BIND_EXPR:
|
||||
@ -7474,15 +7479,17 @@ fold_unary (enum tree_code code, tree type, tree op0)
|
||||
return fold_convert (type, build_fold_addr_expr (base));
|
||||
}
|
||||
|
||||
if (TREE_CODE (op0) == MODIFY_EXPR
|
||||
&& TREE_CONSTANT (TREE_OPERAND (op0, 1))
|
||||
if ((TREE_CODE (op0) == MODIFY_EXPR
|
||||
|| TREE_CODE (op0) == GIMPLE_MODIFY_STMT)
|
||||
&& TREE_CONSTANT (GENERIC_TREE_OPERAND (op0, 1))
|
||||
/* Detect assigning a bitfield. */
|
||||
&& !(TREE_CODE (TREE_OPERAND (op0, 0)) == COMPONENT_REF
|
||||
&& DECL_BIT_FIELD (TREE_OPERAND (TREE_OPERAND (op0, 0), 1))))
|
||||
&& !(TREE_CODE (GENERIC_TREE_OPERAND (op0, 0)) == COMPONENT_REF
|
||||
&& DECL_BIT_FIELD
|
||||
(TREE_OPERAND (GENERIC_TREE_OPERAND (op0, 0), 1))))
|
||||
{
|
||||
/* Don't leave an assignment inside a conversion
|
||||
unless assigning a bitfield. */
|
||||
tem = fold_build1 (code, type, TREE_OPERAND (op0, 1));
|
||||
tem = fold_build1 (code, type, GENERIC_TREE_OPERAND (op0, 1));
|
||||
/* First do the assignment, then return converted constant. */
|
||||
tem = build2 (COMPOUND_EXPR, TREE_TYPE (tem), op0, tem);
|
||||
TREE_NO_WARNING (tem) = 1;
|
||||
@ -8461,7 +8468,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
|
||||
tree arg0, arg1, tem;
|
||||
tree t1 = NULL_TREE;
|
||||
|
||||
gcc_assert (IS_EXPR_CODE_CLASS (kind)
|
||||
gcc_assert ((IS_EXPR_CODE_CLASS (kind)
|
||||
|| IS_GIMPLE_STMT_CODE_CLASS (kind))
|
||||
&& TREE_CODE_LENGTH (code) == 2
|
||||
&& op0 != NULL_TREE
|
||||
&& op1 != NULL_TREE);
|
||||
@ -11673,7 +11681,8 @@ fold (tree expr)
|
||||
if (kind == tcc_constant)
|
||||
return t;
|
||||
|
||||
if (IS_EXPR_CODE_CLASS (kind))
|
||||
if (IS_EXPR_CODE_CLASS (kind)
|
||||
|| IS_GIMPLE_STMT_CODE_CLASS (kind))
|
||||
{
|
||||
tree type = TREE_TYPE (t);
|
||||
tree op0, op1, op2;
|
||||
@ -12359,7 +12368,8 @@ tree_expr_nonnegative_p (tree t)
|
||||
|
||||
case COMPOUND_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
return tree_expr_nonnegative_p (GENERIC_TREE_OPERAND (t, 1));
|
||||
|
||||
case BIND_EXPR:
|
||||
return tree_expr_nonnegative_p (expr_last (TREE_OPERAND (t, 1)));
|
||||
@ -12419,9 +12429,10 @@ tree_expr_nonnegative_p (tree t)
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (TREE_CODE (t) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (t, 0) == temp)
|
||||
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
|
||||
if ((TREE_CODE (t) == MODIFY_EXPR
|
||||
|| TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
&& GENERIC_TREE_OPERAND (t, 0) == temp)
|
||||
return tree_expr_nonnegative_p (GENERIC_TREE_OPERAND (t, 1));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -12657,8 +12668,9 @@ tree_expr_nonzero_p (tree t)
|
||||
|
||||
case COMPOUND_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case BIND_EXPR:
|
||||
return tree_expr_nonzero_p (TREE_OPERAND (t, 1));
|
||||
return tree_expr_nonzero_p (GENERIC_TREE_OPERAND (t, 1));
|
||||
|
||||
case SAVE_EXPR:
|
||||
case NON_LVALUE_EXPR:
|
||||
|
@ -62,7 +62,8 @@ GTY(())
|
||||
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
chain_next ("(GIMPLE_STMT_P (&%h.generic) ? (union lang_tree_node *) 0 : (union lang_tree_node *)TREE_CHAIN (&%h.generic))")))
|
||||
|
||||
{
|
||||
union tree_node GTY((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)"))) generic;
|
||||
|
@ -5741,6 +5741,19 @@ resolve_fl_derived (gfc_symbol *sym)
|
||||
sym->ns->derived_types = dt_list;
|
||||
}
|
||||
|
||||
/* Add derived type to the derived type list. */
|
||||
for (dt_list = sym->ns->derived_types; dt_list; dt_list = dt_list->next)
|
||||
if (sym == dt_list->derived)
|
||||
break;
|
||||
|
||||
if (dt_list == NULL)
|
||||
{
|
||||
dt_list = gfc_get_dt_list ();
|
||||
dt_list->next = sym->ns->derived_types;
|
||||
dt_list->derived = sym;
|
||||
sym->ns->derived_types = dt_list;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -156,10 +156,18 @@ gfc_conv_descriptor_data_get (tree desc)
|
||||
return t;
|
||||
}
|
||||
|
||||
/* This provides WRITE access to the data field. */
|
||||
/* This provides WRITE access to the data field.
|
||||
|
||||
TUPLES_P is true if we are generating tuples.
|
||||
|
||||
This function gets called through the following macros:
|
||||
gfc_conv_descriptor_data_set
|
||||
gfc_conv_descriptor_data_set_tuples. */
|
||||
|
||||
void
|
||||
gfc_conv_descriptor_data_set (stmtblock_t *block, tree desc, tree value)
|
||||
gfc_conv_descriptor_data_set_internal (stmtblock_t *block,
|
||||
tree desc, tree value,
|
||||
bool tuples_p)
|
||||
{
|
||||
tree field, type, t;
|
||||
|
||||
@ -170,7 +178,7 @@ gfc_conv_descriptor_data_set (stmtblock_t *block, tree desc, tree value)
|
||||
gcc_assert (DATA_FIELD == 0);
|
||||
|
||||
t = build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE);
|
||||
gfc_add_modify_expr (block, t, fold_convert (TREE_TYPE (field), value));
|
||||
gfc_add_modify (block, t, fold_convert (TREE_TYPE (field), value), tuples_p);
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,7 +118,11 @@ tree gfc_conv_array_ubound (tree, int);
|
||||
|
||||
/* Build expressions for accessing components of an array descriptor. */
|
||||
tree gfc_conv_descriptor_data_get (tree);
|
||||
void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree);
|
||||
void gfc_conv_descriptor_data_set_internal (stmtblock_t *, tree, tree, bool);
|
||||
#define gfc_conv_descriptor_data_set(BLOCK, T1, T2) \
|
||||
gfc_conv_descriptor_data_set_internal ((BLOCK), (T1), (T2), false)
|
||||
#define gfc_conv_descriptor_data_set_tuples(BLOCK, T1, T2) \
|
||||
gfc_conv_descriptor_data_set_internal ((BLOCK), (T1), (T2), true)
|
||||
tree gfc_conv_descriptor_data_addr (tree);
|
||||
tree gfc_conv_descriptor_offset (tree);
|
||||
tree gfc_conv_descriptor_dtype (tree);
|
||||
|
@ -111,7 +111,7 @@ gfc_omp_clause_default_ctor (tree clause ATTRIBUTE_UNUSED, tree decl)
|
||||
"not currently allocated" allocation status. */
|
||||
gfc_init_block (&block);
|
||||
|
||||
gfc_conv_descriptor_data_set (&block, decl, null_pointer_node);
|
||||
gfc_conv_descriptor_data_set_tuples (&block, decl, null_pointer_node);
|
||||
|
||||
return gfc_finish_block (&block);
|
||||
}
|
||||
@ -832,7 +832,7 @@ gfc_trans_omp_atomic (gfc_code *code)
|
||||
tree accum = gfc_create_var (TREE_TYPE (rse.expr), NULL);
|
||||
gfc_actual_arglist *arg;
|
||||
|
||||
gfc_add_modify_expr (&block, accum, rse.expr);
|
||||
gfc_add_modify_stmt (&block, accum, rse.expr);
|
||||
for (arg = expr2->value.function.actual->next->next; arg;
|
||||
arg = arg->next)
|
||||
{
|
||||
@ -840,7 +840,7 @@ gfc_trans_omp_atomic (gfc_code *code)
|
||||
gfc_conv_expr (&rse, arg->expr);
|
||||
gfc_add_block_to_block (&block, &rse.pre);
|
||||
x = fold_build2 (op, TREE_TYPE (accum), accum, rse.expr);
|
||||
gfc_add_modify_expr (&block, accum, x);
|
||||
gfc_add_modify_stmt (&block, accum, x);
|
||||
}
|
||||
|
||||
rse.expr = accum;
|
||||
@ -957,11 +957,11 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
|
||||
/* Loop body. */
|
||||
if (simple)
|
||||
{
|
||||
init = build2_v (MODIFY_EXPR, dovar, from);
|
||||
init = build2_v (GIMPLE_MODIFY_STMT, dovar, from);
|
||||
cond = build2 (simple > 0 ? LE_EXPR : GE_EXPR, boolean_type_node,
|
||||
dovar, to);
|
||||
incr = fold_build2 (PLUS_EXPR, type, dovar, step);
|
||||
incr = fold_build2 (MODIFY_EXPR, type, dovar, incr);
|
||||
incr = fold_build2 (GIMPLE_MODIFY_STMT, type, dovar, incr);
|
||||
if (pblock != &block)
|
||||
{
|
||||
pushlevel (0);
|
||||
@ -983,10 +983,10 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
|
||||
tmp = fold_build2 (TRUNC_DIV_EXPR, type, tmp, step);
|
||||
tmp = gfc_evaluate_now (tmp, pblock);
|
||||
count = gfc_create_var (type, "count");
|
||||
init = build2_v (MODIFY_EXPR, count, build_int_cst (type, 0));
|
||||
init = build2_v (GIMPLE_MODIFY_STMT, count, build_int_cst (type, 0));
|
||||
cond = build2 (LT_EXPR, boolean_type_node, count, tmp);
|
||||
incr = fold_build2 (PLUS_EXPR, type, count, build_int_cst (type, 1));
|
||||
incr = fold_build2 (MODIFY_EXPR, type, count, incr);
|
||||
incr = fold_build2 (GIMPLE_MODIFY_STMT, type, count, incr);
|
||||
|
||||
if (pblock != &block)
|
||||
{
|
||||
@ -998,7 +998,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
|
||||
/* Initialize DOVAR. */
|
||||
tmp = fold_build2 (MULT_EXPR, type, count, step);
|
||||
tmp = build2 (PLUS_EXPR, type, from, tmp);
|
||||
gfc_add_modify_expr (&body, dovar, tmp);
|
||||
gfc_add_modify_stmt (&body, dovar, tmp);
|
||||
}
|
||||
|
||||
if (!dovar_found)
|
||||
|
@ -140,11 +140,13 @@ gfc_evaluate_now (tree expr, stmtblock_t * pblock)
|
||||
}
|
||||
|
||||
|
||||
/* Build a MODIFY_EXPR node and add it to a given statement block PBLOCK.
|
||||
A MODIFY_EXPR is an assignment: LHS <- RHS. */
|
||||
/* Build a MODIFY_EXPR (or GIMPLE_MODIFY_STMT) node and add it to a
|
||||
given statement block PBLOCK. A MODIFY_EXPR is an assignment:
|
||||
LHS <- RHS. */
|
||||
|
||||
void
|
||||
gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs)
|
||||
gfc_add_modify (stmtblock_t * pblock, tree lhs, tree rhs,
|
||||
bool tuples_p)
|
||||
{
|
||||
tree tmp;
|
||||
|
||||
@ -157,7 +159,8 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs)
|
||||
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
|
||||
#endif
|
||||
|
||||
tmp = fold_build2 (MODIFY_EXPR, void_type_node, lhs, rhs);
|
||||
tmp = fold_build2 (tuples_p ? GIMPLE_MODIFY_STMT : MODIFY_EXPR,
|
||||
void_type_node, lhs, rhs);
|
||||
gfc_add_expr_to_block (pblock, tmp);
|
||||
}
|
||||
|
||||
|
@ -334,8 +334,12 @@ void gfc_trans_vla_type_sizes (gfc_symbol *, stmtblock_t *);
|
||||
void gfc_add_expr_to_block (stmtblock_t *, tree);
|
||||
/* Add a block to the end of a block. */
|
||||
void gfc_add_block_to_block (stmtblock_t *, stmtblock_t *);
|
||||
/* Add a MODIFY_EXPR to a block. */
|
||||
void gfc_add_modify_expr (stmtblock_t *, tree, tree);
|
||||
/* Add a MODIFY_EXPR or a GIMPLE_MODIFY_STMT to a block. */
|
||||
void gfc_add_modify (stmtblock_t *, tree, tree, bool);
|
||||
#define gfc_add_modify_expr(BLOCK, LHS, RHS) \
|
||||
gfc_add_modify ((BLOCK), (LHS), (RHS), false)
|
||||
#define gfc_add_modify_stmt(BLOCK, LHS, RHS) \
|
||||
gfc_add_modify ((BLOCK), (LHS), (RHS), true)
|
||||
|
||||
/* Initialize a statement block. */
|
||||
void gfc_init_block (stmtblock_t *);
|
||||
|
@ -1609,7 +1609,7 @@ static tree
|
||||
instantiate_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree t = *tp;
|
||||
if (! EXPR_P (t))
|
||||
if (! EXPR_P (t) && ! GIMPLE_STMT_P (t))
|
||||
{
|
||||
*walk_subtrees = 0;
|
||||
if (DECL_P (t) && DECL_RTL_SET_P (t))
|
||||
@ -3227,11 +3227,11 @@ gimplify_parameters (void)
|
||||
t = built_in_decls[BUILT_IN_ALLOCA];
|
||||
t = build_function_call_expr (t, args);
|
||||
t = fold_convert (ptr_type, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
gimplify_and_add (t, &stmts);
|
||||
}
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, local, parm);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, local, parm);
|
||||
gimplify_and_add (t, &stmts);
|
||||
|
||||
SET_DECL_VALUE_EXPR (parm, local);
|
||||
|
@ -469,6 +469,11 @@ struct function GTY(())
|
||||
/* Number of units of floating point registers that need saving in stdarg
|
||||
function. */
|
||||
unsigned int va_list_fpr_size : 8;
|
||||
|
||||
/* FIXME tuples: This bit is temporarily here to mark when a
|
||||
function has been gimplified, so we can make sure we're not
|
||||
creating non GIMPLE tuples after gimplification. */
|
||||
unsigned gimplified : 1;
|
||||
};
|
||||
|
||||
/* If va_list_[gf]pr_size is set to this, it means we don't know how
|
||||
|
@ -138,7 +138,7 @@ lower_function_body (void)
|
||||
arg = tree_cons (NULL, t, NULL);
|
||||
t = implicit_built_in_decls[BUILT_IN_SETJMP_DISPATCHER];
|
||||
t = build_function_call_expr (t,arg);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, disp_var, t);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, disp_var, t);
|
||||
|
||||
/* Build 'goto DISP_VAR;' and insert. */
|
||||
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
|
||||
@ -254,9 +254,9 @@ lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data)
|
||||
case OMP_CONTINUE:
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
stmt = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
stmt = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
else
|
||||
break;
|
||||
/* FALLTHRU */
|
||||
@ -436,9 +436,9 @@ block_may_fallthru (tree block)
|
||||
return (block_may_fallthru (TREE_OPERAND (stmt, 0))
|
||||
&& block_may_fallthru (TREE_OPERAND (stmt, 1)));
|
||||
|
||||
case MODIFY_EXPR:
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
stmt = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
stmt = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
else
|
||||
return true;
|
||||
/* FALLTHRU */
|
||||
@ -560,15 +560,15 @@ lower_return_expr (tree_stmt_iterator *tsi, struct lower_data *data)
|
||||
|
||||
/* Extract the value being returned. */
|
||||
value = TREE_OPERAND (stmt, 0);
|
||||
if (value && TREE_CODE (value) == MODIFY_EXPR)
|
||||
value = TREE_OPERAND (value, 1);
|
||||
if (value && TREE_CODE (value) == GIMPLE_MODIFY_STMT)
|
||||
value = GIMPLE_STMT_OPERAND (value, 1);
|
||||
|
||||
/* Match this up with an existing return statement that's been created. */
|
||||
for (t = data->return_statements; t ; t = TREE_CHAIN (t))
|
||||
{
|
||||
tree tvalue = TREE_OPERAND (TREE_VALUE (t), 0);
|
||||
if (tvalue && TREE_CODE (tvalue) == MODIFY_EXPR)
|
||||
tvalue = TREE_OPERAND (tvalue, 1);
|
||||
if (tvalue && TREE_CODE (tvalue) == GIMPLE_MODIFY_STMT)
|
||||
tvalue = GIMPLE_STMT_OPERAND (tvalue, 1);
|
||||
|
||||
if (value == tvalue)
|
||||
{
|
||||
@ -654,10 +654,10 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
|
||||
passed to both __builtin_setjmp_setup and __builtin_setjmp_receiver. */
|
||||
FORCED_LABEL (next_label) = 1;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
dest = TREE_OPERAND (stmt, 0);
|
||||
stmt = TREE_OPERAND (stmt, 1);
|
||||
dest = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
stmt = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
}
|
||||
else
|
||||
dest = NULL_TREE;
|
||||
@ -665,7 +665,7 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
|
||||
/* Build '__builtin_setjmp_setup (BUF, NEXT_LABEL)' and insert. */
|
||||
t = build_addr (next_label, current_function_decl);
|
||||
arg = tree_cons (NULL, t, NULL);
|
||||
t = TREE_VALUE (TREE_OPERAND (stmt, 1));
|
||||
t = TREE_VALUE (GENERIC_TREE_OPERAND (stmt, 1));
|
||||
arg = tree_cons (NULL, t, arg);
|
||||
t = implicit_built_in_decls[BUILT_IN_SETJMP_SETUP];
|
||||
t = build_function_call_expr (t, arg);
|
||||
@ -675,7 +675,7 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
|
||||
/* Build 'DEST = 0' and insert. */
|
||||
if (dest)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, void_type_node, dest, integer_zero_node);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, integer_zero_node);
|
||||
SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
|
||||
tsi_link_before (tsi, t, TSI_SAME_STMT);
|
||||
}
|
||||
@ -699,7 +699,7 @@ lower_builtin_setjmp (tree_stmt_iterator *tsi)
|
||||
/* Build 'DEST = 1' and insert. */
|
||||
if (dest)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, void_type_node, dest, integer_one_node);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, integer_one_node);
|
||||
SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
|
||||
tsi_link_before (tsi, t, TSI_SAME_STMT);
|
||||
}
|
||||
|
182
gcc/gimplify.c
182
gcc/gimplify.c
@ -769,7 +769,8 @@ should_carry_locus_p (tree stmt)
|
||||
static void
|
||||
annotate_one_with_locus (tree t, location_t locus)
|
||||
{
|
||||
if (EXPR_P (t) && ! EXPR_HAS_LOCATION (t) && should_carry_locus_p (t))
|
||||
if (CAN_HAVE_LOCATION_P (t)
|
||||
&& ! EXPR_HAS_LOCATION (t) && should_carry_locus_p (t))
|
||||
SET_EXPR_LOCATION (t, locus);
|
||||
}
|
||||
|
||||
@ -1040,7 +1041,7 @@ build_stack_save_restore (tree *save, tree *restore)
|
||||
NULL_TREE);
|
||||
tmp_var = create_tmp_var (ptr_type_node, "saved_stack");
|
||||
|
||||
*save = build2 (MODIFY_EXPR, ptr_type_node, tmp_var, save_call);
|
||||
*save = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, tmp_var, save_call);
|
||||
*restore =
|
||||
build_function_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
|
||||
tree_cons (NULL_TREE, tmp_var, NULL_TREE));
|
||||
@ -1141,12 +1142,13 @@ gimplify_return_expr (tree stmt, tree *pre_p)
|
||||
result_decl = NULL_TREE;
|
||||
else
|
||||
{
|
||||
result_decl = TREE_OPERAND (ret_expr, 0);
|
||||
result_decl = GENERIC_TREE_OPERAND (ret_expr, 0);
|
||||
if (TREE_CODE (result_decl) == INDIRECT_REF)
|
||||
/* See through a return by reference. */
|
||||
result_decl = TREE_OPERAND (result_decl, 0);
|
||||
|
||||
gcc_assert ((TREE_CODE (ret_expr) == MODIFY_EXPR
|
||||
|| TREE_CODE (ret_expr) == GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (ret_expr) == INIT_EXPR)
|
||||
&& TREE_CODE (result_decl) == RESULT_DECL);
|
||||
}
|
||||
@ -1177,10 +1179,10 @@ gimplify_return_expr (tree stmt, tree *pre_p)
|
||||
gimplify_ctxp->return_temp = result;
|
||||
}
|
||||
|
||||
/* Smash the lhs of the MODIFY_EXPR to the temporary we plan to use.
|
||||
/* Smash the lhs of the GIMPLE_MODIFY_STMT to the temporary we plan to use.
|
||||
Then gimplify the whole thing. */
|
||||
if (result != result_decl)
|
||||
TREE_OPERAND (ret_expr, 0) = result;
|
||||
GENERIC_TREE_OPERAND (ret_expr, 0) = result;
|
||||
|
||||
gimplify_and_add (TREE_OPERAND (stmt, 0), pre_p);
|
||||
|
||||
@ -1189,7 +1191,8 @@ gimplify_return_expr (tree stmt, tree *pre_p)
|
||||
if (result == result_decl)
|
||||
ret_expr = result;
|
||||
else
|
||||
ret_expr = build2 (MODIFY_EXPR, TREE_TYPE (result), result_decl, result);
|
||||
ret_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result), result_decl,
|
||||
result);
|
||||
TREE_OPERAND (stmt, 0) = ret_expr;
|
||||
|
||||
return GS_ALL_DONE;
|
||||
@ -1244,7 +1247,7 @@ gimplify_decl_expr (tree *stmt_p)
|
||||
t = built_in_decls[BUILT_IN_ALLOCA];
|
||||
t = build_function_call_expr (t, args);
|
||||
t = fold_convert (ptr_type, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, addr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
|
||||
|
||||
gimplify_and_add (t, stmt_p);
|
||||
|
||||
@ -1943,7 +1946,7 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
|
||||
}
|
||||
|
||||
t1 = build2 (arith_code, TREE_TYPE (*expr_p), lhs, rhs);
|
||||
t1 = build2 (MODIFY_EXPR, TREE_TYPE (lvalue), lvalue, t1);
|
||||
t1 = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (lvalue), lvalue, t1);
|
||||
|
||||
if (postfix)
|
||||
{
|
||||
@ -2466,12 +2469,14 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
|
||||
if this branch is void; in C++ it can be, if it's a throw. */
|
||||
if (TREE_TYPE (TREE_OPERAND (expr, 1)) != void_type_node)
|
||||
TREE_OPERAND (expr, 1)
|
||||
= build2 (MODIFY_EXPR, void_type_node, tmp, TREE_OPERAND (expr, 1));
|
||||
= build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp,
|
||||
TREE_OPERAND (expr, 1));
|
||||
|
||||
/* Build the else clause, 't1 = b;'. */
|
||||
if (TREE_TYPE (TREE_OPERAND (expr, 2)) != void_type_node)
|
||||
TREE_OPERAND (expr, 2)
|
||||
= build2 (MODIFY_EXPR, void_type_node, tmp2, TREE_OPERAND (expr, 2));
|
||||
= build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp2,
|
||||
TREE_OPERAND (expr, 2));
|
||||
|
||||
TREE_TYPE (expr) = void_type_node;
|
||||
recalculate_side_effects (expr);
|
||||
@ -2551,8 +2556,8 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value)
|
||||
{
|
||||
tree args, t, to, to_ptr, from;
|
||||
|
||||
to = TREE_OPERAND (*expr_p, 0);
|
||||
from = TREE_OPERAND (*expr_p, 1);
|
||||
to = GENERIC_TREE_OPERAND (*expr_p, 0);
|
||||
from = GENERIC_TREE_OPERAND (*expr_p, 1);
|
||||
|
||||
args = tree_cons (NULL, size, NULL);
|
||||
|
||||
@ -2583,7 +2588,7 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value)
|
||||
{
|
||||
tree args, t, to, to_ptr;
|
||||
|
||||
to = TREE_OPERAND (*expr_p, 0);
|
||||
to = GENERIC_TREE_OPERAND (*expr_p, 0);
|
||||
|
||||
args = tree_cons (NULL, size, NULL);
|
||||
|
||||
@ -2746,7 +2751,8 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
|
||||
/* Create and initialize the index variable. */
|
||||
var_type = TREE_TYPE (upper);
|
||||
var = create_tmp_var (var_type, NULL);
|
||||
append_to_statement_list (build2 (MODIFY_EXPR, var_type, var, lower), pre_p);
|
||||
append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var, lower),
|
||||
pre_p);
|
||||
|
||||
/* Add the loop entry label. */
|
||||
append_to_statement_list (build1 (LABEL_EXPR,
|
||||
@ -2767,7 +2773,7 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
|
||||
gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
|
||||
pre_p, cleared);
|
||||
else
|
||||
append_to_statement_list (build2 (MODIFY_EXPR, TREE_TYPE (cref),
|
||||
append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (cref),
|
||||
cref, value),
|
||||
pre_p);
|
||||
|
||||
@ -2782,7 +2788,7 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
|
||||
pre_p);
|
||||
|
||||
/* Otherwise, increment the index var... */
|
||||
append_to_statement_list (build2 (MODIFY_EXPR, var_type, var,
|
||||
append_to_statement_list (build2 (GIMPLE_MODIFY_STMT, var_type, var,
|
||||
build2 (PLUS_EXPR, var_type, var,
|
||||
fold_convert (var_type,
|
||||
integer_one_node))),
|
||||
@ -2918,7 +2924,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
|
||||
tree *post_p, bool want_value)
|
||||
{
|
||||
tree object;
|
||||
tree ctor = TREE_OPERAND (*expr_p, 1);
|
||||
tree ctor = GENERIC_TREE_OPERAND (*expr_p, 1);
|
||||
tree type = TREE_TYPE (ctor);
|
||||
enum gimplify_status ret;
|
||||
VEC(constructor_elt,gc) *elts;
|
||||
@ -2926,11 +2932,11 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
|
||||
if (TREE_CODE (ctor) != CONSTRUCTOR)
|
||||
return GS_UNHANDLED;
|
||||
|
||||
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
|
||||
ret = gimplify_expr (&GENERIC_TREE_OPERAND (*expr_p, 0), pre_p, post_p,
|
||||
is_gimple_lvalue, fb_lvalue);
|
||||
if (ret == GS_ERROR)
|
||||
return ret;
|
||||
object = TREE_OPERAND (*expr_p, 0);
|
||||
object = GENERIC_TREE_OPERAND (*expr_p, 0);
|
||||
|
||||
elts = CONSTRUCTOR_ELTS (ctor);
|
||||
|
||||
@ -3056,7 +3062,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
|
||||
}
|
||||
walk_tree (&DECL_INITIAL (new), force_labels_r, NULL, NULL);
|
||||
|
||||
TREE_OPERAND (*expr_p, 1) = new;
|
||||
GENERIC_TREE_OPERAND (*expr_p, 1) = new;
|
||||
|
||||
/* This is no longer an assignment of a CONSTRUCTOR, but
|
||||
we still may have processing to do on the LHS. So
|
||||
@ -3075,7 +3081,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
|
||||
preeval_data.lhs_base_decl = NULL;
|
||||
preeval_data.lhs_alias_set = get_alias_set (object);
|
||||
|
||||
gimplify_init_ctor_preeval (&TREE_OPERAND (*expr_p, 1),
|
||||
gimplify_init_ctor_preeval (&GENERIC_TREE_OPERAND (*expr_p, 1),
|
||||
pre_p, post_p, &preeval_data);
|
||||
}
|
||||
|
||||
@ -3462,8 +3468,8 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
|
||||
enum tree_code code, ocode;
|
||||
tree lhs, rhs, new_rhs, other, realpart, imagpart;
|
||||
|
||||
lhs = TREE_OPERAND (*expr_p, 0);
|
||||
rhs = TREE_OPERAND (*expr_p, 1);
|
||||
lhs = GENERIC_TREE_OPERAND (*expr_p, 0);
|
||||
rhs = GENERIC_TREE_OPERAND (*expr_p, 1);
|
||||
code = TREE_CODE (lhs);
|
||||
lhs = TREE_OPERAND (lhs, 0);
|
||||
|
||||
@ -3479,8 +3485,8 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
|
||||
else
|
||||
new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
|
||||
|
||||
TREE_OPERAND (*expr_p, 0) = lhs;
|
||||
TREE_OPERAND (*expr_p, 1) = new_rhs;
|
||||
GENERIC_TREE_OPERAND (*expr_p, 0) = lhs;
|
||||
GENERIC_TREE_OPERAND (*expr_p, 1) = new_rhs;
|
||||
|
||||
if (want_value)
|
||||
{
|
||||
@ -3491,6 +3497,53 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
|
||||
return GS_ALL_DONE;
|
||||
}
|
||||
|
||||
|
||||
/* Destructively convert the TREE pointer in TP into a gimple tuple if
|
||||
appropriate. */
|
||||
|
||||
static void
|
||||
tree_to_gimple_tuple (tree *tp)
|
||||
{
|
||||
|
||||
switch (TREE_CODE (*tp))
|
||||
{
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
return;
|
||||
case MODIFY_EXPR:
|
||||
{
|
||||
struct gimple_stmt *gs;
|
||||
tree lhs = TREE_OPERAND (*tp, 0);
|
||||
bool def_stmt_self_p = false;
|
||||
|
||||
if (TREE_CODE (lhs) == SSA_NAME)
|
||||
{
|
||||
if (SSA_NAME_DEF_STMT (lhs) == *tp)
|
||||
def_stmt_self_p = true;
|
||||
}
|
||||
|
||||
gs = &make_node (GIMPLE_MODIFY_STMT)->gstmt;
|
||||
gs->base = (*tp)->base;
|
||||
/* The set to base above overwrites the CODE. */
|
||||
TREE_SET_CODE ((tree) gs, GIMPLE_MODIFY_STMT);
|
||||
|
||||
gs->locus = EXPR_LOCUS (*tp);
|
||||
gs->operands[0] = TREE_OPERAND (*tp, 0);
|
||||
gs->operands[1] = TREE_OPERAND (*tp, 1);
|
||||
gs->block = TREE_BLOCK (*tp);
|
||||
*tp = (tree)gs;
|
||||
|
||||
/* If we re-gimplify a set to an SSA_NAME, we must change the
|
||||
SSA name's DEF_STMT link. */
|
||||
if (def_stmt_self_p)
|
||||
SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (*tp, 0)) = *tp;
|
||||
|
||||
return;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Gimplify the MODIFY_EXPR node pointed to by EXPR_P.
|
||||
|
||||
modify_expr
|
||||
@ -3509,11 +3562,12 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
|
||||
static enum gimplify_status
|
||||
gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
|
||||
{
|
||||
tree *from_p = &TREE_OPERAND (*expr_p, 1);
|
||||
tree *to_p = &TREE_OPERAND (*expr_p, 0);
|
||||
tree *from_p = &GENERIC_TREE_OPERAND (*expr_p, 1);
|
||||
tree *to_p = &GENERIC_TREE_OPERAND (*expr_p, 0);
|
||||
enum gimplify_status ret = GS_UNHANDLED;
|
||||
|
||||
gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
|
||||
|| TREE_CODE (*expr_p) == GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (*expr_p) == INIT_EXPR);
|
||||
|
||||
/* For zero sized types only gimplify the left hand side and right hand side
|
||||
@ -3592,6 +3646,8 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
|
||||
|
||||
if (want_value)
|
||||
{
|
||||
tree_to_gimple_tuple (expr_p);
|
||||
|
||||
append_to_statement_list (*expr_p, pre_p);
|
||||
*expr_p = *to_p;
|
||||
return GS_OK;
|
||||
@ -4182,9 +4238,9 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
|
||||
*/
|
||||
|
||||
tree flag = create_tmp_var (boolean_type_node, "cleanup");
|
||||
tree ffalse = build2 (MODIFY_EXPR, void_type_node, flag,
|
||||
tree ffalse = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
|
||||
boolean_false_node);
|
||||
tree ftrue = build2 (MODIFY_EXPR, void_type_node, flag,
|
||||
tree ftrue = build2 (GIMPLE_MODIFY_STMT, void_type_node, flag,
|
||||
boolean_true_node);
|
||||
cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
|
||||
wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
|
||||
@ -4883,8 +4939,9 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
|
||||
gimplify_scan_omp_clauses (&OMP_FOR_CLAUSES (for_stmt), pre_p, false, false);
|
||||
|
||||
t = OMP_FOR_INIT (for_stmt);
|
||||
gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
|
||||
decl = TREE_OPERAND (t, 0);
|
||||
gcc_assert (TREE_CODE (t) == MODIFY_EXPR
|
||||
|| TREE_CODE (t) == GIMPLE_MODIFY_STMT);
|
||||
decl = GENERIC_TREE_OPERAND (t, 0);
|
||||
gcc_assert (DECL_P (decl));
|
||||
gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (decl)));
|
||||
|
||||
@ -4894,16 +4951,21 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
|
||||
else
|
||||
omp_add_variable (gimplify_omp_ctxp, decl, GOVD_PRIVATE | GOVD_SEEN);
|
||||
|
||||
ret |= gimplify_expr (&TREE_OPERAND (t, 1), &OMP_FOR_PRE_BODY (for_stmt),
|
||||
ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
|
||||
&OMP_FOR_PRE_BODY (for_stmt),
|
||||
NULL, is_gimple_val, fb_rvalue);
|
||||
|
||||
tree_to_gimple_tuple (&OMP_FOR_INIT (for_stmt));
|
||||
|
||||
t = OMP_FOR_COND (for_stmt);
|
||||
gcc_assert (COMPARISON_CLASS_P (t));
|
||||
gcc_assert (TREE_OPERAND (t, 0) == decl);
|
||||
gcc_assert (GENERIC_TREE_OPERAND (t, 0) == decl);
|
||||
|
||||
ret |= gimplify_expr (&TREE_OPERAND (t, 1), &OMP_FOR_PRE_BODY (for_stmt),
|
||||
ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
|
||||
&OMP_FOR_PRE_BODY (for_stmt),
|
||||
NULL, is_gimple_val, fb_rvalue);
|
||||
|
||||
tree_to_gimple_tuple (&OMP_FOR_INCR (for_stmt));
|
||||
t = OMP_FOR_INCR (for_stmt);
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
@ -4917,13 +4979,13 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
|
||||
goto build_modify;
|
||||
build_modify:
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, decl, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, decl, t);
|
||||
OMP_FOR_INCR (for_stmt) = t;
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
gcc_assert (TREE_OPERAND (t, 0) == decl);
|
||||
t = TREE_OPERAND (t, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == decl);
|
||||
t = GIMPLE_STMT_OPERAND (t, 1);
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
case PLUS_EXPR:
|
||||
@ -5133,7 +5195,7 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
|
||||
return GS_ERROR;
|
||||
|
||||
x = build_fold_indirect_ref (addr);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, oldval, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
|
||||
gimplify_and_add (x, pre_p);
|
||||
|
||||
/* For floating-point values, we'll need to view-convert them to integers
|
||||
@ -5151,7 +5213,7 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
|
||||
newival = create_tmp_var (itype, NULL);
|
||||
|
||||
x = build1 (VIEW_CONVERT_EXPR, itype, oldval);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, oldival, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
|
||||
gimplify_and_add (x, pre_p);
|
||||
iaddr = fold_convert (build_pointer_type (itype), addr);
|
||||
}
|
||||
@ -5162,17 +5224,17 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
|
||||
x = build1 (LABEL_EXPR, void_type_node, label);
|
||||
gimplify_and_add (x, pre_p);
|
||||
|
||||
x = build2 (MODIFY_EXPR, void_type_node, newval, rhs);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newval, rhs);
|
||||
gimplify_and_add (x, pre_p);
|
||||
|
||||
if (newval != newival)
|
||||
{
|
||||
x = build1 (VIEW_CONVERT_EXPR, itype, newval);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, newival, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, newival, x);
|
||||
gimplify_and_add (x, pre_p);
|
||||
}
|
||||
|
||||
x = build2 (MODIFY_EXPR, void_type_node, oldival2,
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival2,
|
||||
fold_convert (itype, oldival));
|
||||
gimplify_and_add (x, pre_p);
|
||||
|
||||
@ -5182,14 +5244,14 @@ gimplify_omp_atomic_pipeline (tree *expr_p, tree *pre_p, tree addr,
|
||||
x = build_function_call_expr (cmpxchg, args);
|
||||
if (oldval == oldival)
|
||||
x = fold_convert (type, x);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, oldival, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldival, x);
|
||||
gimplify_and_add (x, pre_p);
|
||||
|
||||
/* For floating point, be prepared for the loop backedge. */
|
||||
if (oldval != oldival)
|
||||
{
|
||||
x = build1 (VIEW_CONVERT_EXPR, type, oldival);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, oldval, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, oldval, x);
|
||||
gimplify_and_add (x, pre_p);
|
||||
}
|
||||
|
||||
@ -5227,7 +5289,7 @@ gimplify_omp_atomic_mutex (tree *expr_p, tree *pre_p, tree addr, tree rhs)
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build_fold_indirect_ref (addr);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, t, rhs);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, t, rhs);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_END];
|
||||
@ -5362,7 +5424,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
|
||||
|
||||
/* Die, die, die, my darling. */
|
||||
if (save_expr == error_mark_node
|
||||
|| (TREE_TYPE (save_expr)
|
||||
|| (!GIMPLE_STMT_P (save_expr)
|
||||
&& TREE_TYPE (save_expr)
|
||||
&& TREE_TYPE (save_expr) == error_mark_node))
|
||||
{
|
||||
ret = GS_ERROR;
|
||||
@ -5438,14 +5501,23 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case INIT_EXPR:
|
||||
ret = gimplify_modify_expr (expr_p, pre_p, post_p,
|
||||
fallback != fb_none);
|
||||
|
||||
/* The distinction between MODIFY_EXPR and INIT_EXPR is no longer
|
||||
useful. */
|
||||
if (*expr_p && TREE_CODE (*expr_p) == INIT_EXPR)
|
||||
TREE_SET_CODE (*expr_p, MODIFY_EXPR);
|
||||
if (*expr_p)
|
||||
{
|
||||
/* The distinction between MODIFY_EXPR and INIT_EXPR is no longer
|
||||
useful. */
|
||||
if (TREE_CODE (*expr_p) == INIT_EXPR)
|
||||
TREE_SET_CODE (*expr_p, MODIFY_EXPR);
|
||||
|
||||
/* Convert MODIFY_EXPR to GIMPLE_MODIFY_STMT. */
|
||||
if (TREE_CODE (*expr_p) == MODIFY_EXPR)
|
||||
tree_to_gimple_tuple (expr_p);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRUTH_ANDIF_EXPR:
|
||||
@ -5885,7 +5957,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
|
||||
given a TREE_ADDRESSABLE type. */
|
||||
tree tmp = create_tmp_var_raw (type, "vol");
|
||||
gimple_add_tmp_var (tmp);
|
||||
*expr_p = build2 (MODIFY_EXPR, type, tmp, *expr_p);
|
||||
*expr_p = build2 (GIMPLE_MODIFY_STMT, type, tmp, *expr_p);
|
||||
}
|
||||
else
|
||||
/* We can't do anything useful with a volatile reference to
|
||||
@ -6117,7 +6189,7 @@ gimplify_one_sizepos (tree *expr_p, tree *stmt_p)
|
||||
|
||||
*expr_p = create_tmp_var (type, NULL);
|
||||
tmp = build1 (NOP_EXPR, type, expr);
|
||||
tmp = build2 (MODIFY_EXPR, type, *expr_p, tmp);
|
||||
tmp = build2 (GIMPLE_MODIFY_STMT, type, *expr_p, tmp);
|
||||
if (EXPR_HAS_LOCATION (expr))
|
||||
SET_EXPR_LOCUS (tmp, EXPR_LOCUS (expr));
|
||||
else
|
||||
@ -6340,10 +6412,10 @@ gimplify_function_tree (tree fndecl)
|
||||
DECL_SAVED_TREE (fndecl) = bind;
|
||||
}
|
||||
|
||||
cfun->gimplified = true;
|
||||
current_function_decl = oldfn;
|
||||
cfun = oldfn ? DECL_STRUCT_FUNCTION (oldfn) : NULL;
|
||||
}
|
||||
|
||||
|
||||
/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true,
|
||||
force the result to be either ssa_name or an invariant, otherwise
|
||||
@ -6368,7 +6440,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
|
||||
gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
|
||||
|
||||
if (var)
|
||||
expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
|
||||
expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), var, expr);
|
||||
|
||||
ret = gimplify_expr (&expr, stmts, NULL,
|
||||
gimple_test_f, fb_rvalue);
|
||||
|
@ -446,7 +446,7 @@ constant_val_insert (tree fn, tree parm1, tree val)
|
||||
edge e_step;
|
||||
edge_iterator ei;
|
||||
|
||||
init_stmt = build2 (MODIFY_EXPR, void_type_node, parm1, val);
|
||||
init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, parm1, val);
|
||||
func = DECL_STRUCT_FUNCTION (fn);
|
||||
cfun = func;
|
||||
current_function_decl = fn;
|
||||
|
@ -247,10 +247,10 @@ ipa_method_modify_stmt (struct cgraph_node *mt, tree stmt)
|
||||
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 0)) == PARM_DECL)
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == PARM_DECL)
|
||||
{
|
||||
i = ipa_method_tree_map (mt, TREE_OPERAND (stmt, 0));
|
||||
i = ipa_method_tree_map (mt, GIMPLE_STMT_OPERAND (stmt, 0));
|
||||
if (i >= 0)
|
||||
ipa_method_modify_set (mt, i, true);
|
||||
}
|
||||
|
@ -412,11 +412,11 @@ scan_function (tree *tp,
|
||||
*walk_subtrees = 0;
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
/* First look on the lhs and see what variable is stored to */
|
||||
tree lhs = TREE_OPERAND (t, 0);
|
||||
tree rhs = TREE_OPERAND (t, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (t, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (t, 1);
|
||||
check_lhs_var (local, lhs);
|
||||
|
||||
/* For the purposes of figuring out what the cast affects */
|
||||
|
@ -494,11 +494,11 @@ scan_for_static_refs (tree *tp,
|
||||
*walk_subtrees = 0;
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
/* First look on the lhs and see what variable is stored to */
|
||||
tree lhs = TREE_OPERAND (t, 0);
|
||||
tree rhs = TREE_OPERAND (t, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (t, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (t, 1);
|
||||
check_lhs_var (local, lhs);
|
||||
|
||||
/* For the purposes of figuring out what the cast affects */
|
||||
|
@ -1184,11 +1184,11 @@ scan_for_refs (tree *tp, int *walk_subtrees, void *data)
|
||||
*walk_subtrees = 0;
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
/* First look on the lhs and see what variable is stored to */
|
||||
tree lhs = TREE_OPERAND (t, 0);
|
||||
tree rhs = TREE_OPERAND (t, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (t, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (t, 1);
|
||||
|
||||
check_lhs_var (lhs);
|
||||
check_cast (TREE_TYPE (lhs), rhs);
|
||||
|
@ -120,6 +120,9 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
|
||||
*expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false);
|
||||
return GS_UNHANDLED;
|
||||
|
||||
/* We don't handle GIMPLE_MODIFY_STMT, as MODIFY_EXPRs with java
|
||||
semantics should only be generated by the front-end, and never
|
||||
by anything after gimplification. */
|
||||
case MODIFY_EXPR:
|
||||
return java_gimplify_modify_expr (expr_p, pre_p, post_p);
|
||||
|
||||
@ -326,7 +329,7 @@ java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p)
|
||||
{
|
||||
tree new_lhs = java_replace_reference (lhs, /* want_lvalue */ true);
|
||||
tree new_rhs = build1 (NOP_EXPR, TREE_TYPE (new_lhs), rhs);
|
||||
modify_expr = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs),
|
||||
modify_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new_lhs),
|
||||
new_lhs, new_rhs);
|
||||
modify_expr = build1 (NOP_EXPR, lhs_type, modify_expr);
|
||||
}
|
||||
@ -424,7 +427,7 @@ java_gimplify_new_array_init (tree exp)
|
||||
|
||||
tree array_ptr_type = build_pointer_type (array_type);
|
||||
tree tmp = create_tmp_var (array_ptr_type, "array");
|
||||
tree body = build2 (MODIFY_EXPR, array_ptr_type, tmp,
|
||||
tree body = build2 (GIMPLE_MODIFY_STMT, array_ptr_type, tmp,
|
||||
build_new_array (element_type, length));
|
||||
|
||||
int index = 0;
|
||||
@ -437,7 +440,7 @@ java_gimplify_new_array_init (tree exp)
|
||||
tree lhs = build3 (COMPONENT_REF, TREE_TYPE (data_field),
|
||||
build_java_indirect_ref (array_type, tmp, 0),
|
||||
data_field, NULL_TREE);
|
||||
tree assignment = build2 (MODIFY_EXPR, element_type,
|
||||
tree assignment = build2 (GIMPLE_MODIFY_STMT, element_type,
|
||||
build4 (ARRAY_REF, element_type, lhs,
|
||||
build_int_cst (NULL_TREE, index++),
|
||||
NULL_TREE, NULL_TREE),
|
||||
|
@ -725,7 +725,8 @@ struct lang_identifier GTY(())
|
||||
/* The resulting tree type. */
|
||||
union lang_tree_node
|
||||
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
|
||||
chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
|
||||
chain_next ("(GIMPLE_STMT_P (&%h.generic) ? (union lang_tree_node *) 0 : (union lang_tree_node *)TREE_CHAIN (&%h.generic))")))
|
||||
|
||||
{
|
||||
union tree_node GTY ((tag ("0"),
|
||||
desc ("tree_node_structure (&%h)")))
|
||||
@ -1881,12 +1882,12 @@ enum
|
||||
|
||||
/* In an EXPR_WITH_FILE_LOCATION node. */
|
||||
#define EXPR_WFL_EMIT_LINE_NOTE(NODE) \
|
||||
(EXPR_WITH_FILE_LOCATION_CHECK (NODE)->common.public_flag)
|
||||
(EXPR_WITH_FILE_LOCATION_CHECK (NODE)->base.public_flag)
|
||||
#undef EXPR_WFL_NODE
|
||||
#define EXPR_WFL_NODE(NODE) \
|
||||
TREE_OPERAND (EXPR_WITH_FILE_LOCATION_CHECK (NODE), 0)
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
#define EXPR_WFL_LINECOL(NODE) ((NODE)->exp.locus)
|
||||
#define EXPR_WFL_LINECOL(NODE) EXPR_LOCUS(NODE)
|
||||
#define EXPR_WFL_FILENAME(NODE) EXPR_FILENAME (NODE)
|
||||
#define EXPR_WFL_LINENO(NODE) EXPR_LINENO (NODE)
|
||||
extern tree build_expr_wfl (tree, source_location);
|
||||
|
@ -1540,9 +1540,10 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
|
||||
add_referenced_var (resvar);
|
||||
|
||||
/* Start at 0. */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, integer_zero_node);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
integer_zero_node);
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
|
||||
@ -1555,20 +1556,20 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
|
||||
|
||||
/* newname = coefficient * induction_variable */
|
||||
coeffmult = build_int_cst (type, LBV_COEFFICIENTS (lbv)[i]);
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
fold_build2 (MULT_EXPR, type, iv, coeffmult));
|
||||
|
||||
newname = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = newname;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
|
||||
/* name = name + newname */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (PLUS_EXPR, type, name, newname));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1580,10 +1581,10 @@ lbv_to_gcc_expression (lambda_body_vector lbv,
|
||||
if (LBV_DENOMINATOR (lbv) != 1)
|
||||
{
|
||||
tree denominator = build_int_cst (type, LBV_DENOMINATOR (lbv));
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (CEIL_DIV_EXPR, type, name, denominator));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1631,9 +1632,10 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
for (; lle != NULL; lle = LLE_NEXT (lle))
|
||||
{
|
||||
/* Start at name = 0. */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, integer_zero_node);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
integer_zero_node);
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1662,18 +1664,18 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
}
|
||||
|
||||
/* newname = mult */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, mult);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, mult);
|
||||
newname = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = newname;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
|
||||
/* name = name + newname */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (PLUS_EXPR, type, name, newname));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1703,18 +1705,18 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
}
|
||||
|
||||
/* newname = mult */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, mult);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, mult);
|
||||
newname = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = newname;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = newname;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
|
||||
/* name = name + newname */
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (PLUS_EXPR, type, name, newname));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1725,11 +1727,11 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
name = name + constant. */
|
||||
if (LLE_CONSTANT (lle) != 0)
|
||||
{
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (PLUS_EXPR, type, name,
|
||||
build_int_cst (type, LLE_CONSTANT (lle))));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1739,11 +1741,11 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
name = name + linear offset. */
|
||||
if (LLE_CONSTANT (offset) != 0)
|
||||
{
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (PLUS_EXPR, type, name,
|
||||
build_int_cst (type, LLE_CONSTANT (offset))));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
fold_stmt (&stmt);
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
@ -1755,11 +1757,11 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
stmt = build_int_cst (type, LLE_DENOMINATOR (lle));
|
||||
stmt = build2 (wrap == MAX_EXPR ? CEIL_DIV_EXPR : FLOOR_DIV_EXPR,
|
||||
type, name, stmt);
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar, stmt);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar, stmt);
|
||||
|
||||
/* name = {ceil, floor}(name/denominator) */
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
}
|
||||
@ -1775,10 +1777,10 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
||||
{
|
||||
tree op1 = VEC_index (tree, results, 0);
|
||||
tree op2 = VEC_index (tree, results, 1);
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, resvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, resvar,
|
||||
build2 (wrap, type, op1, op2));
|
||||
name = make_ssa_name (resvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
tsi = tsi_last (stmts);
|
||||
tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING);
|
||||
}
|
||||
@ -1893,10 +1895,10 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
|
||||
test, and let redundancy elimination sort it out. */
|
||||
inc_stmt = build2 (PLUS_EXPR, type,
|
||||
ivvar, build_int_cst (type, LL_STEP (newloop)));
|
||||
inc_stmt = build2 (MODIFY_EXPR, void_type_node, SSA_NAME_VAR (ivvar),
|
||||
inc_stmt);
|
||||
inc_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
|
||||
SSA_NAME_VAR (ivvar), inc_stmt);
|
||||
ivvarinced = make_ssa_name (SSA_NAME_VAR (ivvar), inc_stmt);
|
||||
TREE_OPERAND (inc_stmt, 0) = ivvarinced;
|
||||
GIMPLE_STMT_OPERAND (inc_stmt, 0) = ivvarinced;
|
||||
bsi = bsi_for_stmt (exitcond);
|
||||
bsi_insert_before (&bsi, inc_stmt, BSI_SAME_STMT);
|
||||
|
||||
@ -2185,9 +2187,9 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
|
||||
var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
|
||||
add_referenced_var (var);
|
||||
val = force_gimple_operand_bsi (firstbsi, val, false, NULL);
|
||||
setstmt = build2 (MODIFY_EXPR, void_type_node, var, val);
|
||||
setstmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, val);
|
||||
var = make_ssa_name (var, setstmt);
|
||||
TREE_OPERAND (setstmt, 0) = var;
|
||||
GIMPLE_STMT_OPERAND (setstmt, 0) = var;
|
||||
bsi_insert_before (firstbsi, setstmt, BSI_SAME_STMT);
|
||||
update_stmt (setstmt);
|
||||
SET_USE (use_p, var);
|
||||
@ -2224,12 +2226,12 @@ can_put_in_inner_loop (struct loop *inner, tree stmt)
|
||||
imm_use_iterator imm_iter;
|
||||
use_operand_p use_p;
|
||||
|
||||
gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
|
||||
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)
|
||||
|| !expr_invariant_in_loop_p (inner, TREE_OPERAND (stmt, 1)))
|
||||
|| !expr_invariant_in_loop_p (inner, GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
return false;
|
||||
|
||||
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, TREE_OPERAND (stmt, 0))
|
||||
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, GIMPLE_STMT_OPERAND (stmt, 0))
|
||||
{
|
||||
if (!exit_phi_for_loop_p (inner, USE_STMT (use_p)))
|
||||
{
|
||||
@ -2252,7 +2254,7 @@ can_put_after_inner_loop (struct loop *loop, tree stmt)
|
||||
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
|
||||
return false;
|
||||
|
||||
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, TREE_OPERAND (stmt, 0))
|
||||
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, GIMPLE_STMT_OPERAND (stmt, 0))
|
||||
{
|
||||
if (!exit_phi_for_loop_p (loop, USE_STMT (use_p)))
|
||||
{
|
||||
@ -2310,12 +2312,12 @@ can_convert_to_perfect_nest (struct loop *loop)
|
||||
win we get from rearranging the memory walk
|
||||
the loop is doing so that it has better
|
||||
cache behavior. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
use_operand_p use_a, use_b;
|
||||
imm_use_iterator imm_iter;
|
||||
ssa_op_iter op_iter, op_iter1;
|
||||
tree op0 = TREE_OPERAND (stmt, 0);
|
||||
tree op0 = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree scev = instantiate_parameters
|
||||
(loop, analyze_scalar_evolution (loop, op0));
|
||||
|
||||
@ -2538,10 +2540,10 @@ perfect_nestify (struct loop *loop,
|
||||
exit_condition = get_loop_exit_condition (newloop);
|
||||
uboundvar = create_tmp_var (integer_type_node, "uboundvar");
|
||||
add_referenced_var (uboundvar);
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, uboundvar,
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, uboundvar,
|
||||
VEC_index (tree, ubounds, 0));
|
||||
uboundvar = make_ssa_name (uboundvar, stmt);
|
||||
TREE_OPERAND (stmt, 0) = uboundvar;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = uboundvar;
|
||||
|
||||
if (insert_after)
|
||||
bsi_insert_after (&bsi, stmt, BSI_SAME_STMT);
|
||||
|
@ -577,7 +577,7 @@ lhd_omp_predetermined_sharing (tree decl ATTRIBUTE_UNUSED)
|
||||
tree
|
||||
lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src)
|
||||
{
|
||||
return build2 (MODIFY_EXPR, void_type_node, dst, src);
|
||||
return build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
|
||||
}
|
||||
|
||||
/* Register language specific type size variables as potentially OpenMP
|
||||
|
@ -157,11 +157,11 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd)
|
||||
fd->pre = NULL;
|
||||
|
||||
t = OMP_FOR_INIT (for_stmt);
|
||||
gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
|
||||
fd->v = TREE_OPERAND (t, 0);
|
||||
gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
|
||||
fd->v = GIMPLE_STMT_OPERAND (t, 0);
|
||||
gcc_assert (DECL_P (fd->v));
|
||||
gcc_assert (TREE_CODE (TREE_TYPE (fd->v)) == INTEGER_TYPE);
|
||||
fd->n1 = TREE_OPERAND (t, 1);
|
||||
fd->n1 = GIMPLE_STMT_OPERAND (t, 1);
|
||||
|
||||
t = OMP_FOR_COND (for_stmt);
|
||||
fd->cond_code = TREE_CODE (t);
|
||||
@ -187,9 +187,9 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd)
|
||||
}
|
||||
|
||||
t = OMP_FOR_INCR (fd->for_stmt);
|
||||
gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_OPERAND (t, 0) == fd->v);
|
||||
t = TREE_OPERAND (t, 1);
|
||||
gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
|
||||
gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == fd->v);
|
||||
t = GIMPLE_STMT_OPERAND (t, 1);
|
||||
gcc_assert (TREE_OPERAND (t, 0) == fd->v);
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
@ -1680,7 +1680,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
|
||||
x = built_in_decls[BUILT_IN_ALLOCA];
|
||||
x = build_function_call_expr (x, args);
|
||||
x = fold_convert (TREE_TYPE (ptr), x);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, ptr, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ptr, x);
|
||||
gimplify_and_add (x, ilist);
|
||||
}
|
||||
else if (is_reference (var))
|
||||
@ -1716,7 +1716,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
|
||||
x = fold_convert (TREE_TYPE (new_var), x);
|
||||
}
|
||||
|
||||
x = build2 (MODIFY_EXPR, void_type_node, new_var, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
|
||||
gimplify_and_add (x, ilist);
|
||||
|
||||
new_var = build_fold_indirect_ref (new_var);
|
||||
@ -1799,7 +1799,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
|
||||
{
|
||||
x = omp_reduction_init (c, TREE_TYPE (new_var));
|
||||
gcc_assert (TREE_CODE (TREE_TYPE (new_var)) != ARRAY_TYPE);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, new_var, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, x);
|
||||
gimplify_and_add (x, ilist);
|
||||
}
|
||||
break;
|
||||
@ -1964,7 +1964,7 @@ lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
|
||||
{
|
||||
x = build2 (code, TREE_TYPE (ref), ref, new_var);
|
||||
ref = build_outer_var_ref (var, ctx);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, ref, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
|
||||
append_to_statement_list (x, &sub_list);
|
||||
}
|
||||
}
|
||||
@ -2003,7 +2003,7 @@ lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
|
||||
ref = build_sender_ref (var, ctx);
|
||||
x = (ctx->is_nested) ? lookup_decl_in_outer_ctx (var, ctx) : var;
|
||||
x = by_ref ? build_fold_addr_expr (x) : x;
|
||||
x = build2 (MODIFY_EXPR, void_type_node, ref, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
|
||||
gimplify_and_add (x, slist);
|
||||
|
||||
ref = build_receiver_ref (var, by_ref, ctx);
|
||||
@ -2084,14 +2084,14 @@ lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
|
||||
{
|
||||
ref = build_sender_ref (val, ctx);
|
||||
x = by_ref ? build_fold_addr_expr (var) : var;
|
||||
x = build2 (MODIFY_EXPR, void_type_node, ref, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, ref, x);
|
||||
gimplify_and_add (x, ilist);
|
||||
}
|
||||
|
||||
if (do_out)
|
||||
{
|
||||
ref = build_sender_ref (val, ctx);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, var, ref);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, ref);
|
||||
gimplify_and_add (x, olist);
|
||||
}
|
||||
}
|
||||
@ -2128,17 +2128,17 @@ lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
|
||||
{
|
||||
x = build_sender_ref (ovar, ctx);
|
||||
var = build_fold_addr_expr (var);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, x, var);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
|
||||
gimplify_and_add (x, ilist);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = build_sender_ref (ovar, ctx);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, x, var);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, var);
|
||||
gimplify_and_add (x, ilist);
|
||||
|
||||
x = build_sender_ref (ovar, ctx);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, var, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, x);
|
||||
gimplify_and_add (x, olist);
|
||||
}
|
||||
}
|
||||
@ -2236,13 +2236,13 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
|
||||
si = bsi_start (then_bb);
|
||||
t = build1 (LABEL_EXPR, void_type_node, then_lab);
|
||||
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, tmp, val);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp, val);
|
||||
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
|
||||
|
||||
si = bsi_start (else_bb);
|
||||
t = build1 (LABEL_EXPR, void_type_node, else_lab);
|
||||
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, tmp,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp,
|
||||
build_int_cst (unsigned_type_node, 1));
|
||||
bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
|
||||
|
||||
@ -2483,19 +2483,20 @@ expand_omp_parallel (struct omp_region *region)
|
||||
|
||||
gcc_assert (!bsi_end_p (si));
|
||||
stmt = bsi_stmt (si);
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
continue;
|
||||
|
||||
arg = TREE_OPERAND (stmt, 1);
|
||||
arg = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
STRIP_NOPS (arg);
|
||||
if (TREE_CODE (arg) == ADDR_EXPR
|
||||
&& TREE_OPERAND (arg, 0)
|
||||
== OMP_PARALLEL_DATA_ARG (entry_stmt))
|
||||
{
|
||||
if (TREE_OPERAND (stmt, 0) == DECL_ARGUMENTS (child_fn))
|
||||
if (GIMPLE_STMT_OPERAND (stmt, 0)
|
||||
== DECL_ARGUMENTS (child_fn))
|
||||
bsi_remove (&si, true);
|
||||
else
|
||||
TREE_OPERAND (stmt, 1) = DECL_ARGUMENTS (child_fn);
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = DECL_ARGUMENTS (child_fn);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2651,11 +2652,11 @@ expand_omp_for_generic (struct omp_region *region,
|
||||
/* Iteration setup for sequential loop goes in L0_BB. */
|
||||
list = alloc_stmt_list ();
|
||||
t = fold_convert (type, istart0);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = fold_convert (type, iend0);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, iend, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, iend, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
si = bsi_start (l0_bb);
|
||||
@ -2677,7 +2678,7 @@ expand_omp_for_generic (struct omp_region *region,
|
||||
list = alloc_stmt_list ();
|
||||
|
||||
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = build2 (fd->cond_code, boolean_type_node, fd->v, iend);
|
||||
@ -2856,7 +2857,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
|
||||
t = fold_convert (type, s0);
|
||||
t = build2 (MULT_EXPR, type, t, fd->step);
|
||||
t = build2 (PLUS_EXPR, type, t, fd->n1);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = fold_convert (type, e0);
|
||||
@ -2871,7 +2872,7 @@ expand_omp_for_static_nochunk (struct omp_region *region,
|
||||
list = alloc_stmt_list ();
|
||||
|
||||
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
|
||||
@ -3040,7 +3041,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
|
||||
t = fold_convert (type, s0);
|
||||
t = build2 (MULT_EXPR, type, t, fd->step);
|
||||
t = build2 (PLUS_EXPR, type, t, fd->n1);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = fold_convert (type, e0);
|
||||
@ -3056,7 +3057,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
|
||||
list = alloc_stmt_list ();
|
||||
|
||||
t = build2 (PLUS_EXPR, type, fd->v, fd->step);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, fd->v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, fd->v, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
t = build2 (fd->cond_code, boolean_type_node, fd->v, e);
|
||||
@ -3075,7 +3076,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
|
||||
|
||||
t = build_int_cst (type, 1);
|
||||
t = build2 (PLUS_EXPR, type, trip, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, trip, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, trip, t);
|
||||
gimplify_and_add (t, &list);
|
||||
|
||||
si = bsi_start (trip_update_bb);
|
||||
@ -3224,7 +3225,7 @@ expand_omp_sections (struct omp_region *region)
|
||||
t = tree_cons (NULL, t, NULL);
|
||||
u = built_in_decls[BUILT_IN_GOMP_SECTIONS_START];
|
||||
t = build_function_call_expr (u, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
|
||||
bsi_insert_after (&si, t, BSI_SAME_STMT);
|
||||
}
|
||||
bsi_remove (&si, true);
|
||||
@ -3293,7 +3294,7 @@ expand_omp_sections (struct omp_region *region)
|
||||
|
||||
t = built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT];
|
||||
t = build_function_call_expr (t, NULL);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, v, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, v, t);
|
||||
bsi_insert_after (&si, t, BSI_SAME_STMT);
|
||||
bsi_remove (&si, true);
|
||||
}
|
||||
@ -3731,7 +3732,7 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
|
||||
t = built_in_decls[BUILT_IN_GOMP_SINGLE_COPY_START];
|
||||
t = build_function_call_expr (t, NULL);
|
||||
t = fold_convert (ptr_type, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
|
||||
gimplify_and_add (t, pre_p);
|
||||
|
||||
t = build2 (EQ_EXPR, boolean_type_node, ctx->receiver_decl,
|
||||
@ -4048,7 +4049,7 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
|
||||
|
||||
We just need to make sure that VAL1, VAL2 and VAL3 are lowered
|
||||
using the .omp_data_s mapping, if needed. */
|
||||
rhs_p = &TREE_OPERAND (OMP_FOR_INIT (stmt), 1);
|
||||
rhs_p = &GIMPLE_STMT_OPERAND (OMP_FOR_INIT (stmt), 1);
|
||||
if (!is_gimple_min_invariant (*rhs_p))
|
||||
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
|
||||
|
||||
@ -4056,7 +4057,7 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
|
||||
if (!is_gimple_min_invariant (*rhs_p))
|
||||
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
|
||||
|
||||
rhs_p = &TREE_OPERAND (TREE_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
|
||||
rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
|
||||
if (!is_gimple_min_invariant (*rhs_p))
|
||||
*rhs_p = get_formal_tmp_var (*rhs_p, body_p);
|
||||
|
||||
@ -4144,7 +4145,7 @@ lower_omp_parallel (tree *stmt_p, omp_context *ctx)
|
||||
t = build_fold_addr_expr (ctx->sender_decl);
|
||||
/* fixup_child_record_type might have changed receiver_decl's type. */
|
||||
t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, ctx->receiver_decl, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, ctx->receiver_decl, t);
|
||||
append_to_statement_list (t, &new_body);
|
||||
}
|
||||
|
||||
|
@ -902,9 +902,10 @@ expr_expected_value (tree expr, bitmap visited)
|
||||
}
|
||||
return val;
|
||||
}
|
||||
if (TREE_CODE (def) != MODIFY_EXPR || TREE_OPERAND (def, 0) != expr)
|
||||
if (TREE_CODE (def) != GIMPLE_MODIFY_STMT
|
||||
|| GIMPLE_STMT_OPERAND (def, 0) != expr)
|
||||
return NULL;
|
||||
return expr_expected_value (TREE_OPERAND (def, 1), visited);
|
||||
return expr_expected_value (GIMPLE_STMT_OPERAND (def, 1), visited);
|
||||
}
|
||||
else if (TREE_CODE (expr) == CALL_EXPR)
|
||||
{
|
||||
@ -968,15 +969,15 @@ strip_builtin_expect (void)
|
||||
tree fndecl;
|
||||
tree arglist;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR
|
||||
&& (fndecl = get_callee_fndecl (TREE_OPERAND (stmt, 1)))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR
|
||||
&& (fndecl = get_callee_fndecl (GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|
||||
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
|
||||
&& (arglist = TREE_OPERAND (TREE_OPERAND (stmt, 1), 1))
|
||||
&& (arglist = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 1))
|
||||
&& TREE_CHAIN (arglist))
|
||||
{
|
||||
TREE_OPERAND (stmt, 1) = TREE_VALUE (arglist);
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = TREE_VALUE (arglist);
|
||||
update_stmt (stmt);
|
||||
}
|
||||
}
|
||||
@ -1167,8 +1168,8 @@ apply_return_prediction (int *heads)
|
||||
return_val = TREE_OPERAND (return_stmt, 0);
|
||||
if (!return_val)
|
||||
return;
|
||||
if (TREE_CODE (return_val) == MODIFY_EXPR)
|
||||
return_val = TREE_OPERAND (return_val, 1);
|
||||
if (TREE_CODE (return_val) == GIMPLE_MODIFY_STMT)
|
||||
return_val = GIMPLE_STMT_OPERAND (return_val, 1);
|
||||
if (TREE_CODE (return_val) != SSA_NAME
|
||||
|| !SSA_NAME_DEF_STMT (return_val)
|
||||
|| TREE_CODE (SSA_NAME_DEF_STMT (return_val)) != PHI_NODE)
|
||||
@ -1221,10 +1222,10 @@ tree_bb_level_predictions (void)
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
|
||||
{
|
||||
stmt = TREE_OPERAND (stmt, 1);
|
||||
stmt = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
goto call_expr;
|
||||
}
|
||||
break;
|
||||
@ -1306,8 +1307,9 @@ tree_estimate_probability (void)
|
||||
{
|
||||
tree stmt = bsi_stmt (bi);
|
||||
if ((TREE_CODE (stmt) == CALL_EXPR
|
||||
|| (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR))
|
||||
|| (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1))
|
||||
== CALL_EXPR))
|
||||
/* Constant and pure calls are hardly used to signalize
|
||||
something exceptional. */
|
||||
&& TREE_SIDE_EFFECTS (stmt))
|
||||
|
@ -263,7 +263,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||
if (indent <= 4)
|
||||
print_node_brief (file, "type", TREE_TYPE (node), indent + 4);
|
||||
}
|
||||
else
|
||||
else if (!GIMPLE_TUPLE_P (node))
|
||||
{
|
||||
print_node (file, "type", TREE_TYPE (node), indent + 4);
|
||||
if (TREE_TYPE (node))
|
||||
@ -679,6 +679,18 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||
print_node (file, "chain", TREE_CHAIN (node), indent + 4);
|
||||
break;
|
||||
|
||||
case tcc_gimple_stmt:
|
||||
len = TREE_CODE_LENGTH (TREE_CODE (node));
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
char temp[10];
|
||||
|
||||
sprintf (temp, "arg %d", i);
|
||||
print_node (file, temp, GIMPLE_STMT_OPERAND (node, i), indent + 4);
|
||||
}
|
||||
break;
|
||||
|
||||
case tcc_constant:
|
||||
case tcc_exceptional:
|
||||
switch (TREE_CODE (node))
|
||||
|
12
gcc/stmt.c
12
gcc/stmt.c
@ -1362,6 +1362,9 @@ expand_expr_stmt (tree exp)
|
||||
tree type;
|
||||
|
||||
value = expand_expr (exp, const0_rtx, VOIDmode, 0);
|
||||
if (GIMPLE_TUPLE_P (exp))
|
||||
type = void_type_node;
|
||||
else
|
||||
type = TREE_TYPE (exp);
|
||||
|
||||
/* If all we do is reference a volatile value in memory,
|
||||
@ -1415,6 +1418,7 @@ warn_if_unused_value (tree exp, location_t locus)
|
||||
case PREDECREMENT_EXPR:
|
||||
case POSTDECREMENT_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case INIT_EXPR:
|
||||
case TARGET_EXPR:
|
||||
case CALL_EXPR:
|
||||
@ -1582,10 +1586,10 @@ expand_return (tree retval)
|
||||
expand_null_return ();
|
||||
return;
|
||||
}
|
||||
else if ((TREE_CODE (retval) == MODIFY_EXPR
|
||||
else if ((TREE_CODE (retval) == GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (retval) == INIT_EXPR)
|
||||
&& TREE_CODE (TREE_OPERAND (retval, 0)) == RESULT_DECL)
|
||||
retval_rhs = TREE_OPERAND (retval, 1);
|
||||
&& TREE_CODE (GENERIC_TREE_OPERAND (retval, 0)) == RESULT_DECL)
|
||||
retval_rhs = GENERIC_TREE_OPERAND (retval, 1);
|
||||
else
|
||||
retval_rhs = retval;
|
||||
|
||||
@ -1604,7 +1608,7 @@ expand_return (tree retval)
|
||||
(and in expand_call). */
|
||||
|
||||
else if (retval_rhs != 0
|
||||
&& TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode
|
||||
&& TYPE_MODE (GENERIC_TREE_TYPE (retval_rhs)) == BLKmode
|
||||
&& REG_P (result_rtl))
|
||||
{
|
||||
int i;
|
||||
|
@ -314,8 +314,8 @@ factor_computed_gotos (void)
|
||||
}
|
||||
|
||||
/* Copy the original computed goto's destination into VAR. */
|
||||
assignment = build2 (MODIFY_EXPR, ptr_type_node,
|
||||
var, GOTO_DESTINATION (last));
|
||||
assignment = build2_gimple (GIMPLE_MODIFY_STMT,
|
||||
var, GOTO_DESTINATION (last));
|
||||
bsi_insert_before (&bsi, assignment, BSI_SAME_STMT);
|
||||
|
||||
/* And re-vector the computed goto to the new destination. */
|
||||
@ -501,11 +501,14 @@ make_edges (void)
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
gcc_unreachable ();
|
||||
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
if (is_ctrl_altering_stmt (last))
|
||||
{
|
||||
/* A MODIFY_EXPR may have a CALL_EXPR on its RHS and the
|
||||
CALL_EXPR may have an abnormal edge. Search the RHS for
|
||||
this case and create any required edges. */
|
||||
/* A GIMPLE_MODIFY_STMT may have a CALL_EXPR on its RHS and
|
||||
the CALL_EXPR may have an abnormal edge. Search the RHS
|
||||
for this case and create any required edges. */
|
||||
if (tree_can_make_abnormal_goto (last))
|
||||
make_abnormal_goto_edges (bb, true);
|
||||
|
||||
@ -1330,7 +1333,7 @@ tree_merge_blocks (basic_block a, basic_block b)
|
||||
with ordering of phi nodes. This is because A is the single
|
||||
predecessor of B, therefore results of the phi nodes cannot
|
||||
appear as arguments of the phi nodes. */
|
||||
copy = build2 (MODIFY_EXPR, void_type_node, def, use);
|
||||
copy = build2_gimple (GIMPLE_MODIFY_STMT, def, use);
|
||||
bsi_insert_after (&bsi, copy, BSI_NEW_STMT);
|
||||
SET_PHI_RESULT (phi, NULL_TREE);
|
||||
SSA_NAME_DEF_STMT (def) = copy;
|
||||
@ -1559,9 +1562,9 @@ remove_useless_stmts_cond (tree *stmt_p, struct rus_data *data)
|
||||
else if (TREE_CODE (cond) == VAR_DECL || TREE_CODE (cond) == PARM_DECL)
|
||||
{
|
||||
if (else_stmt
|
||||
&& TREE_CODE (else_stmt) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (else_stmt, 0) == cond
|
||||
&& integer_zerop (TREE_OPERAND (else_stmt, 1)))
|
||||
&& TREE_CODE (else_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& GIMPLE_STMT_OPERAND (else_stmt, 0) == cond
|
||||
&& integer_zerop (GIMPLE_STMT_OPERAND (else_stmt, 1)))
|
||||
COND_EXPR_ELSE (*stmt_p) = alloc_stmt_list ();
|
||||
}
|
||||
else if ((TREE_CODE (cond) == EQ_EXPR || TREE_CODE (cond) == NE_EXPR)
|
||||
@ -1576,9 +1579,9 @@ remove_useless_stmts_cond (tree *stmt_p, struct rus_data *data)
|
||||
: &COND_EXPR_ELSE (*stmt_p));
|
||||
|
||||
if (stmt
|
||||
&& TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (stmt, 0) == TREE_OPERAND (cond, 0)
|
||||
&& TREE_OPERAND (stmt, 1) == TREE_OPERAND (cond, 1))
|
||||
&& TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& GIMPLE_STMT_OPERAND (stmt, 0) == TREE_OPERAND (cond, 0)
|
||||
&& GIMPLE_STMT_OPERAND (stmt, 1) == TREE_OPERAND (cond, 1))
|
||||
*location = alloc_stmt_list ();
|
||||
}
|
||||
}
|
||||
@ -1871,6 +1874,9 @@ remove_useless_stmts_1 (tree *tp, struct rus_data *data)
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
gcc_unreachable ();
|
||||
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
data->last_goto = NULL;
|
||||
fold_stmt (tp);
|
||||
op = get_call_expr_in (t);
|
||||
@ -2508,8 +2514,8 @@ tree_can_make_abnormal_goto (tree t)
|
||||
{
|
||||
if (computed_goto_p (t))
|
||||
return true;
|
||||
if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
t = TREE_OPERAND (t, 1);
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
t = GIMPLE_STMT_OPERAND (t, 1);
|
||||
if (TREE_CODE (t) == WITH_SIZE_EXPR)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
if (TREE_CODE (t) == CALL_EXPR)
|
||||
@ -3011,9 +3017,9 @@ tree_find_edge_insert_loc (edge e, block_stmt_iterator *bsi,
|
||||
tree op = TREE_OPERAND (tmp, 0);
|
||||
if (op && !is_gimple_val (op))
|
||||
{
|
||||
gcc_assert (TREE_CODE (op) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (op) == GIMPLE_MODIFY_STMT);
|
||||
bsi_insert_before (bsi, op, BSI_NEW_STMT);
|
||||
TREE_OPERAND (tmp, 0) = TREE_OPERAND (op, 0);
|
||||
TREE_OPERAND (tmp, 0) = GIMPLE_STMT_OPERAND (op, 0);
|
||||
}
|
||||
bsi_prev (bsi);
|
||||
return true;
|
||||
@ -3232,7 +3238,10 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
x = TREE_OPERAND (t, 0);
|
||||
gcc_unreachable ();
|
||||
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
x = GIMPLE_STMT_OPERAND (t, 0);
|
||||
if (TREE_CODE (x) == BIT_FIELD_REF
|
||||
&& is_gimple_reg (TREE_OPERAND (x, 0)))
|
||||
{
|
||||
@ -3536,6 +3545,35 @@ verify_node_sharing (tree * tp, int *walk_subtrees, void *data)
|
||||
}
|
||||
|
||||
|
||||
/* Helper function for verify_gimple_tuples. */
|
||||
|
||||
static tree
|
||||
verify_gimple_tuples_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
switch (TREE_CODE (*tp))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
error ("unexpected non-tuple");
|
||||
debug_tree (*tp);
|
||||
gcc_unreachable ();
|
||||
return NULL_TREE;
|
||||
|
||||
default:
|
||||
return NULL_TREE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Verify that there are no trees that should have been converted to
|
||||
gimple tuples. Return true if T contains a node that should have
|
||||
been converted to a gimple tuple, but hasn't. */
|
||||
|
||||
static bool
|
||||
verify_gimple_tuples (tree t)
|
||||
{
|
||||
return walk_tree (&t, verify_gimple_tuples_1, NULL, NULL) != NULL;
|
||||
}
|
||||
|
||||
/* Verify the GIMPLE statement chain. */
|
||||
|
||||
void
|
||||
@ -3604,6 +3642,8 @@ verify_stmts (void)
|
||||
{
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
|
||||
err |= verify_gimple_tuples (stmt);
|
||||
|
||||
if (bb_for_stmt (stmt) != bb)
|
||||
{
|
||||
error ("bb_for_stmt (stmt) is set to a wrong basic block");
|
||||
@ -4570,7 +4610,8 @@ move_stmt_r (tree *tp, int *walk_subtrees, void *data)
|
||||
struct move_stmt_d *p = (struct move_stmt_d *) data;
|
||||
tree t = *tp;
|
||||
|
||||
if (p->block && IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (t))))
|
||||
if (p->block
|
||||
&& (EXPR_P (t) || GIMPLE_STMT_P (t)))
|
||||
TREE_BLOCK (t) = p->block;
|
||||
|
||||
if (OMP_DIRECTIVE_P (t)
|
||||
@ -5638,7 +5679,7 @@ gimplify_val (block_stmt_iterator *bsi, tree type, tree exp)
|
||||
return exp;
|
||||
|
||||
t = make_rename_temp (type, NULL);
|
||||
new_stmt = build2 (MODIFY_EXPR, type, t, exp);
|
||||
new_stmt = build2_gimple (GIMPLE_MODIFY_STMT, t, exp);
|
||||
|
||||
orig_stmt = bsi_stmt (*bsi);
|
||||
SET_EXPR_LOCUS (new_stmt, EXPR_LOCUS (orig_stmt));
|
||||
|
@ -206,13 +206,13 @@ init_dont_simulate_again (void)
|
||||
since it's never used as an input to another computation. */
|
||||
dsa = true;
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
if (!stmt || TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
break;
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
dsa = !is_complex_reg (TREE_OPERAND (stmt, 0));
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
dsa = !is_complex_reg (GIMPLE_STMT_OPERAND (stmt, 0));
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
@ -267,11 +267,11 @@ complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
|
||||
unsigned int ver;
|
||||
tree lhs, rhs;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return SSA_PROP_VARYING;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* These conditions should be satisfied due to the initial filter
|
||||
set up in init_dont_simulate_again. */
|
||||
@ -532,7 +532,7 @@ set_component_ssa_name (tree ssa_name, bool imag_p, tree value)
|
||||
|
||||
/* Do all the work to assign VALUE to COMP. */
|
||||
value = force_gimple_operand (value, &list, false, NULL);
|
||||
last = build2 (MODIFY_EXPR, TREE_TYPE (comp), comp, value);
|
||||
last = build2_gimple (GIMPLE_MODIFY_STMT, comp, value);
|
||||
append_to_statement_list (last, &list);
|
||||
|
||||
gcc_assert (SSA_NAME_DEF_STMT (comp) == NULL);
|
||||
@ -588,7 +588,7 @@ extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
|
||||
static void
|
||||
update_complex_components (block_stmt_iterator *bsi, tree stmt, tree r, tree i)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree list;
|
||||
|
||||
list = set_component_ssa_name (lhs, false, r);
|
||||
@ -628,8 +628,8 @@ update_complex_assignment (block_stmt_iterator *bsi, tree r, tree i)
|
||||
else if (gimple_in_ssa_p (cfun))
|
||||
update_complex_components (bsi, stmt, r, i);
|
||||
|
||||
type = TREE_TYPE (TREE_OPERAND (mod, 1));
|
||||
TREE_OPERAND (mod, 1) = build2 (COMPLEX_EXPR, type, r, i);
|
||||
type = TREE_TYPE (GIMPLE_STMT_OPERAND (mod, 1));
|
||||
GIMPLE_STMT_OPERAND (mod, 1) = build2 (COMPLEX_EXPR, type, r, i);
|
||||
update_stmt (stmt);
|
||||
}
|
||||
|
||||
@ -773,25 +773,24 @@ expand_complex_move (block_stmt_iterator *bsi, tree stmt, tree type,
|
||||
i = extract_component (bsi, rhs, 1, false);
|
||||
|
||||
x = build1 (REALPART_EXPR, inner_type, unshare_expr (lhs));
|
||||
x = build2 (MODIFY_EXPR, inner_type, x, r);
|
||||
x = build2_gimple (GIMPLE_MODIFY_STMT, x, r);
|
||||
bsi_insert_before (bsi, x, BSI_SAME_STMT);
|
||||
|
||||
if (stmt == bsi_stmt (*bsi))
|
||||
{
|
||||
x = build1 (IMAGPART_EXPR, inner_type, unshare_expr (lhs));
|
||||
TREE_OPERAND (stmt, 0) = x;
|
||||
TREE_OPERAND (stmt, 1) = i;
|
||||
TREE_TYPE (stmt) = inner_type;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = x;
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = build1 (IMAGPART_EXPR, inner_type, unshare_expr (lhs));
|
||||
x = build2 (MODIFY_EXPR, inner_type, x, i);
|
||||
x = build2_gimple (GIMPLE_MODIFY_STMT, x, i);
|
||||
bsi_insert_before (bsi, x, BSI_SAME_STMT);
|
||||
|
||||
stmt = bsi_stmt (*bsi);
|
||||
gcc_assert (TREE_CODE (stmt) == RETURN_EXPR);
|
||||
TREE_OPERAND (stmt, 0) = lhs;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = lhs;
|
||||
}
|
||||
|
||||
update_all_vops (stmt);
|
||||
@ -894,7 +893,7 @@ expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
|
||||
args = tree_cons (NULL, ar, args);
|
||||
|
||||
stmt = bsi_stmt (*bsi);
|
||||
type = TREE_TYPE (TREE_OPERAND (stmt, 1));
|
||||
type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
|
||||
mode = TYPE_MODE (type);
|
||||
gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
|
||||
@ -906,13 +905,13 @@ expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
|
||||
gcc_unreachable ();
|
||||
fn = built_in_decls[bcode];
|
||||
|
||||
TREE_OPERAND (stmt, 1)
|
||||
GIMPLE_STMT_OPERAND (stmt, 1)
|
||||
= build3 (CALL_EXPR, type, build_fold_addr_expr (fn), args, NULL);
|
||||
update_stmt (stmt);
|
||||
|
||||
if (gimple_in_ssa_p (cfun))
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
type = TREE_TYPE (type);
|
||||
update_complex_components (bsi, stmt,
|
||||
build1 (REALPART_EXPR, type, lhs),
|
||||
@ -1122,9 +1121,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
|
||||
|
||||
if (bb_true)
|
||||
{
|
||||
t1 = build2 (MODIFY_EXPR, inner_type, rr, tr);
|
||||
t1 = build2_gimple (GIMPLE_MODIFY_STMT, rr, tr);
|
||||
bsi_insert_before (bsi, t1, BSI_SAME_STMT);
|
||||
t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
|
||||
t1 = build2_gimple (GIMPLE_MODIFY_STMT, ri, ti);
|
||||
bsi_insert_before (bsi, t1, BSI_SAME_STMT);
|
||||
bsi_remove (bsi, true);
|
||||
}
|
||||
@ -1161,9 +1160,9 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
|
||||
|
||||
if (bb_false)
|
||||
{
|
||||
t1 = build2 (MODIFY_EXPR, inner_type, rr, tr);
|
||||
t1 = build2_gimple (GIMPLE_MODIFY_STMT, rr, tr);
|
||||
bsi_insert_before (bsi, t1, BSI_SAME_STMT);
|
||||
t1 = build2 (MODIFY_EXPR, inner_type, ri, ti);
|
||||
t1 = build2_gimple (GIMPLE_MODIFY_STMT, ri, ti);
|
||||
bsi_insert_before (bsi, t1, BSI_SAME_STMT);
|
||||
bsi_remove (bsi, true);
|
||||
}
|
||||
@ -1307,9 +1306,9 @@ expand_complex_comparison (block_stmt_iterator *bsi, tree ar, tree ai,
|
||||
case RETURN_EXPR:
|
||||
expr = TREE_OPERAND (stmt, 0);
|
||||
/* FALLTHRU */
|
||||
case MODIFY_EXPR:
|
||||
type = TREE_TYPE (TREE_OPERAND (expr, 1));
|
||||
TREE_OPERAND (expr, 1) = fold_convert (type, cc);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
type = TREE_TYPE (GIMPLE_STMT_OPERAND (expr, 1));
|
||||
GIMPLE_STMT_OPERAND (expr, 1) = fold_convert (type, cc);
|
||||
break;
|
||||
case COND_EXPR:
|
||||
TREE_OPERAND (stmt, 0) = cc;
|
||||
@ -1338,12 +1337,12 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
if (!stmt)
|
||||
return;
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return;
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
@ -1384,8 +1383,8 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
|
||||
|
||||
default:
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GENERIC_TREE_OPERAND (stmt, 0);
|
||||
tree rhs = GENERIC_TREE_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (type) == COMPLEX_TYPE)
|
||||
expand_complex_move (bsi, stmt, type, lhs, rhs);
|
||||
@ -1393,7 +1392,7 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
|
||||
|| TREE_CODE (rhs) == IMAGPART_EXPR)
|
||||
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
|
||||
{
|
||||
TREE_OPERAND (stmt, 1)
|
||||
GENERIC_TREE_OPERAND (stmt, 1)
|
||||
= extract_component (bsi, TREE_OPERAND (rhs, 0),
|
||||
TREE_CODE (rhs) == IMAGPART_EXPR, false);
|
||||
update_stmt (stmt);
|
||||
|
@ -4019,10 +4019,10 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
|
||||
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
|
||||
return clobbers_memory;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
op0 = &TREE_OPERAND (stmt, 0);
|
||||
op1 = &TREE_OPERAND (stmt, 1);
|
||||
op0 = &GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
op1 = &GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (DECL_P (*op1)
|
||||
|| REFERENCE_CLASS_P (*op1))
|
||||
|
@ -128,13 +128,13 @@ create_var_ann (tree t)
|
||||
|
||||
gcc_assert (t);
|
||||
gcc_assert (DECL_P (t));
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
|
||||
gcc_assert (!t->base.ann || t->base.ann->common.type == VAR_ANN);
|
||||
|
||||
ann = GGC_CNEW (struct var_ann_d);
|
||||
|
||||
ann->common.type = VAR_ANN;
|
||||
|
||||
t->common.ann = (tree_ann_t) ann;
|
||||
t->base.ann = (tree_ann_t) ann;
|
||||
|
||||
return ann;
|
||||
}
|
||||
@ -148,14 +148,14 @@ create_function_ann (tree t)
|
||||
|
||||
gcc_assert (t);
|
||||
gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN);
|
||||
gcc_assert (!t->base.ann || t->base.ann->common.type == FUNCTION_ANN);
|
||||
|
||||
ann = ggc_alloc (sizeof (*ann));
|
||||
memset ((void *) ann, 0, sizeof (*ann));
|
||||
|
||||
ann->common.type = FUNCTION_ANN;
|
||||
|
||||
t->common.ann = (tree_ann_t) ann;
|
||||
t->base.ann = (tree_ann_t) ann;
|
||||
|
||||
return ann;
|
||||
}
|
||||
@ -168,7 +168,7 @@ create_stmt_ann (tree t)
|
||||
stmt_ann_t ann;
|
||||
|
||||
gcc_assert (is_gimple_stmt (t));
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN);
|
||||
gcc_assert (!t->base.ann || t->base.ann->common.type == STMT_ANN);
|
||||
|
||||
ann = GGC_CNEW (struct stmt_ann_d);
|
||||
|
||||
@ -177,7 +177,7 @@ create_stmt_ann (tree t)
|
||||
/* Since we just created the annotation, mark the statement modified. */
|
||||
ann->modified = true;
|
||||
|
||||
t->common.ann = (tree_ann_t) ann;
|
||||
t->base.ann = (tree_ann_t) ann;
|
||||
|
||||
return ann;
|
||||
}
|
||||
@ -190,12 +190,12 @@ create_tree_common_ann (tree t)
|
||||
tree_ann_common_t ann;
|
||||
|
||||
gcc_assert (t);
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON);
|
||||
gcc_assert (!t->base.ann || t->base.ann->common.type == TREE_ANN_COMMON);
|
||||
|
||||
ann = GGC_CNEW (struct tree_ann_common_d);
|
||||
|
||||
ann->type = TREE_ANN_COMMON;
|
||||
t->common.ann = (tree_ann_t) ann;
|
||||
t->base.ann = (tree_ann_t) ann;
|
||||
|
||||
return ann;
|
||||
}
|
||||
@ -540,9 +540,9 @@ collect_dfa_stats_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
|
||||
tree t = *tp;
|
||||
struct dfa_stats_d *dfa_stats_p = (struct dfa_stats_d *)data;
|
||||
|
||||
if (t->common.ann)
|
||||
if (t->base.ann)
|
||||
{
|
||||
switch (ann_type (t->common.ann))
|
||||
switch (ann_type (t->base.ann))
|
||||
{
|
||||
case STMT_ANN:
|
||||
{
|
||||
|
@ -576,6 +576,11 @@ dequeue_and_dump (dump_info_p di)
|
||||
dump_child ("op 1", TREE_OPERAND (t, 1));
|
||||
break;
|
||||
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
dump_child ("op 0", GIMPLE_STMT_OPERAND (t, 0));
|
||||
dump_child ("op 1", GIMPLE_STMT_OPERAND (t, 1));
|
||||
break;
|
||||
|
||||
case COMPONENT_REF:
|
||||
dump_child ("op 0", TREE_OPERAND (t, 0));
|
||||
dump_child ("op 1", TREE_OPERAND (t, 1));
|
||||
|
@ -115,7 +115,7 @@ add_stmt_to_eh_region_fn (struct function *ifun, tree t, int num)
|
||||
/* ??? For the benefit of calls.c, converting all this to rtl,
|
||||
we need to record the call expression, not just the outer
|
||||
modify statement. */
|
||||
if (TREE_CODE (t) == MODIFY_EXPR
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
|
||||
&& (t = get_call_expr_in (t)))
|
||||
add_stmt_to_eh_region_fn (ifun, t, num);
|
||||
}
|
||||
@ -144,7 +144,7 @@ remove_stmt_from_eh_region_fn (struct function *ifun, tree t)
|
||||
/* ??? For the benefit of calls.c, converting all this to rtl,
|
||||
we need to record the call expression, not just the outer
|
||||
modify statement. */
|
||||
if (TREE_CODE (t) == MODIFY_EXPR
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
|
||||
&& (t = get_call_expr_in (t)))
|
||||
remove_stmt_from_eh_region_fn (ifun, t);
|
||||
return true;
|
||||
@ -624,10 +624,10 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod,
|
||||
q->cont_stmt = q->stmt;
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree result = TREE_OPERAND (ret_expr, 0);
|
||||
tree new, old = TREE_OPERAND (ret_expr, 1);
|
||||
tree result = GIMPLE_STMT_OPERAND (ret_expr, 0);
|
||||
tree new, old = GIMPLE_STMT_OPERAND (ret_expr, 1);
|
||||
|
||||
if (!*return_value_p)
|
||||
{
|
||||
@ -646,13 +646,13 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod,
|
||||
else
|
||||
new = *return_value_p;
|
||||
|
||||
x = build2 (MODIFY_EXPR, TREE_TYPE (new), new, old);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new), new, old);
|
||||
append_to_statement_list (x, &q->repl_stmt);
|
||||
|
||||
if (new == result)
|
||||
x = result;
|
||||
else
|
||||
x = build2 (MODIFY_EXPR, TREE_TYPE (result), result, new);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result), result, new);
|
||||
q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
|
||||
}
|
||||
|
||||
@ -842,20 +842,20 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
|
||||
|
||||
i = tsi_start (finally);
|
||||
x = build0 (EXC_PTR_EXPR, ptr_type_node);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, save_eptr, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, save_eptr, x);
|
||||
tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
|
||||
|
||||
x = build0 (FILTER_EXPR, integer_type_node);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, save_filt, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, save_filt, x);
|
||||
tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
|
||||
|
||||
i = tsi_last (finally);
|
||||
x = build0 (EXC_PTR_EXPR, ptr_type_node);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, x, save_eptr);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, save_eptr);
|
||||
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
|
||||
|
||||
x = build0 (FILTER_EXPR, integer_type_node);
|
||||
x = build2 (MODIFY_EXPR, void_type_node, x, save_filt);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, x, save_filt);
|
||||
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
|
||||
|
||||
x = build_resx (get_eh_region_number (tf->region));
|
||||
@ -1177,7 +1177,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||
|
||||
if (tf->may_fallthru)
|
||||
{
|
||||
x = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
|
||||
build_int_cst (NULL_TREE, fallthru_index));
|
||||
append_to_statement_list (x, tf->top_p);
|
||||
|
||||
@ -1207,7 +1207,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||
x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
|
||||
append_to_statement_list (x, tf->top_p);
|
||||
|
||||
x = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
|
||||
x = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
|
||||
build_int_cst (NULL_TREE, eh_index));
|
||||
append_to_statement_list (x, tf->top_p);
|
||||
|
||||
@ -1239,14 +1239,14 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||
|
||||
if (q->index < 0)
|
||||
{
|
||||
mod = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
|
||||
mod = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
|
||||
build_int_cst (NULL_TREE, return_index));
|
||||
do_return_redirection (q, finally_label, mod, &return_val);
|
||||
switch_id = return_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
mod = build2 (MODIFY_EXPR, void_type_node, finally_tmp,
|
||||
mod = build2 (GIMPLE_MODIFY_STMT, void_type_node, finally_tmp,
|
||||
build_int_cst (NULL_TREE, q->index));
|
||||
do_goto_redirection (q, finally_label, mod);
|
||||
switch_id = q->index;
|
||||
@ -1612,7 +1612,7 @@ lower_eh_constructs_1 (struct leh_state *state, tree *tp)
|
||||
}
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* Look for things that can throw exceptions, and record them. */
|
||||
if (state->cur_region && tree_could_throw_p (t))
|
||||
{
|
||||
@ -1997,12 +1997,12 @@ tree_could_throw_p (tree t)
|
||||
{
|
||||
if (!flag_exceptions)
|
||||
return false;
|
||||
if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
if (flag_non_call_exceptions
|
||||
&& tree_could_trap_p (TREE_OPERAND (t, 0)))
|
||||
&& tree_could_trap_p (GIMPLE_STMT_OPERAND (t, 0)))
|
||||
return true;
|
||||
t = TREE_OPERAND (t, 1);
|
||||
t = GIMPLE_STMT_OPERAND (t, 1);
|
||||
}
|
||||
|
||||
if (TREE_CODE (t) == WITH_SIZE_EXPR)
|
||||
@ -2081,7 +2081,7 @@ verify_eh_throw_stmt_node (void **slot, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
struct throw_stmt_node *node = (struct throw_stmt_node *)*slot;
|
||||
|
||||
gcc_assert (node->stmt->common.ann == NULL);
|
||||
gcc_assert (node->stmt->base.ann == NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -194,9 +194,10 @@ var_ann (tree t)
|
||||
gcc_assert (t);
|
||||
gcc_assert (DECL_P (t));
|
||||
gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
|
||||
gcc_assert (!t->base.ann
|
||||
|| t->base.ann->common.type == VAR_ANN);
|
||||
|
||||
return (var_ann_t) t->common.ann;
|
||||
return (var_ann_t) t->base.ann;
|
||||
}
|
||||
|
||||
/* Return the variable annotation for T, which must be a _DECL node.
|
||||
@ -215,9 +216,10 @@ function_ann (tree t)
|
||||
{
|
||||
gcc_assert (t);
|
||||
gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == FUNCTION_ANN);
|
||||
gcc_assert (!t->base.ann
|
||||
|| t->base.ann->common.type == FUNCTION_ANN);
|
||||
|
||||
return (function_ann_t) t->common.ann;
|
||||
return (function_ann_t) t->base.ann;
|
||||
}
|
||||
|
||||
/* Return the function annotation for T, which must be a FUNCTION_DECL node.
|
||||
@ -226,7 +228,7 @@ static inline function_ann_t
|
||||
get_function_ann (tree var)
|
||||
{
|
||||
function_ann_t ann = function_ann (var);
|
||||
gcc_assert (!var->common.ann || var->common.ann->common.type == FUNCTION_ANN);
|
||||
gcc_assert (!var->base.ann || var->base.ann->common.type == FUNCTION_ANN);
|
||||
return (ann) ? ann : create_function_ann (var);
|
||||
}
|
||||
|
||||
@ -238,7 +240,7 @@ has_stmt_ann (tree t)
|
||||
#ifdef ENABLE_CHECKING
|
||||
gcc_assert (is_gimple_stmt (t));
|
||||
#endif
|
||||
return t->common.ann && t->common.ann->common.type == STMT_ANN;
|
||||
return t->base.ann && t->base.ann->common.type == STMT_ANN;
|
||||
}
|
||||
|
||||
/* Return the statement annotation for T, which must be a statement
|
||||
@ -249,8 +251,8 @@ stmt_ann (tree t)
|
||||
#ifdef ENABLE_CHECKING
|
||||
gcc_assert (is_gimple_stmt (t));
|
||||
#endif
|
||||
gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN);
|
||||
return (stmt_ann_t) t->common.ann;
|
||||
gcc_assert (!t->base.ann || t->base.ann->common.type == STMT_ANN);
|
||||
return (stmt_ann_t) t->base.ann;
|
||||
}
|
||||
|
||||
/* Return the statement annotation for T, which must be a statement
|
||||
@ -868,7 +870,7 @@ mark_non_addressable (tree var)
|
||||
static inline tree_ann_common_t
|
||||
tree_common_ann (tree t)
|
||||
{
|
||||
return &t->common.ann->common;
|
||||
return &t->base.ann->common;
|
||||
}
|
||||
|
||||
/* Return a common annotation for T. Create the constant annotation if it
|
||||
|
@ -156,7 +156,7 @@ struct ptr_info_def GTY(())
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
Tree annotations stored in tree_common.ann
|
||||
Tree annotations stored in tree_base.ann
|
||||
---------------------------------------------------------------------------*/
|
||||
enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };
|
||||
|
||||
|
@ -87,7 +87,7 @@ is_gimple_formal_tmp_rhs (tree t)
|
||||
bool
|
||||
is_gimple_reg_rhs (tree t)
|
||||
{
|
||||
/* If the RHS of the MODIFY_EXPR may throw or make a nonlocal goto
|
||||
/* If the RHS of the GIMPLE_MODIFY_STMT may throw or make a nonlocal goto
|
||||
and the LHS is a user variable, then we need to introduce a formal
|
||||
temporary. This way the optimizers can determine that the user
|
||||
variable is only modified if evaluation of the RHS does not throw.
|
||||
@ -233,7 +233,7 @@ is_gimple_stmt (tree t)
|
||||
return true;
|
||||
|
||||
case CALL_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* These are valid regardless of their type. */
|
||||
return true;
|
||||
|
||||
@ -427,8 +427,10 @@ is_gimple_call_addr (tree t)
|
||||
tree
|
||||
get_call_expr_in (tree t)
|
||||
{
|
||||
if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
t = TREE_OPERAND (t, 1);
|
||||
/* FIXME tuples: delete the assertion below when conversion complete. */
|
||||
gcc_assert (TREE_CODE (t) != MODIFY_EXPR);
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
t = GIMPLE_STMT_OPERAND (t, 1);
|
||||
if (TREE_CODE (t) == WITH_SIZE_EXPR)
|
||||
t = TREE_OPERAND (t, 0);
|
||||
if (TREE_CODE (t) == CALL_EXPR)
|
||||
@ -473,7 +475,7 @@ recalculate_side_effects (tree t)
|
||||
switch (code)
|
||||
{
|
||||
case INIT_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case VA_ARG_EXPR:
|
||||
case PREDECREMENT_EXPR:
|
||||
case PREINCREMENT_EXPR:
|
||||
|
@ -108,7 +108,8 @@ static tree tree_if_convert_stmt (struct loop *loop, tree, tree,
|
||||
static void tree_if_convert_cond_expr (struct loop *, tree, tree,
|
||||
block_stmt_iterator *);
|
||||
static bool if_convertible_phi_p (struct loop *, basic_block, tree);
|
||||
static bool if_convertible_modify_expr_p (struct loop *, basic_block, tree);
|
||||
static bool if_convertible_gimple_modify_stmt_p (struct loop *, basic_block,
|
||||
tree);
|
||||
static bool if_convertible_stmt_p (struct loop *, basic_block, tree);
|
||||
static bool if_convertible_bb_p (struct loop *, basic_block, basic_block);
|
||||
static bool if_convertible_loop_p (struct loop *, bool);
|
||||
@ -119,7 +120,7 @@ static void clean_predicate_lists (struct loop *loop);
|
||||
static basic_block find_phi_replacement_condition (struct loop *loop,
|
||||
basic_block, tree *,
|
||||
block_stmt_iterator *);
|
||||
static void replace_phi_with_cond_modify_expr (tree, tree, basic_block,
|
||||
static void replace_phi_with_cond_gimple_modify_stmt (tree, tree, basic_block,
|
||||
block_stmt_iterator *);
|
||||
static void process_phi_nodes (struct loop *);
|
||||
static void combine_blocks (struct loop *);
|
||||
@ -209,7 +210,7 @@ tree_if_conversion (struct loop *loop, bool for_vectorizer)
|
||||
}
|
||||
|
||||
/* if-convert stmt T which is part of LOOP.
|
||||
If T is a MODIFY_EXPR than it is converted into conditional modify
|
||||
If T is a GIMPLE_MODIFY_STMT than it is converted into conditional modify
|
||||
expression using COND. For conditional expressions, add condition in the
|
||||
destination basic block's predicate list and remove conditional
|
||||
expression itself. BSI is the iterator used to traverse statements of
|
||||
@ -232,12 +233,12 @@ tree_if_convert_stmt (struct loop * loop, tree t, tree cond,
|
||||
case LABEL_EXPR:
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
/* This modify_expr is killing previous value of LHS. Appropriate value will
|
||||
be selected by PHI node based on condition. It is possible that before
|
||||
this transformation, PHI nodes was selecting default value and now it will
|
||||
use this new value. This is OK because it does not change validity the
|
||||
program. */
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* This GIMPLE_MODIFY_STMT is killing previous value of LHS. Appropriate
|
||||
value will be selected by PHI node based on condition. It is possible
|
||||
that before this transformation, PHI nodes was selecting default
|
||||
value and now it will use this new value. This is OK because it does
|
||||
not change validity the program. */
|
||||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
@ -334,15 +335,16 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, tree phi)
|
||||
}
|
||||
|
||||
/* Return true, if M_EXPR is if-convertible.
|
||||
MODIFY_EXPR is not if-convertible if,
|
||||
GIMPLE_MODIFY_STMT is not if-convertible if,
|
||||
- It is not movable.
|
||||
- It could trap.
|
||||
- LHS is not var decl.
|
||||
MODIFY_EXPR is part of block BB, which is inside loop LOOP.
|
||||
GIMPLE_MODIFY_STMT is part of block BB, which is inside loop LOOP.
|
||||
*/
|
||||
|
||||
static bool
|
||||
if_convertible_modify_expr_p (struct loop *loop, basic_block bb, tree m_expr)
|
||||
if_convertible_gimple_modify_stmt_p (struct loop *loop, basic_block bb,
|
||||
tree m_expr)
|
||||
{
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
@ -360,21 +362,21 @@ if_convertible_modify_expr_p (struct loop *loop, basic_block bb, tree m_expr)
|
||||
|
||||
/* See if it needs speculative loading or not. */
|
||||
if (bb != loop->header
|
||||
&& tree_could_trap_p (TREE_OPERAND (m_expr, 1)))
|
||||
&& tree_could_trap_p (GIMPLE_STMT_OPERAND (m_expr, 1)))
|
||||
{
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file, "tree could trap...\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TREE_CODE (TREE_OPERAND (m_expr, 1)) == CALL_EXPR)
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (m_expr, 1)) == CALL_EXPR)
|
||||
{
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
fprintf (dump_file, "CALL_EXPR \n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TREE_CODE (TREE_OPERAND (m_expr, 0)) != SSA_NAME
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (m_expr, 0)) != SSA_NAME
|
||||
&& bb != loop->header
|
||||
&& !bb_with_exit_edge_p (loop, bb))
|
||||
{
|
||||
@ -392,7 +394,7 @@ if_convertible_modify_expr_p (struct loop *loop, basic_block bb, tree m_expr)
|
||||
|
||||
/* Return true, iff STMT is if-convertible.
|
||||
Statement is if-convertible if,
|
||||
- It is if-convertible MODIFY_EXPR
|
||||
- It is if-convertible GIMPLE_MODIFY_STMT
|
||||
- IT is LABEL_EXPR or COND_EXPR.
|
||||
STMT is inside block BB, which is inside loop LOOP. */
|
||||
|
||||
@ -404,9 +406,9 @@ if_convertible_stmt_p (struct loop *loop, basic_block bb, tree stmt)
|
||||
case LABEL_EXPR:
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
|
||||
if (!if_convertible_modify_expr_p (loop, bb, stmt))
|
||||
if (!if_convertible_gimple_modify_stmt_p (loop, bb, stmt))
|
||||
return false;
|
||||
break;
|
||||
|
||||
@ -634,7 +636,7 @@ add_to_dst_predicate_list (struct loop * loop, basic_block bb,
|
||||
unshare_expr (prev_cond), cond);
|
||||
tmp_stmt = ifc_temp_var (boolean_type_node, tmp);
|
||||
bsi_insert_before (bsi, tmp_stmt, BSI_SAME_STMT);
|
||||
new_cond = TREE_OPERAND (tmp_stmt, 0);
|
||||
new_cond = GIMPLE_STMT_OPERAND (tmp_stmt, 0);
|
||||
}
|
||||
add_to_predicate_list (bb, new_cond);
|
||||
return new_cond;
|
||||
@ -741,7 +743,7 @@ find_phi_replacement_condition (struct loop *loop,
|
||||
|
||||
new_stmt = ifc_temp_var (TREE_TYPE (*cond), unshare_expr (*cond));
|
||||
bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
|
||||
*cond = TREE_OPERAND (new_stmt, 0);
|
||||
*cond = GIMPLE_STMT_OPERAND (new_stmt, 0);
|
||||
}
|
||||
|
||||
gcc_assert (*cond);
|
||||
@ -761,8 +763,9 @@ find_phi_replacement_condition (struct loop *loop,
|
||||
*/
|
||||
|
||||
static void
|
||||
replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb,
|
||||
block_stmt_iterator *bsi)
|
||||
replace_phi_with_cond_gimple_modify_stmt (tree phi, tree cond,
|
||||
basic_block true_bb,
|
||||
block_stmt_iterator *bsi)
|
||||
{
|
||||
tree new_stmt;
|
||||
basic_block bb;
|
||||
@ -799,7 +802,7 @@ replace_phi_with_cond_modify_expr (tree phi, tree cond, basic_block true_bb,
|
||||
unshare_expr (arg_1));
|
||||
|
||||
/* Create new MODIFY expression using RHS. */
|
||||
new_stmt = build2 (MODIFY_EXPR, TREE_TYPE (PHI_RESULT (phi)),
|
||||
new_stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (PHI_RESULT (phi)),
|
||||
unshare_expr (PHI_RESULT (phi)), rhs);
|
||||
|
||||
/* Make new statement definition of the original phi result. */
|
||||
@ -848,7 +851,7 @@ process_phi_nodes (struct loop *loop)
|
||||
while (phi)
|
||||
{
|
||||
tree next = PHI_CHAIN (phi);
|
||||
replace_phi_with_cond_modify_expr (phi, cond, true_bb, &bsi);
|
||||
replace_phi_with_cond_gimple_modify_stmt (phi, cond, true_bb, &bsi);
|
||||
release_phi_node (phi);
|
||||
phi = next;
|
||||
}
|
||||
@ -963,7 +966,7 @@ combine_blocks (struct loop *loop)
|
||||
merge_blocks (loop->header, exit_bb);
|
||||
}
|
||||
|
||||
/* Make new temp variable of type TYPE. Add MODIFY_EXPR to assign EXP
|
||||
/* Make new temp variable of type TYPE. Add GIMPLE_MODIFY_STMT to assign EXP
|
||||
to the new variable. */
|
||||
|
||||
static tree
|
||||
@ -980,12 +983,12 @@ ifc_temp_var (tree type, tree exp)
|
||||
add_referenced_var (var);
|
||||
|
||||
/* Build new statement to assign EXP to new variable. */
|
||||
stmt = build2 (MODIFY_EXPR, type, var, exp);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, type, var, exp);
|
||||
|
||||
/* Get SSA name for the new variable and set make new statement
|
||||
its definition statement. */
|
||||
new_name = make_ssa_name (var, stmt);
|
||||
TREE_OPERAND (stmt, 0) = new_name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = new_name;
|
||||
SSA_NAME_DEF_STMT (new_name) = stmt;
|
||||
|
||||
return stmt;
|
||||
|
@ -58,7 +58,7 @@ Boston, MA 02110-1301, USA. */
|
||||
|
||||
Inlining: a function body is duplicated, but the PARM_DECLs are
|
||||
remapped into VAR_DECLs, and non-void RETURN_EXPRs become
|
||||
MODIFY_EXPRs that store to a dedicated returned-value variable.
|
||||
GIMPLE_MODIFY_STMTs that store to a dedicated returned-value variable.
|
||||
The duplicated eh_region info of the copy will later be appended
|
||||
to the info for the caller; the eh_region info in copied throwing
|
||||
statements and RESX_EXPRs is adjusted accordingly.
|
||||
@ -476,7 +476,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
duplicated and/or tweaked. */
|
||||
|
||||
/* When requested, RETURN_EXPRs should be transformed to just the
|
||||
contained MODIFY_EXPR. The branch semantics of the return will
|
||||
contained GIMPLE_MODIFY_STMT. The branch semantics of the return will
|
||||
be handled elsewhere by manipulating the CFG rather than a statement. */
|
||||
if (TREE_CODE (*tp) == RETURN_EXPR && id->transform_return_to_modify)
|
||||
{
|
||||
@ -487,10 +487,10 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
If the "assignment" is just the result decl, the result
|
||||
decl has already been set (e.g. a recent "foo (&result_decl,
|
||||
...)"); just toss the entire RETURN_EXPR. */
|
||||
if (assignment && TREE_CODE (assignment) == MODIFY_EXPR)
|
||||
if (assignment && TREE_CODE (assignment) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
/* Replace the RETURN_EXPR with (a copy of) the
|
||||
MODIFY_EXPR hanging underneath. */
|
||||
GIMPLE_MODIFY_STMT hanging underneath. */
|
||||
*tp = copy_node (assignment);
|
||||
}
|
||||
else /* Else the RETURN_EXPR returns no value. */
|
||||
@ -557,15 +557,15 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
/* Here we handle trees that are not completely rewritten.
|
||||
First we detect some inlining-induced bogosities for
|
||||
discarding. */
|
||||
if (TREE_CODE (*tp) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
|
||||
if (TREE_CODE (*tp) == GIMPLE_MODIFY_STMT
|
||||
&& GIMPLE_STMT_OPERAND (*tp, 0) == GIMPLE_STMT_OPERAND (*tp, 1)
|
||||
&& (lang_hooks.tree_inlining.auto_var_in_fn_p
|
||||
(TREE_OPERAND (*tp, 0), fn)))
|
||||
(GIMPLE_STMT_OPERAND (*tp, 0), fn)))
|
||||
{
|
||||
/* Some assignments VAR = VAR; don't generate any rtl code
|
||||
and thus don't count as variable modification. Avoid
|
||||
keeping bogosities like 0 = 0. */
|
||||
tree decl = TREE_OPERAND (*tp, 0), value;
|
||||
tree decl = GIMPLE_STMT_OPERAND (*tp, 0), value;
|
||||
splay_tree_node n;
|
||||
|
||||
n = splay_tree_lookup (id->decl_map, (splay_tree_key) decl);
|
||||
@ -624,7 +624,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
/* If EXPR has block defined, map it to newly constructed block.
|
||||
When inlining we want EXPRs without block appear in the block
|
||||
of function call. */
|
||||
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (*tp))))
|
||||
if (EXPR_P (*tp) || GIMPLE_STMT_P (*tp))
|
||||
{
|
||||
new_block = id->block;
|
||||
if (TREE_BLOCK (*tp))
|
||||
@ -644,7 +644,8 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
|
||||
(NULL_TREE,
|
||||
id->eh_region_offset + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0)));
|
||||
|
||||
TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
|
||||
if (!GIMPLE_TUPLE_P (*tp))
|
||||
TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
|
||||
|
||||
/* The copied TARGET_EXPR has never been expanded, even if the
|
||||
original node was expanded already. */
|
||||
@ -708,9 +709,9 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, int count_scal
|
||||
|
||||
/* With return slot optimization we can end up with
|
||||
non-gimple (foo *)&this->m, fix that here. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR
|
||||
&& !is_gimple_val (TREE_OPERAND (TREE_OPERAND (stmt, 1), 0)))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == NOP_EXPR
|
||||
&& !is_gimple_val (TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0)))
|
||||
gimplify_stmt (&stmt);
|
||||
|
||||
bsi_insert_after (©_bsi, stmt, BSI_NEW_STMT);
|
||||
@ -1093,9 +1094,9 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
|
||||
|
||||
STRIP_USELESS_TYPE_CONVERSION (rhs);
|
||||
|
||||
/* We want to use MODIFY_EXPR, not INIT_EXPR here so that we
|
||||
/* We want to use GIMPLE_MODIFY_STMT, not INIT_EXPR here so that we
|
||||
keep our trees in gimple form. */
|
||||
init_stmt = build2 (MODIFY_EXPR, TREE_TYPE (var), var, rhs);
|
||||
init_stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (var), var, rhs);
|
||||
|
||||
/* If we did not create a gimple value and we did not create a gimple
|
||||
cast of a gimple value, then we will need to gimplify INIT_STMTS
|
||||
@ -1167,7 +1168,7 @@ initialize_inlined_parameters (copy_body_data *id, tree args, tree static_chain,
|
||||
|
||||
RETURN_SLOT_ADDR, if non-null, was a fake parameter that
|
||||
took the address of the result. MODIFY_DEST, if non-null, was the LHS of
|
||||
the MODIFY_EXPR to which this call is the RHS.
|
||||
the GIMPLE_MODIFY_STMT to which this call is the RHS.
|
||||
|
||||
The return value is a (possibly null) value that is the result of the
|
||||
function as seen by the callee. *USE_P is a (possibly null) value that
|
||||
@ -1657,30 +1658,32 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
|
||||
3) TARGET_EXPRs.
|
||||
|
||||
Let us look at the first two cases, assuming we have "a = b + C":
|
||||
<modify_expr <var_decl "a"> <plus_expr <var_decl "b"> <constant C>>
|
||||
<GIMPLE_MODIFY_STMT <var_decl "a">
|
||||
<plus_expr <var_decl "b"> <constant C>>
|
||||
If "a" is a GIMPLE register, the assignment to it is free on almost
|
||||
any target, because "a" usually ends up in a real register. Hence
|
||||
the only cost of this expression comes from the PLUS_EXPR, and we
|
||||
can ignore the MODIFY_EXPR.
|
||||
can ignore the GIMPLE_MODIFY_STMT.
|
||||
If "a" is not a GIMPLE register, the assignment to "a" will most
|
||||
likely be a real store, so the cost of the MODIFY_EXPR is the cost
|
||||
likely be a real store, so the cost of the GIMPLE_MODIFY_STMT is the cost
|
||||
of moving something into "a", which we compute using the function
|
||||
estimate_move_cost.
|
||||
|
||||
The third case deals with TARGET_EXPRs, for which the semantics are
|
||||
that a temporary is assigned, unless the TARGET_EXPR itself is being
|
||||
assigned to something else. In the latter case we do not need the
|
||||
temporary. E.g. in <modify_expr <var_decl "a"> <target_expr>>, the
|
||||
MODIFY_EXPR is free. */
|
||||
temporary. E.g. in:
|
||||
<GIMPLE_MODIFY_STMT <var_decl "a"> <target_expr>>, the
|
||||
GIMPLE_MODIFY_STMT is free. */
|
||||
case INIT_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* Is the right and side a TARGET_EXPR? */
|
||||
if (TREE_CODE (TREE_OPERAND (x, 1)) == TARGET_EXPR)
|
||||
if (TREE_CODE (GENERIC_TREE_OPERAND (x, 1)) == TARGET_EXPR)
|
||||
break;
|
||||
/* ... fall through ... */
|
||||
|
||||
case TARGET_EXPR:
|
||||
x = TREE_OPERAND (x, 0);
|
||||
x = GENERIC_TREE_OPERAND (x, 0);
|
||||
/* Is this an assignments to a register? */
|
||||
if (is_gimple_reg (x))
|
||||
break;
|
||||
@ -2100,9 +2103,9 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
|
||||
|
||||
/* Find the lhs to which the result of this call is assigned. */
|
||||
return_slot_addr = NULL;
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
modify_dest = TREE_OPERAND (stmt, 0);
|
||||
modify_dest = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
|
||||
/* The function which we are inlining might not return a value,
|
||||
in which case we should issue a warning that the function
|
||||
@ -2189,7 +2192,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
|
||||
|
||||
/* Expand call statements reachable from STMT_P.
|
||||
We can only have CALL_EXPRs as the "toplevel" tree code or nested
|
||||
in a MODIFY_EXPR. See tree-gimple.c:get_call_expr_in(). We can
|
||||
in a GIMPLE_MODIFY_STMT. See tree-gimple.c:get_call_expr_in(). We can
|
||||
unfortunately not use that function here because we need a pointer
|
||||
to the CALL_EXPR, not the tree itself. */
|
||||
|
||||
@ -2205,8 +2208,8 @@ gimple_expand_calls_inline (basic_block bb, copy_body_data *id)
|
||||
tree *expr_p = bsi_stmt_ptr (bsi);
|
||||
tree stmt = *expr_p;
|
||||
|
||||
if (TREE_CODE (*expr_p) == MODIFY_EXPR)
|
||||
expr_p = &TREE_OPERAND (*expr_p, 1);
|
||||
if (TREE_CODE (*expr_p) == GIMPLE_MODIFY_STMT)
|
||||
expr_p = &GIMPLE_STMT_OPERAND (*expr_p, 1);
|
||||
if (TREE_CODE (*expr_p) == WITH_SIZE_EXPR)
|
||||
expr_p = &TREE_OPERAND (*expr_p, 0);
|
||||
if (TREE_CODE (*expr_p) == CALL_EXPR)
|
||||
@ -2320,9 +2323,11 @@ tree
|
||||
copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
enum tree_code code = TREE_CODE (*tp);
|
||||
enum tree_code_class cl = TREE_CODE_CLASS (code);
|
||||
|
||||
/* We make copies of most nodes. */
|
||||
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
|
||||
if (IS_EXPR_CODE_CLASS (cl)
|
||||
|| IS_GIMPLE_STMT_CODE_CLASS (cl)
|
||||
|| code == TREE_LIST
|
||||
|| code == TREE_VEC
|
||||
|| code == TYPE_DECL
|
||||
@ -2330,8 +2335,10 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* Because the chain gets clobbered when we make a copy, we save it
|
||||
here. */
|
||||
tree chain = TREE_CHAIN (*tp);
|
||||
tree new;
|
||||
tree chain = NULL_TREE, new;
|
||||
|
||||
if (!GIMPLE_TUPLE_P (*tp))
|
||||
chain = TREE_CHAIN (*tp);
|
||||
|
||||
/* Copy the node. */
|
||||
new = copy_node (*tp);
|
||||
|
@ -245,7 +245,7 @@ enum rewrite_mode {
|
||||
processed from those that only need to have their defs processed.
|
||||
Statements that define new SSA names only need to have their defs
|
||||
registered, but they don't need to have their uses renamed. */
|
||||
#define REGISTER_DEFS_IN_THIS_STMT(T) (T)->common.unsigned_flag
|
||||
#define REGISTER_DEFS_IN_THIS_STMT(T) (T)->base.unsigned_flag
|
||||
|
||||
|
||||
/* Prototypes for debugging functions. */
|
||||
|
@ -458,13 +458,13 @@ mf_decl_cache_locals (void)
|
||||
|
||||
/* Build initialization nodes for the cache vars. We just load the
|
||||
globals into the cache variables. */
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (mf_cache_shift_decl_l),
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_shift_decl_l),
|
||||
mf_cache_shift_decl_l, mf_cache_shift_decl);
|
||||
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
|
||||
gimplify_to_stmt_list (&t);
|
||||
shift_init_stmts = t;
|
||||
|
||||
t = build2 (MODIFY_EXPR, TREE_TYPE (mf_cache_mask_decl_l),
|
||||
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (mf_cache_mask_decl_l),
|
||||
mf_cache_mask_decl_l, mf_cache_mask_decl);
|
||||
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
|
||||
gimplify_to_stmt_list (&t);
|
||||
@ -553,7 +553,7 @@ mf_build_check_statement_for (tree base, tree limit,
|
||||
mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit");
|
||||
|
||||
/* Build: __mf_base = (uintptr_t) <base address expression>. */
|
||||
t = build2 (MODIFY_EXPR, void_type_node, mf_base,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_base,
|
||||
convert (mf_uintptr_type, unshare_expr (base)));
|
||||
SET_EXPR_LOCUS (t, locus);
|
||||
gimplify_to_stmt_list (&t);
|
||||
@ -561,7 +561,7 @@ mf_build_check_statement_for (tree base, tree limit,
|
||||
tsi = tsi_last (t);
|
||||
|
||||
/* Build: __mf_limit = (uintptr_t) <limit address expression>. */
|
||||
t = build2 (MODIFY_EXPR, void_type_node, mf_limit,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_limit,
|
||||
convert (mf_uintptr_type, unshare_expr (limit)));
|
||||
SET_EXPR_LOCUS (t, locus);
|
||||
gimplify_to_stmt_list (&t);
|
||||
@ -577,7 +577,7 @@ mf_build_check_statement_for (tree base, tree limit,
|
||||
TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
|
||||
mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
|
||||
t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, mf_elem, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, mf_elem, t);
|
||||
SET_EXPR_LOCUS (t, locus);
|
||||
gimplify_to_stmt_list (&t);
|
||||
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
|
||||
@ -623,7 +623,7 @@ mf_build_check_statement_for (tree base, tree limit,
|
||||
can use as the condition for the conditional jump. */
|
||||
t = build2 (TRUTH_OR_EXPR, boolean_type_node, t, u);
|
||||
cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
|
||||
t = build2 (MODIFY_EXPR, boolean_type_node, cond, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, boolean_type_node, cond, t);
|
||||
gimplify_to_stmt_list (&t);
|
||||
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
|
||||
|
||||
@ -676,11 +676,11 @@ mf_build_check_statement_for (tree base, tree limit,
|
||||
|
||||
if (! flag_mudflap_threads)
|
||||
{
|
||||
t = build2 (MODIFY_EXPR, void_type_node,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
|
||||
mf_cache_shift_decl_l, mf_cache_shift_decl);
|
||||
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node,
|
||||
mf_cache_mask_decl_l, mf_cache_mask_decl);
|
||||
tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
|
||||
}
|
||||
@ -912,18 +912,19 @@ mf_xform_derefs (void)
|
||||
/* Only a few GIMPLE statements can reference memory. */
|
||||
switch (TREE_CODE (s))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
mf_xform_derefs_1 (&i, &TREE_OPERAND (s, 0), EXPR_LOCUS (s),
|
||||
integer_one_node);
|
||||
mf_xform_derefs_1 (&i, &TREE_OPERAND (s, 1), EXPR_LOCUS (s),
|
||||
integer_zero_node);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 0),
|
||||
EXPR_LOCUS (s), integer_one_node);
|
||||
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 1),
|
||||
EXPR_LOCUS (s), integer_zero_node);
|
||||
break;
|
||||
|
||||
case RETURN_EXPR:
|
||||
if (TREE_OPERAND (s, 0) != NULL_TREE)
|
||||
{
|
||||
if (TREE_CODE (TREE_OPERAND (s, 0)) == MODIFY_EXPR)
|
||||
mf_xform_derefs_1 (&i, &TREE_OPERAND (TREE_OPERAND (s, 0), 1),
|
||||
if (TREE_CODE (TREE_OPERAND (s, 0)) == GIMPLE_MODIFY_STMT)
|
||||
mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND
|
||||
(TREE_OPERAND (s, 0), 1),
|
||||
EXPR_LOCUS (s), integer_zero_node);
|
||||
else
|
||||
mf_xform_derefs_1 (&i, &TREE_OPERAND (s, 0), EXPR_LOCUS (s),
|
||||
|
@ -388,7 +388,7 @@ init_tmp_var (struct nesting_info *info, tree exp, tree_stmt_iterator *tsi)
|
||||
tree t, stmt;
|
||||
|
||||
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
|
||||
stmt = build2 (MODIFY_EXPR, TREE_TYPE (t), t, exp);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), t, exp);
|
||||
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
|
||||
tsi_link_before (tsi, stmt, TSI_SAME_STMT);
|
||||
|
||||
@ -416,7 +416,7 @@ save_tmp_var (struct nesting_info *info, tree exp,
|
||||
tree t, stmt;
|
||||
|
||||
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
|
||||
stmt = build2 (MODIFY_EXPR, TREE_TYPE (t), exp, t);
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (t), exp, t);
|
||||
SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
|
||||
tsi_link_after (tsi, stmt, TSI_SAME_STMT);
|
||||
|
||||
@ -613,16 +613,16 @@ walk_stmts (struct walk_stmt_info *wi, tree *tp)
|
||||
walk_stmts (wi, &TREE_OPERAND (t, 0));
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* A formal temporary lhs may use a COMPONENT_REF rhs. */
|
||||
wi->val_only = !is_gimple_formal_tmp_var (TREE_OPERAND (t, 0));
|
||||
walk_tree (&TREE_OPERAND (t, 1), wi->callback, wi, NULL);
|
||||
wi->val_only = !is_gimple_formal_tmp_var (GIMPLE_STMT_OPERAND (t, 0));
|
||||
walk_tree (&GIMPLE_STMT_OPERAND (t, 1), wi->callback, wi, NULL);
|
||||
|
||||
/* If the rhs is appropriate for a memory, we may use a
|
||||
COMPONENT_REF on the lhs. */
|
||||
wi->val_only = !is_gimple_mem_rhs (TREE_OPERAND (t, 1));
|
||||
wi->val_only = !is_gimple_mem_rhs (GIMPLE_STMT_OPERAND (t, 1));
|
||||
wi->is_lhs = true;
|
||||
walk_tree (&TREE_OPERAND (t, 0), wi->callback, wi, NULL);
|
||||
walk_tree (&GIMPLE_STMT_OPERAND (t, 0), wi->callback, wi, NULL);
|
||||
|
||||
wi->val_only = true;
|
||||
wi->is_lhs = false;
|
||||
@ -1648,7 +1648,7 @@ convert_call_expr (tree *tp, int *walk_subtrees, void *data)
|
||||
break;
|
||||
|
||||
case RETURN_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case WITH_SIZE_EXPR:
|
||||
/* Only return modify and with_size_expr may contain calls. */
|
||||
*walk_subtrees = 1;
|
||||
@ -1770,7 +1770,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
|
||||
|
||||
y = build3 (COMPONENT_REF, TREE_TYPE (field),
|
||||
root->frame_decl, field, NULL_TREE);
|
||||
x = build2 (MODIFY_EXPR, TREE_TYPE (field), y, x);
|
||||
x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (field), y, x);
|
||||
append_to_statement_list (x, &stmt_list);
|
||||
}
|
||||
}
|
||||
@ -1781,7 +1781,7 @@ finalize_nesting_tree_1 (struct nesting_info *root)
|
||||
{
|
||||
tree x = build3 (COMPONENT_REF, TREE_TYPE (root->chain_field),
|
||||
root->frame_decl, root->chain_field, NULL_TREE);
|
||||
x = build2 (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
|
||||
x = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (x), x, get_chain_decl (root));
|
||||
append_to_statement_list (x, &stmt_list);
|
||||
}
|
||||
|
||||
|
@ -133,10 +133,10 @@ tree_nrv (void)
|
||||
if (ret_expr)
|
||||
gcc_assert (ret_expr == result);
|
||||
}
|
||||
else if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (stmt, 0) == result)
|
||||
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& GIMPLE_STMT_OPERAND (stmt, 0) == result)
|
||||
{
|
||||
ret_expr = TREE_OPERAND (stmt, 1);
|
||||
ret_expr = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* Now verify that this return statement uses the same value
|
||||
as any previously encountered return statement. */
|
||||
@ -197,9 +197,9 @@ tree_nrv (void)
|
||||
{
|
||||
tree *tp = bsi_stmt_ptr (bsi);
|
||||
/* If this is a copy from VAR to RESULT, remove it. */
|
||||
if (TREE_CODE (*tp) == MODIFY_EXPR
|
||||
&& TREE_OPERAND (*tp, 0) == result
|
||||
&& TREE_OPERAND (*tp, 1) == found)
|
||||
if (TREE_CODE (*tp) == GIMPLE_MODIFY_STMT
|
||||
&& GIMPLE_STMT_OPERAND (*tp, 0) == result
|
||||
&& GIMPLE_STMT_OPERAND (*tp, 1) == found)
|
||||
bsi_remove (&bsi, true);
|
||||
else
|
||||
{
|
||||
@ -264,7 +264,7 @@ dest_safe_for_nrv_p (tree dest)
|
||||
}
|
||||
}
|
||||
|
||||
/* Walk through the function looking for MODIFY_EXPRs with calls that
|
||||
/* Walk through the function looking for GIMPLE_MODIFY_STMTs with calls that
|
||||
return in memory on the RHS. For each of these, determine whether it is
|
||||
safe to pass the address of the LHS as the return slot, and mark the
|
||||
call appropriately if so.
|
||||
@ -289,15 +289,15 @@ execute_return_slot_opt (void)
|
||||
tree stmt = bsi_stmt (i);
|
||||
tree call;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& (call = TREE_OPERAND (stmt, 1),
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& (call = GIMPLE_STMT_OPERAND (stmt, 1),
|
||||
TREE_CODE (call) == CALL_EXPR)
|
||||
&& !CALL_EXPR_RETURN_SLOT_OPT (call)
|
||||
&& aggregate_value_p (call, call))
|
||||
/* Check if the location being assigned to is
|
||||
call-clobbered. */
|
||||
CALL_EXPR_RETURN_SLOT_OPT (call) =
|
||||
dest_safe_for_nrv_p (TREE_OPERAND (stmt, 0)) ? 1 : 0;
|
||||
dest_safe_for_nrv_p (GIMPLE_STMT_OPERAND (stmt, 0)) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -688,13 +688,13 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1), arg;
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
|
||||
STRIP_NOPS (rhs);
|
||||
|
||||
if (TREE_CODE (rhs) == CALL_EXPR)
|
||||
@ -814,13 +814,13 @@ check_for_plus_in_loops_1 (struct object_size_info *osi, tree var,
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1), arg;
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
|
||||
STRIP_NOPS (rhs);
|
||||
|
||||
if (TREE_CODE (rhs) == CALL_EXPR)
|
||||
@ -892,13 +892,13 @@ check_for_plus_in_loops (struct object_size_info *osi, tree var)
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1), arg;
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
|
||||
STRIP_NOPS (rhs);
|
||||
|
||||
if (TREE_CODE (rhs) == CALL_EXPR)
|
||||
|
@ -206,8 +206,8 @@ execute_free_cfg_annotations (void)
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
{
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
ggc_free (stmt->common.ann);
|
||||
stmt->common.ann = NULL;
|
||||
ggc_free (stmt->base.ann);
|
||||
stmt->base.ann = NULL;
|
||||
}
|
||||
|
||||
/* And get rid of annotations we no longer need. */
|
||||
|
@ -188,7 +188,7 @@ insert_copy_on_edge (edge e, tree dest, tree src)
|
||||
{
|
||||
tree copy;
|
||||
|
||||
copy = build2 (MODIFY_EXPR, TREE_TYPE (dest), dest, src);
|
||||
copy = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (dest), dest, src);
|
||||
set_is_used (dest);
|
||||
|
||||
if (TREE_CODE (src) == ADDR_EXPR)
|
||||
@ -1026,10 +1026,10 @@ replace_use_variable (var_map map, use_operand_p p, tree *expr)
|
||||
int version = SSA_NAME_VERSION (var);
|
||||
if (expr[version])
|
||||
{
|
||||
tree new_expr = TREE_OPERAND (expr[version], 1);
|
||||
tree new_expr = GIMPLE_STMT_OPERAND (expr[version], 1);
|
||||
SET_USE (p, new_expr);
|
||||
/* Clear the stmt's RHS, or GC might bite us. */
|
||||
TREE_OPERAND (expr[version], 1) = NULL_TREE;
|
||||
GIMPLE_STMT_OPERAND (expr[version], 1) = NULL_TREE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1437,7 +1437,7 @@ check_replaceable (temp_expr_table_p tab, tree stmt)
|
||||
tree call_expr;
|
||||
bitmap def_vars, use_vars;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
/* Punt if there is more than 1 def, or more than 1 use. */
|
||||
@ -1453,7 +1453,8 @@ check_replaceable (temp_expr_table_p tab, tree stmt)
|
||||
return false;
|
||||
|
||||
/* Float expressions must go through memory if float-store is on. */
|
||||
if (flag_float_store && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1))))
|
||||
if (flag_float_store && FLOAT_TYPE_P (TREE_TYPE
|
||||
(GENERIC_TREE_OPERAND (stmt, 1))))
|
||||
return false;
|
||||
|
||||
/* Calls to functions with side-effects cannot be replaced. */
|
||||
@ -1793,8 +1794,8 @@ rewrite_trees (var_map map, tree *values)
|
||||
ann = stmt_ann (stmt);
|
||||
changed = false;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& (TREE_CODE (TREE_OPERAND (stmt, 1)) == SSA_NAME))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME))
|
||||
is_copy = true;
|
||||
|
||||
copy_use_p = NULL_USE_OPERAND_P;
|
||||
@ -1877,17 +1878,17 @@ static inline bool
|
||||
identical_copies_p (tree s1, tree s2)
|
||||
{
|
||||
#ifdef ENABLE_CHECKING
|
||||
gcc_assert (TREE_CODE (s1) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (s2) == MODIFY_EXPR);
|
||||
gcc_assert (DECL_P (TREE_OPERAND (s1, 0)));
|
||||
gcc_assert (DECL_P (TREE_OPERAND (s2, 0)));
|
||||
gcc_assert (TREE_CODE (s1) == GIMPLE_MODIFY_STMT);
|
||||
gcc_assert (TREE_CODE (s2) == GIMPLE_MODIFY_STMT);
|
||||
gcc_assert (DECL_P (GIMPLE_STMT_OPERAND (s1, 0)));
|
||||
gcc_assert (DECL_P (GIMPLE_STMT_OPERAND (s2, 0)));
|
||||
#endif
|
||||
|
||||
if (TREE_OPERAND (s1, 0) != TREE_OPERAND (s2, 0))
|
||||
if (GIMPLE_STMT_OPERAND (s1, 0) != GIMPLE_STMT_OPERAND (s2, 0))
|
||||
return false;
|
||||
|
||||
s1 = TREE_OPERAND (s1, 1);
|
||||
s2 = TREE_OPERAND (s2, 1);
|
||||
s1 = GIMPLE_STMT_OPERAND (s1, 1);
|
||||
s2 = GIMPLE_STMT_OPERAND (s2, 1);
|
||||
|
||||
if (s1 != s2)
|
||||
return false;
|
||||
@ -2343,10 +2344,10 @@ insert_backedge_copies (void)
|
||||
|
||||
/* Create a new instance of the underlying
|
||||
variable of the PHI result. */
|
||||
stmt = build2 (MODIFY_EXPR, TREE_TYPE (result_var),
|
||||
stmt = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (result_var),
|
||||
NULL_TREE, PHI_ARG_DEF (phi, i));
|
||||
name = make_ssa_name (result_var, stmt);
|
||||
TREE_OPERAND (stmt, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = name;
|
||||
|
||||
/* Insert the new statement into the block and update
|
||||
the PHI node. */
|
||||
|
@ -419,7 +419,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||
if (node == NULL_TREE)
|
||||
return spc;
|
||||
|
||||
is_expr = EXPR_P (node);
|
||||
is_expr = EXPR_P (node) || GIMPLE_STMT_P (node);
|
||||
|
||||
/* We use has_stmt_ann because CALL_EXPR can be both an expression
|
||||
and a statement, and we have no guarantee that it will have a
|
||||
@ -1024,12 +1024,15 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case INIT_EXPR:
|
||||
dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
|
||||
dump_generic_node (buffer, GENERIC_TREE_OPERAND (node, 0), spc, flags,
|
||||
false);
|
||||
pp_space (buffer);
|
||||
pp_character (buffer, '=');
|
||||
pp_space (buffer);
|
||||
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
|
||||
dump_generic_node (buffer, GENERIC_TREE_OPERAND (node, 1), spc, flags,
|
||||
false);
|
||||
break;
|
||||
|
||||
case TARGET_EXPR:
|
||||
@ -1485,8 +1488,10 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||
if (op0)
|
||||
{
|
||||
pp_space (buffer);
|
||||
if (TREE_CODE (op0) == MODIFY_EXPR)
|
||||
dump_generic_node (buffer, TREE_OPERAND (op0, 1), spc, flags, false);
|
||||
if (TREE_CODE (op0) == MODIFY_EXPR
|
||||
|| TREE_CODE (op0) == GIMPLE_MODIFY_STMT)
|
||||
dump_generic_node (buffer, GENERIC_TREE_OPERAND (op0, 1),
|
||||
spc, flags, false);
|
||||
else
|
||||
dump_generic_node (buffer, op0, spc, flags, false);
|
||||
}
|
||||
@ -2180,6 +2185,7 @@ op_prio (tree op)
|
||||
return 1;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
case INIT_EXPR:
|
||||
return 2;
|
||||
|
||||
@ -2311,6 +2317,7 @@ op_symbol_1 (enum tree_code code)
|
||||
switch (code)
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
return "=";
|
||||
|
||||
case TRUTH_OR_EXPR:
|
||||
|
@ -106,11 +106,11 @@ tree_gen_edge_profiler (int edgeno, edge e)
|
||||
tree tmp1 = create_tmp_var (gcov_type_node, "PROF");
|
||||
tree tmp2 = create_tmp_var (gcov_type_node, "PROF");
|
||||
tree ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
|
||||
tree stmt1 = build2 (MODIFY_EXPR, gcov_type_node, tmp1, ref);
|
||||
tree stmt2 = build2 (MODIFY_EXPR, gcov_type_node, tmp2,
|
||||
tree stmt1 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, tmp1, ref);
|
||||
tree stmt2 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, tmp2,
|
||||
build2 (PLUS_EXPR, gcov_type_node,
|
||||
tmp1, integer_one_node));
|
||||
tree stmt3 = build2 (MODIFY_EXPR, gcov_type_node, ref, tmp2);
|
||||
tree stmt3 = build2 (GIMPLE_MODIFY_STMT, gcov_type_node, ref, tmp2);
|
||||
bsi_insert_on_edge (e, stmt1);
|
||||
bsi_insert_on_edge (e, stmt2);
|
||||
bsi_insert_on_edge (e, stmt3);
|
||||
|
@ -48,7 +48,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
Given a scalar variable to be analyzed, follow the SSA edge to
|
||||
its definition:
|
||||
|
||||
- When the definition is a MODIFY_EXPR: if the right hand side
|
||||
- When the definition is a GIMPLE_MODIFY_STMT: if the right hand side
|
||||
(RHS) of the definition cannot be statically analyzed, the answer
|
||||
of the analyzer is: "don't know".
|
||||
Otherwise, for all the variables that are not yet analyzed in the
|
||||
@ -1405,15 +1405,15 @@ follow_ssa_edge (struct loop *loop, tree def, tree halting_phi,
|
||||
/* Outer loop. */
|
||||
return t_false;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
return follow_ssa_edge_in_rhs (loop, def,
|
||||
TREE_OPERAND (def, 1),
|
||||
GIMPLE_STMT_OPERAND (def, 1),
|
||||
halting_phi,
|
||||
evolution_of_loop, limit);
|
||||
|
||||
default:
|
||||
/* At this level of abstraction, the program is just a set
|
||||
of MODIFY_EXPRs and PHI_NODEs. In principle there is no
|
||||
of GIMPLE_MODIFY_STMTs and PHI_NODEs. In principle there is no
|
||||
other node to be handled. */
|
||||
return t_false;
|
||||
}
|
||||
@ -1607,16 +1607,16 @@ interpret_condition_phi (struct loop *loop, tree condition_phi)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Interpret the right hand side of a modify_expr OPND1. If we didn't
|
||||
/* Interpret the right hand side of a GIMPLE_MODIFY_STMT OPND1. If we didn't
|
||||
analyze this node before, follow the definitions until ending
|
||||
either on an analyzed modify_expr, or on a loop-phi-node. On the
|
||||
either on an analyzed GIMPLE_MODIFY_STMT, or on a loop-phi-node. On the
|
||||
return path, this function propagates evolutions (ala constant copy
|
||||
propagation). OPND1 is not a GIMPLE expression because we could
|
||||
analyze the effect of an inner loop: see interpret_loop_phi. */
|
||||
|
||||
static tree
|
||||
interpret_rhs_modify_expr (struct loop *loop, tree at_stmt,
|
||||
tree opnd1, tree type)
|
||||
interpret_rhs_modify_stmt (struct loop *loop, tree at_stmt,
|
||||
tree opnd1, tree type)
|
||||
{
|
||||
tree res, opnd10, opnd11, chrec10, chrec11;
|
||||
|
||||
@ -1883,15 +1883,15 @@ pointer_used_p (tree ptr)
|
||||
if (TREE_CODE (stmt) == COND_EXPR)
|
||||
return true;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
continue;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (!COMPARISON_CLASS_P (rhs))
|
||||
continue;
|
||||
|
||||
if (TREE_OPERAND (stmt, 0) == ptr
|
||||
|| TREE_OPERAND (stmt, 1) == ptr)
|
||||
if (GIMPLE_STMT_OPERAND (stmt, 0) == ptr
|
||||
|| GIMPLE_STMT_OPERAND (stmt, 1) == ptr)
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1911,7 +1911,7 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
|
||||
return chrec_dont_know;
|
||||
|
||||
if (TREE_CODE (var) != SSA_NAME)
|
||||
return interpret_rhs_modify_expr (loop, NULL_TREE, var, type);
|
||||
return interpret_rhs_modify_stmt (loop, NULL_TREE, var, type);
|
||||
|
||||
def = SSA_NAME_DEF_STMT (var);
|
||||
bb = bb_for_stmt (def);
|
||||
@ -1944,8 +1944,9 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
|
||||
|
||||
switch (TREE_CODE (def))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
res = interpret_rhs_modify_expr (loop, def, TREE_OPERAND (def, 1), type);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
res = interpret_rhs_modify_stmt (loop, def,
|
||||
GIMPLE_STMT_OPERAND (def, 1), type);
|
||||
|
||||
if (POINTER_TYPE_P (type)
|
||||
&& !automatically_generated_chrec_p (res)
|
||||
@ -3005,14 +3006,14 @@ scev_const_prop (void)
|
||||
SET_PHI_RESULT (phi, NULL_TREE);
|
||||
remove_phi_node (phi, NULL_TREE);
|
||||
|
||||
ass = build2 (MODIFY_EXPR, void_type_node, rslt, NULL_TREE);
|
||||
ass = build2 (GIMPLE_MODIFY_STMT, void_type_node, rslt, NULL_TREE);
|
||||
SSA_NAME_DEF_STMT (rslt) = ass;
|
||||
{
|
||||
block_stmt_iterator dest = bsi;
|
||||
bsi_insert_before (&dest, ass, BSI_NEW_STMT);
|
||||
def = force_gimple_operand_bsi (&dest, def, false, NULL_TREE);
|
||||
}
|
||||
TREE_OPERAND (ass, 1) = def;
|
||||
GIMPLE_STMT_OPERAND (ass, 1) = def;
|
||||
update_stmt (ass);
|
||||
}
|
||||
}
|
||||
|
@ -851,17 +851,17 @@ sra_walk_asm_expr (tree expr, block_stmt_iterator *bsi,
|
||||
sra_walk_tree_list (ASM_OUTPUTS (expr), bsi, true, fns);
|
||||
}
|
||||
|
||||
/* Walk a MODIFY_EXPR and categorize the assignment appropriately. */
|
||||
/* Walk a GIMPLE_MODIFY_STMT and categorize the assignment appropriately. */
|
||||
|
||||
static void
|
||||
sra_walk_modify_expr (tree expr, block_stmt_iterator *bsi,
|
||||
sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
|
||||
const struct sra_walk_fns *fns)
|
||||
{
|
||||
struct sra_elt *lhs_elt, *rhs_elt;
|
||||
tree lhs, rhs;
|
||||
|
||||
lhs = TREE_OPERAND (expr, 0);
|
||||
rhs = TREE_OPERAND (expr, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (expr, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (expr, 1);
|
||||
lhs_elt = maybe_lookup_element_for_expr (lhs);
|
||||
rhs_elt = maybe_lookup_element_for_expr (rhs);
|
||||
|
||||
@ -878,7 +878,7 @@ sra_walk_modify_expr (tree expr, block_stmt_iterator *bsi,
|
||||
if (!rhs_elt->is_scalar)
|
||||
fns->ldst (rhs_elt, lhs, bsi, false);
|
||||
else
|
||||
fns->use (rhs_elt, &TREE_OPERAND (expr, 1), bsi, false, false);
|
||||
fns->use (rhs_elt, &GIMPLE_STMT_OPERAND (expr, 1), bsi, false, false);
|
||||
}
|
||||
|
||||
/* If it isn't scalarizable, there may be scalarizable variables within, so
|
||||
@ -892,7 +892,7 @@ sra_walk_modify_expr (tree expr, block_stmt_iterator *bsi,
|
||||
if (call)
|
||||
sra_walk_call_expr (call, bsi, fns);
|
||||
else
|
||||
sra_walk_expr (&TREE_OPERAND (expr, 1), bsi, false, fns);
|
||||
sra_walk_expr (&GIMPLE_STMT_OPERAND (expr, 1), bsi, false, fns);
|
||||
}
|
||||
|
||||
/* Likewise, handle the LHS being scalarizable. We have cases similar
|
||||
@ -924,14 +924,14 @@ sra_walk_modify_expr (tree expr, block_stmt_iterator *bsi,
|
||||
/* Otherwise we're being used in some context that requires the
|
||||
aggregate to be seen as a whole. Invoke USE. */
|
||||
else
|
||||
fns->use (lhs_elt, &TREE_OPERAND (expr, 0), bsi, true, false);
|
||||
fns->use (lhs_elt, &GIMPLE_STMT_OPERAND (expr, 0), bsi, true, false);
|
||||
}
|
||||
|
||||
/* Similarly to above, LHS_ELT being null only means that the LHS as a
|
||||
whole is not a scalarizable reference. There may be occurrences of
|
||||
scalarizable variables within, which implies a USE. */
|
||||
else
|
||||
sra_walk_expr (&TREE_OPERAND (expr, 0), bsi, true, fns);
|
||||
sra_walk_expr (&GIMPLE_STMT_OPERAND (expr, 0), bsi, true, fns);
|
||||
}
|
||||
|
||||
/* Entry point to the walk functions. Search the entire function,
|
||||
@ -977,14 +977,14 @@ sra_walk_function (const struct sra_walk_fns *fns)
|
||||
as a USE of the variable on the RHS of this assignment. */
|
||||
|
||||
t = TREE_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
sra_walk_expr (&TREE_OPERAND (t, 1), &si, false, fns);
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
sra_walk_expr (&GIMPLE_STMT_OPERAND (t, 1), &si, false, fns);
|
||||
else
|
||||
sra_walk_expr (&TREE_OPERAND (stmt, 0), &si, false, fns);
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
sra_walk_modify_expr (stmt, &si, fns);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
sra_walk_gimple_modify_stmt (stmt, &si, fns);
|
||||
break;
|
||||
case CALL_EXPR:
|
||||
sra_walk_call_expr (stmt, &si, fns);
|
||||
@ -1689,16 +1689,16 @@ generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr,
|
||||
i = c->replacement;
|
||||
|
||||
t = build2 (COMPLEX_EXPR, elt->type, r, i);
|
||||
t = build2 (MODIFY_EXPR, void_type_node, expr, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, expr, t);
|
||||
SSA_NAME_DEF_STMT (expr) = t;
|
||||
append_to_statement_list (t, list_p);
|
||||
}
|
||||
else if (elt->replacement)
|
||||
{
|
||||
if (copy_out)
|
||||
t = build2 (MODIFY_EXPR, void_type_node, elt->replacement, expr);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, elt->replacement, expr);
|
||||
else
|
||||
t = build2 (MODIFY_EXPR, void_type_node, expr, elt->replacement);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, expr, elt->replacement);
|
||||
append_to_statement_list (t, list_p);
|
||||
}
|
||||
else
|
||||
@ -1733,7 +1733,7 @@ generate_element_copy (struct sra_elt *dst, struct sra_elt *src, tree *list_p)
|
||||
|
||||
gcc_assert (src->replacement);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, dst->replacement,
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst->replacement,
|
||||
src->replacement);
|
||||
append_to_statement_list (t, list_p);
|
||||
}
|
||||
@ -1765,7 +1765,7 @@ generate_element_zero (struct sra_elt *elt, tree *list_p)
|
||||
gcc_assert (elt->is_scalar);
|
||||
t = fold_convert (elt->type, integer_zero_node);
|
||||
|
||||
t = build2 (MODIFY_EXPR, void_type_node, elt->replacement, t);
|
||||
t = build2 (GIMPLE_MODIFY_STMT, void_type_node, elt->replacement, t);
|
||||
append_to_statement_list (t, list_p);
|
||||
}
|
||||
}
|
||||
@ -1777,7 +1777,7 @@ static void
|
||||
generate_one_element_init (tree var, tree init, tree *list_p)
|
||||
{
|
||||
/* The replacement can be almost arbitrarily complex. Gimplify. */
|
||||
tree stmt = build2 (MODIFY_EXPR, void_type_node, var, init);
|
||||
tree stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, var, init);
|
||||
gimplify_and_add (stmt, list_p);
|
||||
}
|
||||
|
||||
@ -2024,10 +2024,10 @@ scalarize_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
|
||||
|
||||
/* See the commentary in sra_walk_function concerning
|
||||
RETURN_EXPR, and why we should never see one here. */
|
||||
gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
|
||||
|
||||
TREE_OPERAND (stmt, 0) = lhs_elt->replacement;
|
||||
TREE_OPERAND (stmt, 1) = rhs_elt->replacement;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = lhs_elt->replacement;
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = rhs_elt->replacement;
|
||||
update_stmt (stmt);
|
||||
}
|
||||
else if (lhs_elt->use_block_copy || rhs_elt->use_block_copy)
|
||||
|
@ -408,7 +408,7 @@ compute_call_clobbered (struct alias_info *ai)
|
||||
static bool
|
||||
lhs_may_store_to (tree stmt, tree sym ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GENERIC_TREE_OPERAND (stmt, 0);
|
||||
|
||||
lhs = get_base_address (lhs);
|
||||
|
||||
@ -459,8 +459,8 @@ recalculate_used_alone (void)
|
||||
stmt = bsi_stmt (bsi);
|
||||
|
||||
if (TREE_CODE (stmt) == CALL_EXPR
|
||||
|| (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR))
|
||||
|| (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR))
|
||||
{
|
||||
iscall = true;
|
||||
VEC_safe_push (tree, heap, calls, stmt);
|
||||
@ -786,24 +786,24 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
|
||||
find all the indirect and direct uses of x_1 inside. The only
|
||||
shortcut we can take is the fact that GIMPLE only allows
|
||||
INDIRECT_REFs inside the expressions below. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
|| (TREE_CODE (stmt) == RETURN_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR)
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
|
||||
|| TREE_CODE (stmt) == ASM_EXPR
|
||||
|| TREE_CODE (stmt) == CALL_EXPR)
|
||||
{
|
||||
tree lhs, rhs;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
}
|
||||
else if (TREE_CODE (stmt) == RETURN_EXPR)
|
||||
{
|
||||
tree e = TREE_OPERAND (stmt, 0);
|
||||
lhs = TREE_OPERAND (e, 0);
|
||||
rhs = TREE_OPERAND (e, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (e, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (e, 1);
|
||||
}
|
||||
else if (TREE_CODE (stmt) == ASM_EXPR)
|
||||
{
|
||||
@ -816,7 +816,8 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
|
||||
rhs = stmt;
|
||||
}
|
||||
|
||||
if (lhs && (TREE_CODE (lhs) == TREE_LIST || EXPR_P (lhs)))
|
||||
if (lhs && (TREE_CODE (lhs) == TREE_LIST
|
||||
|| EXPR_P (lhs) || GIMPLE_STMT_P (lhs)))
|
||||
{
|
||||
struct count_ptr_d count;
|
||||
count.ptr = ptr;
|
||||
@ -826,7 +827,8 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
|
||||
*num_derefs_p = count.count;
|
||||
}
|
||||
|
||||
if (rhs && (TREE_CODE (rhs) == TREE_LIST || EXPR_P (rhs)))
|
||||
if (rhs && (TREE_CODE (rhs) == TREE_LIST
|
||||
|| EXPR_P (rhs) || GIMPLE_STMT_P (rhs)))
|
||||
{
|
||||
struct count_ptr_d count;
|
||||
count.ptr = ptr;
|
||||
@ -2167,9 +2169,9 @@ is_escape_site (tree stmt)
|
||||
}
|
||||
else if (TREE_CODE (stmt) == ASM_EXPR)
|
||||
return ESCAPE_TO_ASM;
|
||||
else if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
|
||||
/* Get to the base of _REF nodes. */
|
||||
if (TREE_CODE (lhs) != SSA_NAME)
|
||||
@ -2180,12 +2182,13 @@ is_escape_site (tree stmt)
|
||||
if (lhs == NULL_TREE)
|
||||
return ESCAPE_UNKNOWN;
|
||||
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (stmt, 1)) == CONVERT_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (stmt, 1)) == VIEW_CONVERT_EXPR)
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == NOP_EXPR
|
||||
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CONVERT_EXPR
|
||||
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VIEW_CONVERT_EXPR)
|
||||
{
|
||||
tree from = TREE_TYPE (TREE_OPERAND (TREE_OPERAND (stmt, 1), 0));
|
||||
tree to = TREE_TYPE (TREE_OPERAND (stmt, 1));
|
||||
tree from
|
||||
= TREE_TYPE (TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0));
|
||||
tree to = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
|
||||
/* If the RHS is a conversion between a pointer and an integer, the
|
||||
pointer escapes since we can't track the integer. */
|
||||
@ -3173,11 +3176,12 @@ find_used_portions (tree *tp, int *walk_subtrees, void *lhs_p)
|
||||
{
|
||||
switch (TREE_CODE (*tp))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
/* Recurse manually here to track whether the use is in the
|
||||
LHS of an assignment. */
|
||||
find_used_portions (&TREE_OPERAND (*tp, 0), walk_subtrees, tp);
|
||||
return find_used_portions (&TREE_OPERAND (*tp, 1), walk_subtrees, NULL);
|
||||
find_used_portions (&GIMPLE_STMT_OPERAND (*tp, 0), walk_subtrees, tp);
|
||||
return find_used_portions (&GIMPLE_STMT_OPERAND (*tp, 1),
|
||||
walk_subtrees, NULL);
|
||||
case REALPART_EXPR:
|
||||
case IMAGPART_EXPR:
|
||||
case COMPONENT_REF:
|
||||
|
@ -375,7 +375,7 @@ get_default_value (tree var)
|
||||
else
|
||||
val.lattice_val = VARYING;
|
||||
}
|
||||
else if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (stmt) == PHI_NODE)
|
||||
{
|
||||
/* Any other variable defined by an assignment or a PHI node
|
||||
@ -543,7 +543,7 @@ likely_value (tree stmt)
|
||||
|
||||
/* Anything other than assignments and conditional jumps are not
|
||||
interesting for CCP. */
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
&& !(TREE_CODE (stmt) == RETURN_EXPR && get_rhs (stmt) != NULL_TREE)
|
||||
&& TREE_CODE (stmt) != COND_EXPR
|
||||
&& TREE_CODE (stmt) != SWITCH_EXPR)
|
||||
@ -601,7 +601,7 @@ surely_varying_stmt_p (tree stmt)
|
||||
|
||||
/* Anything other than assignments and conditional jumps are not
|
||||
interesting for CCP. */
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
&& !(TREE_CODE (stmt) == RETURN_EXPR && get_rhs (stmt) != NULL_TREE)
|
||||
&& TREE_CODE (stmt) != COND_EXPR
|
||||
&& TREE_CODE (stmt) != SWITCH_EXPR)
|
||||
@ -1184,8 +1184,8 @@ visit_assignment (tree stmt, tree *output_p)
|
||||
tree lhs, rhs;
|
||||
enum ssa_prop_result retval;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (rhs) == SSA_NAME)
|
||||
{
|
||||
@ -1219,7 +1219,7 @@ visit_assignment (tree stmt, tree *output_p)
|
||||
the constant value into the type of the destination variable. This
|
||||
should not be necessary if GCC represented bitfields properly. */
|
||||
{
|
||||
tree orig_lhs = TREE_OPERAND (stmt, 0);
|
||||
tree orig_lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
|
||||
if (TREE_CODE (orig_lhs) == VIEW_CONVERT_EXPR
|
||||
&& val.lattice_val == CONSTANT)
|
||||
@ -1364,7 +1364,7 @@ ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
/* If the statement is an assignment that produces a single
|
||||
output value, evaluate its RHS to see if the lattice value of
|
||||
@ -2145,14 +2145,14 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type)
|
||||
|
||||
switch (TREE_CODE (def_stmt))
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree rhs;
|
||||
|
||||
/* The RHS of the statement defining VAR must either have a
|
||||
constant length or come from another SSA_NAME with a constant
|
||||
length. */
|
||||
rhs = TREE_OPERAND (def_stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
|
||||
STRIP_NOPS (rhs);
|
||||
return get_maxval_strlen (rhs, length, visited, type);
|
||||
}
|
||||
@ -2204,7 +2204,7 @@ ccp_fold_builtin (tree stmt, tree fn)
|
||||
bitmap visited;
|
||||
bool ignore;
|
||||
|
||||
ignore = TREE_CODE (stmt) != MODIFY_EXPR;
|
||||
ignore = TREE_CODE (stmt) != GIMPLE_MODIFY_STMT;
|
||||
|
||||
/* First try the generic builtin folder. If that succeeds, return the
|
||||
result directly. */
|
||||
@ -2308,13 +2308,13 @@ ccp_fold_builtin (tree stmt, tree fn)
|
||||
|
||||
case BUILT_IN_FPUTS:
|
||||
result = fold_builtin_fputs (arglist,
|
||||
TREE_CODE (stmt) != MODIFY_EXPR, 0,
|
||||
TREE_CODE (stmt) != GIMPLE_MODIFY_STMT, 0,
|
||||
val[0]);
|
||||
break;
|
||||
|
||||
case BUILT_IN_FPUTS_UNLOCKED:
|
||||
result = fold_builtin_fputs (arglist,
|
||||
TREE_CODE (stmt) != MODIFY_EXPR, 1,
|
||||
TREE_CODE (stmt) != GIMPLE_MODIFY_STMT, 1,
|
||||
val[0]);
|
||||
break;
|
||||
|
||||
@ -2578,7 +2578,7 @@ execute_fold_all_builtins (void)
|
||||
{
|
||||
result = convert_to_gimple_builtin (&i, result,
|
||||
TREE_CODE (old_stmt)
|
||||
!= MODIFY_EXPR);
|
||||
!= GIMPLE_MODIFY_STMT);
|
||||
if (result)
|
||||
{
|
||||
bool ok = set_rhs (stmtp, result);
|
||||
|
@ -370,11 +370,11 @@ stmt_may_generate_copy (tree stmt)
|
||||
if (TREE_CODE (stmt) == PHI_NODE)
|
||||
return !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (stmt));
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
ann = stmt_ann (stmt);
|
||||
|
||||
/* If the statement has volatile operands, it won't generate a
|
||||
@ -554,8 +554,8 @@ copy_prop_visit_assignment (tree stmt, tree *result_p)
|
||||
tree lhs, rhs;
|
||||
prop_value_t *rhs_val;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
gcc_assert (TREE_CODE (rhs) == SSA_NAME);
|
||||
|
||||
@ -690,17 +690,17 @@ copy_prop_visit_stmt (tree stmt, edge *taken_edge_p, tree *result_p)
|
||||
fprintf (dump_file, "\n");
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == SSA_NAME
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME
|
||||
&& (do_store_copy_prop
|
||||
|| TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME))
|
||||
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME))
|
||||
{
|
||||
/* If the statement is a copy assignment, evaluate its RHS to
|
||||
see if the lattice value of its output has changed. */
|
||||
retval = copy_prop_visit_assignment (stmt, result_p);
|
||||
}
|
||||
else if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME
|
||||
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
|
||||
&& do_store_copy_prop
|
||||
&& stmt_makes_single_load (stmt))
|
||||
{
|
||||
@ -711,14 +711,14 @@ copy_prop_visit_stmt (tree stmt, edge *taken_edge_p, tree *result_p)
|
||||
if (val
|
||||
&& val->mem_ref
|
||||
&& is_gimple_reg (val->value)
|
||||
&& operand_equal_p (val->mem_ref, TREE_OPERAND (stmt, 1), 0))
|
||||
&& operand_equal_p (val->mem_ref, GIMPLE_STMT_OPERAND (stmt, 1), 0))
|
||||
{
|
||||
bool changed;
|
||||
changed = set_copy_of_val (TREE_OPERAND (stmt, 0),
|
||||
changed = set_copy_of_val (GIMPLE_STMT_OPERAND (stmt, 0),
|
||||
val->value, val->mem_ref);
|
||||
if (changed)
|
||||
{
|
||||
*result_p = TREE_OPERAND (stmt, 0);
|
||||
*result_p = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
retval = SSA_PROP_INTERESTING;
|
||||
}
|
||||
else
|
||||
@ -910,7 +910,7 @@ init_copy_prop (void)
|
||||
if (stmt_ends_bb_p (stmt))
|
||||
DONT_SIMULATE_AGAIN (stmt) = false;
|
||||
else if (stmt_may_generate_copy (stmt)
|
||||
&& loop_depth_of_name (TREE_OPERAND (stmt, 1)) <= depth)
|
||||
&& loop_depth_of_name (GIMPLE_STMT_OPERAND (stmt, 1)) <= depth)
|
||||
DONT_SIMULATE_AGAIN (stmt) = false;
|
||||
else
|
||||
DONT_SIMULATE_AGAIN (stmt) = true;
|
||||
|
@ -315,10 +315,10 @@ rename_ssa_copies (void)
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
{
|
||||
stmt = bsi_stmt (bsi);
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (lhs) == SSA_NAME && TREE_CODE (rhs) == SSA_NAME)
|
||||
copy_rename_partition_coalesce (map, lhs, rhs, debug);
|
||||
|
@ -216,7 +216,7 @@ find_pdom (basic_block block)
|
||||
}
|
||||
}
|
||||
|
||||
#define NECESSARY(stmt) stmt->common.asm_written_flag
|
||||
#define NECESSARY(stmt) stmt->base.asm_written_flag
|
||||
|
||||
/* If STMT is not already marked necessary, mark it, and add it to the
|
||||
worklist if ADD_TO_WORKLIST is true. */
|
||||
@ -318,7 +318,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
|
||||
mark_stmt_necessary (stmt, true);
|
||||
return;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
op = get_call_expr_in (stmt);
|
||||
if (op && TREE_SIDE_EFFECTS (op))
|
||||
{
|
||||
@ -329,8 +329,8 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
|
||||
/* These values are mildly magic bits of the EH runtime. We can't
|
||||
see the entire lifetime of these values until landing pads are
|
||||
generated. */
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 0)) == EXC_PTR_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (stmt, 0)) == FILTER_EXPR)
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == EXC_PTR_EXPR
|
||||
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == FILTER_EXPR)
|
||||
{
|
||||
mark_stmt_necessary (stmt, true);
|
||||
return;
|
||||
|
@ -489,7 +489,7 @@ initialize_hash_element (tree expr, tree lhs, struct expr_hash_elt *element)
|
||||
else if (TREE_CODE (expr) == RETURN_EXPR && TREE_OPERAND (expr, 0))
|
||||
{
|
||||
element->stmt = expr;
|
||||
element->rhs = TREE_OPERAND (TREE_OPERAND (expr, 0), 1);
|
||||
element->rhs = GIMPLE_STMT_OPERAND (TREE_OPERAND (expr, 0), 1);
|
||||
}
|
||||
else if (TREE_CODE (expr) == GOTO_EXPR)
|
||||
{
|
||||
@ -499,7 +499,7 @@ initialize_hash_element (tree expr, tree lhs, struct expr_hash_elt *element)
|
||||
else
|
||||
{
|
||||
element->stmt = expr;
|
||||
element->rhs = TREE_OPERAND (expr, 1);
|
||||
element->rhs = GENERIC_TREE_OPERAND (expr, 1);
|
||||
}
|
||||
|
||||
element->lhs = lhs;
|
||||
@ -1183,14 +1183,14 @@ simple_iv_increment_p (tree stmt)
|
||||
tree lhs, rhs, preinc, phi;
|
||||
unsigned i;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (lhs) != SSA_NAME)
|
||||
return false;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (rhs) != PLUS_EXPR
|
||||
&& TREE_CODE (rhs) != MINUS_EXPR)
|
||||
@ -1473,8 +1473,8 @@ eliminate_redundant_computations (tree stmt)
|
||||
bool retval = false;
|
||||
bool modify_expr_p = false;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
def = TREE_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
def = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
|
||||
/* Certain expressions on the RHS can be optimized away, but can not
|
||||
themselves be entered into the hash tables. */
|
||||
@ -1499,12 +1499,12 @@ eliminate_redundant_computations (tree stmt)
|
||||
expr_p = &SWITCH_COND (stmt);
|
||||
else if (TREE_CODE (stmt) == RETURN_EXPR && TREE_OPERAND (stmt, 0))
|
||||
{
|
||||
expr_p = &TREE_OPERAND (TREE_OPERAND (stmt, 0), 1);
|
||||
expr_p = &GIMPLE_STMT_OPERAND (TREE_OPERAND (stmt, 0), 1);
|
||||
modify_expr_p = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
expr_p = &TREE_OPERAND (stmt, 1);
|
||||
expr_p = &GENERIC_TREE_OPERAND (stmt, 1);
|
||||
modify_expr_p = true;
|
||||
}
|
||||
|
||||
@ -1552,7 +1552,7 @@ eliminate_redundant_computations (tree stmt)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* STMT, a MODIFY_EXPR, may create certain equivalences, in either
|
||||
/* STMT, a GIMPLE_MODIFY_STMT, may create certain equivalences, in either
|
||||
the available expressions table or the const_and_copies table.
|
||||
Detect and record those equivalences. */
|
||||
|
||||
@ -1561,12 +1561,12 @@ record_equivalences_from_stmt (tree stmt,
|
||||
int may_optimize_p,
|
||||
stmt_ann_t ann)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
enum tree_code lhs_code = TREE_CODE (lhs);
|
||||
|
||||
if (lhs_code == SSA_NAME)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* Strip away any useless type conversions. */
|
||||
STRIP_USELESS_TYPE_CONVERSION (rhs);
|
||||
@ -1588,11 +1588,11 @@ record_equivalences_from_stmt (tree stmt,
|
||||
vops and recording the result in the available expression table,
|
||||
we may be able to expose more redundant loads. */
|
||||
if (!ann->has_volatile_ops
|
||||
&& (TREE_CODE (TREE_OPERAND (stmt, 1)) == SSA_NAME
|
||||
|| is_gimple_min_invariant (TREE_OPERAND (stmt, 1)))
|
||||
&& (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME
|
||||
|| is_gimple_min_invariant (GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
&& !is_gimple_reg (lhs))
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree new;
|
||||
|
||||
/* FIXME: If the LHS of the assignment is a bitfield and the RHS
|
||||
@ -1619,7 +1619,7 @@ record_equivalences_from_stmt (tree stmt,
|
||||
if (rhs)
|
||||
{
|
||||
/* Build a new statement with the RHS and LHS exchanged. */
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs);
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT, rhs, lhs);
|
||||
|
||||
create_ssa_artficial_load_stmt (new, stmt);
|
||||
|
||||
@ -1840,11 +1840,14 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
||||
may_optimize_p = (!ann->has_volatile_ops
|
||||
&& ((TREE_CODE (stmt) == RETURN_EXPR
|
||||
&& TREE_OPERAND (stmt, 0)
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0))
|
||||
== GIMPLE_MODIFY_STMT
|
||||
&& ! (TREE_SIDE_EFFECTS
|
||||
(TREE_OPERAND (TREE_OPERAND (stmt, 0), 1))))
|
||||
|| (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& ! TREE_SIDE_EFFECTS (TREE_OPERAND (stmt, 1)))
|
||||
(GIMPLE_STMT_OPERAND
|
||||
(TREE_OPERAND (stmt, 0), 1))))
|
||||
|| (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& ! TREE_SIDE_EFFECTS (GIMPLE_STMT_OPERAND (stmt,
|
||||
1)))
|
||||
|| TREE_CODE (stmt) == COND_EXPR
|
||||
|| TREE_CODE (stmt) == SWITCH_EXPR));
|
||||
|
||||
@ -1852,7 +1855,7 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
||||
may_have_exposed_new_symbols |= eliminate_redundant_computations (stmt);
|
||||
|
||||
/* Record any additional equivalences created by this statement. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
record_equivalences_from_stmt (stmt,
|
||||
may_optimize_p,
|
||||
ann);
|
||||
@ -1917,7 +1920,7 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
||||
is also added to the stack pointed to by BLOCK_AVAIL_EXPRS_P, so that they
|
||||
can be removed when we finish processing this block and its children.
|
||||
|
||||
NOTE: This function assumes that STMT is a MODIFY_EXPR node that
|
||||
NOTE: This function assumes that STMT is a GIMPLE_MODIFY_STMT node that
|
||||
contains no CALL_EXPR on its RHS and makes no volatile nor
|
||||
aliased references. */
|
||||
|
||||
@ -1929,7 +1932,8 @@ lookup_avail_expr (tree stmt, bool insert)
|
||||
tree temp;
|
||||
struct expr_hash_elt *element = XNEW (struct expr_hash_elt);
|
||||
|
||||
lhs = TREE_CODE (stmt) == MODIFY_EXPR ? TREE_OPERAND (stmt, 0) : NULL;
|
||||
lhs = TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
? GIMPLE_STMT_OPERAND (stmt, 0) : NULL;
|
||||
|
||||
initialize_hash_element (stmt, lhs, element);
|
||||
|
||||
@ -1978,8 +1982,8 @@ lookup_avail_expr (tree stmt, bool insert)
|
||||
}
|
||||
|
||||
/* Hashing and equality functions for AVAIL_EXPRS. The table stores
|
||||
MODIFY_EXPR statements. We compute a value number for expressions using
|
||||
the code of the expression and the SSA numbers of its operands. */
|
||||
GIMPLE_MODIFY_STMT statements. We compute a value number for expressions
|
||||
using the code of the expression and the SSA numbers of its operands. */
|
||||
|
||||
static hashval_t
|
||||
avail_expr_hash (const void *p)
|
||||
@ -2078,7 +2082,7 @@ degenerate_phi_result (tree phi)
|
||||
return (i == PHI_NUM_ARGS (phi) ? val : NULL);
|
||||
}
|
||||
|
||||
/* Given a tree node T, which is either a PHI_NODE or MODIFY_EXPR,
|
||||
/* Given a tree node T, which is either a PHI_NODE or GIMPLE_MODIFY_STMT,
|
||||
remove it from the IL. */
|
||||
|
||||
static void
|
||||
@ -2093,7 +2097,7 @@ remove_stmt_or_phi (tree t)
|
||||
}
|
||||
}
|
||||
|
||||
/* Given a tree node T, which is either a PHI_NODE or MODIFY_EXPR,
|
||||
/* Given a tree node T, which is either a PHI_NODE or GIMPLE_MODIFY_STMT,
|
||||
return the "rhs" of the node, in the case of a non-degenerate
|
||||
PHI, NULL is returned. */
|
||||
|
||||
@ -2102,13 +2106,13 @@ get_rhs_or_phi_arg (tree t)
|
||||
{
|
||||
if (TREE_CODE (t) == PHI_NODE)
|
||||
return degenerate_phi_result (t);
|
||||
else if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
return TREE_OPERAND (t, 1);
|
||||
else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
return GIMPLE_STMT_OPERAND (t, 1);
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
|
||||
/* Given a tree node T, which is either a PHI_NODE or a MODIFY_EXPR,
|
||||
/* Given a tree node T, which is either a PHI_NODE or a GIMPLE_MODIFY_STMT,
|
||||
return the "lhs" of the node. */
|
||||
|
||||
static tree
|
||||
@ -2116,8 +2120,8 @@ get_lhs_or_phi_result (tree t)
|
||||
{
|
||||
if (TREE_CODE (t) == PHI_NODE)
|
||||
return PHI_RESULT (t);
|
||||
else if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
return TREE_OPERAND (t, 0);
|
||||
else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
return GIMPLE_STMT_OPERAND (t, 0);
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
@ -2239,9 +2243,10 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
|
||||
|
||||
/* If we replaced a variable index with a constant, then
|
||||
we would need to update the invariant flag for ADDR_EXPRs. */
|
||||
if (TREE_CODE (use_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (use_stmt, 1)) == ADDR_EXPR)
|
||||
recompute_tree_invariant_for_addr_expr (TREE_OPERAND (use_stmt, 1));
|
||||
if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == ADDR_EXPR)
|
||||
recompute_tree_invariant_for_addr_expr
|
||||
(GIMPLE_STMT_OPERAND (use_stmt, 1));
|
||||
|
||||
/* If we cleaned up EH information from the statement,
|
||||
mark its containing block as needing EH cleanups. */
|
||||
@ -2254,10 +2259,11 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
|
||||
|
||||
/* Propagation may expose new trivial copy/constant propagation
|
||||
opportunities. */
|
||||
if (TREE_CODE (use_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (use_stmt, 0)) == SSA_NAME
|
||||
&& (TREE_CODE (TREE_OPERAND (use_stmt, 1)) == SSA_NAME
|
||||
|| is_gimple_min_invariant (TREE_OPERAND (use_stmt, 1))))
|
||||
if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME
|
||||
&& (TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == SSA_NAME
|
||||
|| is_gimple_min_invariant (GIMPLE_STMT_OPERAND (use_stmt,
|
||||
1))))
|
||||
{
|
||||
tree result = get_lhs_or_phi_result (use_stmt);
|
||||
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
|
||||
|
@ -205,7 +205,7 @@ memory_address_same (tree store1, tree store2)
|
||||
walk_data.store1_bb = bb_for_stmt (store1);
|
||||
walk_data.store2_bb = bb_for_stmt (store2);
|
||||
|
||||
return (walk_tree (&TREE_OPERAND (store1, 0), memory_ssa_name_same,
|
||||
return (walk_tree (&GIMPLE_STMT_OPERAND (store1, 0), memory_ssa_name_same,
|
||||
&walk_data, NULL)
|
||||
== NULL);
|
||||
}
|
||||
@ -237,15 +237,15 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
|
||||
if (ZERO_SSA_OPERANDS (stmt, (SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF)))
|
||||
return;
|
||||
|
||||
/* We know we have virtual definitions. If this is a MODIFY_EXPR that's
|
||||
not also a function call, then record it into our table. */
|
||||
/* We know we have virtual definitions. If this is a GIMPLE_MODIFY_STMT
|
||||
that's not also a function call, then record it into our table. */
|
||||
if (get_call_expr_in (stmt))
|
||||
return;
|
||||
|
||||
if (ann->has_volatile_ops)
|
||||
return;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
use_operand_p first_use_p = NULL_USE_OPERAND_P;
|
||||
use_operand_p use_p = NULL;
|
||||
@ -328,8 +328,8 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
|
||||
SSA-form variables in the address will have the same values. */
|
||||
if (use_p != NULL_USE_OPERAND_P
|
||||
&& bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt))
|
||||
&& operand_equal_p (TREE_OPERAND (stmt, 0),
|
||||
TREE_OPERAND (use_stmt, 0), 0)
|
||||
&& operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0),
|
||||
GIMPLE_STMT_OPERAND (use_stmt, 0), 0)
|
||||
&& memory_address_same (stmt, use_stmt))
|
||||
{
|
||||
/* Make sure we propagate the ABNORMAL bit setting. */
|
||||
|
@ -162,9 +162,9 @@ ssa_name_defined_by_comparison_p (tree var)
|
||||
{
|
||||
tree def = SSA_NAME_DEF_STMT (var);
|
||||
|
||||
if (TREE_CODE (def) == MODIFY_EXPR)
|
||||
if (TREE_CODE (def) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (def, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (def, 1);
|
||||
return COMPARISON_CLASS_P (rhs);
|
||||
}
|
||||
|
||||
@ -203,12 +203,12 @@ forward_propagate_into_cond_1 (tree cond, tree *test_var_p)
|
||||
test_var = TREE_OPERAND (cond, 0);
|
||||
|
||||
/* Now get the defining statement for TEST_VAR. Skip this case if
|
||||
it's not defined by some MODIFY_EXPR. */
|
||||
it's not defined by some GIMPLE_MODIFY_STMT. */
|
||||
def = SSA_NAME_DEF_STMT (test_var);
|
||||
if (TREE_CODE (def) != MODIFY_EXPR)
|
||||
if (TREE_CODE (def) != GIMPLE_MODIFY_STMT)
|
||||
return NULL_TREE;
|
||||
|
||||
def_rhs = TREE_OPERAND (def, 1);
|
||||
def_rhs = GIMPLE_STMT_OPERAND (def, 1);
|
||||
|
||||
/* If TEST_VAR is set by adding or subtracting a constant
|
||||
from an SSA_NAME, then it is interesting to us as we
|
||||
@ -429,15 +429,15 @@ find_equivalent_equality_comparison (tree cond)
|
||||
tree def_stmt = SSA_NAME_DEF_STMT (op0);
|
||||
|
||||
while (def_stmt
|
||||
&& TREE_CODE (def_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (def_stmt, 1)) == SSA_NAME)
|
||||
def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (def_stmt, 1));
|
||||
&& TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == SSA_NAME)
|
||||
def_stmt = SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (def_stmt, 1));
|
||||
|
||||
/* OP0 might have been a parameter, so first make sure it
|
||||
was defined by a MODIFY_EXPR. */
|
||||
if (def_stmt && TREE_CODE (def_stmt) == MODIFY_EXPR)
|
||||
was defined by a GIMPLE_MODIFY_STMT. */
|
||||
if (def_stmt && TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree def_rhs = TREE_OPERAND (def_stmt, 1);
|
||||
tree def_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
|
||||
|
||||
/* If either operand to the comparison is a pointer to
|
||||
a function, then we can not apply this optimization
|
||||
@ -450,7 +450,7 @@ find_equivalent_equality_comparison (tree cond)
|
||||
&& TREE_CODE (TREE_TYPE (TREE_TYPE (op1))) == FUNCTION_TYPE))
|
||||
return NULL;
|
||||
|
||||
/* Now make sure the RHS of the MODIFY_EXPR is a typecast. */
|
||||
/* Now make sure the RHS of the GIMPLE_MODIFY_STMT is a typecast. */
|
||||
if ((TREE_CODE (def_rhs) == NOP_EXPR
|
||||
|| TREE_CODE (def_rhs) == CONVERT_EXPR)
|
||||
&& TREE_CODE (TREE_OPERAND (def_rhs, 0)) == SSA_NAME)
|
||||
@ -583,8 +583,8 @@ tidy_after_forward_propagate_addr (tree stmt)
|
||||
&& tree_purge_dead_eh_edges (bb_for_stmt (stmt)))
|
||||
cfg_changed = true;
|
||||
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == ADDR_EXPR)
|
||||
recompute_tree_invariant_for_addr_expr (TREE_OPERAND (stmt, 1));
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ADDR_EXPR)
|
||||
recompute_tree_invariant_for_addr_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
|
||||
mark_new_vars_to_rename (stmt);
|
||||
}
|
||||
@ -610,13 +610,13 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
|
||||
{
|
||||
tree index;
|
||||
|
||||
/* The offset must be defined by a simple MODIFY_EXPR statement. */
|
||||
if (TREE_CODE (offset) != MODIFY_EXPR)
|
||||
/* The offset must be defined by a simple GIMPLE_MODIFY_STMT statement. */
|
||||
if (TREE_CODE (offset) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
/* The RHS of the statement which defines OFFSET must be a gimple
|
||||
cast of another SSA_NAME. */
|
||||
offset = TREE_OPERAND (offset, 1);
|
||||
offset = GIMPLE_STMT_OPERAND (offset, 1);
|
||||
if (!is_gimple_cast (offset))
|
||||
return false;
|
||||
|
||||
@ -629,15 +629,15 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
|
||||
offset = SSA_NAME_DEF_STMT (offset);
|
||||
|
||||
/* The statement which defines OFFSET before type conversion
|
||||
must be a simple MODIFY_EXPR. */
|
||||
if (TREE_CODE (offset) != MODIFY_EXPR)
|
||||
must be a simple GIMPLE_MODIFY_STMT. */
|
||||
if (TREE_CODE (offset) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
/* The RHS of the statement which defines OFFSET must be a
|
||||
multiplication of an object by the size of the array elements.
|
||||
This implicitly verifies that the size of the array elements
|
||||
is constant. */
|
||||
offset = TREE_OPERAND (offset, 1);
|
||||
offset = GIMPLE_STMT_OPERAND (offset, 1);
|
||||
if (TREE_CODE (offset) != MULT_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (offset, 1)) != INTEGER_CST
|
||||
|| !simple_cst_equal (TREE_OPERAND (offset, 1),
|
||||
@ -648,8 +648,10 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
|
||||
index = TREE_OPERAND (offset, 0);
|
||||
|
||||
/* Replace the pointer addition with array indexing. */
|
||||
TREE_OPERAND (use_stmt, 1) = unshare_expr (TREE_OPERAND (stmt, 1));
|
||||
TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (use_stmt, 1), 0), 1) = index;
|
||||
GIMPLE_STMT_OPERAND (use_stmt, 1)
|
||||
= unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
TREE_OPERAND (TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0), 1)
|
||||
= index;
|
||||
|
||||
/* That should have created gimple, so there is no need to
|
||||
record information to undo the propagation. */
|
||||
@ -673,12 +675,12 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
|
||||
static bool
|
||||
forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
{
|
||||
tree name = TREE_OPERAND (stmt, 0);
|
||||
tree name = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree lhs, rhs, array_ref;
|
||||
|
||||
/* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.
|
||||
ADDR_EXPR will not appear on the LHS. */
|
||||
lhs = TREE_OPERAND (use_stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (use_stmt, 0);
|
||||
while (TREE_CODE (lhs) == COMPONENT_REF || TREE_CODE (lhs) == ARRAY_REF)
|
||||
lhs = TREE_OPERAND (lhs, 0);
|
||||
|
||||
@ -688,7 +690,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
{
|
||||
/* This should always succeed in creating gimple, so there is
|
||||
no need to save enough state to undo this propagation. */
|
||||
TREE_OPERAND (lhs, 0) = unshare_expr (TREE_OPERAND (stmt, 1));
|
||||
TREE_OPERAND (lhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
fold_stmt_inplace (use_stmt);
|
||||
tidy_after_forward_propagate_addr (use_stmt);
|
||||
if (changed)
|
||||
@ -702,9 +704,11 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
we can catch some cascading effects, ie the single use is
|
||||
in a copy, and the copy is used later by a single INDIRECT_REF
|
||||
for example. */
|
||||
else if (TREE_CODE (lhs) == SSA_NAME && TREE_OPERAND (use_stmt, 1) == name)
|
||||
else if (TREE_CODE (lhs) == SSA_NAME
|
||||
&& GIMPLE_STMT_OPERAND (use_stmt, 1) == name)
|
||||
{
|
||||
TREE_OPERAND (use_stmt, 1) = unshare_expr (TREE_OPERAND (stmt, 1));
|
||||
GIMPLE_STMT_OPERAND (use_stmt, 1)
|
||||
= unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
tidy_after_forward_propagate_addr (use_stmt);
|
||||
if (changed)
|
||||
*changed = true;
|
||||
@ -713,7 +717,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
|
||||
/* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
|
||||
nodes from the RHS. */
|
||||
rhs = TREE_OPERAND (use_stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
|
||||
while (TREE_CODE (rhs) == COMPONENT_REF
|
||||
|| TREE_CODE (rhs) == ARRAY_REF
|
||||
|| TREE_CODE (rhs) == ADDR_EXPR)
|
||||
@ -725,7 +729,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
{
|
||||
/* This should always succeed in creating gimple, so there is
|
||||
no need to save enough state to undo this propagation. */
|
||||
TREE_OPERAND (rhs, 0) = unshare_expr (TREE_OPERAND (stmt, 1));
|
||||
TREE_OPERAND (rhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
fold_stmt_inplace (use_stmt);
|
||||
tidy_after_forward_propagate_addr (use_stmt);
|
||||
if (changed)
|
||||
@ -737,7 +741,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
array indexing. They only apply when we have the address of
|
||||
element zero in an array. If that is not the case then there
|
||||
is nothing to do. */
|
||||
array_ref = TREE_OPERAND (TREE_OPERAND (stmt, 1), 0);
|
||||
array_ref = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
|
||||
if (TREE_CODE (array_ref) != ARRAY_REF
|
||||
|| TREE_CODE (TREE_TYPE (TREE_OPERAND (array_ref, 0))) != ARRAY_TYPE
|
||||
|| !integer_zerop (TREE_OPERAND (array_ref, 1)))
|
||||
@ -754,7 +758,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
&& TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
|
||||
{
|
||||
tree orig = unshare_expr (rhs);
|
||||
TREE_OPERAND (rhs, 0) = unshare_expr (TREE_OPERAND (stmt, 1));
|
||||
TREE_OPERAND (rhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
|
||||
/* If folding succeeds, then we have just exposed new variables
|
||||
in USE_STMT which will need to be renamed. If folding fails,
|
||||
@ -768,7 +772,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
|
||||
}
|
||||
else
|
||||
{
|
||||
TREE_OPERAND (use_stmt, 1) = orig;
|
||||
GIMPLE_STMT_OPERAND (use_stmt, 1) = orig;
|
||||
update_stmt (use_stmt);
|
||||
return false;
|
||||
}
|
||||
@ -826,7 +830,7 @@ static bool
|
||||
forward_propagate_addr_expr (tree stmt, bool *some)
|
||||
{
|
||||
int stmt_loop_depth = bb_for_stmt (stmt)->loop_depth;
|
||||
tree name = TREE_OPERAND (stmt, 0);
|
||||
tree name = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
imm_use_iterator iter;
|
||||
tree use_stmt;
|
||||
bool all = true;
|
||||
@ -837,7 +841,7 @@ forward_propagate_addr_expr (tree stmt, bool *some)
|
||||
|
||||
/* If the use is not in a simple assignment statement, then
|
||||
there is nothing we can do. */
|
||||
if (TREE_CODE (use_stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (use_stmt) != GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
all = false;
|
||||
continue;
|
||||
@ -877,20 +881,21 @@ forward_propagate_addr_expr (tree stmt, bool *some)
|
||||
static void
|
||||
simplify_not_neg_expr (tree stmt)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
|
||||
|
||||
/* See if the RHS_DEF_STMT has the same form as our statement. */
|
||||
if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == TREE_CODE (rhs))
|
||||
if (TREE_CODE (rhs_def_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (rhs_def_stmt, 1)) == TREE_CODE (rhs))
|
||||
{
|
||||
tree rhs_def_operand = TREE_OPERAND (TREE_OPERAND (rhs_def_stmt, 1), 0);
|
||||
tree rhs_def_operand =
|
||||
TREE_OPERAND (GIMPLE_STMT_OPERAND (rhs_def_stmt, 1), 0);
|
||||
|
||||
/* Verify that RHS_DEF_OPERAND is a suitable SSA_NAME. */
|
||||
if (TREE_CODE (rhs_def_operand) == SSA_NAME
|
||||
&& ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs_def_operand))
|
||||
{
|
||||
TREE_OPERAND (stmt, 1) = rhs_def_operand;
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = rhs_def_operand;
|
||||
update_stmt (stmt);
|
||||
}
|
||||
}
|
||||
@ -911,9 +916,9 @@ simplify_switch_expr (tree stmt)
|
||||
if (TREE_CODE (cond) == SSA_NAME)
|
||||
{
|
||||
def = SSA_NAME_DEF_STMT (cond);
|
||||
if (TREE_CODE (def) == MODIFY_EXPR)
|
||||
if (TREE_CODE (def) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
def = TREE_OPERAND (def, 1);
|
||||
def = GIMPLE_STMT_OPERAND (def, 1);
|
||||
if (TREE_CODE (def) == NOP_EXPR)
|
||||
{
|
||||
int need_precision;
|
||||
@ -974,10 +979,10 @@ tree_ssa_forward_propagate_single_use_vars (void)
|
||||
|
||||
/* If this statement sets an SSA_NAME to an address,
|
||||
try to propagate the address into the uses of the SSA_NAME. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
|
||||
if (TREE_CODE (lhs) != SSA_NAME)
|
||||
|
@ -1331,10 +1331,10 @@ build_tree_conflict_graph (tree_live_info_p liveinfo, tpa_p tpa,
|
||||
be interested in trying to coalesce SSA_NAME variables with
|
||||
root variables in some cases. */
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
int p1, p2;
|
||||
int bit;
|
||||
|
||||
|
@ -244,7 +244,7 @@ movement_possibility (tree stmt)
|
||||
return MOVE_POSSIBLE;
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return MOVE_IMPOSSIBLE;
|
||||
|
||||
if (stmt_ends_bb_p (stmt))
|
||||
@ -253,12 +253,12 @@ movement_possibility (tree stmt)
|
||||
if (stmt_ann (stmt)->has_volatile_ops)
|
||||
return MOVE_IMPOSSIBLE;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (lhs) == SSA_NAME
|
||||
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
|
||||
return MOVE_IMPOSSIBLE;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_SIDE_EFFECTS (rhs))
|
||||
return MOVE_IMPOSSIBLE;
|
||||
@ -423,7 +423,7 @@ stmt_cost (tree stmt)
|
||||
if (TREE_CODE (stmt) == COND_EXPR)
|
||||
return LIM_EXPENSIVE;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GENERIC_TREE_OPERAND (stmt, 1);
|
||||
|
||||
/* Hoisting memory references out should almost surely be a win. */
|
||||
if (stmt_references_memory_p (stmt))
|
||||
@ -609,7 +609,7 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
|
||||
/* If divisor is invariant, convert a/b to a*(1/b), allowing reciprocal
|
||||
to be hoisted out of loop, saving expensive divide. */
|
||||
if (pos == MOVE_POSSIBLE
|
||||
&& (rhs = TREE_OPERAND (stmt, 1)) != NULL
|
||||
&& (rhs = GENERIC_TREE_OPERAND (stmt, 1)) != NULL
|
||||
&& TREE_CODE (rhs) == RDIV_EXPR
|
||||
&& flag_unsafe_math_optimizations
|
||||
&& !flag_trapping_math
|
||||
@ -620,19 +620,19 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
|
||||
{
|
||||
tree lhs, stmt1, stmt2, var, name;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GENERIC_TREE_OPERAND (stmt, 0);
|
||||
|
||||
/* stmt must be MODIFY_EXPR. */
|
||||
/* stmt must be GIMPLE_MODIFY_STMT. */
|
||||
var = create_tmp_var (TREE_TYPE (rhs), "reciptmp");
|
||||
add_referenced_var (var);
|
||||
|
||||
stmt1 = build2 (MODIFY_EXPR, void_type_node, var,
|
||||
stmt1 = build2 (GIMPLE_MODIFY_STMT, void_type_node, var,
|
||||
build2 (RDIV_EXPR, TREE_TYPE (rhs),
|
||||
build_real (TREE_TYPE (rhs), dconst1),
|
||||
TREE_OPERAND (rhs, 1)));
|
||||
name = make_ssa_name (var, stmt1);
|
||||
TREE_OPERAND (stmt1, 0) = name;
|
||||
stmt2 = build2 (MODIFY_EXPR, void_type_node, lhs,
|
||||
GIMPLE_STMT_OPERAND (stmt1, 0) = name;
|
||||
stmt2 = build2 (GIMPLE_MODIFY_STMT, void_type_node, lhs,
|
||||
build2 (MULT_EXPR, TREE_TYPE (rhs),
|
||||
name, TREE_OPERAND (rhs, 0)));
|
||||
|
||||
@ -1051,7 +1051,7 @@ schedule_sm (struct loop *loop, VEC (edge, heap) *exits, tree ref,
|
||||
LIM_DATA (aref->stmt)->sm_done = true;
|
||||
|
||||
/* Emit the load & stores. */
|
||||
load = build2 (MODIFY_EXPR, void_type_node, tmp_var, ref);
|
||||
load = build2_gimple (GIMPLE_MODIFY_STMT, tmp_var, ref);
|
||||
get_stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
|
||||
LIM_DATA (load)->max_loop = loop;
|
||||
LIM_DATA (load)->tgt_loop = loop;
|
||||
@ -1062,8 +1062,7 @@ schedule_sm (struct loop *loop, VEC (edge, heap) *exits, tree ref,
|
||||
|
||||
for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
|
||||
{
|
||||
store = build2 (MODIFY_EXPR, void_type_node,
|
||||
unshare_expr (ref), tmp_var);
|
||||
store = build2_gimple (GIMPLE_MODIFY_STMT, unshare_expr (ref), tmp_var);
|
||||
bsi_insert_on_edge (ex, store);
|
||||
}
|
||||
}
|
||||
@ -1201,11 +1200,11 @@ gather_mem_refs_stmt (struct loop *loop, htab_t mem_refs,
|
||||
return;
|
||||
|
||||
/* Recognize MEM = (SSA_NAME | invariant) and SSA_NAME = MEM patterns. */
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
goto fail;
|
||||
|
||||
lhs = &TREE_OPERAND (stmt, 0);
|
||||
rhs = &TREE_OPERAND (stmt, 1);
|
||||
lhs = &GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = &GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (*lhs) == SSA_NAME)
|
||||
{
|
||||
|
@ -455,7 +455,7 @@ empty_loop_p (struct loop *loop)
|
||||
switch (TREE_CODE (stmt))
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
stmt = get_call_expr_in (stmt);
|
||||
if (!stmt)
|
||||
break;
|
||||
|
@ -1037,14 +1037,14 @@ find_givs_in_stmt_scev (struct ivopts_data *data, tree stmt, affine_iv *iv)
|
||||
iv->base = NULL_TREE;
|
||||
iv->step = NULL_TREE;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (lhs) != SSA_NAME)
|
||||
return false;
|
||||
|
||||
if (!simple_iv (loop, stmt, TREE_OPERAND (stmt, 1), iv, true))
|
||||
if (!simple_iv (loop, stmt, GIMPLE_STMT_OPERAND (stmt, 1), iv, true))
|
||||
return false;
|
||||
iv->base = expand_simple_operations (iv->base);
|
||||
|
||||
@ -1065,7 +1065,7 @@ find_givs_in_stmt (struct ivopts_data *data, tree stmt)
|
||||
if (!find_givs_in_stmt_scev (data, stmt, &iv))
|
||||
return;
|
||||
|
||||
set_iv (data, TREE_OPERAND (stmt, 0), iv.base, iv.step);
|
||||
set_iv (data, GIMPLE_STMT_OPERAND (stmt, 0), iv.base, iv.step);
|
||||
}
|
||||
|
||||
/* Finds general ivs in basic block BB. */
|
||||
@ -1222,7 +1222,7 @@ find_interesting_uses_op (struct ivopts_data *data, tree op)
|
||||
|
||||
stmt = SSA_NAME_DEF_STMT (op);
|
||||
gcc_assert (TREE_CODE (stmt) == PHI_NODE
|
||||
|| TREE_CODE (stmt) == MODIFY_EXPR);
|
||||
|| TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
|
||||
|
||||
use = record_use (data, NULL, civ, stmt, USE_NONLINEAR_EXPR);
|
||||
iv->use_id = use->id;
|
||||
@ -1314,7 +1314,7 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!EXPR_P (expr))
|
||||
if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
|
||||
return false;
|
||||
|
||||
len = TREE_CODE_LENGTH (TREE_CODE (expr));
|
||||
@ -1636,10 +1636,10 @@ find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
|
||||
return;
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (TREE_CODE (lhs) == SSA_NAME)
|
||||
{
|
||||
@ -1655,13 +1655,16 @@ find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
|
||||
switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
|
||||
{
|
||||
case tcc_comparison:
|
||||
find_interesting_uses_cond (data, stmt, &TREE_OPERAND (stmt, 1));
|
||||
find_interesting_uses_cond (data, stmt,
|
||||
&GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
return;
|
||||
|
||||
case tcc_reference:
|
||||
find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 1));
|
||||
find_interesting_uses_address (data, stmt,
|
||||
&GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
if (REFERENCE_CLASS_P (lhs))
|
||||
find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 0));
|
||||
find_interesting_uses_address (data, stmt,
|
||||
&GIMPLE_STMT_OPERAND (stmt, 0));
|
||||
return;
|
||||
|
||||
default: ;
|
||||
@ -1670,7 +1673,8 @@ find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
|
||||
if (REFERENCE_CLASS_P (lhs)
|
||||
&& is_gimple_val (rhs))
|
||||
{
|
||||
find_interesting_uses_address (data, stmt, &TREE_OPERAND (stmt, 0));
|
||||
find_interesting_uses_address (data, stmt,
|
||||
&GIMPLE_STMT_OPERAND (stmt, 0));
|
||||
find_interesting_uses_op (data, rhs);
|
||||
return;
|
||||
}
|
||||
@ -5383,8 +5387,8 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
|
||||
tree step, ctype, utype;
|
||||
enum tree_code incr_code = PLUS_EXPR;
|
||||
|
||||
gcc_assert (TREE_CODE (use->stmt) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_OPERAND (use->stmt, 0) == cand->var_after);
|
||||
gcc_assert (TREE_CODE (use->stmt) == GIMPLE_MODIFY_STMT);
|
||||
gcc_assert (GIMPLE_STMT_OPERAND (use->stmt, 0) == cand->var_after);
|
||||
|
||||
step = cand->iv->step;
|
||||
ctype = TREE_TYPE (step);
|
||||
@ -5400,7 +5404,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
|
||||
computations in the loop -- otherwise, the computation
|
||||
we rely upon may be removed in remove_unused_ivs,
|
||||
thus leading to ICE. */
|
||||
op = TREE_OPERAND (use->stmt, 1);
|
||||
op = GIMPLE_STMT_OPERAND (use->stmt, 1);
|
||||
if (TREE_CODE (op) == PLUS_EXPR
|
||||
|| TREE_CODE (op) == MINUS_EXPR)
|
||||
{
|
||||
@ -5448,8 +5452,8 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
|
||||
}
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
tgt = TREE_OPERAND (use->stmt, 0);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
tgt = GIMPLE_STMT_OPERAND (use->stmt, 0);
|
||||
bsi = bsi_for_stmt (use->stmt);
|
||||
break;
|
||||
|
||||
@ -5463,7 +5467,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
|
||||
{
|
||||
if (stmts)
|
||||
bsi_insert_after (&bsi, stmts, BSI_CONTINUE_LINKING);
|
||||
ass = build2 (MODIFY_EXPR, TREE_TYPE (tgt), tgt, op);
|
||||
ass = build2_gimple (GIMPLE_MODIFY_STMT, tgt, op);
|
||||
bsi_insert_after (&bsi, ass, BSI_NEW_STMT);
|
||||
remove_statement (use->stmt, false);
|
||||
SSA_NAME_DEF_STMT (tgt) = ass;
|
||||
@ -5472,7 +5476,7 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
|
||||
{
|
||||
if (stmts)
|
||||
bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
|
||||
TREE_OPERAND (use->stmt, 1) = op;
|
||||
GIMPLE_STMT_OPERAND (use->stmt, 1) = op;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,9 +100,8 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
|
||||
if (stmts)
|
||||
bsi_insert_on_edge_immediate (pe, stmts);
|
||||
|
||||
stmt = build2 (MODIFY_EXPR, void_type_node, va,
|
||||
build2 (incr_op, TREE_TYPE (base),
|
||||
vb, step));
|
||||
stmt = build2_gimple (GIMPLE_MODIFY_STMT, va,
|
||||
build2 (incr_op, TREE_TYPE (base), vb, step));
|
||||
SSA_NAME_DEF_STMT (va) = stmt;
|
||||
if (after)
|
||||
bsi_insert_after (incr_pos, stmt, BSI_NEW_STMT);
|
||||
|
@ -684,7 +684,7 @@ simplify_replace_tree (tree expr, tree old, tree new)
|
||||
|| operand_equal_p (expr, old, 0))
|
||||
return unshare_expr (new);
|
||||
|
||||
if (!EXPR_P (expr))
|
||||
if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
|
||||
return expr;
|
||||
|
||||
n = TREE_CODE_LENGTH (TREE_CODE (expr));
|
||||
@ -744,10 +744,10 @@ expand_simple_operations (tree expr)
|
||||
return expr;
|
||||
|
||||
stmt = SSA_NAME_DEF_STMT (expr);
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return expr;
|
||||
|
||||
e = TREE_OPERAND (stmt, 1);
|
||||
e = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (/* Casts are simple. */
|
||||
TREE_CODE (e) != NOP_EXPR
|
||||
&& TREE_CODE (e) != CONVERT_EXPR
|
||||
@ -1255,7 +1255,7 @@ chain_of_csts_start (struct loop *loop, tree x)
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return NULL_TREE;
|
||||
|
||||
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
|
||||
@ -1337,7 +1337,7 @@ get_val_for (tree x, tree base)
|
||||
nx = USE_FROM_PTR (op);
|
||||
val = get_val_for (nx, base);
|
||||
SET_USE (op, val);
|
||||
val = fold (TREE_OPERAND (stmt, 1));
|
||||
val = fold (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
SET_USE (op, nx);
|
||||
/* only iterate loop once. */
|
||||
return val;
|
||||
@ -1655,10 +1655,11 @@ derive_constant_upper_bound (tree val, tree additional)
|
||||
|
||||
case SSA_NAME:
|
||||
stmt = SSA_NAME_DEF_STMT (val);
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
|| TREE_OPERAND (stmt, 0) != val)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
|| GIMPLE_STMT_OPERAND (stmt, 0) != val)
|
||||
return max;
|
||||
return derive_constant_upper_bound (TREE_OPERAND (stmt, 1), additional);
|
||||
return derive_constant_upper_bound (GIMPLE_STMT_OPERAND (stmt, 1),
|
||||
additional);
|
||||
|
||||
default:
|
||||
return max;
|
||||
@ -1872,10 +1873,10 @@ infer_loop_bounds_from_array (struct loop *loop, tree stmt)
|
||||
{
|
||||
tree call;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree op0 = TREE_OPERAND (stmt, 0);
|
||||
tree op1 = TREE_OPERAND (stmt, 1);
|
||||
tree op0 = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree op1 = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* For each memory access, analyze its access function
|
||||
and record a bound on the loop iteration domain. */
|
||||
@ -1906,10 +1907,10 @@ infer_loop_bounds_from_signedness (struct loop *loop, tree stmt)
|
||||
{
|
||||
tree def, base, step, scev, type, low, high;
|
||||
|
||||
if (flag_wrapv || TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (flag_wrapv || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return;
|
||||
|
||||
def = TREE_OPERAND (stmt, 0);
|
||||
def = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
|
||||
if (TREE_CODE (def) != SSA_NAME)
|
||||
return;
|
||||
|
@ -461,11 +461,11 @@ gather_memory_references (struct loop *loop)
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
{
|
||||
stmt = bsi_stmt (bsi);
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
continue;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (REFERENCE_CLASS_P (rhs))
|
||||
gather_memory_references_ref (loop, &refs, rhs, false, stmt);
|
||||
|
@ -111,7 +111,7 @@ struct occurrence {
|
||||
inserted in BB. */
|
||||
tree recip_def;
|
||||
|
||||
/* If non-NULL, the MODIFY_EXPR for a reciprocal computation that
|
||||
/* If non-NULL, the GIMPLE_MODIFY_STMT for a reciprocal computation that
|
||||
was inserted in BB. */
|
||||
tree recip_def_stmt;
|
||||
|
||||
@ -274,9 +274,9 @@ compute_merit (struct occurrence *occ)
|
||||
static inline bool
|
||||
is_division_by (tree use_stmt, tree def)
|
||||
{
|
||||
return TREE_CODE (use_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (use_stmt, 1)) == RDIV_EXPR
|
||||
&& TREE_OPERAND (TREE_OPERAND (use_stmt, 1), 1) == def;
|
||||
return TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == RDIV_EXPR
|
||||
&& TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 1) == def;
|
||||
}
|
||||
|
||||
/* Walk the subset of the dominator tree rooted at OCC, setting the
|
||||
@ -303,7 +303,7 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
|
||||
/* Make a variable with the replacement and substitute it. */
|
||||
type = TREE_TYPE (def);
|
||||
recip_def = make_rename_temp (type, "reciptmp");
|
||||
new_stmt = build2 (MODIFY_EXPR, void_type_node, recip_def,
|
||||
new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, recip_def,
|
||||
fold_build2 (RDIV_EXPR, type, build_one_cst (type),
|
||||
def));
|
||||
|
||||
@ -353,7 +353,7 @@ replace_reciprocal (use_operand_p use_p)
|
||||
|
||||
if (occ->recip_def && use_stmt != occ->recip_def_stmt)
|
||||
{
|
||||
TREE_SET_CODE (TREE_OPERAND (use_stmt, 1), MULT_EXPR);
|
||||
TREE_SET_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1), MULT_EXPR);
|
||||
SET_USE (use_p, occ->recip_def);
|
||||
fold_stmt_inplace (use_stmt);
|
||||
update_stmt (use_stmt);
|
||||
@ -490,7 +490,7 @@ execute_cse_reciprocals (void)
|
||||
for (bsi = bsi_after_labels (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
{
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& (def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF)) != NULL
|
||||
&& FLOAT_TYPE_P (TREE_TYPE (def))
|
||||
&& TREE_CODE (def) == SSA_NAME)
|
||||
|
@ -98,7 +98,7 @@ Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Operand is a "non-specific" kill for call-clobbers and such. This
|
||||
is used to distinguish "reset the world" events from explicit
|
||||
MODIFY_EXPRs. */
|
||||
GIMPLE_MODIFY_STMTs. */
|
||||
#define opf_non_specific (1 << 3)
|
||||
|
||||
/* Array for building all the def operands. */
|
||||
@ -533,7 +533,7 @@ finalize_ssa_defs (tree stmt)
|
||||
unsigned int num = VEC_length (tree, build_defs);
|
||||
|
||||
/* There should only be a single real definition per assignment. */
|
||||
gcc_assert ((stmt && TREE_CODE (stmt) != MODIFY_EXPR) || num <= 1);
|
||||
gcc_assert ((stmt && TREE_CODE (stmt) != GIMPLE_MODIFY_STMT) || num <= 1);
|
||||
|
||||
/* If there is an old list, often the new list is identical, or close, so
|
||||
find the elements at the beginning that are the same as the vector. */
|
||||
@ -1230,7 +1230,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
|
||||
check that this only happens on non-specific stores.
|
||||
|
||||
Note that if this is a specific store, i.e. associated with a
|
||||
modify_expr, then we can't suppress the V_MAY_DEF, lest we run
|
||||
gimple_modify_stmt, then we can't suppress the V_MAY_DEF, lest we run
|
||||
into validation problems.
|
||||
|
||||
This can happen when programs cast away const, leaving us with a
|
||||
@ -1814,10 +1814,10 @@ get_asm_expr_operands (tree stmt)
|
||||
/* Scan operands for the assignment expression EXPR in statement STMT. */
|
||||
|
||||
static void
|
||||
get_modify_expr_operands (tree stmt, tree expr)
|
||||
get_modify_stmt_operands (tree stmt, tree expr)
|
||||
{
|
||||
/* First get operands from the RHS. */
|
||||
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), opf_none);
|
||||
get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (expr, 1), opf_none);
|
||||
|
||||
/* For the LHS, use a regular definition (OPF_IS_DEF) for GIMPLE
|
||||
registers. If the LHS is a store to memory, we will either need
|
||||
@ -1832,7 +1832,8 @@ get_modify_expr_operands (tree stmt, tree expr)
|
||||
The determination of whether to use a preserving or a killing
|
||||
definition is done while scanning the LHS of the assignment. By
|
||||
default, assume that we will emit a V_MUST_DEF. */
|
||||
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_is_def|opf_kill_def);
|
||||
get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (expr, 0),
|
||||
opf_is_def|opf_kill_def);
|
||||
}
|
||||
|
||||
|
||||
@ -2005,8 +2006,8 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
|
||||
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_none);
|
||||
return;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
get_modify_expr_operands (stmt, expr);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
get_modify_stmt_operands (stmt, expr);
|
||||
return;
|
||||
|
||||
case CONSTRUCTOR:
|
||||
@ -2106,8 +2107,8 @@ parse_ssa_operands (tree stmt)
|
||||
code = TREE_CODE (stmt);
|
||||
switch (code)
|
||||
{
|
||||
case MODIFY_EXPR:
|
||||
get_modify_expr_operands (stmt, stmt);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
get_modify_stmt_operands (stmt, stmt);
|
||||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
|
@ -439,7 +439,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
TREE_OPERAND (old_result, 0),
|
||||
TREE_OPERAND (old_result, 1));
|
||||
|
||||
new1 = build2 (MODIFY_EXPR, TREE_TYPE (old_result), new_var, new1);
|
||||
new1 = build2_gimple (GIMPLE_MODIFY_STMT, new_var, new1);
|
||||
SSA_NAME_DEF_STMT (new_var) = new1;
|
||||
|
||||
bsi_insert_after (&bsi, new1, BSI_NEW_STMT);
|
||||
@ -470,7 +470,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
|| (e1 == true_edge && integer_onep (arg1))
|
||||
|| (e1 == false_edge && integer_zerop (arg1)))
|
||||
{
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (new_var1), new_var1, cond);
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT, new_var1, cond);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -514,14 +514,14 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
tmp = create_tmp_var (TREE_TYPE (op0), NULL);
|
||||
add_referenced_var (tmp);
|
||||
cond_tmp = make_ssa_name (tmp, NULL);
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (cond_tmp), cond_tmp, op0);
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT, cond_tmp, op0);
|
||||
SSA_NAME_DEF_STMT (cond_tmp) = new;
|
||||
|
||||
bsi_insert_after (&bsi, new, BSI_NEW_STMT);
|
||||
cond = fold_convert (TREE_TYPE (result), cond_tmp);
|
||||
}
|
||||
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (new_var1), new_var1, cond);
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT, new_var1, cond);
|
||||
}
|
||||
|
||||
bsi_insert_after (&bsi, new, BSI_NEW_STMT);
|
||||
@ -715,11 +715,11 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
tree lhs, rhs, op0, op1, bound;
|
||||
|
||||
if (!assign
|
||||
|| TREE_CODE (assign) != MODIFY_EXPR)
|
||||
|| TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (assign, 0);
|
||||
rhs = TREE_OPERAND (assign, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (assign, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (assign, 1);
|
||||
ass_code = TREE_CODE (rhs);
|
||||
if (ass_code != MAX_EXPR && ass_code != MIN_EXPR)
|
||||
return false;
|
||||
@ -853,8 +853,8 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
|
||||
/* Emit the statement to compute min/max. */
|
||||
result = duplicate_ssa_name (PHI_RESULT (phi), NULL);
|
||||
new = build2 (MODIFY_EXPR, type, result,
|
||||
build2 (minmax, type, arg0, arg1));
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT, result,
|
||||
build2 (minmax, type, arg0, arg1));
|
||||
SSA_NAME_DEF_STMT (result) = new;
|
||||
bsi = bsi_last (cond_bb);
|
||||
bsi_insert_before (&bsi, new, BSI_NEW_STMT);
|
||||
@ -901,11 +901,11 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
/* If we got here, then we have found the only executable statement
|
||||
in OTHER_BLOCK. If it is anything other than arg = -arg1 or
|
||||
arg1 = -arg0, then we can not optimize. */
|
||||
if (TREE_CODE (assign) != MODIFY_EXPR)
|
||||
if (TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (assign, 0);
|
||||
rhs = TREE_OPERAND (assign, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (assign, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (assign, 1);
|
||||
|
||||
if (TREE_CODE (rhs) != NEGATE_EXPR)
|
||||
return false;
|
||||
@ -966,8 +966,8 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
lhs = result;
|
||||
|
||||
/* Build the modify expression with abs expression. */
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (lhs),
|
||||
lhs, build1 (ABS_EXPR, TREE_TYPE (lhs), rhs));
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT,
|
||||
lhs, build1 (ABS_EXPR, TREE_TYPE (lhs), rhs));
|
||||
SSA_NAME_DEF_STMT (lhs) = new;
|
||||
|
||||
bsi = bsi_last (cond_bb);
|
||||
@ -978,8 +978,8 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
|
||||
/* Get the right BSI. We want to insert after the recently
|
||||
added ABS_EXPR statement (which we know is the first statement
|
||||
in the block. */
|
||||
new = build2 (MODIFY_EXPR, TREE_TYPE (result),
|
||||
result, build1 (NEGATE_EXPR, TREE_TYPE (lhs), lhs));
|
||||
new = build2_gimple (GIMPLE_MODIFY_STMT,
|
||||
result, build1 (NEGATE_EXPR, TREE_TYPE (lhs), lhs));
|
||||
SSA_NAME_DEF_STMT (result) = new;
|
||||
|
||||
bsi_insert_after (&bsi, new, BSI_NEW_STMT);
|
||||
|
@ -61,9 +61,9 @@ Boston, MA 02110-1301, USA. */
|
||||
*/
|
||||
|
||||
/* For ease of terminology, "expression node" in the below refers to
|
||||
every expression node but MODIFY_EXPR, because MODIFY_EXPR's represent
|
||||
the actual statement containing the expressions we care about, and
|
||||
we cache the value number by putting it in the expression. */
|
||||
every expression node but GIMPLE_MODIFY_STMT, because GIMPLE_MODIFY_STMT's
|
||||
represent the actual statement containing the expressions we care about,
|
||||
and we cache the value number by putting it in the expression. */
|
||||
|
||||
/* Basic algorithm
|
||||
|
||||
@ -986,7 +986,7 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
return expr;
|
||||
|
||||
/* Phi translations of a given expression don't change. */
|
||||
if (EXPR_P (expr))
|
||||
if (EXPR_P (expr) || GIMPLE_STMT_P (expr))
|
||||
{
|
||||
tree vh;
|
||||
|
||||
@ -1115,7 +1115,7 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
TREE_OPERAND (newexpr, 0) = newop0 == oldop0 ? oldval0 : get_value_handle (newop0);
|
||||
TREE_OPERAND (newexpr, 1) = listchanged ? newarglist : oldarglist;
|
||||
TREE_OPERAND (newexpr, 2) = newop2 == oldop2 ? oldval2 : get_value_handle (newop2);
|
||||
newexpr->common.ann = NULL;
|
||||
newexpr->base.ann = NULL;
|
||||
vn_lookup_or_add_with_vuses (newexpr, tvuses);
|
||||
expr = newexpr;
|
||||
phi_trans_add (oldexpr, newexpr, pred, tvuses);
|
||||
@ -1227,7 +1227,7 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
}
|
||||
else
|
||||
{
|
||||
newexpr->common.ann = NULL;
|
||||
newexpr->base.ann = NULL;
|
||||
vn_lookup_or_add_with_vuses (newexpr, newvuses);
|
||||
}
|
||||
expr = newexpr;
|
||||
@ -1272,7 +1272,7 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
}
|
||||
else
|
||||
{
|
||||
newexpr->common.ann = NULL;
|
||||
newexpr->base.ann = NULL;
|
||||
vn_lookup_or_add (newexpr, NULL);
|
||||
}
|
||||
expr = newexpr;
|
||||
@ -1305,7 +1305,7 @@ phi_translate (tree expr, bitmap_set_t set1, bitmap_set_t set2,
|
||||
}
|
||||
else
|
||||
{
|
||||
newexpr->common.ann = NULL;
|
||||
newexpr->base.ann = NULL;
|
||||
vn_lookup_or_add (newexpr, NULL);
|
||||
}
|
||||
expr = newexpr;
|
||||
@ -2490,7 +2490,7 @@ find_or_generate_expression (basic_block block, tree expr, tree stmts)
|
||||
return genop;
|
||||
}
|
||||
|
||||
#define NECESSARY(stmt) stmt->common.asm_written_flag
|
||||
#define NECESSARY(stmt) stmt->base.asm_written_flag
|
||||
/* Create an expression in pieces, so that we can handle very complex
|
||||
expressions that may be ANTIC, but not necessary GIMPLE.
|
||||
BLOCK is the basic block the expression will be inserted into,
|
||||
@ -2608,8 +2608,8 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts)
|
||||
for (; !tsi_end_p (tsi); tsi_next (&tsi))
|
||||
{
|
||||
tree stmt = tsi_stmt (tsi);
|
||||
tree forcedname = TREE_OPERAND (stmt, 0);
|
||||
tree forcedexpr = TREE_OPERAND (stmt, 1);
|
||||
tree forcedname = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree forcedexpr = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree val = vn_lookup_or_add (forcedexpr, NULL);
|
||||
|
||||
VEC_safe_push (tree, heap, inserted_exprs, stmt);
|
||||
@ -2636,9 +2636,9 @@ create_expression_by_pieces (basic_block block, tree expr, tree stmts)
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == COMPLEX_TYPE)
|
||||
DECL_COMPLEX_GIMPLE_REG_P (temp) = 1;
|
||||
|
||||
newexpr = build2 (MODIFY_EXPR, TREE_TYPE (expr), temp, newexpr);
|
||||
newexpr = build2_gimple (GIMPLE_MODIFY_STMT, temp, newexpr);
|
||||
name = make_ssa_name (temp, newexpr);
|
||||
TREE_OPERAND (newexpr, 0) = name;
|
||||
GIMPLE_STMT_OPERAND (newexpr, 0) = name;
|
||||
NECESSARY (newexpr) = 0;
|
||||
|
||||
tsi = tsi_last (stmts);
|
||||
@ -3375,7 +3375,7 @@ try_look_through_load (tree lhs, tree mem_ref, tree stmt, basic_block block)
|
||||
uses, we can stop right here. Note that this means we do
|
||||
not look through PHI nodes, which is intentional. */
|
||||
if (!def_stmt
|
||||
|| TREE_CODE (def_stmt) != MODIFY_EXPR
|
||||
|| TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT
|
||||
|| !ZERO_SSA_OPERANDS (def_stmt, SSA_OP_VIRTUAL_USES))
|
||||
return false;
|
||||
|
||||
@ -3388,7 +3388,7 @@ try_look_through_load (tree lhs, tree mem_ref, tree stmt, basic_block block)
|
||||
{
|
||||
/* Is this a store to the exact same location as the one we are
|
||||
loading from in STMT? */
|
||||
if (!operand_equal_p (TREE_OPERAND (def_stmt, 0), mem_ref, 0))
|
||||
if (!operand_equal_p (GIMPLE_STMT_OPERAND (def_stmt, 0), mem_ref, 0))
|
||||
return false;
|
||||
|
||||
/* Otherwise remember this statement and see if all other VUSEs
|
||||
@ -3400,7 +3400,7 @@ try_look_through_load (tree lhs, tree mem_ref, tree stmt, basic_block block)
|
||||
/* Alright then, we have visited all VUSEs of STMT and we've determined
|
||||
that all of them come from the same statement STORE_STMT. See if there
|
||||
is a useful expression we can deduce from STORE_STMT. */
|
||||
rhs = TREE_OPERAND (store_stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (store_stmt, 1);
|
||||
if ((TREE_CODE (rhs) == SSA_NAME
|
||||
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs))
|
||||
|| is_gimple_min_invariant (rhs)
|
||||
@ -3438,12 +3438,14 @@ poolify_tree (tree node)
|
||||
return temp;
|
||||
}
|
||||
break;
|
||||
case MODIFY_EXPR:
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
{
|
||||
tree temp = (tree) pool_alloc (modify_expr_node_pool);
|
||||
memcpy (temp, node, tree_size (node));
|
||||
TREE_OPERAND (temp, 0) = poolify_tree (TREE_OPERAND (temp, 0));
|
||||
TREE_OPERAND (temp, 1) = poolify_tree (TREE_OPERAND (temp, 1));
|
||||
GIMPLE_STMT_OPERAND (temp, 0) =
|
||||
poolify_tree (GIMPLE_STMT_OPERAND (temp, 0));
|
||||
GIMPLE_STMT_OPERAND (temp, 1) =
|
||||
poolify_tree (GIMPLE_STMT_OPERAND (temp, 1));
|
||||
return temp;
|
||||
}
|
||||
break;
|
||||
@ -3462,17 +3464,16 @@ poolify_tree (tree node)
|
||||
|
||||
static tree modify_expr_template;
|
||||
|
||||
/* Allocate a MODIFY_EXPR with TYPE, and operands OP1, OP2 in the
|
||||
/* Allocate a GIMPLE_MODIFY_STMT with TYPE, and operands OP1, OP2 in the
|
||||
alloc pools and return it. */
|
||||
static tree
|
||||
poolify_modify_expr (tree type, tree op1, tree op2)
|
||||
poolify_modify_stmt (tree op1, tree op2)
|
||||
{
|
||||
if (modify_expr_template == NULL)
|
||||
modify_expr_template = build2 (MODIFY_EXPR, type, op1, op2);
|
||||
modify_expr_template = build2_gimple (GIMPLE_MODIFY_STMT, op1, op2);
|
||||
|
||||
TREE_OPERAND (modify_expr_template, 0) = op1;
|
||||
TREE_OPERAND (modify_expr_template, 1) = op2;
|
||||
TREE_TYPE (modify_expr_template) = type;
|
||||
GIMPLE_STMT_OPERAND (modify_expr_template, 0) = op1;
|
||||
GIMPLE_STMT_OPERAND (modify_expr_template, 1) = op2;
|
||||
|
||||
return poolify_tree (modify_expr_template);
|
||||
}
|
||||
@ -3506,15 +3507,16 @@ insert_fake_stores (void)
|
||||
or aggregate. We also want to ignore things whose
|
||||
virtual uses occur in abnormal phis. */
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == INDIRECT_REF
|
||||
&& !AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 0)))
|
||||
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (stmt, 0))) != COMPLEX_TYPE)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == INDIRECT_REF
|
||||
&& !AGGREGATE_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0)))
|
||||
&& TREE_CODE (TREE_TYPE (GIMPLE_STMT_OPERAND
|
||||
(stmt, 0))) != COMPLEX_TYPE)
|
||||
{
|
||||
ssa_op_iter iter;
|
||||
def_operand_p defp;
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree new;
|
||||
bool notokay = false;
|
||||
|
||||
@ -3537,10 +3539,10 @@ insert_fake_stores (void)
|
||||
get_var_ann (storetemp);
|
||||
}
|
||||
|
||||
new = poolify_modify_expr (TREE_TYPE (stmt), storetemp, lhs);
|
||||
new = poolify_modify_stmt (storetemp, lhs);
|
||||
|
||||
lhs = make_ssa_name (storetemp, new);
|
||||
TREE_OPERAND (new, 0) = lhs;
|
||||
GIMPLE_STMT_OPERAND (new, 0) = lhs;
|
||||
create_ssa_artficial_load_stmt (new, stmt);
|
||||
|
||||
NECESSARY (new) = 0;
|
||||
@ -3570,7 +3572,7 @@ realify_fake_stores (void)
|
||||
tree newstmt;
|
||||
|
||||
/* Mark the temp variable as referenced */
|
||||
add_referenced_var (SSA_NAME_VAR (TREE_OPERAND (stmt, 0)));
|
||||
add_referenced_var (SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0)));
|
||||
|
||||
/* Put the new statement in GC memory, fix up the
|
||||
SSA_NAME_DEF_STMT on it, and then put it in place of
|
||||
@ -3578,10 +3580,10 @@ realify_fake_stores (void)
|
||||
as a plain ssa name copy. */
|
||||
bsi = bsi_for_stmt (stmt);
|
||||
bsi_prev (&bsi);
|
||||
newstmt = build2 (MODIFY_EXPR, void_type_node,
|
||||
TREE_OPERAND (stmt, 0),
|
||||
TREE_OPERAND (bsi_stmt (bsi), 1));
|
||||
SSA_NAME_DEF_STMT (TREE_OPERAND (newstmt, 0)) = newstmt;
|
||||
newstmt = build2_gimple (GIMPLE_MODIFY_STMT,
|
||||
GIMPLE_STMT_OPERAND (stmt, 0),
|
||||
GIMPLE_STMT_OPERAND (bsi_stmt (bsi), 1));
|
||||
SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (newstmt, 0)) = newstmt;
|
||||
bsi_insert_before (&bsi, newstmt, BSI_SAME_STMT);
|
||||
bsi = bsi_for_stmt (stmt);
|
||||
bsi_remove (&bsi, true);
|
||||
@ -3752,10 +3754,10 @@ compute_avail (void)
|
||||
tree rhs;
|
||||
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
if (stmt && TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (stmt && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (TREE_CODE (rhs) == SSA_NAME
|
||||
&& !is_undefined_value (rhs))
|
||||
bitmap_value_insert_into_set (EXP_GEN (block), rhs);
|
||||
@ -3767,13 +3769,14 @@ compute_avail (void)
|
||||
continue;
|
||||
}
|
||||
|
||||
else if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& !ann->has_volatile_ops
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME
|
||||
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (stmt, 0)))
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
|
||||
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI
|
||||
(GIMPLE_STMT_OPERAND (stmt, 0)))
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* Try to look through loads. */
|
||||
if (TREE_CODE (lhs) == SSA_NAME
|
||||
@ -3868,14 +3871,14 @@ eliminate (void)
|
||||
/* Lookup the RHS of the expression, see if we have an
|
||||
available computation for it. If so, replace the RHS with
|
||||
the available computation. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME
|
||||
&& TREE_CODE (TREE_OPERAND (stmt ,1)) != SSA_NAME
|
||||
&& !is_gimple_min_invariant (TREE_OPERAND (stmt, 1))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) != SSA_NAME
|
||||
&& !is_gimple_min_invariant (GIMPLE_STMT_OPERAND (stmt, 1))
|
||||
&& !stmt_ann (stmt)->has_volatile_ops)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree *rhs_p = &TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree *rhs_p = &GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree sprime;
|
||||
|
||||
sprime = bitmap_find_leader (AVAIL_OUT (b),
|
||||
@ -4097,8 +4100,8 @@ init_pre (bool do_fre)
|
||||
tree_code_size (TREE_LIST), 30);
|
||||
comparison_node_pool = create_alloc_pool ("Comparison tree nodes",
|
||||
tree_code_size (EQ_EXPR), 30);
|
||||
modify_expr_node_pool = create_alloc_pool ("MODIFY_EXPR nodes",
|
||||
tree_code_size (MODIFY_EXPR),
|
||||
modify_expr_node_pool = create_alloc_pool ("GIMPLE_MODIFY_STMT nodes",
|
||||
tree_code_size (GIMPLE_MODIFY_STMT),
|
||||
30);
|
||||
modify_expr_template = NULL;
|
||||
|
||||
|
@ -531,12 +531,12 @@ get_rhs (tree stmt)
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
stmt = TREE_OPERAND (stmt, 0);
|
||||
if (!stmt || TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return stmt;
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
stmt = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
stmt = GENERIC_TREE_OPERAND (stmt, 1);
|
||||
if (TREE_CODE (stmt) == WITH_SIZE_EXPR)
|
||||
return TREE_OPERAND (stmt, 0);
|
||||
else
|
||||
@ -641,7 +641,8 @@ set_rhs (tree *stmt_p, tree expr)
|
||||
}
|
||||
|
||||
if (EXPR_HAS_LOCATION (stmt)
|
||||
&& EXPR_P (expr)
|
||||
&& (EXPR_P (expr)
|
||||
|| GIMPLE_STMT_P (expr))
|
||||
&& ! EXPR_HAS_LOCATION (expr)
|
||||
&& TREE_SIDE_EFFECTS (expr)
|
||||
&& TREE_CODE (expr) != LABEL_EXPR)
|
||||
@ -651,19 +652,23 @@ set_rhs (tree *stmt_p, tree expr)
|
||||
{
|
||||
case RETURN_EXPR:
|
||||
op = TREE_OPERAND (stmt, 0);
|
||||
if (TREE_CODE (op) != MODIFY_EXPR)
|
||||
if (TREE_CODE (op) != GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
TREE_OPERAND (stmt, 0) = expr;
|
||||
GIMPLE_STMT_OPERAND (stmt, 0) = expr;
|
||||
break;
|
||||
}
|
||||
stmt = op;
|
||||
/* FALLTHRU */
|
||||
|
||||
case MODIFY_EXPR:
|
||||
op = TREE_OPERAND (stmt, 1);
|
||||
case GIMPLE_MODIFY_STMT:
|
||||
op = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (TREE_CODE (op) == WITH_SIZE_EXPR)
|
||||
stmt = op;
|
||||
TREE_OPERAND (stmt, 1) = expr;
|
||||
{
|
||||
stmt = op;
|
||||
TREE_OPERAND (stmt, 1) = expr;
|
||||
}
|
||||
else
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = expr;
|
||||
break;
|
||||
|
||||
case COND_EXPR:
|
||||
@ -686,7 +691,7 @@ set_rhs (tree *stmt_p, tree expr)
|
||||
effects, then replace *STMT_P with an empty statement. */
|
||||
ann = stmt_ann (stmt);
|
||||
*stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
|
||||
(*stmt_p)->common.ann = (tree_ann_t) ann;
|
||||
(*stmt_p)->base.ann = (tree_ann_t) ann;
|
||||
|
||||
if (gimple_in_ssa_p (cfun)
|
||||
&& TREE_SIDE_EFFECTS (expr))
|
||||
@ -770,13 +775,13 @@ stmt_makes_single_load (tree stmt)
|
||||
{
|
||||
tree rhs;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VUSE))
|
||||
return false;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
STRIP_NOPS (rhs);
|
||||
|
||||
return (!TREE_THIS_VOLATILE (rhs)
|
||||
@ -795,13 +800,13 @@ stmt_makes_single_store (tree stmt)
|
||||
{
|
||||
tree lhs;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return false;
|
||||
|
||||
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF))
|
||||
return false;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
STRIP_NOPS (lhs);
|
||||
|
||||
return (!TREE_THIS_VOLATILE (lhs)
|
||||
@ -963,7 +968,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p,
|
||||
see if we are trying to propagate a constant or a GIMPLE
|
||||
register (case #1 above). */
|
||||
prop_value_t *val = get_value_loaded_by (stmt, prop_value);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (val
|
||||
&& val->value
|
||||
@ -975,7 +980,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p,
|
||||
/* If we are replacing a constant address, inform our
|
||||
caller. */
|
||||
if (TREE_CODE (val->value) != SSA_NAME
|
||||
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1)))
|
||||
&& POINTER_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
&& replaced_addresses_p)
|
||||
*replaced_addresses_p = true;
|
||||
|
||||
@ -985,7 +990,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p,
|
||||
stores between DEF_STMT and STMT, we only need to check
|
||||
that the RHS of STMT is the same as the memory reference
|
||||
propagated together with the value. */
|
||||
TREE_OPERAND (stmt, 1) = val->value;
|
||||
GIMPLE_STMT_OPERAND (stmt, 1) = val->value;
|
||||
|
||||
if (TREE_CODE (val->value) != SSA_NAME)
|
||||
prop_stats.num_const_prop++;
|
||||
@ -1084,14 +1089,14 @@ static bool
|
||||
fold_predicate_in (tree stmt)
|
||||
{
|
||||
tree *pred_p = NULL;
|
||||
bool modify_expr_p = false;
|
||||
bool modify_stmt_p = false;
|
||||
tree val;
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& COMPARISON_CLASS_P (TREE_OPERAND (stmt, 1)))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
{
|
||||
modify_expr_p = true;
|
||||
pred_p = &TREE_OPERAND (stmt, 1);
|
||||
modify_stmt_p = true;
|
||||
pred_p = &GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
}
|
||||
else if (TREE_CODE (stmt) == COND_EXPR)
|
||||
pred_p = &COND_EXPR_COND (stmt);
|
||||
@ -1101,7 +1106,7 @@ fold_predicate_in (tree stmt)
|
||||
val = vrp_evaluate_conditional (*pred_p, true);
|
||||
if (val)
|
||||
{
|
||||
if (modify_expr_p)
|
||||
if (modify_stmt_p)
|
||||
val = fold_convert (TREE_TYPE (*pred_p), val);
|
||||
|
||||
if (dump_file)
|
||||
@ -1167,8 +1172,8 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
|
||||
/* Ignore ASSERT_EXPRs. They are used by VRP to generate
|
||||
range information for names and they are discarded
|
||||
afterwards. */
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == ASSERT_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
|
||||
continue;
|
||||
|
||||
/* Replace the statement with its folded version and mark it
|
||||
|
@ -271,7 +271,7 @@ get_rank (tree e)
|
||||
if (bb_for_stmt (stmt) == NULL)
|
||||
return 0;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
|| !ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
|
||||
return bb_rank[bb_for_stmt (stmt)->index];
|
||||
|
||||
@ -284,7 +284,7 @@ get_rank (tree e)
|
||||
rank, whichever is less. */
|
||||
rank = 0;
|
||||
maxrank = bb_rank[bb_for_stmt(stmt)->index];
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (TREE_CODE_LENGTH (TREE_CODE (rhs)) == 0)
|
||||
rank = MAX (rank, get_rank (rhs));
|
||||
else
|
||||
@ -378,9 +378,9 @@ static bool
|
||||
is_reassociable_op (tree stmt, enum tree_code code)
|
||||
{
|
||||
if (!IS_EMPTY_STMT (stmt)
|
||||
&& TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == code
|
||||
&& has_single_use (TREE_OPERAND (stmt, 0)))
|
||||
&& TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == code
|
||||
&& has_single_use (GIMPLE_STMT_OPERAND (stmt, 0)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -395,10 +395,10 @@ get_unary_op (tree name, enum tree_code opcode)
|
||||
tree stmt = SSA_NAME_DEF_STMT (name);
|
||||
tree rhs;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return NULL_TREE;
|
||||
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
if (TREE_CODE (rhs) == opcode)
|
||||
return TREE_OPERAND (rhs, 0);
|
||||
return NULL_TREE;
|
||||
@ -814,7 +814,7 @@ static bool
|
||||
is_phi_for_stmt (tree stmt, tree operand)
|
||||
{
|
||||
tree def_stmt;
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
use_operand_p arg_p;
|
||||
ssa_op_iter i;
|
||||
|
||||
@ -839,7 +839,7 @@ static void
|
||||
rewrite_expr_tree (tree stmt, unsigned int opindex,
|
||||
VEC(operand_entry_t, heap) * ops)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
operand_entry_t oe;
|
||||
|
||||
/* If we have three operands left, then we want to make sure the one
|
||||
@ -952,7 +952,7 @@ static void
|
||||
linearize_expr (tree stmt)
|
||||
{
|
||||
block_stmt_iterator bsinow, bsirhs;
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
enum tree_code rhscode = TREE_CODE (rhs);
|
||||
tree binrhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 1));
|
||||
tree binlhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
|
||||
@ -965,11 +965,12 @@ linearize_expr (tree stmt)
|
||||
bsirhs = bsi_for_stmt (binrhs);
|
||||
bsi_move_before (&bsirhs, &bsinow);
|
||||
|
||||
TREE_OPERAND (rhs, 1) = TREE_OPERAND (TREE_OPERAND (binrhs, 1), 0);
|
||||
TREE_OPERAND (rhs, 1) = TREE_OPERAND (GIMPLE_STMT_OPERAND (binrhs, 1), 0);
|
||||
if (TREE_CODE (TREE_OPERAND (rhs, 1)) == SSA_NAME)
|
||||
newbinrhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 1));
|
||||
TREE_OPERAND (TREE_OPERAND (binrhs, 1), 0) = TREE_OPERAND (binlhs, 0);
|
||||
TREE_OPERAND (rhs, 0) = TREE_OPERAND (binrhs, 0);
|
||||
TREE_OPERAND (GIMPLE_STMT_OPERAND (binrhs, 1), 0)
|
||||
= GIMPLE_STMT_OPERAND (binlhs, 0);
|
||||
TREE_OPERAND (rhs, 0) = GIMPLE_STMT_OPERAND (binrhs, 0);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
@ -991,7 +992,7 @@ linearize_expr (tree stmt)
|
||||
|
||||
}
|
||||
|
||||
/* If LHS has a single immediate use that is a MODIFY_EXPR, return
|
||||
/* If LHS has a single immediate use that is a GIMPLE_MODIFY_STMT, return
|
||||
it. Otherwise, return NULL. */
|
||||
|
||||
static tree
|
||||
@ -1005,7 +1006,7 @@ get_single_immediate_use (tree lhs)
|
||||
{
|
||||
if (TREE_CODE (immusestmt) == RETURN_EXPR)
|
||||
immusestmt = TREE_OPERAND (immusestmt, 0);
|
||||
if (TREE_CODE (immusestmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (immusestmt) == GIMPLE_MODIFY_STMT)
|
||||
return immusestmt;
|
||||
}
|
||||
return NULL_TREE;
|
||||
@ -1032,13 +1033,13 @@ negate_value (tree tonegate, block_stmt_iterator *bsi)
|
||||
/* If we are trying to negate a name, defined by an add, negate the
|
||||
add operands instead. */
|
||||
if (TREE_CODE (tonegate) == SSA_NAME
|
||||
&& TREE_CODE (negatedef) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (negatedef, 0)) == SSA_NAME
|
||||
&& has_single_use (TREE_OPERAND (negatedef, 0))
|
||||
&& TREE_CODE (TREE_OPERAND (negatedef, 1)) == PLUS_EXPR)
|
||||
&& TREE_CODE (negatedef) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (negatedef, 0)) == SSA_NAME
|
||||
&& has_single_use (GIMPLE_STMT_OPERAND (negatedef, 0))
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (negatedef, 1)) == PLUS_EXPR)
|
||||
{
|
||||
block_stmt_iterator bsi;
|
||||
tree binop = TREE_OPERAND (negatedef, 1);
|
||||
tree binop = GIMPLE_STMT_OPERAND (negatedef, 1);
|
||||
|
||||
bsi = bsi_for_stmt (negatedef);
|
||||
TREE_OPERAND (binop, 0) = negate_value (TREE_OPERAND (binop, 0),
|
||||
@ -1047,7 +1048,7 @@ negate_value (tree tonegate, block_stmt_iterator *bsi)
|
||||
TREE_OPERAND (binop, 1) = negate_value (TREE_OPERAND (binop, 1),
|
||||
&bsi);
|
||||
update_stmt (negatedef);
|
||||
return TREE_OPERAND (negatedef, 0);
|
||||
return GIMPLE_STMT_OPERAND (negatedef, 0);
|
||||
}
|
||||
|
||||
tonegate = fold_build1 (NEGATE_EXPR, TREE_TYPE (tonegate), tonegate);
|
||||
@ -1068,8 +1069,8 @@ static bool
|
||||
should_break_up_subtract (tree stmt)
|
||||
{
|
||||
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree binlhs = TREE_OPERAND (rhs, 0);
|
||||
tree binrhs = TREE_OPERAND (rhs, 1);
|
||||
tree immusestmt;
|
||||
@ -1084,7 +1085,7 @@ should_break_up_subtract (tree stmt)
|
||||
|
||||
if (TREE_CODE (lhs) == SSA_NAME
|
||||
&& (immusestmt = get_single_immediate_use (lhs))
|
||||
&& TREE_CODE (TREE_OPERAND (immusestmt, 1)) == PLUS_EXPR)
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (immusestmt, 1)) == PLUS_EXPR)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@ -1095,7 +1096,7 @@ should_break_up_subtract (tree stmt)
|
||||
static void
|
||||
break_up_subtract (tree stmt, block_stmt_iterator *bsi)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
@ -1103,7 +1104,7 @@ break_up_subtract (tree stmt, block_stmt_iterator *bsi)
|
||||
print_generic_stmt (dump_file, stmt, 0);
|
||||
}
|
||||
|
||||
TREE_SET_CODE (TREE_OPERAND (stmt, 1), PLUS_EXPR);
|
||||
TREE_SET_CODE (GIMPLE_STMT_OPERAND (stmt, 1), PLUS_EXPR);
|
||||
TREE_OPERAND (rhs, 1) = negate_value (TREE_OPERAND (rhs, 1), bsi);
|
||||
|
||||
update_stmt (stmt);
|
||||
@ -1116,7 +1117,7 @@ static void
|
||||
linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree stmt)
|
||||
{
|
||||
block_stmt_iterator bsinow, bsilhs;
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GENERIC_TREE_OPERAND (stmt, 1);
|
||||
tree binrhs = TREE_OPERAND (rhs, 1);
|
||||
tree binlhs = TREE_OPERAND (rhs, 0);
|
||||
tree binlhsdef, binrhsdef;
|
||||
@ -1180,7 +1181,7 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree stmt)
|
||||
else if (binrhsisreassoc)
|
||||
{
|
||||
linearize_expr (stmt);
|
||||
gcc_assert (rhs == TREE_OPERAND (stmt, 1));
|
||||
gcc_assert (rhs == GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
binlhs = TREE_OPERAND (rhs, 0);
|
||||
binrhs = TREE_OPERAND (rhs, 1);
|
||||
}
|
||||
@ -1213,15 +1214,15 @@ repropagate_negates (void)
|
||||
Force the negate operand to the RHS of the PLUS_EXPR, then
|
||||
transform the PLUS_EXPR into a MINUS_EXPR. */
|
||||
if (user
|
||||
&& TREE_CODE (user) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (user, 1)) == PLUS_EXPR)
|
||||
&& TREE_CODE (user) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (user, 1)) == PLUS_EXPR)
|
||||
{
|
||||
tree rhs = TREE_OPERAND (user, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (user, 1);
|
||||
|
||||
/* If the negated operand appears on the LHS of the
|
||||
PLUS_EXPR, exchange the operands of the PLUS_EXPR
|
||||
to force the negated operand to the RHS of the PLUS_EXPR. */
|
||||
if (TREE_OPERAND (TREE_OPERAND (user, 1), 0) == negate)
|
||||
if (TREE_OPERAND (GIMPLE_STMT_OPERAND (user, 1), 0) == negate)
|
||||
{
|
||||
tree temp = TREE_OPERAND (rhs, 0);
|
||||
TREE_OPERAND (rhs, 0) = TREE_OPERAND (rhs, 1);
|
||||
@ -1230,7 +1231,7 @@ repropagate_negates (void)
|
||||
|
||||
/* Now transform the PLUS_EXPR into a MINUS_EXPR and replace
|
||||
the RHS of the PLUS_EXPR with the operand of the NEGATE_EXPR. */
|
||||
if (TREE_OPERAND (TREE_OPERAND (user, 1), 1) == negate)
|
||||
if (TREE_OPERAND (GIMPLE_STMT_OPERAND (user, 1), 1) == negate)
|
||||
{
|
||||
TREE_SET_CODE (rhs, MINUS_EXPR);
|
||||
TREE_OPERAND (rhs, 1) = get_unary_op (negate, NEGATE_EXPR);
|
||||
@ -1265,10 +1266,10 @@ break_up_subtract_bb (basic_block bb)
|
||||
{
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
TREE_VISITED (stmt) = 0;
|
||||
/* If unsafe math optimizations we can do reassociation for
|
||||
@ -1308,10 +1309,10 @@ reassociate_bb (basic_block bb)
|
||||
{
|
||||
tree stmt = bsi_stmt (bsi);
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhs = TREE_OPERAND (stmt, 0);
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* If this was part of an already processed tree, we don't
|
||||
need to touch it again. */
|
||||
@ -1351,14 +1352,15 @@ reassociate_bb (basic_block bb)
|
||||
fprintf (dump_file, "Transforming ");
|
||||
print_generic_expr (dump_file, rhs, 0);
|
||||
}
|
||||
TREE_OPERAND (stmt, 1) = VEC_last (operand_entry_t, ops)->op;
|
||||
GIMPLE_STMT_OPERAND (stmt, 1)
|
||||
= VEC_last (operand_entry_t, ops)->op;
|
||||
update_stmt (stmt);
|
||||
|
||||
if (dump_file && (dump_flags & TDF_DETAILS))
|
||||
{
|
||||
fprintf (dump_file, " into ");
|
||||
print_generic_stmt (dump_file,
|
||||
TREE_OPERAND (stmt, 1), 0);
|
||||
GIMPLE_STMT_OPERAND (stmt, 1), 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -144,7 +144,7 @@ is_hidden_global_store (tree stmt)
|
||||
{
|
||||
tree lhs;
|
||||
|
||||
gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
|
||||
|
||||
/* Note that we must not check the individual virtual operands
|
||||
here. In particular, if this is an aliased store, we could
|
||||
@ -171,7 +171,7 @@ is_hidden_global_store (tree stmt)
|
||||
address is a pointer, we check if its name tag or symbol tag is
|
||||
a global variable. Otherwise, we check if the base variable
|
||||
is a global. */
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
if (REFERENCE_CLASS_P (lhs))
|
||||
lhs = get_base_address (lhs);
|
||||
|
||||
@ -292,9 +292,9 @@ statement_sink_location (tree stmt, basic_block frombb)
|
||||
if (one_use == NULL_USE_OPERAND_P)
|
||||
return NULL;
|
||||
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
|
||||
return NULL;
|
||||
rhs = TREE_OPERAND (stmt, 1);
|
||||
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
/* There are a few classes of things we can't or don't move, some because we
|
||||
don't have code to handle it, some because it's not profitable and some
|
||||
|
@ -2763,13 +2763,13 @@ update_alias_info (tree stmt, struct alias_info *ai)
|
||||
of an assignment and their base address is always an
|
||||
INDIRECT_REF expression. */
|
||||
is_potential_deref = false;
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == ADDR_EXPR
|
||||
&& !is_gimple_val (TREE_OPERAND (stmt, 1)))
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ADDR_EXPR
|
||||
&& !is_gimple_val (GIMPLE_STMT_OPERAND (stmt, 1)))
|
||||
{
|
||||
/* If the RHS if of the form &PTR->FLD and PTR == OP, then
|
||||
this represents a potential dereference of PTR. */
|
||||
tree rhs = TREE_OPERAND (stmt, 1);
|
||||
tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
tree base = get_base_address (TREE_OPERAND (rhs, 0));
|
||||
if (TREE_CODE (base) == INDIRECT_REF
|
||||
&& TREE_OPERAND (base, 0) == op)
|
||||
@ -2971,9 +2971,9 @@ find_func_aliases (tree origt)
|
||||
modify_expr when we are returning a value, or just a plain
|
||||
call_expr when we are not. */
|
||||
else if (in_ipa_mode
|
||||
&& ((TREE_CODE (t) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (t, 1)) == CALL_EXPR
|
||||
&& !(call_expr_flags (TREE_OPERAND (t, 1))
|
||||
&& ((TREE_CODE (t) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (t, 1)) == CALL_EXPR
|
||||
&& !(call_expr_flags (GIMPLE_STMT_OPERAND (t, 1))
|
||||
& (ECF_MALLOC | ECF_MAY_BE_ALLOCA)))
|
||||
|| (TREE_CODE (t) == CALL_EXPR
|
||||
&& !(call_expr_flags (t)
|
||||
@ -2986,10 +2986,10 @@ find_func_aliases (tree origt)
|
||||
varinfo_t fi;
|
||||
int i = 1;
|
||||
tree decl;
|
||||
if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
lhsop = TREE_OPERAND (t, 0);
|
||||
rhsop = TREE_OPERAND (t, 1);
|
||||
lhsop = GIMPLE_STMT_OPERAND (t, 0);
|
||||
rhsop = GIMPLE_STMT_OPERAND (t, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3068,10 +3068,10 @@ find_func_aliases (tree origt)
|
||||
}
|
||||
}
|
||||
/* Otherwise, just a regular assignment statement. */
|
||||
else if (TREE_CODE (t) == MODIFY_EXPR)
|
||||
else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
|
||||
{
|
||||
tree lhsop = TREE_OPERAND (t, 0);
|
||||
tree rhsop = TREE_OPERAND (t, 1);
|
||||
tree lhsop = GIMPLE_STMT_OPERAND (t, 0);
|
||||
tree rhsop = GIMPLE_STMT_OPERAND (t, 1);
|
||||
int i;
|
||||
|
||||
if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
|
||||
|
@ -91,12 +91,12 @@ lhs_of_dominating_assert (tree op, basic_block bb, tree stmt)
|
||||
{
|
||||
use_stmt = USE_STMT (use_p);
|
||||
if (use_stmt != stmt
|
||||
&& TREE_CODE (use_stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (use_stmt, 1)) == ASSERT_EXPR
|
||||
&& TREE_OPERAND (TREE_OPERAND (use_stmt, 1), 0) == op
|
||||
&& TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == ASSERT_EXPR
|
||||
&& TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0) == op
|
||||
&& dominated_by_p (CDI_DOMINATORS, bb, bb_for_stmt (use_stmt)))
|
||||
{
|
||||
return TREE_OPERAND (use_stmt, 0);
|
||||
return GIMPLE_STMT_OPERAND (use_stmt, 0);
|
||||
}
|
||||
}
|
||||
return op;
|
||||
@ -245,11 +245,11 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|
||||
if (stmt_count > max_stmt_count)
|
||||
return NULL;
|
||||
|
||||
/* If this is not a MODIFY_EXPR which sets an SSA_NAME to a new
|
||||
/* If this is not a GIMPLE_MODIFY_STMT which sets an SSA_NAME to a new
|
||||
value, then do not try to simplify this statement as it will
|
||||
not simplify in any way that is helpful for jump threading. */
|
||||
if (TREE_CODE (stmt) != MODIFY_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
|
||||
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
|
||||
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
|
||||
continue;
|
||||
|
||||
/* At this point we have a statement which assigns an RHS to an
|
||||
@ -259,10 +259,10 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|
||||
|
||||
Handle simple copy operations as well as implied copies from
|
||||
ASSERT_EXPRs. */
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == SSA_NAME)
|
||||
cached_lhs = TREE_OPERAND (stmt, 1);
|
||||
else if (TREE_CODE (TREE_OPERAND (stmt, 1)) == ASSERT_EXPR)
|
||||
cached_lhs = TREE_OPERAND (TREE_OPERAND (stmt, 1), 0);
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME)
|
||||
cached_lhs = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
else if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
|
||||
cached_lhs = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
|
||||
else
|
||||
{
|
||||
/* A statement that is not a trivial copy or ASSERT_EXPR.
|
||||
@ -296,19 +296,19 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|
||||
here, because fold expects all the operands of an expression
|
||||
to be folded before the expression itself is folded, but we
|
||||
can't just substitute the folded condition here. */
|
||||
if (TREE_CODE (TREE_OPERAND (stmt, 1)) == COND_EXPR)
|
||||
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == COND_EXPR)
|
||||
{
|
||||
tree cond = COND_EXPR_COND (TREE_OPERAND (stmt, 1));
|
||||
tree cond = COND_EXPR_COND (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
cond = fold (cond);
|
||||
if (cond == boolean_true_node)
|
||||
pre_fold_expr = COND_EXPR_THEN (TREE_OPERAND (stmt, 1));
|
||||
pre_fold_expr = COND_EXPR_THEN (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
else if (cond == boolean_false_node)
|
||||
pre_fold_expr = COND_EXPR_ELSE (TREE_OPERAND (stmt, 1));
|
||||
pre_fold_expr = COND_EXPR_ELSE (GIMPLE_STMT_OPERAND (stmt, 1));
|
||||
else
|
||||
pre_fold_expr = TREE_OPERAND (stmt, 1);
|
||||
pre_fold_expr = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
}
|
||||
else
|
||||
pre_fold_expr = TREE_OPERAND (stmt, 1);
|
||||
pre_fold_expr = GIMPLE_STMT_OPERAND (stmt, 1);
|
||||
|
||||
if (pre_fold_expr)
|
||||
{
|
||||
@ -331,7 +331,7 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|
||||
if (cached_lhs
|
||||
&& (TREE_CODE (cached_lhs) == SSA_NAME
|
||||
|| is_gimple_min_invariant (cached_lhs)))
|
||||
record_temporary_equivalence (TREE_OPERAND (stmt, 0),
|
||||
record_temporary_equivalence (GIMPLE_STMT_OPERAND (stmt, 0),
|
||||
cached_lhs,
|
||||
stack);
|
||||
}
|
||||
|
@ -624,12 +624,12 @@ verify_ssa (bool check_modified_stmt)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (TREE_CODE (stmt) == MODIFY_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
|
||||
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
|
||||
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
|
||||
{
|
||||
tree lhs, base_address;
|
||||
|
||||
lhs = TREE_OPERAND (stmt, 0);
|
||||
lhs = GIMPLE_STMT_OPERAND (stmt, 0);
|
||||
base_address = get_base_address (lhs);
|
||||
|
||||
if (base_address
|
||||
@ -758,8 +758,8 @@ delete_tree_ssa (void)
|
||||
/* Remove annotations from every referenced variable. */
|
||||
FOR_EACH_REFERENCED_VAR (var, rvi)
|
||||
{
|
||||
ggc_free (var->common.ann);
|
||||
var->common.ann = NULL;
|
||||
ggc_free (var->base.ann);
|
||||
var->base.ann = NULL;
|
||||
}
|
||||
htab_delete (gimple_referenced_vars (cfun));
|
||||
cfun->gimple_df->referenced_vars = NULL;
|
||||
|
@ -119,7 +119,9 @@ make_ssa_name (tree var, tree stmt)
|
||||
gcc_assert (DECL_P (var)
|
||||
|| TREE_CODE (var) == INDIRECT_REF);
|
||||
|
||||
gcc_assert (!stmt || EXPR_P (stmt) || TREE_CODE (stmt) == PHI_NODE);
|
||||
gcc_assert (!stmt
|
||||
|| EXPR_P (stmt) || GIMPLE_STMT_P (stmt)
|
||||
|| TREE_CODE (stmt) == PHI_NODE);
|
||||
|
||||
/* If our free list has an element, then use it. */
|
||||
if (FREE_SSANAMES (cfun))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user