+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.
/* 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;
};
&& 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;
{
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;
&& !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);
}
/* 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);
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);
}
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:
}
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;
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)
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;
}
&& 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,
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)")))
{
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);
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);
(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);
}
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;
{
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 %<;%>");
}
{
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 %<;%>");
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);
break;
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
pp_assignment_expression (pp, e);
break;
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;
{
/* 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;
}
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
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);
{
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;
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);
}
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);
}
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);
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);
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;
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);
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);
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);
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);
}
/* 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)
/* 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)
/* 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++)
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);
}
}
{
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);
}
}
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)
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);
}
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.
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);
}
/* [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;
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;
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)
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);
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);
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);
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);
}
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);
{
/* 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);
}
}
}
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)
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);
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);
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);
}
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);
}
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);
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);
/* 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);
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);
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);
}
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)
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)
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;
}
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);
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);
}
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);
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);
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);
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);
}
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);
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;
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);
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);
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);
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);
/* 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);
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);
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);
}
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);
}
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);
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);
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)
+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
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:
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);
}
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);
}
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;
}
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;
}
/* 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;
/* 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);
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:
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)
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
/* 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;
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);
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))
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);
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"
case WITH_CLEANUP_EXPR:
case COMPOUND_EXPR:
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case TARGET_EXPR:
case COND_EXPR:
case BIND_EXPR:
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;
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);
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;
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)));
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;
}
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:
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;
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;
}
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;
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);
}
/* 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);
"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);
}
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)
{
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;
/* 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);
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)
{
/* 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)
}
-/* 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;
|| 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);
}
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 *);
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))
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);
/* 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
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);
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 */
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 */
/* 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)
{
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;
/* 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);
/* 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);
}
/* 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);
}
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);
}
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));
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);
}
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);
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;
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);
}
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)
{
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);
{
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);
{
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);
/* 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,
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);
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))),
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;
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);
}
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
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);
}
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);
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)
{
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
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
if (want_value)
{
+ tree_to_gimple_tuple (expr_p);
+
append_to_statement_list (*expr_p, pre_p);
*expr_p = *to_p;
return GS_OK;
*/
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);
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)));
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))
{
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:
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
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);
}
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);
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);
}
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];
/* 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;
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:
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
*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
DECL_SAVED_TREE (fndecl) = bind;
}
+ cfun->gimplified = true;
current_function_decl = oldfn;
cfun = oldfn ? DECL_STRUCT_FUNCTION (oldfn) : NULL;
}
-
\f
/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true,
force the result to be either ssa_name or an invariant, otherwise
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);
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;
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);
}
*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 */
*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 */
*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);
*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);
{
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);
}
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;
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),
/* 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)")))
/* 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);
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);
/* 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);
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);
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);
}
/* 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);
}
/* 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);
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);
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);
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);
}
{
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);
}
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);
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);
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)))
{
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)))
{
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));
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);
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
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);
}
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))
{
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))
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);
{
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;
{
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);
}
}
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);
{
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);
}
}
{
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);
}
}
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);
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;
}
}
/* 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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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,
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);
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);
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);
}
}
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)
{
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);
}
}
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)
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;
{
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))
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))
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))
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,
case PREDECREMENT_EXPR:
case POSTDECREMENT_EXPR:
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
case TARGET_EXPR:
case CALL_EXPR:
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;
(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;
}
/* 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. */
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);
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;
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)
: &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 ();
}
}
break;
case MODIFY_EXPR:
+ gcc_unreachable ();
+
+ case GIMPLE_MODIFY_STMT:
data->last_goto = NULL;
fold_stmt (tp);
op = get_call_expr_in (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)
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;
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)))
{
}
+/* 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
{
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");
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)
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));
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:
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. */
/* 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);
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);
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);
}
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);
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);
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),
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);
}
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);
}
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;
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:
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);
|| 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);
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))
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;
}
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;
}
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);
/* 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;
}
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;
}
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:
{
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));
/* ??? 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);
}
/* ??? 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;
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)
{
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);
}
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));
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);
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);
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;
}
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))
{
{
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)
{
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;
}
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.
{
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.
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);
}
#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
#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
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
/*---------------------------------------------------------------------------
- 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 };
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.
return true;
case CALL_EXPR:
- case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
/* These are valid regardless of their type. */
return true;
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)
switch (code)
{
case INIT_EXPR:
- case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case VA_ARG_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
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);
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 *);
}
/* 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
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:
}
/* 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))
{
/* 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))
{
/* 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. */
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;
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;
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);
*/
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;
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. */
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;
}
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
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;
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.
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)
{
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. */
/* 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);
/* 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))
(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. */
/* 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);
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
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
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;
/* 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
/* 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. */
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)
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
{
/* 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);
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. */
/* 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);
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);
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);
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);
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);
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);
}
/* 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),
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);
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);
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;
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;
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);
}
}
{
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);
}
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. */
{
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
{
}
}
-/* 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.
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;
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)
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)
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)
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. */
{
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)
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;
}
}
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. */
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. */
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;
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;
/* 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. */
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
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:
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);
}
return 1;
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
return 2;
switch (code)
{
case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
return "=";
case TRUTH_OR_EXPR:
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);
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
/* 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;
}
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;
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;
}
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);
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)
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);
}
}
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);
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
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
/* 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,
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);
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
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);
}
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);
}
}
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);
}
/* 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)
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);
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);
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)
{
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;
*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;
}
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)
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. */
{
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:
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
/* 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)
/* 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)
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)
{
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)
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
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);
}
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. */
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;
{
result = convert_to_gimple_builtin (&i, result,
TREE_CODE (old_stmt)
- != MODIFY_EXPR);
+ != GIMPLE_MODIFY_STMT);
if (result)
{
bool ok = set_rhs (stmtp, result);
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
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);
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))
{
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
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;
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);
}
}
\f
-#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. */
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))
{
/* 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;
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)
{
else
{
element->stmt = expr;
- element->rhs = TREE_OPERAND (expr, 1);
+ element->rhs = GENERIC_TREE_OPERAND (expr, 1);
}
element->lhs = lhs;
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)
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. */
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;
}
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. */
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);
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
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);
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));
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);
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. */
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);
}
/* 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)
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
}
}
-/* 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. */
{
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
{
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 ();
}
/* 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. */
/* 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));
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);
}
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;
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. */
{
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);
}
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
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
&& 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)
&& 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);
}
{
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;
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),
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. */
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);
{
/* 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)
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;
/* 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)
{
/* 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)
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)))
&& 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,
}
else
{
- TREE_OPERAND (use_stmt, 1) = orig;
+ GIMPLE_STMT_OPERAND (use_stmt, 1) = orig;
update_stmt (use_stmt);
return false;
}
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;
/* 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;
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);
}
}
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;
/* 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)
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;
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))
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;
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))
/* 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
{
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)));
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;
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);
}
}
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)
{
switch (TREE_CODE (stmt))
{
case RETURN_EXPR:
- case MODIFY_EXPR:
+ case GIMPLE_MODIFY_STMT:
stmt = get_call_expr_in (stmt);
if (!stmt)
break;
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);
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. */
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;
return true;
}
- if (!EXPR_P (expr))
+ if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
return false;
len = TREE_CODE_LENGTH (TREE_CODE (expr));
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)
{
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: ;
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;
}
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);
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)
{
}
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;
{
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;
{
if (stmts)
bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
- TREE_OPERAND (use->stmt, 1) = op;
+ GIMPLE_STMT_OPERAND (use->stmt, 1) = op;
}
}
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);
|| 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));
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
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))
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;
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;
{
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. */
{
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;
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);
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;
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
/* 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));
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);
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)
/* 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. */
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. */
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
/* 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
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);
}
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:
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:
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);
|| (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
{
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);
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;
/* 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);
/* 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;
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);
/* 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);
*/
/* 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
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;
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);
}
else
{
- newexpr->common.ann = NULL;
+ newexpr->base.ann = NULL;
vn_lookup_or_add_with_vuses (newexpr, newvuses);
}
expr = newexpr;
}
else
{
- newexpr->common.ann = NULL;
+ newexpr->base.ann = NULL;
vn_lookup_or_add (newexpr, NULL);
}
expr = newexpr;
}
else
{
- newexpr->common.ann = NULL;
+ newexpr->base.ann = NULL;
vn_lookup_or_add (newexpr, NULL);
}
expr = newexpr;
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,
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);
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);
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;
{
/* 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
/* 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)
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;
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);
}
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;
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;
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
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);
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);
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
/* 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),
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;
{
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
}
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)
{
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:
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))
{
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)
{
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)
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
/* 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;
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++;
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);
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)
/* 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
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];
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
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;
}
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;
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;
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
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));
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))
{
}
-/* 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
{
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;
/* 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),
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);
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;
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;
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))
{
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);
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;
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);
}
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);
/* 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);
{
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
{
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. */
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
{
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
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);
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
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)
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)
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
{
}
}
/* 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))
{
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;
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
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.
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)
{
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);
}
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
/* 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;
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))
stmt = SSA_NAME_DEF_STMT (lhs);
- 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 (unsigned HOST_WIDE_INT) -1;
- rhs = TREE_OPERAND (stmt, 1);
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
stmt = SSA_NAME_DEF_STMT (lhs);
- rhs = TREE_OPERAND (stmt, 1);
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
DECL_UID (SSA_NAME_VAR (use))))
continue;
- 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 (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
continue;
}
- 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 (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
tree *a, tree *ass_var)
{
tree op0, op1, non_ass_var;
- tree dest = TREE_OPERAND (ass, 0);
- tree src = TREE_OPERAND (ass, 1);
+ tree dest = GIMPLE_STMT_OPERAND (ass, 0);
+ tree src = GIMPLE_STMT_OPERAND (ass, 1);
enum tree_code code = TREE_CODE (src);
tree src_var = src;
continue;
/* Check for a call. */
- if (TREE_CODE (stmt) == MODIFY_EXPR)
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
{
- ass_var = TREE_OPERAND (stmt, 0);
- call = TREE_OPERAND (stmt, 1);
+ ass_var = GIMPLE_STMT_OPERAND (stmt, 0);
+ call = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (call) == WITH_SIZE_EXPR)
call = TREE_OPERAND (call, 0);
}
of copying the value. This test implies is_gimple_reg_type
from the previous condition, however this one could be
relaxed by being more careful with copying the new value
- of the parameter (emitting appropriate MODIFY_EXPR and
+ of the parameter (emitting appropriate GIMPLE_MODIFY_STMT and
updating the virtual operands). */
if (!is_gimple_reg (param))
break;
if (TREE_CODE (stmt) == RETURN_EXPR)
break;
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return;
if (!process_assignment (stmt, stmt, bsi, &m, &a, &ass_var))
/* See if this is a tail call we can handle. */
ret_var = TREE_OPERAND (stmt, 0);
if (ret_var
- && TREE_CODE (ret_var) == MODIFY_EXPR)
+ && TREE_CODE (ret_var) == GIMPLE_MODIFY_STMT)
{
- tree ret_op = TREE_OPERAND (ret_var, 1);
+ tree ret_op = GIMPLE_STMT_OPERAND (ret_var, 1);
STRIP_NOPS (ret_op);
if (!tail_recursion
&& TREE_CODE (ret_op) != SSA_NAME)
if (!process_assignment (ret_var, stmt, bsi, &m, &a, &ass_var))
return;
- ret_var = TREE_OPERAND (ret_var, 0);
+ ret_var = GIMPLE_STMT_OPERAND (ret_var, 0);
}
/* We may proceed if there either is no return value, or the return value
var = m_acc;
else
{
- stmt = build2 (MODIFY_EXPR, ret_type, NULL_TREE,
+ stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
build2 (MULT_EXPR, ret_type, m_acc, a));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
var = make_ssa_name (tmp, stmt);
- TREE_OPERAND (stmt, 0) = var;
+ GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
}
}
else
var = a;
- stmt = build2 (MODIFY_EXPR, ret_type, NULL_TREE,
+ stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
build2 (PLUS_EXPR, ret_type, a_acc, var));
var = make_ssa_name (SSA_NAME_VAR (a_acc), stmt);
- TREE_OPERAND (stmt, 0) = var;
+ GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
a_acc_arg = var;
}
if (m)
{
- stmt = build2 (MODIFY_EXPR, ret_type, NULL_TREE,
+ stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
build2 (MULT_EXPR, ret_type, m_acc, m));
var = make_ssa_name (SSA_NAME_VAR (m_acc), stmt);
- TREE_OPERAND (stmt, 0) = var;
+ GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
m_acc_arg = var;
}
if (!ret_var)
return;
- if (TREE_CODE (ret_var) == MODIFY_EXPR)
+ if (TREE_CODE (ret_var) == GIMPLE_MODIFY_STMT)
{
- ret_var->common.ann = (tree_ann_t) stmt_ann (ret_stmt);
+ ret_var->base.ann = (tree_ann_t) stmt_ann (ret_stmt);
bsi_replace (&bsi, ret_var, true);
- SSA_NAME_DEF_STMT (TREE_OPERAND (ret_var, 0)) = ret_var;
- ret_var = TREE_OPERAND (ret_var, 0);
+ SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (ret_var, 0)) = ret_var;
+ ret_var = GIMPLE_STMT_OPERAND (ret_var, 0);
ret_stmt = build1 (RETURN_EXPR, TREE_TYPE (ret_stmt), ret_var);
bsi_insert_after (&bsi, ret_stmt, BSI_NEW_STMT);
}
if (m)
{
- stmt = build2 (MODIFY_EXPR, ret_type, NULL_TREE,
+ stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
build2 (MULT_EXPR, ret_type, m_acc, ret_var));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
var = make_ssa_name (tmp, stmt);
- TREE_OPERAND (stmt, 0) = var;
+ GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
}
else
if (a)
{
- stmt = build2 (MODIFY_EXPR, ret_type, NULL_TREE,
+ stmt = build2 (GIMPLE_MODIFY_STMT, ret_type, NULL_TREE,
build2 (PLUS_EXPR, ret_type, a_acc, var));
tmp = create_tmp_var (ret_type, "acc_tmp");
add_referenced_var (tmp);
var = make_ssa_name (tmp, stmt);
- TREE_OPERAND (stmt, 0) = var;
+ GIMPLE_STMT_OPERAND (stmt, 0) = var;
bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
}
fprintf (dump_file, "\n");
}
- if (TREE_CODE (stmt) == MODIFY_EXPR)
- stmt = TREE_OPERAND (stmt, 1);
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ stmt = GIMPLE_STMT_OPERAND (stmt, 1);
first = single_succ (ENTRY_BLOCK_PTR);
adjust_accumulator_values (t->call_bsi, t->mult, t->add, e);
call = bsi_stmt (t->call_bsi);
- if (TREE_CODE (call) == MODIFY_EXPR)
+ if (TREE_CODE (call) == GIMPLE_MODIFY_STMT)
{
- rslt = TREE_OPERAND (call, 0);
+ rslt = GIMPLE_STMT_OPERAND (call, 0);
/* Result of the call will no longer be defined. So adjust the
SSA_NAME_DEF_STMT accordingly. */
continue;
}
- if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))))
+ if (!GIMPLE_STMT_P (stmt)
+ && VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
if (STMT_VINFO_DATA_REF (stmt_info))
scalar_type =
TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));
- else if (TREE_CODE (stmt) == MODIFY_EXPR)
- scalar_type = TREE_TYPE (TREE_OPERAND (stmt, 0));
+ else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ scalar_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
else
scalar_type = TREE_TYPE (stmt);
if (STMT_VINFO_RELEVANT_P (stmt_info))
{
- gcc_assert (!VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))));
+ gcc_assert (GIMPLE_STMT_P (stmt)
+ || !VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))));
gcc_assert (STMT_VINFO_VECTYPE (stmt_info));
ok = (vectorizable_type_promotion (stmt, NULL, NULL)
Therefore, all we need to check is if STMT falls into the
first case, and whether var corresponds to USE. */
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) == SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
return false;
- operand = TREE_OPERAND (stmt, 1);
+ operand = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (operand) != SSA_NAME)
return false;
{
case RETURN_EXPR:
stmt = TREE_OPERAND (stmt, 0);
- if (!stmt || TREE_CODE (stmt) != MODIFY_EXPR)
+ if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return;
/* FALLTHRU */
- case MODIFY_EXPR:
- p_lhs = &TREE_OPERAND (stmt, 0);
- p_rhs = &TREE_OPERAND (stmt, 1);
+ case GIMPLE_MODIFY_STMT:
+ p_lhs = &GIMPLE_STMT_OPERAND (stmt, 0);
+ p_rhs = &GIMPLE_STMT_OPERAND (stmt, 1);
lhs = *p_lhs;
rhs = *p_rhs;
break;
if (! *def_stmt)
return false;
- if (TREE_CODE (*def_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (*def_stmt) != GIMPLE_MODIFY_STMT)
return false;
- expr = TREE_OPERAND (*def_stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (*def_stmt, 1);
if (TREE_CODE (expr) != NOP_EXPR)
return false;
tree pattern_expr;
tree prod_type;
- if (TREE_CODE (last_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
return NULL;
- expr = TREE_OPERAND (last_stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
type = TREE_TYPE (expr);
/* Look for the following pattern
if (widened_name_p (oprnd0, stmt, &half_type, &def_stmt))
{
stmt = def_stmt;
- expr = TREE_OPERAND (stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (stmt, 1);
oprnd0 = TREE_OPERAND (expr, 0);
}
else
gcc_assert (stmt_vinfo);
if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_loop_def)
return NULL;
- expr = TREE_OPERAND (stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (expr) != MULT_EXPR)
return NULL;
if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
/* Has been detected as a widening multiplication? */
stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo);
- expr = TREE_OPERAND (stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (expr) != WIDEN_MULT_EXPR)
return NULL;
stmt_vinfo = vinfo_for_stmt (stmt);
return NULL;
if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt))
return NULL;
- oprnd00 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
+ oprnd00 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
if (!widened_name_p (oprnd1, stmt, &half_type1, &def_stmt))
return NULL;
- oprnd01 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
+ oprnd01 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1))
return NULL;
if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2)
tree dummy;
enum tree_code dummy_code;
- if (TREE_CODE (last_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
return NULL;
- expr = TREE_OPERAND (last_stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
type = TREE_TYPE (expr);
/* Starting from LAST_STMT, follow the defs of its uses in search
/* Check argument 0 */
if (!widened_name_p (oprnd0, last_stmt, &half_type0, &def_stmt0))
return NULL;
- oprnd0 = TREE_OPERAND (TREE_OPERAND (def_stmt0, 1), 0);
+ oprnd0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt0, 1), 0);
/* Check argument 1 */
if (!widened_name_p (oprnd1, last_stmt, &half_type1, &def_stmt1))
return NULL;
- oprnd1 = TREE_OPERAND (TREE_OPERAND (def_stmt1, 1), 0);
+ oprnd1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt1, 1), 0);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1))
return NULL;
tree type;
tree fn, arglist, base, exp;
- if (TREE_CODE (last_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
return NULL;
- expr = TREE_OPERAND (last_stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
type = TREE_TYPE (expr);
if (TREE_CODE (expr) != CALL_EXPR)
tree type, half_type;
tree pattern_expr;
- if (TREE_CODE (last_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
return NULL;
- expr = TREE_OPERAND (last_stmt, 1);
+ expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
type = TREE_TYPE (expr);
/* Look for the following pattern
if (!widened_name_p (oprnd0, last_stmt, &half_type, &stmt))
return NULL;
- oprnd0 = TREE_OPERAND (TREE_OPERAND (stmt, 1), 0);
+ oprnd0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
*type_in = half_type;
*type_out = type;
var = create_tmp_var (pattern_type, "patt");
add_referenced_var (var);
var_name = make_ssa_name (var, NULL_TREE);
- pattern_expr = build2 (MODIFY_EXPR, void_type_node, var_name, pattern_expr);
+ pattern_expr = build2 (GIMPLE_MODIFY_STMT, void_type_node, var_name,
+ pattern_expr);
SSA_NAME_DEF_STMT (var_name) = pattern_expr;
bsi_insert_before (&si, pattern_expr, BSI_SAME_STMT);
ann = stmt_ann (pattern_expr);
Input:
1. STMT: a stmt that references memory. Expected to be of the form
- MODIFY_EXPR <name, data-ref> or MODIFY_EXPR <data-ref, name>.
+ GIMPLE_MODIFY_STMT <name, data-ref> or
+ GIMPLE_MODIFY_STMT <data-ref, name>.
2. BSI: block_stmt_iterator where new stmts can be added.
3. OFFSET (optional): an offset to be added to the initial address accessed
by the data-ref in STMT.
/* Create: p = (vectype *) initial_base */
vec_stmt = fold_convert (vect_ptr_type, new_temp);
- vec_stmt = build2 (MODIFY_EXPR, void_type_node, vect_ptr, vec_stmt);
+ vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vect_ptr, vec_stmt);
vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
- TREE_OPERAND (vec_stmt, 0) = vect_ptr_init;
+ GIMPLE_STMT_OPERAND (vec_stmt, 0) = vect_ptr_init;
new_bb = bsi_insert_on_edge_immediate (pe, vec_stmt);
gcc_assert (!new_bb);
use_operand_p use_p;
tree new_dataref_ptr;
- incr_stmt = build2 (MODIFY_EXPR, void_type_node, ptr_var,
+ incr_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, ptr_var,
build2 (PLUS_EXPR, vptr_type, dataref_ptr, update));
new_dataref_ptr = make_ssa_name (ptr_var, incr_stmt);
- TREE_OPERAND (incr_stmt, 0) = new_dataref_ptr;
+ GIMPLE_STMT_OPERAND (incr_stmt, 0) = new_dataref_ptr;
vect_finish_stmt_generation (stmt, incr_stmt, bsi);
/* Update the vector-pointer's cross-iteration increment. */
new_var = vect_get_new_vect_var (vector_type, vect_simple_var, "cst_");
add_referenced_var (new_var);
- init_stmt = build2 (MODIFY_EXPR, void_type_node, new_var, vector_var);
+ init_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, new_var, vector_var);
new_temp = make_ssa_name (new_var, init_stmt);
- TREE_OPERAND (init_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (init_stmt, 0) = new_temp;
pe = loop_preheader_edge (loop);
new_bb = bsi_insert_on_edge_immediate (pe, init_stmt);
print_generic_expr (vect_dump, init_stmt, TDF_SLIM);
}
- vec_oprnd = TREE_OPERAND (init_stmt, 0);
+ vec_oprnd = GIMPLE_STMT_OPERAND (init_stmt, 0);
return vec_oprnd;
}
def_stmt_info = vinfo_for_stmt (def_stmt);
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
gcc_assert (vec_stmt);
- vec_oprnd = TREE_OPERAND (vec_stmt, 0);
+ vec_oprnd = GIMPLE_STMT_OPERAND (vec_stmt, 0);
return vec_oprnd;
}
gcc_assert (def_stmt_info);
vec_stmt_for_operand = STMT_VINFO_RELATED_STMT (def_stmt_info);
gcc_assert (vec_stmt_for_operand);
- vec_oprnd = TREE_OPERAND (vec_stmt_for_operand, 0);
+ vec_oprnd = GIMPLE_STMT_OPERAND (vec_stmt_for_operand, 0);
return vec_oprnd;
}
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
int nelements;
- enum tree_code code = TREE_CODE (TREE_OPERAND (stmt, 1));
+ enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
tree type = TREE_TYPE (init_val);
tree def;
tree vec, t = NULL_TREE;
tree epilog_stmt;
tree new_scalar_dest, exit_phi;
tree bitsize, bitpos, bytesize;
- enum tree_code code = TREE_CODE (TREE_OPERAND (stmt, 1));
+ enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
tree scalar_initial_def;
tree vec_initial_def;
tree orig_name;
tree reduction_op;
tree orig_stmt;
tree use_stmt;
- tree operation = TREE_OPERAND (stmt, 1);
+ tree operation = GIMPLE_STMT_OPERAND (stmt, 1);
int op_type;
op_type = TREE_CODE_LENGTH (TREE_CODE (operation));
gcc_assert (STMT_VINFO_IN_PATTERN_P (stmt_vinfo));
gcc_assert (STMT_VINFO_RELATED_STMT (stmt_vinfo) == stmt);
}
- code = TREE_CODE (TREE_OPERAND (orig_stmt, 1));
- scalar_dest = TREE_OPERAND (orig_stmt, 0);
+ code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
+ scalar_dest = GIMPLE_STMT_OPERAND (orig_stmt, 0);
scalar_type = TREE_TYPE (scalar_dest);
new_scalar_dest = vect_create_destination_var (scalar_dest, NULL);
bitsize = TYPE_SIZE (scalar_type);
fprintf (vect_dump, "Reduce using direct vector reduction.");
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest,
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
build1 (reduc_code, vectype, PHI_RESULT (new_phi)));
new_temp = make_ssa_name (vec_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
extract_scalar_result = true;
{
tree bitpos = size_int (bit_offset);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest,
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ vec_dest,
build2 (shift_code, vectype,
new_temp, bitpos));
new_name = make_ssa_name (vec_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_name;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest,
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ vec_dest,
build2 (code, vectype,
new_name, new_temp));
new_temp = make_ssa_name (vec_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
}
rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitsize_zero_node);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, new_scalar_dest, rhs);
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
for (bit_offset = element_bitsize;
bitpos);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, new_scalar_dest,
- rhs);
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_scalar_dest, rhs);
new_name = make_ssa_name (new_scalar_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_name;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, new_scalar_dest,
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_scalar_dest,
build2 (code, scalar_type, new_name, new_temp));
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
}
rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, new_scalar_dest, rhs);
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
}
if (scalar_initial_def)
{
- epilog_stmt = build2 (MODIFY_EXPR, void_type_node, new_scalar_dest,
+ epilog_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_scalar_dest,
build2 (code, scalar_type, new_temp, scalar_initial_def));
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- TREE_OPERAND (epilog_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
}
inside the loop body. The last operand is the reduction variable,
which is defined by the loop-header-phi. */
- gcc_assert (TREE_CODE (stmt) == MODIFY_EXPR);
+ gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
op_type = TREE_CODE_LENGTH (code);
if (op_type != binary_op && op_type != ternary_op)
return false;
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
scalar_type = TREE_TYPE (scalar_dest);
/* All uses but the last are expected to be defined in the loop.
{
/* This is a reduction pattern: get the vectype from the type of the
reduction variable, and get the tree-code from orig_stmt. */
- orig_code = TREE_CODE (TREE_OPERAND (orig_stmt, 1));
+ orig_code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
vectype = get_vectype_for_scalar_type (TREE_TYPE (def));
vec_mode = TYPE_MODE (vectype);
}
/* Get the vector def for the reduction variable from the vectorized
reduction operation generated in the previous iteration (j-1) */
- reduc_def = TREE_OPERAND (new_stmt ,0);
+ reduc_def = GIMPLE_STMT_OPERAND (new_stmt ,0);
}
/* Arguments are ready. create the new vector stmt. */
else
expr = build3 (code, vectype, loop_vec_def0, loop_vec_def1,
reduc_def);
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, expr);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
if (j == 0)
enum vect_def_type dt;
/* Is STMT a vectorizable call? */
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
return false;
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (operation) != CALL_EXPR)
return false;
fprintf (vect_dump, "transform operation.");
/* Handle def. */
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle uses. */
fndecl = get_callee_fndecl (operation);
rhs = build_vectorized_function_call (fndecl, vectype, vargs);
- *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, rhs);
+ *vec_stmt = build2 (GIMPLE_MODIFY_STMT, vectype, vec_dest, rhs);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
- TREE_OPERAND (*vec_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_info) == vect_loop_def);
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
- op = TREE_OPERAND (stmt, 1);
+ op = GIMPLE_STMT_OPERAND (stmt, 1);
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt))
{
if (vect_print_dump_info (REPORT_DETAILS))
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle use. */
- op = TREE_OPERAND (stmt, 1);
+ op = GIMPLE_STMT_OPERAND (stmt, 1);
vec_oprnd = vect_get_vec_def_for_operand (op, stmt, NULL);
/* Arguments are ready. create the new vector stmt. */
- *vec_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, vec_oprnd);
+ *vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, vec_oprnd);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
- TREE_OPERAND (*vec_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
return true;
return false;
}
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
return false;
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
if (nunits_out != nunits_in)
return false;
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
optab = optab_for_tree_code (code, vectype);
/* Arguments are ready. create the new vector stmt. */
if (op_type == binary_op)
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest,
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
build2 (code, vectype, vec_oprnd0, vec_oprnd1));
else
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest,
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
build1 (code, vectype, vec_oprnd0));
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
if (j == 0)
return false;
}
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
return false;
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
if (code != NOP_EXPR && code != CONVERT_EXPR)
return false;
vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op0));
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
scalar_type = TREE_TYPE (scalar_dest);
vectype_out = get_vectype_for_scalar_type (scalar_type);
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
/* Arguments are ready. Create the new vector stmt. */
expr = build2 (code, vectype_out, vec_oprnd0, vec_oprnd1);
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, expr);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
if (j == 0)
else
expr = build1 (code, vectype, vec_oprnd0);
}
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, expr);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
if (code == CALL_EXPR)
return false;
}
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
return false;
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
if (code != NOP_EXPR && code != WIDEN_MULT_EXPR)
return false;
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
if (nunits_out != nunits_in / 2) /* FORNOW */
/* high = interleave_high (vect1, vect2); */
perm_dest = create_tmp_var (vectype, "vect_inter_high");
add_referenced_var (perm_dest);
- perm_stmt = build2 (MODIFY_EXPR, void_type_node, perm_dest,
+ perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype, vect1,
vect2));
high = make_ssa_name (perm_dest, perm_stmt);
- TREE_OPERAND (perm_stmt, 0) = high;
+ GIMPLE_STMT_OPERAND (perm_stmt, 0) = high;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
VEC_replace (tree, *result_chain, 2*j, high);
/* low = interleave_low (vect1, vect2); */
perm_dest = create_tmp_var (vectype, "vect_inter_low");
add_referenced_var (perm_dest);
- perm_stmt = build2 (MODIFY_EXPR, void_type_node, perm_dest,
+ perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
build2 (VEC_INTERLEAVE_LOW_EXPR, vectype, vect1,
vect2));
low = make_ssa_name (perm_dest, perm_stmt);
- TREE_OPERAND (perm_stmt, 0) = low;
+ GIMPLE_STMT_OPERAND (perm_stmt, 0) = low;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
VEC_replace (tree, *result_chain, 2*j+1, low);
}
/* Is vectorizable store? */
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
if (TREE_CODE (scalar_dest) != ARRAY_REF
&& TREE_CODE (scalar_dest) != INDIRECT_REF
&& !DR_GROUP_FIRST_DR (stmt_info))
return false;
- op = TREE_OPERAND (stmt, 1);
+ op = GIMPLE_STMT_OPERAND (stmt, 1);
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt))
{
if (vect_print_dump_info (REPORT_DETAILS))
executed.
*/
gcc_assert (next_stmt);
- op = TREE_OPERAND (next_stmt, 1);
+ op = GIMPLE_STMT_OPERAND (next_stmt, 1);
vec_oprnd = vect_get_vec_def_for_operand (op, next_stmt, NULL);
VEC_quick_push(tree, dr_chain, vec_oprnd);
VEC_quick_push(tree, oprnds, vec_oprnd);
data_ref = build_fold_indirect_ref (dataref_ptr);
/* Arguments are ready. Create the new vector stmt. */
- new_stmt = build2 (MODIFY_EXPR, void_type_node, data_ref,
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, data_ref,
vec_oprnd);
vect_finish_stmt_generation (stmt, new_stmt, bsi);
ptr = vect_create_data_ref_ptr (stmt, bsi, NULL_TREE, &init_addr, &inc, true,
NULL_TREE);
data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, data_ref);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
gcc_assert (!new_bb);
- msq_init = TREE_OPERAND (new_stmt, 0);
+ msq_init = GIMPLE_STMT_OPERAND (new_stmt, 0);
copy_virtual_operands (new_stmt, stmt);
update_vuses_to_preheader (new_stmt, loop);
new_stmt = build_function_call_expr (builtin_decl, params);
vec_dest = vect_create_destination_var (scalar_dest,
TREE_TYPE (new_stmt));
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, new_stmt);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ new_stmt);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
gcc_assert (!new_bb);
- *realignment_token = TREE_OPERAND (new_stmt, 0);
+ *realignment_token = GIMPLE_STMT_OPERAND (new_stmt, 0);
/* The result of the CALL_EXPR to this builtin is determined from
the value of the parameter and no global variables are touched
perm_dest = create_tmp_var (vectype, "vect_perm_even");
add_referenced_var (perm_dest);
- perm_stmt = build2 (MODIFY_EXPR, void_type_node, perm_dest,
+ perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
build2 (VEC_EXTRACT_EVEN_EXPR, vectype,
first_vect, second_vect));
data_ref = make_ssa_name (perm_dest, perm_stmt);
- TREE_OPERAND (perm_stmt, 0) = data_ref;
+ GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
mark_new_vars_to_rename (perm_stmt);
perm_dest = create_tmp_var (vectype, "vect_perm_odd");
add_referenced_var (perm_dest);
- perm_stmt = build2 (MODIFY_EXPR, void_type_node, perm_dest,
+ perm_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, perm_dest,
build2 (VEC_EXTRACT_ODD_EXPR, vectype,
first_vect, second_vect));
data_ref = make_ssa_name (perm_dest, perm_stmt);
- TREE_OPERAND (perm_stmt, 0) = data_ref;
+ GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
vect_finish_stmt_generation (stmt, perm_stmt, bsi);
mark_new_vars_to_rename (perm_stmt);
return false;
}
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
- op = TREE_OPERAND (stmt, 1);
+ op = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (op) != ARRAY_REF
&& TREE_CODE (op) != INDIRECT_REF
&& !DR_GROUP_FIRST_DR (stmt_info))
gcc_unreachable ();
}
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, data_ref);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
copy_virtual_operands (new_stmt, stmt);
mark_new_vars_to_rename (new_stmt);
{
/* Create in loop:
<vec_dest = realign_load (msq, lsq, realignment_token)> */
- lsq = TREE_OPERAND (new_stmt, 0);
+ lsq = GIMPLE_STMT_OPERAND (new_stmt, 0);
if (!realignment_token)
realignment_token = dataref_ptr;
vec_dest = vect_create_destination_var (scalar_dest, vectype);
new_stmt =
build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq, realignment_token);
- new_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, new_stmt);
+ new_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ new_stmt);
new_temp = make_ssa_name (vec_dest, new_stmt);
- TREE_OPERAND (new_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, new_stmt, bsi);
if (i == group_size - 1 && j == ncopies - 1)
add_phi_arg (phi_stmt, lsq, loop_latch_edge (loop));
if (!STMT_VINFO_LIVE_P (stmt_info))
return false;
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- if (TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
return false;
- operation = TREE_OPERAND (stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (stmt, 1);
code = TREE_CODE (operation);
op_type = TREE_CODE_LENGTH (code);
return false;
}
- if (TREE_CODE (stmt) != MODIFY_EXPR)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
- op = TREE_OPERAND (stmt, 1);
+ op = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_CODE (op) != COND_EXPR)
return false;
/* Transform */
/* Handle def. */
- scalar_dest = TREE_OPERAND (stmt, 0);
+ scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle cond expr. */
vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
vec_compare, vec_then_clause, vec_else_clause);
- *vec_stmt = build2 (MODIFY_EXPR, void_type_node, vec_dest, vec_cond_expr);
+ *vec_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node, vec_dest,
+ vec_cond_expr);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
- TREE_OPERAND (*vec_stmt, 0) = new_temp;
+ GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
return true;
add_referenced_var (addr_tmp);
addr_tmp_name = make_ssa_name (addr_tmp, NULL_TREE);
addr_stmt = fold_convert (int_ptrsize_type, addr_base);
- addr_stmt = build2 (MODIFY_EXPR, void_type_node,
+ addr_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
addr_tmp_name, addr_stmt);
SSA_NAME_DEF_STMT (addr_tmp_name) = addr_stmt;
append_to_statement_list_force (addr_stmt, cond_expr_stmt_list);
or_tmp = create_tmp_var (int_ptrsize_type, tmp_name);
add_referenced_var (or_tmp);
new_or_tmp_name = make_ssa_name (or_tmp, NULL_TREE);
- or_stmt = build2 (MODIFY_EXPR, void_type_node, new_or_tmp_name,
+ or_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
+ new_or_tmp_name,
build2 (BIT_IOR_EXPR, int_ptrsize_type,
or_tmp_name,
addr_tmp_name));
add_referenced_var (and_tmp);
and_tmp_name = make_ssa_name (and_tmp, NULL_TREE);
- and_stmt = build2 (MODIFY_EXPR, void_type_node,
+ and_stmt = build2 (GIMPLE_MODIFY_STMT, void_type_node,
and_tmp_name,
build2 (BIT_AND_EXPR, int_ptrsize_type,
or_tmp_name, mask_cst));
node = get_loop_exit_condition (loop);
- if (node && EXPR_P (node) && EXPR_HAS_LOCATION (node)
+ if (node && CAN_HAVE_LOCATION_P (node) && EXPR_HAS_LOCATION (node)
&& EXPR_FILENAME (node) && EXPR_LINENO (node))
return EXPR_LOC (node);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
{
node = bsi_stmt (si);
- if (node && EXPR_P (node) && EXPR_HAS_LOCATION (node))
+ if (node && CAN_HAVE_LOCATION_P (node) && EXPR_HAS_LOCATION (node))
return EXPR_LOC (node);
}
}
/* empty stmt is expected only in case of a function argument.
- (Otherwise - we expect a phi_node or a modify_expr). */
+ (Otherwise - we expect a phi_node or a GIMPLE_MODIFY_STMT). */
if (IS_EMPTY_STMT (*def_stmt))
{
tree arg = TREE_OPERAND (*def_stmt, 0);
|| *dt == vect_invariant_def);
break;
- case MODIFY_EXPR:
- *def = TREE_OPERAND (*def_stmt, 0);
+ case GIMPLE_MODIFY_STMT:
+ *def = GIMPLE_STMT_OPERAND (*def_stmt, 0);
gcc_assert (*dt == vect_loop_def || *dt == vect_invariant_def);
break;
enum machine_mode vec_mode;
enum insn_code icode1, icode2;
optab optab1, optab2;
- tree expr = TREE_OPERAND (stmt, 1);
+ tree expr = GIMPLE_STMT_OPERAND (stmt, 1);
tree type = TREE_TYPE (expr);
tree wide_vectype = get_vectype_for_scalar_type (type);
enum tree_code c1, c2;
return NULL_TREE;
}
- if (TREE_CODE (def_stmt) != MODIFY_EXPR)
+ if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT)
{
if (vect_print_dump_info (REPORT_DETAILS))
{
return NULL_TREE;
}
- operation = TREE_OPERAND (def_stmt, 1);
+ operation = GIMPLE_STMT_OPERAND (def_stmt, 1);
code = TREE_CODE (operation);
if (!commutative_tree_code (code) || !associative_tree_code (code))
{
return NULL_TREE;
}
- if (TREE_CODE (def1) == MODIFY_EXPR
+ if (TREE_CODE (def1) == GIMPLE_MODIFY_STMT
&& flow_bb_inside_loop_p (loop, bb_for_stmt (def1))
&& def2 == phi)
{
}
return def_stmt;
}
- else if (TREE_CODE (def2) == MODIFY_EXPR
+ else if (TREE_CODE (def2) == GIMPLE_MODIFY_STMT
&& flow_bb_inside_loop_p (loop, bb_for_stmt (def2))
&& def1 == phi)
{
/* EXPR must not be a statement. We are only interested in value
numbering expressions on the RHS of assignments. */
gcc_assert (expr);
- gcc_assert (!expr->common.ann
- || expr->common.ann->common.type != STMT_ANN);
+ gcc_assert (!expr->base.ann
+ || expr->base.ann->common.type != STMT_ANN);
val = iterative_hash_expr (expr, val);
return val;
if (TREE_CODE (e) == SSA_NAME)
SSA_NAME_VALUE (e) = v;
else if (EXPR_P (e) || DECL_P (e) || TREE_CODE (e) == TREE_LIST
+ || GIMPLE_STMT_P (e)
|| TREE_CODE (e) == CONSTRUCTOR)
get_tree_common_ann (e)->value_handle = v;
else
if (COMPARISON_CLASS_P (cond))
{
tree a = build2 (ASSERT_EXPR, TREE_TYPE (v), v, cond);
- assertion = build2 (MODIFY_EXPR, TREE_TYPE (v), n, a);
+ assertion = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (v), n, a);
}
else if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
{
/* Given !V, build the assignment N = false. */
tree op0 = TREE_OPERAND (cond, 0);
gcc_assert (op0 == v);
- assertion = build2 (MODIFY_EXPR, TREE_TYPE (v), n, boolean_false_node);
+ assertion = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (v), n,
+ boolean_false_node);
}
else if (TREE_CODE (cond) == SSA_NAME)
{
/* Given V, build the assignment N = true. */
gcc_assert (v == cond);
- assertion = build2 (MODIFY_EXPR, TREE_TYPE (v), n, boolean_true_node);
+ assertion = build2 (GIMPLE_MODIFY_STMT,
+ TREE_TYPE (v), n, boolean_true_node);
}
else
gcc_unreachable ();
a truth operation or some bit operations, then we may be able
to register information about the operands of that assignment. */
op_def = SSA_NAME_DEF_STMT (op);
- if (TREE_CODE (op_def) != MODIFY_EXPR)
+ if (TREE_CODE (op_def) != GIMPLE_MODIFY_STMT)
return retval;
- rhs = TREE_OPERAND (op_def, 1);
+ rhs = GIMPLE_STMT_OPERAND (op_def, 1);
if (COMPARISON_CLASS_P (rhs))
{
{
tree def_stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def_stmt) == MODIFY_EXPR
- && (TREE_CODE (TREE_OPERAND (def_stmt, 1)) == TRUTH_AND_EXPR
- || TREE_CODE (TREE_OPERAND (def_stmt, 1)) == BIT_AND_EXPR))
+ if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
+ && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == TRUTH_AND_EXPR
+ || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == BIT_AND_EXPR))
{
- tree op0 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
- tree op1 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 1);
+ tree op0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ tree op1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);
retval |= register_edge_assert_for_1 (op0, NE_EXPR, e, si);
retval |= register_edge_assert_for_1 (op1, NE_EXPR, e, si);
}
{
tree def_stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def_stmt) == MODIFY_EXPR
- && (TREE_CODE (TREE_OPERAND (def_stmt, 1)) == TRUTH_OR_EXPR
- || TREE_CODE (TREE_OPERAND (def_stmt, 1)) == BIT_IOR_EXPR))
+ if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
+ && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == TRUTH_OR_EXPR
+ || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == BIT_IOR_EXPR))
{
- tree op0 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
- tree op1 = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 1);
+ tree op0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ tree op1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);
retval |= register_edge_assert_for_1 (op0, EQ_EXPR, e, si);
retval |= register_edge_assert_for_1 (op1, EQ_EXPR, e, si);
}
tree t = op;
tree def_stmt = SSA_NAME_DEF_STMT (t);
- while (TREE_CODE (def_stmt) == MODIFY_EXPR
- && TREE_CODE (TREE_OPERAND (def_stmt, 1)) == NOP_EXPR
- && TREE_CODE (TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0)) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0))))
+ while (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
+ && TREE_CODE
+ (GIMPLE_STMT_OPERAND (def_stmt, 1)) == NOP_EXPR
+ && TREE_CODE
+ (TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1),
+ 0)) == SSA_NAME
+ && POINTER_TYPE_P
+ (TREE_TYPE (TREE_OPERAND
+ (GIMPLE_STMT_OPERAND (def_stmt,
+ 1), 0))))
{
- t = TREE_OPERAND (TREE_OPERAND (def_stmt, 1), 0);
+ t = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
def_stmt = SSA_NAME_DEF_STMT (t);
/* Note we want to register the assert for the
tree stmt = bsi_stmt (si);
tree use_stmt;
- 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)
{
- tree rhs = TREE_OPERAND (stmt, 1), var;
+ tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), var;
tree cond = fold (ASSERT_EXPR_COND (rhs));
use_operand_p use_p;
imm_use_iterator iter;
/* Propagate the RHS into every use of the LHS. */
var = ASSERT_EXPR_VAR (rhs);
- FOR_EACH_IMM_USE_STMT (use_stmt, iter, TREE_OPERAND (stmt, 0))
+ FOR_EACH_IMM_USE_STMT (use_stmt, iter,
+ GIMPLE_STMT_OPERAND (stmt, 0))
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
{
SET_USE (use_p, var);
&& (INTEGRAL_TYPE_P (TREE_TYPE (PHI_RESULT (stmt)))
|| POINTER_TYPE_P (TREE_TYPE (PHI_RESULT (stmt)))))
return true;
- else if (TREE_CODE (stmt) == MODIFY_EXPR)
+ else 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);
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
tree lhs, rhs, def;
ssa_op_iter iter;
- lhs = TREE_OPERAND (stmt, 0);
- rhs = TREE_OPERAND (stmt, 1);
+ lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
/* We only keep track of ranges in integral and pointer types. */
if (TREE_CODE (lhs) == SSA_NAME
}
ann = stmt_ann (stmt);
- if (TREE_CODE (stmt) == MODIFY_EXPR)
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
{
- tree rhs = TREE_OPERAND (stmt, 1);
+ tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
t = build2 (BIT_AND_EXPR, TREE_TYPE (op0), op0, t);
}
- TREE_OPERAND (stmt, 1) = t;
+ GIMPLE_STMT_OPERAND (stmt, 1) = t;
update_stmt (stmt);
}
}
else
t = op;
- TREE_OPERAND (stmt, 1) = t;
+ GIMPLE_STMT_OPERAND (stmt, 1) = t;
update_stmt (stmt);
}
}
void
simplify_stmt_using_ranges (tree stmt)
{
- if (TREE_CODE (stmt) == MODIFY_EXPR)
+ if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
{
- tree rhs = TREE_OPERAND (stmt, 1);
+ tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
enum tree_code rhs_code = TREE_CODE (rhs);
/* Transform TRUNC_DIV_EXPR and TRUNC_MOD_EXPR into RSHIFT_EXPR
"random kinds",
"lang_decl kinds",
"lang_type kinds",
- "omp clauses"
+ "omp clauses",
+ "gimple statements"
};
#endif /* GATHER_STATISTICS */
return (sizeof (struct tree_exp)
+ (TREE_CODE_LENGTH (code) - 1) * sizeof (char *));
+ case tcc_gimple_stmt:
+ return (sizeof (struct gimple_stmt)
+ + (TREE_CODE_LENGTH (code) - 1) * sizeof (char *));
+
case tcc_constant: /* a constant */
switch (code)
{
kind = c_kind;
break;
+ case tcc_gimple_stmt:
+ kind = gimple_stmt_kind;
+ break;
+
case tcc_exceptional: /* something random, like an identifier. */
switch (code)
{
}
break;
+ case tcc_gimple_stmt:
+ switch (code)
+ {
+ case GIMPLE_MODIFY_STMT:
+ TREE_SIDE_EFFECTS (t) = 1;
+ break;
+
+ default:
+ break;
+ }
+
default:
/* Other classes need no special treatment. */
break;
t = ggc_alloc_zone_pass_stat (length, &tree_zone);
memcpy (t, node, length);
- TREE_CHAIN (t) = 0;
+ if (!GIMPLE_TUPLE_P (node))
+ TREE_CHAIN (t) = 0;
TREE_ASM_WRITTEN (t) = 0;
TREE_VISITED (t) = 0;
- t->common.ann = 0;
+ t->base.ann = 0;
if (TREE_CODE_CLASS (code) == tcc_declaration)
{
align1 = TYPE_ALIGN (TREE_TYPE (t));
return MAX (align0, align1);
- case SAVE_EXPR: case COMPOUND_EXPR: case MODIFY_EXPR:
+ case MODIFY_EXPR:
+ /* FIXME tuples: It is unclear to me if this function, which
+ is only called from ADA, is called on gimple or non gimple
+ trees. Let's assume it's from gimple trees unless we hit
+ this abort. */
+ gcc_unreachable ();
+
+ case SAVE_EXPR: case COMPOUND_EXPR: case GIMPLE_MODIFY_STMT:
case INIT_EXPR: case TARGET_EXPR: case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
/* These don't change the alignment of an object. */
case tcc_expression:
case tcc_statement:
return TS_EXP;
+ case tcc_gimple_stmt:
+ return TS_GIMPLE_STATEMENT;
default: /* tcc_constant and tcc_exceptional */
break;
}
case VECTOR_CST: return TS_VECTOR;
case STRING_CST: return TS_STRING;
/* tcc_exceptional cases. */
+ /* FIXME tuples: eventually this should be TS_BASE. For now, nothing
+ returns TS_BASE. */
case ERROR_MARK: return TS_COMMON;
case IDENTIFIER_NODE: return TS_IDENTIFIER;
case TREE_LIST: return TS_LIST;
gcc_assert (TREE_CODE_LENGTH (code) == 2);
+ if (code == MODIFY_EXPR && cfun && cfun->gimplified)
+ {
+ /* We should be talking GIMPLE_MODIFY_STMT by now. */
+ gcc_unreachable ();
+ }
+
+ /* FIXME tuples: For now let's be lazy; later we must rewrite all
+ build2 calls to build2_gimple calls. */
+ if (TREE_CODE_CLASS (code) == tcc_gimple_stmt)
+ return build2_gimple (code, arg0, arg1);
+
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
return t;
}
+
+/* Similar as build2_stat, but for GIMPLE tuples. For convenience's sake,
+ arguments and return type are trees. */
+
+tree
+build2_gimple_stat (enum tree_code code, tree arg0, tree arg1 MEM_STAT_DECL)
+{
+ bool side_effects;
+ tree t;
+
+ gcc_assert (TREE_CODE_LENGTH (code) == 2);
+
+ t = make_node_stat (code PASS_MEM_STAT);
+
+ side_effects = TREE_SIDE_EFFECTS (t);
+
+ /* ?? We don't care about setting flags for tuples... */
+ GIMPLE_STMT_OPERAND (t, 0) = arg0;
+ GIMPLE_STMT_OPERAND (t, 1) = arg1;
+
+ /* ...except perhaps side_effects and volatility. ?? */
+ TREE_SIDE_EFFECTS (t) = side_effects;
+ TREE_THIS_VOLATILE (t) = (TREE_CODE_CLASS (code) == tcc_reference
+ && arg0 && TREE_THIS_VOLATILE (arg0));
+
+
+ return t;
+}
+
tree
build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2 MEM_STAT_DECL)
}
#endif
\f
+/* Source location accessor functions. */
+
+
+/* The source location of this expression. Non-tree_exp nodes such as
+ decls and constants can be shared among multiple locations, so
+ return nothing. */
+location_t
+expr_location (tree node)
+{
+#ifdef USE_MAPPED_LOCATION
+ if (GIMPLE_STMT_P (node))
+ return GIMPLE_STMT_LOCUS (node);
+ return EXPR_P (node) ? node->exp.locus : UNKNOWN_LOCATION;
+#else
+ if (GIMPLE_STMT_P (node))
+ return EXPR_HAS_LOCATION (node)
+ ? *GIMPLE_STMT_LOCUS (node) : UNKNOWN_LOCATION;
+ return EXPR_HAS_LOCATION (node) ? *node->exp.locus : UNKNOWN_LOCATION;
+#endif
+}
+
+void
+set_expr_location (tree node, location_t locus)
+{
+#ifdef USE_MAPPED_LOCATION
+ if (GIMPLE_STMT_P (node))
+ GIMPLE_STMT_LOCUS (node) = locus;
+ else
+ EXPR_CHECK (node)->exp.locus = locus;
+#else
+ annotate_with_locus (node, locus);
+#endif
+}
+
+bool
+expr_has_location (tree node)
+{
+#ifdef USE_MAPPED_LOCATION
+ return expr_location (node) != UNKNOWN_LOCATION;
+#else
+ return expr_locus (node) != NULL;
+#endif
+}
+
+#ifdef USE_MAPPED_LOCATION
+source_location *
+#else
+source_locus
+#endif
+expr_locus (tree node)
+{
+#ifdef USE_MAPPED_LOCATION
+ if (GIMPLE_STMT_P (node))
+ return &GIMPLE_STMT_LOCUS (node);
+ return EXPR_P (node) ? &node->exp.locus : (location_t *) NULL;
+#else
+ if (GIMPLE_STMT_P (node))
+ return GIMPLE_STMT_LOCUS (node);
+ /* ?? The cast below was originally "(location_t *)" in the macro,
+ but that makes no sense. ?? */
+ return EXPR_P (node) ? node->exp.locus : (source_locus) NULL;
+#endif
+}
+
+void
+set_expr_locus (tree node,
+#ifdef USE_MAPPED_LOCATION
+ source_location *loc
+#else
+ source_locus loc
+#endif
+ )
+{
+#ifdef USE_MAPPED_LOCATION
+ if (loc == NULL)
+ {
+ if (GIMPLE_STMT_P (node))
+ GIMPLE_STMT_LOCUS (node) = UNKNOWN_LOCATION;
+ else
+ EXPR_CHECK (node)->exp.locus = UNKNOWN_LOCATION;
+ }
+ else
+ {
+ if (GIMPLE_STMT_P (node))
+ GIMPLE_STMT_LOCUS (node) = *loc;
+ else
+ EXPR_CHECK (node)->exp.locus = *loc;
+ }
+#else
+ if (GIMPLE_STMT_P (node))
+ GIMPLE_STMT_LOCUS (node) = loc;
+ else
+ EXPR_CHECK (node)->exp.locus = loc;
+#endif
+}
+
+const char **
+expr_filename (tree node)
+{
+#ifdef USE_MAPPED_LOCATION
+ if (GIMPLE_STMT_P (node))
+ return &LOCATION_FILE (GIMPLE_STMT_LOCUS (node));
+ return &LOCATION_FILE (EXPR_CHECK (node)->exp.locus);
+#else
+ if (GIMPLE_STMT_P (node))
+ return &GIMPLE_STMT_LOCUS (node)->file;
+ return &(EXPR_CHECK (node)->exp.locus->file);
+#endif
+}
+
+int *
+expr_lineno (tree node)
+{
+#ifdef USE_MAPPED_LOCATION
+ if (GIMPLE_STMT_P (node))
+ return &LOCATION_LINE (GIMPLE_STMT_LOCUS (node));
+ return &LOCATION_LINE (EXPR_CHECK (node)->exp.locus);
+#else
+ if (GIMPLE_STMT_P (node))
+ return &GIMPLE_STMT_LOCUS (node)->line;
+ return &EXPR_CHECK (node)->exp.locus->line;
+#endif
+}
+\f
/* Return a declaration like DDECL except that its DECL_ATTRIBUTES
is ATTRIBUTE. */
/* FALLTHRU */
default:
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
+ || IS_GIMPLE_STMT_CODE_CLASS (TREE_CODE_CLASS (code)))
{
int i, len;
if (len)
{
for (i = 0; i < len - 1; ++i)
- WALK_SUBTREE (TREE_OPERAND (*tp, i));
- WALK_SUBTREE_TAIL (TREE_OPERAND (*tp, len - 1));
+ WALK_SUBTREE (GENERIC_TREE_OPERAND (*tp, i));
+ WALK_SUBTREE_TAIL (GENERIC_TREE_OPERAND (*tp, len - 1));
}
}
-
/* If this is a type, walk the needed fields in the type. */
else if (TYPE_P (*tp))
return walk_type_fields (*tp, func, data, pset);
return true;
}
+tree *
+tree_block (tree t)
+{
+ char const c = TREE_CODE_CLASS (TREE_CODE (t));
+
+ if (IS_EXPR_CODE_CLASS (c))
+ return &t->exp.block;
+ else if (IS_GIMPLE_STMT_CODE_CLASS (c))
+ return &GIMPLE_STMT_BLOCK (t);
+ gcc_unreachable ();
+ return NULL;
+}
+
+tree *
+generic_tree_operand (tree node, int i)
+{
+ if (GIMPLE_STMT_P (node))
+ return &GIMPLE_STMT_OPERAND (node, i);
+ return &TREE_OPERAND (node, i);
+}
+
+tree *
+generic_tree_type (tree node)
+{
+ if (GIMPLE_STMT_P (node))
+ return &void_type_node;
+ return &TREE_TYPE (node);
+}
+
#include "gt-tree.h"
Operand 1 is an integer shift amount in bits. */
DEFTREECODE (VEC_LSHIFT_EXPR, "vec_lshift_expr", tcc_binary, 2)
DEFTREECODE (VEC_RSHIFT_EXPR, "vec_rshift_expr", tcc_binary, 2)
+\f
+/* GIMPLE tree codes. */
+
+/* Assignment expression. Operand 0 is the what to set; 1, the new value. */
+DEFTREECODE (GIMPLE_MODIFY_STMT, "gimple_modify_stmt", tcc_gimple_stmt, 2)
/* Widening vector multiplication.
The two operands are vectors with N elements of size S. Multiplying the
tcc_binary, /* A binary arithmetic expression. */
tcc_statement, /* A statement expression, which have side effects
but usually no interesting value. */
- tcc_expression /* Any other expression. */
+ tcc_expression, /* Any other expression. */
+ tcc_gimple_stmt /* A GIMPLE statement. */
};
/* Each tree code class has an associated string representation.
#define IS_EXPR_CODE_CLASS(CLASS)\
((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
+/* Returns nonzer iff CLASS is a GIMPLE statement. */
+
+#define IS_GIMPLE_STMT_CODE_CLASS(CLASS) ((CLASS) == tcc_gimple_stmt)
+
/* Returns nonzero iff NODE is an expression of some kind. */
#define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
fields. */
union tree_ann_d;
-struct tree_common GTY(())
+struct tree_base GTY(())
{
- tree chain;
- tree type;
- union tree_ann_d *ann;
-
ENUM_BITFIELD(tree_code) code : 8;
unsigned side_effects_flag : 1;
unsigned lang_flag_5 : 1;
unsigned lang_flag_6 : 1;
unsigned visited : 1;
+
+ /* FIXME tuples: Eventually, we need to move this somewhere external to
+ the trees. */
+ union tree_ann_d *ann;
+};
+
+struct tree_common GTY(())
+{
+ struct tree_base base;
+ tree chain;
+ tree type;
+};
+
+/* GIMPLE_MODIFY_STMT */
+struct gimple_stmt GTY(())
+{
+ struct tree_base base;
+ source_locus locus;
+ tree block;
+ /* FIXME tuples: Eventually this should be of type ``struct gimple_expr''. */
+ tree GTY ((length ("TREE_CODE_LENGTH (TREE_CODE (&%h))"))) operands[1];
};
/* The following table lists the uses of each of the above flags and
/* The tree-code says what kind of node it is.
Codes are defined in tree.def. */
-#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
-#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
+#define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
+#define TREE_SET_CODE(NODE, VALUE) ((NODE)->base.code = (VALUE))
/* When checking is enabled, errors will be generated if a tree node
is accessed incorrectly. The macros die with a fatal error. */
__FUNCTION__); \
__t; })
+#define GIMPLE_STMT_CHECK(T) __extension__ \
+({ const tree __t = (T); \
+ char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
+ if (!IS_GIMPLE_STMT_CODE_CLASS (__c)) \
+ tree_class_check_failed (__t, tcc_gimple_stmt, __FILE__, __LINE__,\
+ __FUNCTION__); \
+ __t; })
+
/* These checks have to be special cased. */
#define NON_TYPE_CHECK(T) __extension__ \
({ const tree __t = (T); \
#define TREE_OPERAND_CHECK(T, I) __extension__ \
(*({const tree __t = EXPR_CHECK (T); \
const int __i = (I); \
+ if (GIMPLE_TUPLE_P (__t)) \
+ gcc_unreachable (); \
if (__i < 0 || __i >= TREE_CODE_LENGTH (TREE_CODE (__t))) \
tree_operand_check_failed (__i, TREE_CODE (__t), \
__FILE__, __LINE__, __FUNCTION__); \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
+/* Special checks for GIMPLE_STMT_OPERANDs. */
+#define GIMPLE_STMT_OPERAND_CHECK(T, I) __extension__ \
+(*({const tree __t = GIMPLE_STMT_CHECK (T); \
+ const int __i = (I); \
+ if (__i < 0 || __i >= TREE_CODE_LENGTH (TREE_CODE (__t))) \
+ tree_operand_check_failed (__i, TREE_CODE (__t), \
+ __FILE__, __LINE__, __FUNCTION__); \
+ &__t->gstmt.operands[__i]; }))
+
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
(*(rtx *) \
({const tree __t = (T); \
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
+/* Nodes are chained together for many purposes.
+ Types are chained together to record them for being output to the debugger
+ (see the function `chain_type').
+ Decls in the same scope are chained together to record the contents
+ of the scope.
+ Statement nodes for successive statements used to be chained together.
+ Often lists of things are represented by TREE_LIST nodes that
+ are chained together. */
+
+#define TREE_CHAIN(NODE) __extension__ \
+(*({const tree __t = (NODE); \
+ if (GIMPLE_TUPLE_P (__t)) \
+ gcc_unreachable (); \
+ &__t->common.chain; }))
+
+/* In all nodes that are expressions, this is the data type of the expression.
+ In POINTER_TYPE nodes, this is the type that the pointer points to.
+ In ARRAY_TYPE nodes, this is the type of the elements.
+ In VECTOR_TYPE nodes, this is the type of the elements. */
+#define TREE_TYPE(NODE) __extension__ \
+(*({const tree __t = (NODE); \
+ if (GIMPLE_TUPLE_P (__t)) \
+ gcc_unreachable (); \
+ &__t->common.type; }))
+
extern void tree_contains_struct_check_failed (const tree,
const enum tree_node_structure_enum,
const char *, int, const char *)
#define TREE_CLASS_CHECK(T, CODE) (T)
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
+#define GIMPLE_STMT_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
+#define GIMPLE_STMT_OPERAND_CHECK(T, I) ((T)->gstmt.operands[I])
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
+#define TREE_CHAIN(NODE) ((NODE)->common.chain)
+#define TREE_TYPE(NODE) ((NODE)->common.type)
+
#endif
-#define TREE_BLOCK(NODE) (EXPR_CHECK (NODE)->exp.block)
+#define TREE_BLOCK(NODE) *(tree_block (NODE))
#include "tree-check.h"
#define NUMERICAL_TYPE_CHECK(T) \
TREE_CHECK4 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE)
-/* In all nodes that are expressions, this is the data type of the expression.
- In POINTER_TYPE nodes, this is the type that the pointer points to.
- In ARRAY_TYPE nodes, this is the type of the elements.
- In VECTOR_TYPE nodes, this is the type of the elements. */
-#define TREE_TYPE(NODE) ((NODE)->common.type)
+/* Nonzero if NODE is a GIMPLE statement. */
+#define GIMPLE_STMT_P(NODE) \
+ (TREE_CODE_CLASS (TREE_CODE ((NODE))) == tcc_gimple_stmt)
+
+/* Nonzero if NODE is a GIMPLE tuple. */
+#define GIMPLE_TUPLE_P(NODE) (GIMPLE_STMT_P (NODE))
+
+/* A GIMPLE tuple that has a ``locus'' field. */
+#define GIMPLE_TUPLE_HAS_LOCUS_P(NODE) GIMPLE_STMT_P ((NODE))
+
+/* Like TREE_OPERAND but works with GIMPLE stmt tuples as well.
+
+ If you know the NODE is a GIMPLE statement, use GIMPLE_STMT_OPERAND. If the
+ NODE code is unknown at compile time, use this macro. */
+#define GENERIC_TREE_OPERAND(NODE, I) *(generic_tree_operand ((NODE), (I)))
+
+/* Like TREE_TYPE but returns void_type_node for gimple tuples that have
+ no type. */
+
+#define GENERIC_TREE_TYPE(NODE) *(generic_tree_type ((NODE)))
/* Here is how primitive or already-canonicalized types' hash codes
are made. */
used in hash tables which are saved to a PCH. */
#define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
-/* Nodes are chained together for many purposes.
- Types are chained together to record them for being output to the debugger
- (see the function `chain_type').
- Decls in the same scope are chained together to record the contents
- of the scope.
- Statement nodes for successive statements used to be chained together.
- Often lists of things are represented by TREE_LIST nodes that
- are chained together. */
-
-#define TREE_CHAIN(NODE) ((NODE)->common.chain)
-
/* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs
that don't change the machine mode. */
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
- == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
+ == TYPE_MODE (GENERIC_TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
(EXP) = TREE_OPERAND (EXP, 0)
/* Like STRIP_NOPS, but don't let the signedness change either. */
object cannot go into register parameters, for example.
In IDENTIFIER_NODEs, this means that some extern decl for this name
had its address taken. That matters for inline functions. */
-#define TREE_ADDRESSABLE(NODE) ((NODE)->common.addressable_flag)
+#define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
/* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
exit of a function. Calls for which this is true are candidates for tail
call optimizations. */
-#define CALL_EXPR_TAILCALL(NODE) (CALL_EXPR_CHECK(NODE)->common.addressable_flag)
+#define CALL_EXPR_TAILCALL(NODE) \
+ (CALL_EXPR_CHECK(NODE)->base.addressable_flag)
/* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
CASE_LOW operand has been processed. */
#define CASE_LOW_SEEN(NODE) \
- (CASE_LABEL_EXPR_CHECK (NODE)->common.addressable_flag)
+ (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag)
/* In a VAR_DECL, nonzero means allocate static storage.
In a FUNCTION_DECL, nonzero if function has been defined.
??? This is also used in lots of other nodes in unclear ways which
should be cleaned up some day. */
-#define TREE_STATIC(NODE) ((NODE)->common.static_flag)
+#define TREE_STATIC(NODE) ((NODE)->base.static_flag)
/* In a TARGET_EXPR, WITH_CLEANUP_EXPR, means that the pertinent cleanup
should only be executed if an exception is thrown, not on normal exit
of its scope. */
-#define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
+#define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
/* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
CASE_HIGH operand has been processed. */
#define CASE_HIGH_SEEN(NODE) \
- (CASE_LABEL_EXPR_CHECK (NODE)->common.static_flag)
+ (CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
/* In an expr node (usually a conversion) this means the node was made
implicitly and should not lead to any sort of warning. In a decl node,
warnings concerning the decl should be suppressed. This is used at
least for used-before-set warnings, and it set after one warning is
emitted. */
-#define TREE_NO_WARNING(NODE) ((NODE)->common.nowarning_flag)
+#define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST this means
there was an overflow in folding. This is distinct from
TREE_OVERFLOW because ANSI C requires a diagnostic when overflows
occur in constant expressions. */
-#define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->common.static_flag)
+#define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->base.static_flag)
/* In an IDENTIFIER_NODE, this means that assemble_name was called with
this string as an argument. */
#define TREE_SYMBOL_REFERENCED(NODE) \
- (IDENTIFIER_NODE_CHECK (NODE)->common.static_flag)
+ (IDENTIFIER_NODE_CHECK (NODE)->base.static_flag)
/* Nonzero in a pointer or reference type means the data pointed to
by this type can alias anything. */
#define TYPE_REF_CAN_ALIAS_ALL(NODE) \
- (PTR_OR_REF_CHECK (NODE)->common.static_flag)
+ (PTR_OR_REF_CHECK (NODE)->base.static_flag)
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
there was an overflow in folding, and no warning has been issued
for this subexpression. TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
but not vice versa. */
-#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.public_flag)
+#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)
/* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
nonzero means name is to be accessible from outside this module.
In an IDENTIFIER_NODE, nonzero means an external declaration
accessible from outside this module was previously seen
for this name in an inner scope. */
-#define TREE_PUBLIC(NODE) ((NODE)->common.public_flag)
+#define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
/* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
of cached values, or is something else. */
-#define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->common.public_flag)
+#define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->base.public_flag)
/* In a SAVE_EXPR, indicates that the original expression has already
been substituted with a VAR_DECL that contains the value. */
#define SAVE_EXPR_RESOLVED_P(NODE) \
- (TREE_CHECK (NODE, SAVE_EXPR)->common.public_flag)
+ (TREE_CHECK (NODE, SAVE_EXPR)->base.public_flag)
/* In any expression, decl, or constant, nonzero means it has side effects or
reevaluation of the whole expression could produce a different value.
reference to a volatile variable. In a ..._DECL, this is set only if the
declaration said `volatile'. This will never be set for a constant. */
#define TREE_SIDE_EFFECTS(NODE) \
- (NON_TYPE_CHECK (NODE)->common.side_effects_flag)
+ (NON_TYPE_CHECK (NODE)->base.side_effects_flag)
/* In a LABEL_DECL, nonzero means this label had its address taken
and therefore can never be deleted and is a jump target for
computed gotos. */
-#define FORCED_LABEL(NODE) ((NODE)->common.side_effects_flag)
+#define FORCED_LABEL(NODE) ((NODE)->base.side_effects_flag)
/* Nonzero means this expression is volatile in the C sense:
its address should be of type `volatile WHATEVER *'.
because eventually we may make that a different bit.
If this bit is set in an expression, so is TREE_SIDE_EFFECTS. */
-#define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag)
+#define TREE_THIS_VOLATILE(NODE) ((NODE)->base.volatile_flag)
/* Nonzero means this node will not trap. In an INDIRECT_REF, means
accessing the memory pointed to won't generate a trap. However,
(or slice of the array) always belongs to the range of the array.
I.e. that the access will not trap, provided that the access to
the base to the array will not trap. */
-#define TREE_THIS_NOTRAP(NODE) ((NODE)->common.nothrow_flag)
+#define TREE_THIS_NOTRAP(NODE) ((NODE)->base.nothrow_flag)
/* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
nonzero means it may not be the lhs of an assignment. */
-#define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->common.readonly_flag)
+#define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
/* Nonzero if NODE is a _DECL with TREE_READONLY set. */
#define TREE_READONLY_DECL_P(NODE)\
/* Value of expression is constant. Always on in all ..._CST nodes. May
also appear in an expression or decl where the value is constant. */
-#define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->common.constant_flag)
+#define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->base.constant_flag)
/* Nonzero if NODE, a type, has had its sizes gimplified. */
-#define TYPE_SIZES_GIMPLIFIED(NODE) (TYPE_CHECK (NODE)->common.constant_flag)
+#define TYPE_SIZES_GIMPLIFIED(NODE) \
+ (TYPE_CHECK (NODE)->base.constant_flag)
/* In a decl (most significantly a FIELD_DECL), means an unsigned field. */
-#define DECL_UNSIGNED(NODE) (DECL_COMMON_CHECK (NODE)->common.unsigned_flag)
+#define DECL_UNSIGNED(NODE) \
+ (DECL_COMMON_CHECK (NODE)->base.unsigned_flag)
/* In a BIT_FIELD_REF, means the bitfield is to be interpreted as unsigned. */
#define BIT_FIELD_REF_UNSIGNED(NODE) \
- (BIT_FIELD_REF_CHECK (NODE)->common.unsigned_flag)
+ (BIT_FIELD_REF_CHECK (NODE)->base.unsigned_flag)
/* In integral and pointer types, means an unsigned type. */
-#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)
+#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.unsigned_flag)
#define TYPE_TRAP_SIGNED(NODE) \
(flag_trapv && ! TYPE_UNSIGNED (NODE))
In a BLOCK node, nonzero if reorder_blocks has already seen this block.
In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
PHI node. */
-#define TREE_ASM_WRITTEN(NODE) ((NODE)->common.asm_written_flag)
+#define TREE_ASM_WRITTEN(NODE) ((NODE)->base.asm_written_flag)
/* Nonzero in a _DECL if the name is used in its scope.
Nonzero in an expr node means inhibit warning if value is unused.
In IDENTIFIER_NODEs, this means that some extern decl for this name
was used.
In a BLOCK, this means that the block contains variables that are used. */
-#define TREE_USED(NODE) ((NODE)->common.used_flag)
+#define TREE_USED(NODE) ((NODE)->base.used_flag)
/* In a FUNCTION_DECL, nonzero means a call to the function cannot throw
an exception. In a CALL_EXPR, nonzero means the call cannot throw. */
-#define TREE_NOTHROW(NODE) ((NODE)->common.nothrow_flag)
+#define TREE_NOTHROW(NODE) ((NODE)->base.nothrow_flag)
/* In a CALL_EXPR, means that it's safe to use the target of the call
expansion as the return slot for a call that returns in memory. */
-#define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->common.private_flag)
+#define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->base.private_flag)
/* In a RESULT_DECL or PARM_DECL, means that it is passed by invisible
reference (and the TREE_TYPE is a pointer to the true type). */
-#define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->common.private_flag)
+#define DECL_BY_REFERENCE(NODE) \
+ (DECL_COMMON_CHECK (NODE)->base.private_flag)
/* In a CALL_EXPR, means that the call is the jump from a thunk to the
thunked-to function. */
-#define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->common.protected_flag)
+#define CALL_FROM_THUNK_P(NODE) \
+ (CALL_EXPR_CHECK (NODE)->base.protected_flag)
/* In a type, nonzero means that all objects of the type are guaranteed by the
language or front-end to be properly aligned, so we can indicate that a MEM
In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
freelist. */
-#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->common.nothrow_flag)
+#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
/* Used in classes in C++. */
-#define TREE_PRIVATE(NODE) ((NODE)->common.private_flag)
+#define TREE_PRIVATE(NODE) ((NODE)->base.private_flag)
/* Used in classes in C++.
In a BLOCK node, this is BLOCK_HANDLER_BLOCK. */
-#define TREE_PROTECTED(NODE) ((NODE)->common.protected_flag)
+#define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
/* Nonzero in a _DECL if the use of the name is defined as a
deprecated feature by __attribute__((deprecated)). */
#define TREE_DEPRECATED(NODE) \
- ((NODE)->common.deprecated_flag)
+ ((NODE)->base.deprecated_flag)
/* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
uses are to be substituted for uses of the TREE_CHAINed identifier. */
#define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
- (IDENTIFIER_NODE_CHECK (NODE)->common.deprecated_flag)
+ (IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
/* Value of expression is function invariant. A strict subset of
TREE_CONSTANT, such an expression is constant over any one function
invocation, though not across different invocations. May appear in
any expression node. */
-#define TREE_INVARIANT(NODE) ((NODE)->common.invariant_flag)
+#define TREE_INVARIANT(NODE) ((NODE)->base.invariant_flag)
/* These flags are available for each language front end to use internally. */
-#define TREE_LANG_FLAG_0(NODE) ((NODE)->common.lang_flag_0)
-#define TREE_LANG_FLAG_1(NODE) ((NODE)->common.lang_flag_1)
-#define TREE_LANG_FLAG_2(NODE) ((NODE)->common.lang_flag_2)
-#define TREE_LANG_FLAG_3(NODE) ((NODE)->common.lang_flag_3)
-#define TREE_LANG_FLAG_4(NODE) ((NODE)->common.lang_flag_4)
-#define TREE_LANG_FLAG_5(NODE) ((NODE)->common.lang_flag_5)
-#define TREE_LANG_FLAG_6(NODE) ((NODE)->common.lang_flag_6)
+#define TREE_LANG_FLAG_0(NODE) ((NODE)->base.lang_flag_0)
+#define TREE_LANG_FLAG_1(NODE) ((NODE)->base.lang_flag_1)
+#define TREE_LANG_FLAG_2(NODE) ((NODE)->base.lang_flag_2)
+#define TREE_LANG_FLAG_3(NODE) ((NODE)->base.lang_flag_3)
+#define TREE_LANG_FLAG_4(NODE) ((NODE)->base.lang_flag_4)
+#define TREE_LANG_FLAG_5(NODE) ((NODE)->base.lang_flag_5)
+#define TREE_LANG_FLAG_6(NODE) ((NODE)->base.lang_flag_6)
\f
/* Define additional fields and accessors for nodes representing constants. */
#define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
+/* In gimple statements. */
+#define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I)
+#define GIMPLE_STMT_LOCUS(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.locus)
+#define GIMPLE_STMT_BLOCK(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.block)
+
/* In a LOOP_EXPR node. */
#define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
-#ifdef USE_MAPPED_LOCATION
/* The source location of this expression. Non-tree_exp nodes such as
decls and constants can be shared among multiple locations, so
return nothing. */
-#define EXPR_LOCATION(NODE) \
- (EXPR_P (NODE) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
-#define SET_EXPR_LOCATION(NODE, FROM) \
- (EXPR_CHECK (NODE)->exp.locus = (FROM))
-#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
-/* EXPR_LOCUS and SET_EXPR_LOCUS are deprecated. */
-#define EXPR_LOCUS(NODE) \
- (EXPR_P (NODE) ? &(NODE)->exp.locus : (location_t *)NULL)
-#define SET_EXPR_LOCUS(NODE, FROM) \
- do { source_location *loc_tmp = FROM; \
- EXPR_CHECK (NODE)->exp.locus \
- = loc_tmp == NULL ? UNKNOWN_LOCATION : *loc_tmp; } while (0)
-#define EXPR_FILENAME(NODE) \
- LOCATION_FILE (EXPR_CHECK (NODE)->exp.locus)
-#define EXPR_LINENO(NODE) \
- LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
-#else
-/* The source location of this expression. Non-tree_exp nodes such as
- decls and constants can be shared among multiple locations, so
- return nothing. */
-#define EXPR_LOCUS(NODE) \
- (EXPR_P (NODE) ? (NODE)->exp.locus : (location_t *)NULL)
-#define SET_EXPR_LOCUS(NODE, FROM) \
- (EXPR_CHECK (NODE)->exp.locus = (FROM))
-#define SET_EXPR_LOCATION(NODE, FROM) annotate_with_locus (NODE, FROM)
-#define EXPR_FILENAME(NODE) \
- (EXPR_CHECK (NODE)->exp.locus->file)
-#define EXPR_LINENO(NODE) \
- (EXPR_CHECK (NODE)->exp.locus->line)
-#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCUS (NODE) != NULL)
-#define EXPR_LOCATION(NODE) \
- (EXPR_HAS_LOCATION(NODE) ? *(NODE)->exp.locus : UNKNOWN_LOCATION)
-#endif
+#define EXPR_LOCATION(NODE) expr_location ((NODE))
+#define SET_EXPR_LOCATION(NODE, FROM) set_expr_location ((NODE), (FROM))
+#define EXPR_HAS_LOCATION(NODE) expr_has_location ((NODE))
+#define EXPR_LOCUS(NODE) expr_locus ((NODE))
+#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM))
+#define EXPR_FILENAME(NODE) *(expr_filename ((NODE)))
+#define EXPR_LINENO(NODE) *(expr_lineno ((NODE)))
+
+/* True if a tree is an expression or statement that can have a
+ location. */
+#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE) || GIMPLE_STMT_P (NODE))
/* In a TARGET_EXPR node. */
#define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
never output, so we can safely use the ASM_WRITTEN_FLAG for this
status bit. */
#define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
- SSA_NAME_CHECK (NODE)->common.asm_written_flag
+ SSA_NAME_CHECK (NODE)->base.asm_written_flag
/* Nonzero if this SSA_NAME expression is currently on the free list of
SSA_NAMES. Using NOTHROW_FLAG seems reasonably safe since throwing
has no meaning for an SSA_NAME. */
#define SSA_NAME_IN_FREE_LIST(NODE) \
- SSA_NAME_CHECK (NODE)->common.nothrow_flag
+ SSA_NAME_CHECK (NODE)->base.nothrow_flag
/* Attributes for SSA_NAMEs for pointer-type variables. */
#define SSA_NAME_PTR_INFO(N) \
(FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag)
/* Nonzero in a type considered volatile as a whole. */
-#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->common.volatile_flag)
+#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
/* Means this type is const-qualified. */
-#define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->common.readonly_flag)
+#define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
/* If nonzero, this type is `restrict'-qualified, in the C sense of
the term. */
/* Used to keep track of visited nodes in tree traversals. This is set to
0 by copy_node and make_node. */
-#define TREE_VISITED(NODE) ((NODE)->common.visited)
+#define TREE_VISITED(NODE) ((NODE)->base.visited)
/* If set in an ARRAY_TYPE, indicates a string type (for languages
that distinguish string from array of char).
/* BINFO specific flags. */
/* Nonzero means that the derivation chain is via a `virtual' declaration. */
-#define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->common.static_flag)
+#define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->base.static_flag)
/* Flags for language dependent use. */
#define BINFO_MARKED(NODE) TREE_LANG_FLAG_0(TREE_BINFO_CHECK(NODE))
union tree_node GTY ((ptr_alias (union lang_tree_node),
desc ("tree_node_structure (&%h)")))
{
+ struct tree_base GTY ((tag ("TS_BASE"))) base;
struct tree_common GTY ((tag ("TS_COMMON"))) common;
struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
struct tree_block GTY ((tag ("TS_BLOCK"))) block;
struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
+ struct gimple_stmt GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt;
struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
#define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO)
extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
#define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO)
+extern tree build2_gimple_stat (enum tree_code, tree, tree MEM_STAT_DECL);
+#define build2_gimple(c,t1,t2) build2_gimple_stat (c,t1,t2 MEM_STAT_INFO)
extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
#define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO)
extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
extern bool fields_compatible_p (tree, tree);
extern tree find_compatible_field (tree, tree);
+extern location_t expr_location (tree);
+extern void set_expr_location (tree, location_t);
+extern bool expr_has_location (tree);
+extern
+#ifdef USE_MAPPED_LOCATION
+source_location *
+#else
+source_locus
+#endif
+expr_locus (tree);
+extern void set_expr_locus (tree,
+#ifdef USE_MAPPED_LOCATION
+ source_location *loc
+#else
+ source_locus loc
+#endif
+ );
+extern const char **expr_filename (tree);
+extern int *expr_lineno (tree);
+extern tree *tree_block (tree);
+extern tree *generic_tree_operand (tree, int);
+extern tree *generic_tree_type (tree);
+
/* In function.c */
extern void expand_main_function (void);
extern void init_dummy_function_start (void);
lang_decl,
lang_type,
omp_clause_kind,
+ gimple_stmt_kind,
all_kinds
} tree_node_kind;
tree_node for garbage collection purposes, as well as specifying what structures
contain what other structures in the tree_contains_struct array. */
+DEFTREESTRUCT(TS_BASE, "base")
DEFTREESTRUCT(TS_COMMON, "common")
DEFTREESTRUCT(TS_INT_CST, "integer cst")
DEFTREESTRUCT(TS_REAL_CST, "real cst")
DEFTREESTRUCT(TS_BLOCK, "block")
DEFTREESTRUCT(TS_BINFO, "binfo")
DEFTREESTRUCT(TS_STATEMENT_LIST, "statement list")
+DEFTREESTRUCT(TS_GIMPLE_STATEMENT, "gimple statement")
DEFTREESTRUCT(TS_VALUE_HANDLE, "value handle")
DEFTREESTRUCT(TS_CONSTRUCTOR, "constructor")
DEFTREESTRUCT(TS_MEMORY_TAG, "memory tag")
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (MODIFY_EXPR, optype, tmpv, fold_convert (optype, value));
- stmt2 = build2 (MODIFY_EXPR, optype, tmp1, op2);
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmpv,
+ fold_convert (optype, value));
+ stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1, op2);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
build1 (GOTO_EXPR, void_type_node, label_decl2),
tmp2 = create_tmp_var (optype, "PROF");
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (MODIFY_EXPR, optype, tmp2,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
build2 (TREE_CODE (operation), optype, op1, tmpv));
bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb2end = stmt1;
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (MODIFY_EXPR, optype, tmp2,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
build2 (TREE_CODE (operation), optype, op1, op2));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
modify = stmt;
if (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)
modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != MODIFY_EXPR)
+ if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
return false;
- op = TREE_OPERAND (modify, 1);
+ op = GIMPLE_STMT_OPERAND (modify, 1);
if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
return false;
code = TREE_CODE (op);
print_generic_stmt (dump_file, stmt, TDF_SLIM);
}
- TREE_OPERAND (modify, 1) = result;
+ GIMPLE_STMT_OPERAND (modify, 1) = result;
return true;
}
tmp2 = create_tmp_var (optype, "PROF");
tmp3 = create_tmp_var (optype, "PROF");
- stmt2 = build2 (MODIFY_EXPR, optype, tmp2,
+ stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp2,
build2 (PLUS_EXPR, optype, op2, build_int_cst (optype, -1)));
- stmt3 = build2 (MODIFY_EXPR, optype, tmp3,
+ stmt3 = build2 (GIMPLE_MODIFY_STMT, optype, tmp3,
build2 (BIT_AND_EXPR, optype, tmp2, op2));
stmt4 = build3 (COND_EXPR, void_type_node,
build2 (NE_EXPR, boolean_type_node,
/* tmp2 == op2-1 inherited from previous block */
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (MODIFY_EXPR, optype, result,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
build2 (BIT_AND_EXPR, optype, op1, tmp2));
bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
bb2end = stmt1;
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (MODIFY_EXPR, optype, result,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
build2 (TREE_CODE (operation), optype, op1, op2));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
modify = stmt;
if (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)
modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != MODIFY_EXPR)
+ if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
return false;
- op = TREE_OPERAND (modify, 1);
+ op = GIMPLE_STMT_OPERAND (modify, 1);
if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
return false;
code = TREE_CODE (op);
result = tree_mod_pow2 (stmt, op, op1, op2, prob, count, all);
- TREE_OPERAND (modify, 1) = result;
+ GIMPLE_STMT_OPERAND (modify, 1) = result;
return true;
}
bsi = bsi_for_stmt (stmt);
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build2 (MODIFY_EXPR, optype, result, op1);
- stmt2 = build2 (MODIFY_EXPR, optype, tmp1, op2);
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result, op1);
+ stmt2 = build2 (GIMPLE_MODIFY_STMT, optype, tmp1, op2);
stmt3 = build3 (COND_EXPR, void_type_node,
build2 (LT_EXPR, boolean_type_node, result, tmp1),
build1 (GOTO_EXPR, void_type_node, label_decl3),
if (ncounts) /* Assumed to be 0 or 1 */
{
label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build2 (MODIFY_EXPR, optype, result,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
build2 (MINUS_EXPR, optype, result, tmp1));
stmt2 = build3 (COND_EXPR, void_type_node,
build2 (LT_EXPR, boolean_type_node, result, tmp1),
/* Fallback case. */
label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build2 (MODIFY_EXPR, optype, result,
+ stmt1 = build2 (GIMPLE_MODIFY_STMT, optype, result,
build2 (TREE_CODE (operation), optype, result, tmp1));
bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
modify = stmt;
if (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)
modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != MODIFY_EXPR)
+ if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
return false;
- op = TREE_OPERAND (modify, 1);
+ op = GIMPLE_STMT_OPERAND (modify, 1);
if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
return false;
code = TREE_CODE (op);
histogram->hvalue.counters[0],
histogram->hvalue.counters[1], all);
- TREE_OPERAND (modify, 1) = result;
+ GIMPLE_STMT_OPERAND (modify, 1) = result;
return true;
}
assign = stmt;
if (!assign
- || TREE_CODE (assign) != MODIFY_EXPR)
+ || TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
return;
- lhs = TREE_OPERAND (assign, 0);
+ lhs = GIMPLE_STMT_OPERAND (assign, 0);
type = TREE_TYPE (lhs);
if (!INTEGRAL_TYPE_P (type))
return;
- rhs = TREE_OPERAND (assign, 1);
+ rhs = GIMPLE_STMT_OPERAND (assign, 1);
switch (TREE_CODE (rhs))
{
case TRUNC_DIV_EXPR: