GCC Middle and Back End API Reference
fold-const.h File Reference

Go to the source code of this file.

Data Structures

class  operand_compare
 

Macros

#define fold_unary(CODE, T1, T2)    fold_unary_loc (UNKNOWN_LOCATION, CODE, T1, T2)
 
#define fold_unary_ignore_overflow(CODE, T1, T2)    fold_unary_ignore_overflow_loc (UNKNOWN_LOCATION, CODE, T1, T2)
 
#define fold_binary(CODE, T1, T2, T3)    fold_binary_loc (UNKNOWN_LOCATION, CODE, T1, T2, T3)
 
#define fold_ternary(CODE, T1, T2, T3, T4)    fold_ternary_loc (UNKNOWN_LOCATION, CODE, T1, T2, T3, T4)
 
#define fold_build1(c, t1, t2)    fold_build1_loc (UNKNOWN_LOCATION, c, t1, t2 MEM_STAT_INFO)
 
#define fold_build2(c, t1, t2, t3)    fold_build2_loc (UNKNOWN_LOCATION, c, t1, t2, t3 MEM_STAT_INFO)
 
#define fold_build3(c, t1, t2, t3, t4)    fold_build3_loc (UNKNOWN_LOCATION, c, t1, t2, t3, t4 MEM_STAT_INFO)
 
#define fold_build_call_array(T1, T2, N, T4)    fold_build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T4)
 
#define fold_build_call_array_initializer(T1, T2, N, T4)    fold_build_call_array_initializer_loc (UNKNOWN_LOCATION, T1, T2, N, T4)
 
#define fold_convert(T1, T2)    fold_convert_loc (UNKNOWN_LOCATION, T1, T2)
 
#define omit_one_operand(T1, T2, T3)    omit_one_operand_loc (UNKNOWN_LOCATION, T1, T2, T3)
 
#define omit_two_operands(T1, T2, T3, T4)    omit_two_operands_loc (UNKNOWN_LOCATION, T1, T2, T3, T4)
 
#define invert_truthvalue(T)    invert_truthvalue_loc (UNKNOWN_LOCATION, T)
 
#define build_fold_addr_expr(T)    build_fold_addr_expr_loc (UNKNOWN_LOCATION, (T))
 
#define build_fold_addr_expr_with_type(T, TYPE)    build_fold_addr_expr_with_type_loc (UNKNOWN_LOCATION, (T), TYPE)
 
#define build_fold_indirect_ref(T)    build_fold_indirect_ref_loc (UNKNOWN_LOCATION, T)
 
#define fold_indirect_ref(T)    fold_indirect_ref_loc (UNKNOWN_LOCATION, T)
 
#define build_simple_mem_ref(T)    build_simple_mem_ref_loc (UNKNOWN_LOCATION, T)
 
#define round_up(T, N)   round_up_loc (UNKNOWN_LOCATION, T, N)
 
#define round_down(T, N)   round_down_loc (UNKNOWN_LOCATION, T, N)
 
#define size_binop(CODE, T1, T2)    size_binop_loc (UNKNOWN_LOCATION, CODE, T1, T2)
 
#define size_diffop(T1, T2)    size_diffop_loc (UNKNOWN_LOCATION, T1, T2)
 
#define non_lvalue(T)   non_lvalue_loc (UNKNOWN_LOCATION, T)
 
#define convert_to_ptrofftype(t)   convert_to_ptrofftype_loc (UNKNOWN_LOCATION, t)
 
#define fold_build_pointer_plus(p, o)    fold_build_pointer_plus_loc (UNKNOWN_LOCATION, p, o)
 
#define fold_build_pointer_plus_hwi(p, o)    fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
 

Functions

int native_encode_expr (const_tree, unsigned char *, int, int off=-1)
 
int native_encode_initializer (tree, unsigned char *, int, int off=-1, unsigned char *=nullptr)
 
tree native_interpret_expr (tree, const unsigned char *, int)
 
tree native_interpret_real (tree, const unsigned char *, int)
 
bool can_native_interpret_type_p (tree)
 
tree native_interpret_aggregate (tree, const unsigned char *, int, int)
 
tree find_bitfield_repr_type (int, int)
 
void shift_bytes_in_array_left (unsigned char *, unsigned int, unsigned int)
 
void shift_bytes_in_array_right (unsigned char *, unsigned int, unsigned int)
 
tree fold (tree)
 
tree fold_init (tree)
 
tree fold_unary_loc (location_t, enum tree_code, tree, tree)
 
tree fold_unary_ignore_overflow_loc (location_t, enum tree_code, tree, tree)
 
tree fold_binary_loc (location_t, enum tree_code, tree, tree, tree)
 
tree fold_ternary_loc (location_t, enum tree_code, tree, tree, tree, tree)
 
tree fold_build1_loc (location_t, enum tree_code, tree, tree CXX_MEM_STAT_INFO)
 
tree fold_build2_loc (location_t, enum tree_code, tree, tree, tree CXX_MEM_STAT_INFO)
 
tree fold_build3_loc (location_t, enum tree_code, tree, tree, tree, tree CXX_MEM_STAT_INFO)
 
tree fold_build1_initializer_loc (location_t, enum tree_code, tree, tree)
 
tree fold_build2_initializer_loc (location_t, enum tree_code, tree, tree, tree)
 
tree fold_build_call_array_loc (location_t, tree, tree, int, tree *)
 
tree fold_build_call_array_initializer_loc (location_t, tree, tree, int, tree *)
 
tree fold_binary_initializer_loc (location_t, tree_code, tree, tree, tree)
 
tree get_array_ctor_element_at_index (tree, offset_int, unsigned *=NULL)
 
bool fold_convertible_p (const_tree, const_tree)
 
tree fold_convert_loc (location_t, tree, tree)
 
tree fold_ignored_result (tree)
 
tree fold_abs_const (tree, tree)
 
tree fold_indirect_ref_1 (location_t, tree, tree)
 
void fold_defer_overflow_warnings (void)
 
void fold_undefer_overflow_warnings (bool, const gimple *, int)
 
void fold_undefer_and_ignore_overflow_warnings (void)
 
bool fold_deferring_overflow_warnings_p (void)
 
void fold_overflow_warning (const char *, enum warn_strict_overflow_code)
 
enum tree_code fold_div_compare (enum tree_code, tree, tree, tree *, tree *, bool *)
 
bool operand_equal_p (const_tree, const_tree, unsigned int flags=0)
 
bool multiple_of_p (tree, const_tree, const_tree, bool=true)
 
tree omit_one_operand_loc (location_t, tree, tree, tree)
 
tree omit_two_operands_loc (location_t, tree, tree, tree, tree)
 
tree invert_truthvalue_loc (location_t, tree)
 
tree fold_unary_to_constant (enum tree_code, tree, tree)
 
tree fold_binary_to_constant (enum tree_code, tree, tree, tree)
 
tree fold_bit_and_mask (tree, tree, enum tree_code, tree, enum tree_code, tree, tree, tree, enum tree_code, tree, tree, tree *)
 
tree fold_read_from_constant_string (tree)
 
tree fold_read_from_vector (tree, poly_uint64)
 
bool wide_int_binop (wide_int &res, enum tree_code, const wide_int &arg1, const wide_int &arg2, signop, wi::overflow_type *)
 
tree int_const_binop (enum tree_code, const_tree, const_tree, int=1)
 
tree build_fold_addr_expr_loc (location_t, tree)
 
tree build_fold_addr_expr_with_type_loc (location_t, tree, tree)
 
tree fold_build_cleanup_point_expr (tree type, tree expr)
 
tree build_fold_indirect_ref_loc (location_t, tree)
 
tree fold_indirect_ref_loc (location_t, tree)
 
tree build_simple_mem_ref_loc (location_t, tree)
 
poly_offset_int mem_ref_offset (const_tree)
 
tree build_invariant_address (tree, tree, poly_int64)
 
tree constant_boolean_node (bool, tree)
 
tree div_if_zero_remainder (const_tree, const_tree)
 
bool tree_swap_operands_p (const_tree, const_tree)
 
enum tree_code swap_tree_comparison (enum tree_code)
 
bool ptr_difference_const (tree, tree, poly_int64 *)
 
enum tree_code invert_tree_comparison (enum tree_code, bool)
 
bool inverse_conditions_p (const_tree, const_tree)
 
bool tree_unary_nonzero_warnv_p (enum tree_code, tree, tree, bool *)
 
bool tree_binary_nonzero_warnv_p (enum tree_code, tree, tree, tree op1, bool *)
 
bool tree_single_nonzero_warnv_p (tree, bool *)
 
bool tree_unary_nonnegative_warnv_p (enum tree_code, tree, tree, bool *, int)
 
bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree, bool *, int)
 
bool tree_single_nonnegative_warnv_p (tree, bool *, int)
 
bool tree_call_nonnegative_warnv_p (tree, combined_fn, tree, tree, bool *, int)
 
bool integer_valued_real_unary_p (tree_code, tree, int)
 
bool integer_valued_real_binary_p (tree_code, tree, tree, int)
 
bool integer_valued_real_call_p (combined_fn, tree, tree, int)
 
bool integer_valued_real_single_p (tree, int)
 
bool integer_valued_real_p (tree, int=0)
 
bool fold_real_zero_addition_p (const_tree, const_tree, const_tree, int)
 
tree combine_comparisons (location_t, enum tree_code, enum tree_code, enum tree_code, tree, tree, tree)
 
void debug_fold_checksum (const_tree)
 
bool may_negate_without_overflow_p (const_tree)
 
tree round_up_loc (location_t, tree, unsigned int)
 
tree round_down_loc (location_t, tree, int)
 
tree size_int_kind (poly_int64, enum size_type_kind)
 
tree size_binop_loc (location_t, enum tree_code, tree, tree)
 
tree size_diffop_loc (location_t, tree, tree)
 
tree non_lvalue_loc (location_t, tree)
 
bool tree_expr_nonzero_p (tree)
 
bool tree_expr_nonnegative_p (tree)
 
bool tree_expr_nonnegative_warnv_p (tree, bool *, int=0)
 
bool tree_expr_finite_p (const_tree)
 
bool tree_expr_infinite_p (const_tree)
 
bool tree_expr_maybe_infinite_p (const_tree)
 
bool tree_expr_signaling_nan_p (const_tree)
 
bool tree_expr_maybe_signaling_nan_p (const_tree)
 
bool tree_expr_nan_p (const_tree)
 
bool tree_expr_maybe_nan_p (const_tree)
 
bool tree_expr_maybe_real_minus_zero_p (const_tree)
 
tree make_range (tree, int *, tree *, tree *, bool *)
 
tree make_range_step (location_t, enum tree_code, tree, tree, tree, tree *, tree *, int *, bool *)
 
tree range_check_type (tree)
 
tree build_range_check (location_t, tree, tree, int, tree, tree)
 
bool merge_ranges (int *, tree *, tree *, int, tree, tree, int, tree, tree)
 
tree sign_bit_p (tree, const_tree)
 
bool simple_condition_p (tree)
 
tree exact_inverse (tree, tree)
 
bool expr_not_equal_to (tree t, const wide_int &)
 
tree const_unop (enum tree_code, tree, tree)
 
tree const_binop (enum tree_code, tree, tree, tree)
 
bool negate_mathfn_p (combined_fn)
 
const chargetbyterep (tree, unsigned HOST_WIDE_INT *)
 
const charc_getstr (tree)
 
wide_int tree_nonzero_bits (const_tree)
 
int address_compare (tree_code, tree, tree, tree, tree &, tree &, poly_int64 &, poly_int64 &, bool)
 
tree ctor_single_nonzero_element (const_tree)
 
tree convert_to_ptrofftype_loc (location_t loc, tree off)
 
tree fold_build_pointer_plus_loc (location_t loc, tree ptr, tree off)
 
tree fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE_INT off)
 
tree_code minmax_from_comparison (tree_code, tree, tree, tree, tree)
 
void clear_type_padding_in_mask (tree, unsigned char *)
 
bool clear_padding_type_may_have_padding_p (tree)
 
bool arith_overflowed_p (enum tree_code, const_tree, const_tree, const_tree)
 

Variables

int folding_initializer
 
bool folding_cxx_constexpr
 

Macro Definition Documentation

◆ build_fold_addr_expr

#define build_fold_addr_expr ( T)     build_fold_addr_expr_loc (UNKNOWN_LOCATION, (T))

Referenced by add_decls_addresses_to_decl_constructor(), analyze_scalar_evolution_for_address_of(), asan_add_global(), asan_emit_stack_protection(), asan_expand_poison_ifn(), asan_finish_file(), asan_poison_variable(), build_addr(), build_asan_poison_call_expr(), build_debug_ref_for_model(), build_fn_info(), build_gcov_info_var_registration(), build_init_ctor(), build_instrumentation_call(), build_invariant_address(), build_ref_for_offset(), build_simple_mem_ref_loc(), canonicalize_base_object_address(), canonicalize_constructor_val(), compute_access_range(), compute_access_stride(), cond_store_replacement(), create_component_ref_by_pieces_1(), create_final_loads_for_reduction(), create_odr_indicator(), create_parallel_loop(), declare_return_variable(), determine_base_object_1(), dr_analyze_indices(), dr_analyze_innermost(), dr_may_alias_p(), dw2_output_indirect_constant_1(), emutls_common_1(), expand_assign_tm(), expand_builtin(), expand_DEFERRED_INIT(), expand_omp_for_generic(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_source(), expand_omp_sections(), expand_omp_target(), expand_parallel_call(), expand_task_call(), expand_teams_call(), find_func_aliases(), find_interesting_uses_address(), fold_builtin_alloca_with_align(), forward_propagate_addr_expr_1(), gen_counter_update(), gen_emutls_addr(), generate_memcpy_builtin(), generate_memset_builtin(), generate_strlen_builtin(), get_emutls_init_templ_addr(), get_inner_reference_aff(), get_memory_rtx(), get_target_arguments(), gimple_add_padding_init_for_auto_var(), gimple_build_call_1(), gimple_lower_bitint(), gimplify_addr(), gimplify_addr_expr(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_omp_depend(), gimplify_scan_omp_clauses(), strlen_pass::handle_store(), increment_start_addr(), instrument_bool_enum_load(), instrument_builtin_call(), instrument_derefs(), instrument_expr(), ipa_simd_modify_stmt_ops(), lower_assumption(), lower_builtin_posix_memalign(), lower_depend_clauses(), lower_oacc_private_marker(), lower_oacc_reductions(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), lower_send_shared_vars(), make_bit_field_ref(), make_tree(), maybe_canonicalize_mem_ref_addr(), maybe_fold_tmr(), maybe_trim_constructor_store(), ipa_param_adjustments::modify_call(), oacc_rewrite_var_decl(), omp_addr_tokenizer::omp_accessed_addr(), omp_accumulate_sibling_list(), omp_build_struct_sibling_lists(), omp_resolve_clause_dependencies(), predicate_load_or_store(), scan_omp_1_op(), simd_clone_adjust(), simd_clone_init_simd_arrays(), simplify_builtin_call(), split_constant_offset_1(), strip_offset_1(), take_address_of(), loop_distribution::transform_reduction_loop(), tree_coverage_counter_addr(), tree_function_versioning(), tree_to_aff_combination(), ubsan_encode_value(), ubsan_source_location(), ubsan_type_descriptor(), vect_check_gather_scatter(), vect_create_cond_for_unequal_addrs(), vectorizable_simd_clone_call(), visit_loadstore(), vn_reference_fold_indirect(), vn_reference_lookup_3(), and worker_single_copy().

◆ build_fold_addr_expr_with_type

◆ build_fold_indirect_ref

◆ build_simple_mem_ref

◆ convert_to_ptrofftype

◆ fold_binary

◆ fold_build1

#define fold_build1 ( c,
t1,
t2 )    fold_build1_loc (UNKNOWN_LOCATION, c, t1, t2 MEM_STAT_INFO)

Referenced by add_autoinc_candidates(), add_elt_to_tree(), analyze_siv_subscript_cst_affine(), ipcp_modif_dom_walker::before_dom_children(), build_tm_load(), build_tm_store(), build_vector_from_val(), clear_padding_flush(), compute_object_offset(), convert_to_divmod(), convert_to_fixed(), convert_to_integer_1(), create_component_ref_by_pieces_1(), create_iv(), edge_info::derive_equivalences(), derive_simple_iv_with_niters(), execute_cse_sincos_1(), execute_update_addresses_taken(), expand_DEFERRED_INIT(), expand_expr_real_2(), expand_oacc_collapse_init(), expand_oacc_for(), expand_omp_for(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_simd(), expand_omp_target(), expand_simple_operations(), expr_expected_value_1(), extract_muldiv_1(), factor_out_conditional_operation(), fold_builtin_interclass_mathfn(), ccp_folder::fold_stmt(), fold_ternary_loc(), force_value_to_type(), get_debug_computation_at(), get_val_for(), gimple_fold_indirect_ref(), gimplify_omp_for(), ifcombine_ifandif(), instantiate_scev_name(), instantiate_scev_not(), ipa_tm_insert_gettmclone_call(), loop_exits_before_overflow(), lower_rec_input_clauses(), make_tree(), most_expensive_mult_to_index(), multiple_of_p(), negate_value(), number_of_iterations_lt(), number_of_iterations_lt_to_ne(), number_of_iterations_ne(), number_of_iterations_until_wrap(), omp_extract_for_data(), optimize_range_tests_diff(), optimize_range_tests_xor(), process_assignment(), record_nonwrapping_iv(), rewrite_use_address(), simplify_permutation(), split_loop(), strip_offset_1(), substitute_in_expr(), substitute_placeholder_in_expr(), tree_int_cst_min_precision(), ubsan_encode_value(), ubsan_expand_ptr_ifn(), vect_create_data_ref_ptr(), vect_get_data_ptr_increment(), vect_get_loop_niters(), and vectorizable_simd_clone_call().

◆ fold_build2

#define fold_build2 ( c,
t1,
t2,
t3 )    fold_build2_loc (UNKNOWN_LOCATION, c, t1, t2, t3 MEM_STAT_INFO)

Referenced by add_autoinc_candidates(), add_elt_to_tree(), add_iv_candidate_for_doloop(), add_to_dst_predicate_list(), add_to_parts(), addr_to_parts(), adjust_return_value_with_ops(), aff_combination_add_elt(), aff_combination_add_product(), aff_combination_scale(), affine_fn_op(), analyze_and_compute_bitop_with_inv_effect(), analyze_and_compute_bitwise_induction_effect(), analyze_siv_subscript_cst_affine(), and_comparisons_1(), array_type_nelts(), asan_mem_ref_get_end(), assert_loop_rolls_lt(), assert_no_overflow_lt(), build_cltz_expr(), build_info(), build_invariant_address(), build_popcount_expr(), bump_vector_ptr(), canonicalize_bool(), canonicalize_constructor_val(), chain_cond_expr(), check_access(), check_strncat_sizes(), chrec_convert_1(), chrec_evaluate(), chrec_fold_multiply(), chrec_fold_plus_1(), compute_doloop_base_on_mode(), compute_object_offset(), const_binop(), constant_byte_string(), copy_tree_body_r(), create_call_for_reduction_1(), create_canonical_iv(), create_component_ref_by_pieces_1(), create_intersect_range_checks(), create_intersect_range_checks_index(), create_mem_ref(), create_mem_ref_raw(), create_runtime_alias_checks(), create_waw_or_war_checks(), decl_init_size(), declare_return_variable(), derive_simple_iv_with_niters(), determine_exit_conditions(), do_mpfr_lgamma_r(), do_mpfr_remquo(), tree_switch_conversion::bit_test_cluster::emit(), emit_case_dispatch_table(), expand_builtin_strub_enter(), expand_builtin_strub_leave(), expand_builtin_strub_update(), expand_call_mem_ref(), expand_case(), expand_oacc_collapse_init(), expand_oacc_collapse_vars(), expand_oacc_for(), expand_omp_for(), expand_omp_for_generic(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_ordered_loops(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_sink(), expand_omp_scantemp_alloc(), expand_omp_simd(), expand_omp_taskloop_for_inner(), expand_omp_taskloop_for_outer(), expand_simple_operations(), expr_expected_value_1(), extract_muldiv_1(), extract_omp_for_update_vars(), field_byte_offset(), find_interesting_uses_address(), find_tail_calls(), find_unswitching_predicates_for_bb(), fold_binary_loc(), fold_builtin_bit_query(), fold_builtin_interclass_mathfn(), fold_builtin_isascii(), fold_builtin_isdigit(), fold_relational_const(), forward_propagate_addr_expr_1(), fuse_memset_builtins(), gather_mem_refs_stmt(), gen_one_condition(), gen_parallel_loop(), gen_simplified_condition(), get_bitfield_rep(), get_debug_computation_at(), get_dr_vinfo_offset(), get_init_expr(), get_inner_reference(), get_memory_rtx(), get_misalign_in_elems(), get_range_strlen_dynamic(), get_range_strlen_tree(), get_references_in_stmt(), get_segment_min_max(), get_stridx(), get_target_argument_identifier_1(), get_target_argument_value(), get_upper_bound_based_on_builtin_expr_with_prob(), get_val_for(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_memset(), gimple_fold_indirect_ref(), gimple_fold_partial_load_store_mem_ref(), gimple_fold_stmt_to_constant_1(), gimple_lower_bitint(), gimplify_self_mod_expr(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_stxncpy_strncat(), idx_analyze_ref(), idx_find_step(), ifcombine_ifandif(), increment_start_addr(), initialize_ao_ref_for_dse(), instantiate_scev_binary(), instantiate_scev_name(), instrument_object_size(), interpret_rhs_expr(), ipa_get_jf_ancestor_result(), issue_prefetch_ref(), iv_elimination_compare_lt(), loop_exits_before_overflow(), lower_builtin_posix_memalign(), lower_coro_builtin(), lower_omp_for_scan(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_vec_perm(), make_bit_field_ref(), make_tree(), maybe_emit_sprintf_chk_warning(), maybe_instrument_pointer_overflow(), maybe_trim_constructor_store(), minmax_replacement(), most_expensive_mult_to_index(), number_of_iterations_cltz(), number_of_iterations_cltz_complement(), number_of_iterations_exit_assumptions(), number_of_iterations_le(), number_of_iterations_lt(), number_of_iterations_lt_to_ne(), number_of_iterations_ne(), number_of_iterations_popcount(), number_of_iterations_until_wrap(), oacc_launch_pack(), oacc_thread_numbers(), oacc_xform_loop(), oacc_xform_tile(), omp_adjust_chunk_size(), omp_build_struct_sibling_lists(), omp_extract_for_data(), optimize_range_tests_diff(), optimize_range_tests_xor(), or_comparisons_1(), phiprop_insert_phi(), ptr_difference_const(), range_binop(), record_biv_for_address_use(), record_equivalences_from_stmt(), record_nonwrapping_iv(), remap_gimple_op_r(), replace_ref(), restructure_reference(), rewrite_bittest(), rewrite_phi_with_iv(), rewrite_use_nonlinear_expr(), simple_iv_with_niters(), simplify_using_initial_conditions(), simplify_using_outer_evolutions(), size_for_offset(), split_constant_offset_1(), split_loop(), std_gimplify_va_arg_expr(), stmt_kills_ref_p(), store_constructor(), strdup_object_size(), strip_offset_1(), substitute_in_expr(), substitute_placeholder_in_expr(), test_for_singularity(), dom_opt_dom_walker::test_for_singularity(), tree_mem_ref_addr(), tree_simplify_using_condition_1(), try_tablejump(), try_transform_to_exit_first_loop_alt(), ubsan_instrument_float_cast(), unterminated_array(), update_accumulator_with_ops(), vect_analyze_data_refs(), vect_create_addr_base_for_vector_ref(), vect_create_cond_for_align_checks(), vect_create_cond_for_lower_bounds(), vect_create_cond_for_niters_checks(), vect_create_cond_for_unequal_addrs(), vect_do_peeling(), vect_gen_prolog_loop_niters(), vect_gen_scalar_loop_niters(), vect_gen_vector_loop_niters(), vect_gen_vector_loop_niters_mult_vf(), vect_get_loop_niters(), vect_get_loop_variant_data_ptr_increment(), vect_get_strided_load_store_ops(), vect_loop_versioning(), vect_recog_divmod_pattern(), vect_set_loop_condition_normal(), vect_set_loop_condition_partial_vectors(), vect_set_loop_condition_partial_vectors_avx512(), vect_setup_realignment(), vect_simd_lane_linear(), vect_update_init_of_dr(), vect_update_ivs_after_vectorizer(), vector_element(), vectorizable_load(), vectorizable_scan_store(), vectorizable_simd_clone_call(), and vectorizable_store().

◆ fold_build3

◆ fold_build_call_array

#define fold_build_call_array ( T1,
T2,
N,
T4 )    fold_build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T4)

◆ fold_build_call_array_initializer

#define fold_build_call_array_initializer ( T1,
T2,
N,
T4 )    fold_build_call_array_initializer_loc (UNKNOWN_LOCATION, T1, T2, N, T4)

◆ fold_build_pointer_plus

◆ fold_build_pointer_plus_hwi

◆ fold_convert

#define fold_convert ( T1,
T2 )    fold_convert_loc (UNKNOWN_LOCATION, T1, T2)

Referenced by add_autoinc_candidates(), add_candidate_1(), add_decls_addresses_to_decl_constructor(), add_elt_to_tree(), add_iv_candidate_for_biv(), add_iv_candidate_for_use(), scev_dfs::add_to_evolution_1(), add_to_parts(), addr_to_parts(), adjust_return_value_with_ops(), aff_combination_add_elt(), aff_combination_add_product(), aff_combination_convert(), aff_combination_expand(), aff_combination_to_tree(), alloc_iv(), alloc_object_size(), asan_add_global(), asan_dynamic_init_call(), assert_loop_rolls_lt(), assert_no_overflow_lt(), associate_equivalences_with_edges(), eliminate_dom_walker::before_dom_children(), bits_from_bytes(), tree_switch_conversion::switch_conversion::build_arrays(), rt_bb_visited::build_block_check(), build_case_label(), build_cltz_expr(), tree_switch_conversion::switch_conversion::build_constructors(), tree_switch_conversion::switch_conversion::build_one_array(), build_popcount_expr(), build_range_type_1(), build_zero_cst(), bump_vector_ptr(), byte_from_pos(), canonicalize_addr_expr(), canonicalize_constructor_val(), canonicalize_loop_ivs(), rt_bb_visited::check(), chrec_convert_1(), chrec_fold_plus_1(), compare_values_warnv(), compute_alias_check_pairs(), compute_doloop_base_on_mode(), compute_object_offset(), cond_store_replacement(), const_binop(), const_unop(), constant_boolean_node(), constant_byte_string(), convert_mult_to_widen(), convert_plusminus_to_widen(), convert_single_case_switch(), convert_to_integer_1(), copy_tree_body_r(), create_expression_by_pieces(), create_intersect_range_checks_index(), create_mem_ref_raw(), create_odr_indicator(), create_parallel_loop(), create_task_copyfn(), create_waw_or_war_checks(), data_ref_segment_size(), declare_return_variable(), default_emutls_var_init(), edge_info::derive_equivalences(), derive_simple_iv_with_niters(), determine_base_object_1(), determine_exit_conditions(), do_jump(), tree_switch_conversion::switch_decision_tree::do_jump_if_equal(), dr_analyze_indices(), dr_analyze_innermost(), dr_known_forward_stride_p(), dr_step_indicator(), early_object_sizes_execute_one(), eliminate_redundant_comparison(), eliminate_redundant_computations(), eliminate_dom_walker::eliminate_stmt(), tree_switch_conversion::jump_table_cluster::emit(), tree_switch_conversion::bit_test_cluster::emit(), tree_switch_conversion::switch_decision_tree::emit_cmp_and_jump_insns(), emutls_common_1(), expand_call_stmt(), expand_case(), expand_complex_comparison(), expand_oacc_collapse_init(), expand_oacc_collapse_vars(), expand_oacc_for(), expand_omp_atomic_mutex(), expand_omp_atomic_pipeline(), expand_omp_for(), expand_omp_for_generic(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_ordered_loops(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_sink(), expand_omp_scantemp_alloc(), expand_omp_simd(), expand_omp_target(), expand_omp_taskloop_for_inner(), expand_omp_taskloop_for_outer(), expand_parallel_call(), expand_task_call(), expand_teams_call(), expr_expected_value_1(), expr_to_aff_combination(), extract_muldiv_1(), factor_out_conditional_operation(), finalize_type_size(), find_bivs(), find_tail_calls(), find_unswitching_predicates_for_bb(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_builtin_alloca_with_align(), fold_builtin_bit_query(), fold_builtin_object_size(), fold_builtin_sincos(), fold_const_call(), fold_const_call(), fold_gimple_assign(), fold_plusminus_mult_expr(), ccp_folder::fold_stmt(), fold_stmt_1(), force_value_to_type(), forward_propagate_addr_expr_1(), generate_memset_builtin(), generate_range_test(), get_computation_aff_1(), get_computation_at(), get_debug_computation_at(), get_dr_vinfo_offset(), get_inner_reference(), get_misalign_in_elems(), get_narrower(), get_offset_range(), get_segment_min_max(), get_stridx(), get_target_argument_identifier(), get_target_argument_value(), get_unwidened(), get_up_bounds_for_array_ref(), gimple_call_alloc_size(), gimple_divmod_fixed_value(), gimple_fold_builtin(), gimple_fold_builtin_fputs(), gimple_fold_builtin_snprintf(), gimple_fold_builtin_sprintf(), gimple_fold_call(), gimple_fold_stmt_to_constant_1(), gimple_ic(), gimple_lower_bitint(), gimple_stringop_fixed_value(), gimplify_addr_expr(), gimplify_bind_expr(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_omp_depend(), gimplify_omp_for(), gimplify_parameters(), gimplify_self_mod_expr(), gimplify_vla_decl(), strlen_pass::handle_builtin_memset(), idx_analyze_ref(), idx_infer_loop_bounds(), ifcombine_ifandif(), insert_trap(), instantiate_scev_convert(), instantiate_scev_not(), instrument_bool_enum_load(), instrument_object_size(), interpret_rhs_expr(), ipa_range_contains_p(), issue_prefetch_ref(), iv_elimination_compare_lt(), layout_type(), loop_exits_before_overflow(), lower_depend_clauses(), lower_lastprivate_clauses(), lower_omp_1(), lower_omp_for_lastprivate(), lower_omp_master(), lower_omp_ordered(), lower_omp_target(), lower_omp_task_reductions(), lower_omp_teams(), lower_private_allocate(), lower_rec_input_clauses(), lower_reduction_clauses(), make_tree(), match_arith_overflow(), match_uaddc_usubc(), may_eliminate_iv(), maybe_add_implicit_barrier_cancel(), maybe_canonicalize_comparison_1(), maybe_instrument_pointer_overflow(), maybe_optimize_mod_cmp(), maybe_optimize_range_tests(), most_expensive_mult_to_index(), move_hint_to_base(), move_variant_to_index(), number_of_iterations_cltz(), number_of_iterations_cltz_complement(), number_of_iterations_exit_assumptions(), number_of_iterations_lt(), number_of_iterations_lt_to_ne(), number_of_iterations_ne(), number_of_iterations_popcount(), number_of_iterations_until_wrap(), oacc_xform_loop(), oacc_xform_tile(), object_sizes_execute(), omp_build_struct_sibling_lists(), omp_extract_for_data(), omp_get_for_step_from_incr(), optimize_atomic_bit_test_and(), optimize_range_tests_diff(), optimize_range_tests_xor(), dom_opt_dom_walker::optimize_stmt(), output_constant(), parm_object_size(), place_field(), pos_from_bit(), prepare_instrumented_value(), preprocess_case_label_vec_for_gimple(), propagate_vr_across_jump_function(), ptr_difference_const(), vn_walk_cb_data::push_partial_def(), push_target_argument_according_to_value(), range_binop(), range_check_type(), record_equivalences_from_stmt(), record_nonwrapping_iv(), ref_at_iteration(), refine_bounds_using_guard(), refine_value_range_using_guard(), remap_gimple_op_r(), replace_call_with_value(), replace_trapping_overflow(), restructure_reference(), rewrite_phi_with_iv(), rewrite_use_address(), rewrite_use_compare(), rewrite_use_nonlinear_expr(), simd_clone_clauses_extract(), simd_clone_linear_addend(), simple_iv_with_niters(), simplify_builtin_call(), simplify_using_ranges::simplify_casted_compare(), simplify_using_ranges::simplify_div_or_mod_using_ranges(), simplify_using_ranges::simplify_internal_call_using_ranges(), simplify_using_ranges::simplify_switch_using_ranges(), size_for_offset(), spaceship_replacement(), split_constant_offset(), split_constant_offset(), split_constant_offset_1(), split_function(), std_gimplify_va_arg_expr(), store_constructor(), strip_offset_1(), take_address_of(), transform_add_to_multiply(), transform_to_exit_first_loop(), tree_fold_binomial(), tree_mem_ref_addr(), try_casesi(), try_tablejump(), ubsan_encode_value(), ubsan_expand_bounds_ifn(), ubsan_expand_null_ifn(), unextend(), unterminated_array(), update_accumulator_with_ops(), value_replacement(), vec_cst_ctor_to_array(), vect_check_gather_scatter(), vect_create_addr_base_for_vector_ref(), vect_create_cond_for_lower_bounds(), vect_create_data_ref_ptr(), vect_gen_prolog_loop_niters(), vect_get_strided_load_store_ops(), vect_prepare_for_masked_peels(), vect_recog_bitfield_ref_pattern(), vect_recog_mixed_size_cond_pattern(), vect_set_loop_condition_partial_vectors_avx512(), vect_truncate_gather_scatter_offset(), vect_update_init_of_dr(), vect_update_inits_of_drs(), vect_update_ivs_after_vectorizer(), vect_use_strided_gather_scatters_p(), vect_vfa_segment_size(), vectorizable_conversion(), vectorizable_induction(), vectorizable_live_operation(), vectorizable_live_operation_1(), vectorizable_load(), vectorizable_nonlinear_induction(), vectorizable_shift(), vectorizable_simd_clone_call(), vectorizable_store(), rt_bb_visited::visit(), vn_reference_lookup_3(), rt_bb_visited::vword(), and worker_single_copy().

◆ fold_indirect_ref

#define fold_indirect_ref ( T)     fold_indirect_ref_loc (UNKNOWN_LOCATION, T)

Referenced by lower_omp_target().

◆ fold_ternary

◆ fold_unary

◆ fold_unary_ignore_overflow

#define fold_unary_ignore_overflow ( CODE,
T1,
T2 )    fold_unary_ignore_overflow_loc (UNKNOWN_LOCATION, CODE, T1, T2)

◆ invert_truthvalue

◆ non_lvalue

#define non_lvalue ( T)    non_lvalue_loc (UNKNOWN_LOCATION, T)
Return an expr equal to X but certainly not valid as an lvalue.   

Referenced by do_mpfr_lgamma_r(), and do_mpfr_remquo().

◆ omit_one_operand

#define omit_one_operand ( T1,
T2,
T3 )    omit_one_operand_loc (UNKNOWN_LOCATION, T1, T2, T3)

Referenced by extract_muldiv_1().

◆ omit_two_operands

#define omit_two_operands ( T1,
T2,
T3,
T4 )    omit_two_operands_loc (UNKNOWN_LOCATION, T1, T2, T3, T4)

◆ round_down

#define round_down ( T,
N )   round_down_loc (UNKNOWN_LOCATION, T, N)

Referenced by pad_to_arg_alignment().

◆ round_up

◆ size_binop

◆ size_diffop

#define size_diffop ( T1,
T2 )    size_diffop_loc (UNKNOWN_LOCATION, T1, T2)

Function Documentation

◆ address_compare()

int address_compare ( tree_code code,
tree type,
tree op0,
tree op1,
tree & base0,
tree & base1,
poly_int64 & off0,
poly_int64 & off1,
bool generic )
extern
Helper function for address compare simplifications in match.pd.
OP0 and OP1 are ADDR_EXPR operands being compared by CODE.
TYPE is the type of comparison operands.
BASE0, BASE1, OFF0 and OFF1 are set by the function.
GENERIC is true if GENERIC folding and false for GIMPLE folding.
Returns 0 if OP0 is known to be unequal to OP1 regardless of OFF{0,1},
1 if bases are known to be equal and OP0 cmp OP1 depends on OFF0 cmp OFF1,
and 2 if unknown.   

References DECL_HAS_VALUE_EXPR_P, decl_in_symtab_p(), DECL_P, DECL_SIZE_UNIT, folding_cxx_constexpr, folding_initializer, poly_int< N, C >::force_shwi(), gcc_checking_assert, get_addr_base_and_unit_offset(), symtab_node::get_create(), ggc_alloc(), gimple_assign_rhs1(), INTEGRAL_TYPE_P, is_global_var(), known_eq, known_ne, mem_ref_offset(), MIN, NULL_TREE, POINTER_TYPE_P, SSA_NAME_DEF_STMT, TREE_CODE, tree_fits_poly_int64_p(), TREE_OPERAND, TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_poly_int64(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, and VAR_P.

◆ arith_overflowed_p()

bool arith_overflowed_p ( enum tree_code code,
const_tree type,
const_tree arg0,
const_tree arg1 )
extern
Return true if ARG0 CODE ARG1 in infinite signed precision operation
doesn't fit into TYPE.  The test for overflow should be regardless of
-fwrapv, and even for unsigned types.   

References wi::add(), gcc_unreachable, ggc_alloc(), wi::min_precision(), wi::mul(), wi::neg_p(), wi::sub(), TYPE_PRECISION, TYPE_SIGN, and UNSIGNED.

Referenced by check_for_binary_op_overflow(), fold_builtin_arith_overflow(), fold_const_call(), fold_const_call(), and gimple_fold_call().

◆ build_fold_addr_expr_loc()

◆ build_fold_addr_expr_with_type_loc()

tree build_fold_addr_expr_with_type_loc ( location_t loc,
tree t,
tree ptrtype )
extern
Build an expression for the address of T.  Folds away INDIRECT_REF
to avoid confusing the gimplify process.   

References build1_loc(), build_fold_addr_expr_loc(), convert_to_ptrofftype, fold_binary, fold_convert_loc(), ggc_alloc(), INDIRECT_REF_P, integer_zerop(), TREE_CODE, TREE_OPERAND, and TREE_TYPE.

Referenced by build_fold_addr_expr_loc(), and stabilize_va_list_loc().

◆ build_fold_indirect_ref_loc()

◆ build_invariant_address()

tree build_invariant_address ( tree type,
tree base,
poly_int64 offset )
extern
Return an invariant ADDR_EXPR of type TYPE taking the address of BASE
offsetted by OFFSET units.   

References build1(), build_fold_addr_expr, build_int_cst(), fold_build2, ggc_alloc(), offset, ptr_type_node, recompute_tree_invariant_for_addr_expr(), and TREE_TYPE.

Referenced by gimple_fold_stmt_to_constant_1().

◆ build_range_check()

tree build_range_check ( location_t loc,
tree type,
tree exp,
int in_p,
tree low,
tree high )
extern

◆ build_simple_mem_ref_loc()

◆ c_getstr()

◆ can_native_interpret_type_p()

bool can_native_interpret_type_p ( tree type)
extern
Returns true if we can interpret the contents of a native encoding
as TYPE.   

References ggc_alloc(), and TREE_CODE.

Referenced by fold_ctor_reference(), fold_ternary_loc(), and native_interpret_aggregate().

◆ clear_padding_type_may_have_padding_p()

◆ clear_type_padding_in_mask()

◆ combine_comparisons()

tree combine_comparisons ( location_t loc,
enum tree_code code,
enum tree_code lcode,
enum tree_code rcode,
tree truth_type,
tree ll_arg,
tree lr_arg )
extern
Return a tree for the comparison which is the combination of
doing the AND or OR (depending on CODE) of the two operations LCODE
and RCODE on the identical operands LL_ARG and LR_ARG.  Take into account
the possibility of trapping if the mode has NaNs, and return NULL_TREE
if this makes the transformation invalid.   

References comparison_to_compcode(), COMPCODE_EQ, COMPCODE_FALSE, COMPCODE_LTGT, COMPCODE_NE, COMPCODE_ORD, compcode_to_comparison(), COMPCODE_TRUE, COMPCODE_UNORD, constant_boolean_node(), fold_build2_loc(), ggc_alloc(), HONOR_NANS(), and NULL_TREE.

Referenced by and_comparisons_1(), fold_truth_andor_1(), and or_comparisons_1().

◆ const_binop()

◆ const_unop()

◆ constant_boolean_node()

◆ convert_to_ptrofftype_loc()

tree convert_to_ptrofftype_loc ( location_t loc,
tree off )
extern
Return OFF converted to a pointer offset type suitable as offset for
POINTER_PLUS_EXPR.  Use location LOC for this conversion.   

References fold_convert_loc(), ptrofftype_p(), sizetype, and TREE_TYPE.

Referenced by fold_build_pointer_plus_loc(), and gimplify_self_mod_expr().

◆ ctor_single_nonzero_element()

tree ctor_single_nonzero_element ( const_tree t)
extern
Return the single non-zero element of a CONSTRUCTOR or NULL_TREE.   

References CONSTRUCTOR_ELTS, ggc_alloc(), integer_zerop(), NULL_TREE, real_zerop(), TREE_CODE, and vec_safe_iterate().

◆ debug_fold_checksum()

void debug_fold_checksum ( const_tree )
extern

◆ div_if_zero_remainder()

tree div_if_zero_remainder ( const_tree arg1,
const_tree arg2 )
extern
If ARG2 divides ARG1 with zero remainder, carries out the exact
division and returns the quotient.  Otherwise returns
NULL_TREE.   

References ggc_alloc(), wi::multiple_of_p(), NULL_TREE, SIGNED, wi::to_widest(), TREE_TYPE, and wide_int_to_tree().

◆ exact_inverse()

tree exact_inverse ( tree type,
tree cst )
extern

◆ expr_not_equal_to()

◆ find_bitfield_repr_type()

tree find_bitfield_repr_type ( int fieldsize,
int len )
extern
Try to find a type whose byte size is smaller or equal to LEN bytes larger
or equal to FIELDSIZE bytes, with underlying mode precision/size multiple
of BITS_PER_UNIT.  As native_{interpret,encode}_int works in term of
machine modes, we can't just use build_nonstandard_integer_type.   

References FOR_EACH_MODE_IN_CLASS, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_SIZE(), ggc_alloc(), i, int_n_data, int_n_enabled_p, int_n_trees, known_eq, known_ge, known_le, NULL_TREE, lang_hooks_for_types::type_for_mode, TYPE_MODE, lang_hooks::types, and int_n_trees_t::unsigned_type.

Referenced by native_encode_initializer(), and native_interpret_aggregate().

◆ fold()

tree fold ( tree expr)
extern
Fold constants as much as possible in an expression.
Returns the simplified expression.
Acts only on the top level of the expression;
if the argument itself cannot be simplified, its
subexpressions are not changed.   
Perform constant folding and related simplification of EXPR.
The related simplifications include x*1 => x, x*0 => 0, etc.,
and application of the associative law.
NOP_EXPR conversions may be removed freely (as long as we
are careful not to change the type of the overall expression).
We cannot simplify through a CONVERT_EXPR, FIX_EXPR or FLOAT_EXPR,
but we can constant-fold them if they have constant operands.   

References build_vector_from_ctor(), CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, DECL_INITIAL, expr, EXPR_LOCATION, fold(), fold_binary_loc(), fold_call_expr(), fold_ternary_loc(), fold_unary_loc(), FOR_EACH_CONSTRUCTOR_VALUE, get_array_ctor_element_at_index(), ggc_alloc(), i, IS_EXPR_CODE_CLASS, tcc_constant, tcc_vl_exp, wi::to_offset(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_OPERAND, TREE_TYPE, and type_contains_placeholder_p().

Referenced by create_component_ref_by_pieces_1(), expand_expr_real_1(), expand_simple_operations(), fold(), fold_init(), fold_mem_refs(), simplify_replace_tree(), substitute_in_expr(), and substitute_placeholder_in_expr().

◆ fold_abs_const()

tree fold_abs_const ( tree arg0,
tree type )
extern
Return the tree for abs (ARG0) when ARG0 is known to be either
an integer constant or real constant.

TYPE is the type of the result.   

References build_real(), force_fit_type(), gcc_unreachable, ggc_alloc(), wi::neg(), wi::neg_p(), NULL_TREE, wi::OVF_NONE, real_value_negate(), REAL_VALUE_NEGATIVE, wi::to_wide(), TREE_CODE, TREE_OVERFLOW, TREE_REAL_CST, TREE_TYPE, and TYPE_SIGN.

Referenced by const_binop(), and const_unop().

◆ fold_binary_initializer_loc()

tree fold_binary_initializer_loc ( location_t loc,
tree_code code,
tree type,
tree lhs,
tree rhs )
extern

◆ fold_binary_loc()

tree fold_binary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1 )
extern
Fold a binary expression of code CODE and type TYPE with operands
OP0 and OP1.  LOC is the location of the resulting expression.
Return the folded expression if folding is successful.  Otherwise,
return NULL_TREE.   

References ANY_INTEGRAL_TYPE_P, associate_trees(), wi::bit_and_not(), boolean_false_node, boolean_true_node, boolean_type_node, build1(), build1_loc(), build2(), build2_loc(), build_fold_indirect_ref_loc(), build_int_cst(), build_one_cst(), build_pointer_type(), build_qualified_type(), build_zero_cst(), CALL_EXPR_ARG, call_expr_nargs, char_type_node, commutative_tree_code(), compare_tree_int(), COMPARISON_CLASS_P, COMPLEX_FLOAT_TYPE_P, const_binop(), constant_boolean_node(), CONSTANT_CLASS_P, CONVERT_EXPR_P, element_precision(), wi::exact_log2(), extract_muldiv(), FLOAT_TYPE_P, fndecl_built_in_p(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_binary_op_with_conditional_arg(), fold_build1_loc(), fold_build2, fold_build2_loc(), fold_comparison(), fold_convert, fold_convert_loc(), fold_mult_zconjz(), fold_overflow_warning(), fold_plusminus_mult_expr(), fold_to_nonsharp_ineq_using_bound(), fold_truth_andor(), fold_unary_loc(), wide_int_storage::from(), gcc_assert, gcc_unreachable, generic_simplify(), get_addr_base_and_unit_offset(), get_callee_fndecl(), GET_MODE_UNIT_PRECISION, ggc_alloc(), handled_component_p(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), HONOR_SNANS(), int_const_binop(), integer_one_node, integer_onep(), integer_pow2p(), integer_zero_node, integer_zerop(), INTEGRAL_TYPE_P, invert_truthvalue_loc(), IS_EXPR_CODE_CLASS, is_truth_type_for(), wi::mask(), mask_with_tz(), MODE_HAS_INFINITIES, multiple_of_p(), negate_expr(), negate_expr_p(), non_lvalue_loc(), NULL_TREE, OEP_ONLY_CONST, omit_one_operand_loc(), omit_two_operands_loc(), operand_equal_p(), optimize_bit_field_compare(), POINTER_TYPE_P, wi::popcount(), pow2p_hwi(), real_minus_onep(), real_onep(), REAL_VALUE_NEGATIVE, real_zerop(), signed_type_for(), size_int, sizetype, split_tree(), strip_float_extensions(), STRIP_NOPS, STRIP_SIGN_NOPS, swap_tree_comparison(), tcc_binary, tcc_comparison, wi::to_wide(), wi::to_widest(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_CONSTANT, tree_expr_nonnegative_warnv_p, TREE_IMAGPART, tree_int_cst_lt(), tree_int_cst_sgn(), TREE_OPERAND, TREE_OVERFLOW, TREE_OVERFLOW_P, TREE_REAL_CST, TREE_REALPART, TREE_SIDE_EFFECTS, tree_swap_operands_p(), TREE_TYPE, truth_value_p(), type(), TYPE_MODE, TYPE_OVERFLOW_SANITIZED, TYPE_OVERFLOW_UNDEFINED, TYPE_OVERFLOW_WRAPS, TYPE_PRECISION, TYPE_QUAL_CONST, TYPE_SATURATING, TYPE_UNSIGNED, wi::umod_trunc(), UNSIGNED, VECTOR_INTEGER_TYPE_P, VECTOR_TYPE_P, WARN_STRICT_OVERFLOW_CONDITIONAL, WARN_STRICT_OVERFLOW_MISC, and wide_int_to_tree().

Referenced by combine_cond_expr_cond(), copy_prop_visit_cond_stmt(), fold(), fold_addr_of_array_ref_difference(), fold_binary_initializer_loc(), fold_binary_loc(), fold_build2_loc(), fold_builtin_arith_overflow(), fold_to_nonsharp_ineq_using_bound(), gimple_fold_stmt_to_constant_1(), and dom_opt_dom_walker::optimize_stmt().

◆ fold_binary_to_constant()

tree fold_binary_to_constant ( enum tree_code code,
tree type,
tree op0,
tree op1 )
extern
Given the components of a binary expression CODE, TYPE, OP0 and OP1,
attempt to fold the expression to a constant without modifying TYPE,
OP0 or OP1.

If the expression could be simplified to a constant, then return
the constant.  If the expression would not be simplified to a
constant, then return NULL_TREE.   

References fold_binary, ggc_alloc(), NULL_TREE, and TREE_CONSTANT.

Referenced by compare_values_warnv(), evaluate_conditions_for_known_args(), maybe_fold_tmr(), number_of_iterations_cond(), and number_of_iterations_ne().

◆ fold_bit_and_mask()

tree fold_bit_and_mask ( tree type,
tree arg1,
enum tree_code code,
tree arg00,
enum tree_code code00,
tree arg000,
tree arg001,
tree arg01,
enum tree_code code01,
tree arg010,
tree arg011,
tree * pmop )
extern
For constants M and N, if M == (1LL << cst) - 1 && (N & M) == M,
((A & N) + B) & M -> (A + B) & M
Similarly if (N & M) == 0,
((A | N) + B) & M -> (A + B) & M
and for - instead of + (or unary - instead of +)
and/or ^ instead of |.
If B is constant and (B & M) == 0, fold into A & M.

This function is a helper for match.pd patterns.  Return non-NULL
type in which the simplified operation should be performed only
if any optimization is possible.

ARG1 is M above, ARG00 is left operand of +/-, if CODE00 is BIT_*_EXPR,
then ARG00{0,1} are operands of that bitop, otherwise CODE00 is ERROR_MARK.
Similarly for ARG01, CODE01 and ARG01{0,1}, just for the right operand of
+/-.   

References build_int_cst(), gcc_assert, gcc_unreachable, ggc_alloc(), INTEGRAL_TYPE_P, wi::max_value(), NULL_TREE, wi::to_wide(), TREE_CODE, type(), TYPE_OVERFLOW_WRAPS, and unsigned_type_for().

◆ fold_build1_initializer_loc()

tree fold_build1_initializer_loc ( location_t loc,
enum tree_code,
tree type,
tree op )
extern

◆ fold_build1_loc()

tree fold_build1_loc ( location_t ,
enum tree_code,
tree ,
tree CXX_MEM_STAT_INFO )
extern

◆ fold_build2_initializer_loc()

tree fold_build2_initializer_loc ( location_t loc,
enum tree_code,
tree type,
tree op0,
tree op1 )
extern

◆ fold_build2_loc()

tree fold_build2_loc ( location_t ,
enum tree_code,
tree ,
tree ,
tree CXX_MEM_STAT_INFO )
extern

◆ fold_build3_loc()

tree fold_build3_loc ( location_t ,
enum tree_code,
tree ,
tree ,
tree ,
tree CXX_MEM_STAT_INFO )
extern

◆ fold_build_call_array_initializer_loc()

tree fold_build_call_array_initializer_loc ( location_t loc,
tree type,
tree fn,
int nargs,
tree * argarray )
extern

◆ fold_build_call_array_loc()

tree fold_build_call_array_loc ( location_t loc,
tree type,
tree fn,
int nargs,
tree * argarray )
extern
Fold a CALL_EXPR expression of type TYPE with operands FN and NARGS
arguments in ARGARRAY, and a null static chain.
Return a folded expression if successful.  Otherwise, return a CALL_EXPR
of type TYPE from the given operands as constructed by build_call_array.   

References build_call_array_loc(), fold_builtin_call_array(), ggc_alloc(), i, and NULL_TREE.

Referenced by build_call_expr_loc_array(), and fold_build_call_array_initializer_loc().

◆ fold_build_cleanup_point_expr()

tree fold_build_cleanup_point_expr ( tree type,
tree expr )
extern
If necessary, return a CLEANUP_POINT_EXPR for EXPR with the
indicated TYPE.  If no CLEANUP_POINT_EXPR is necessary, return EXPR
itself.   

References build1_loc(), expr, EXPR_LOCATION, ggc_alloc(), TREE_CODE, TREE_OPERAND, and TREE_SIDE_EFFECTS.

◆ fold_build_pointer_plus_hwi_loc()

tree fold_build_pointer_plus_hwi_loc ( location_t loc,
tree ptr,
HOST_WIDE_INT off )
extern
Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.   

References fold_build2_loc(), ggc_alloc(), size_int, and TREE_TYPE.

Referenced by fold_builtin_strpbrk(), omp_adjust_for_condition(), and thunk_adjust().

◆ fold_build_pointer_plus_loc()

tree fold_build_pointer_plus_loc ( location_t loc,
tree ptr,
tree off )
extern
Build and fold a POINTER_PLUS_EXPR at LOC offsetting PTR by OFF.   

References convert_to_ptrofftype_loc(), fold_build2_loc(), ggc_alloc(), and TREE_TYPE.

Referenced by compute_access_range(), fold_unary_loc(), gimple_fold_builtin_strcat(), and thunk_adjust().

◆ fold_convert_loc()

tree fold_convert_loc ( location_t loc,
tree type,
tree arg )
extern
Convert expression ARG to type TYPE.  Used by the middle-end for
simple conversions in preference to calling the front-end's convert.   

References build_zero_vector(), error_mark_node, fold_build1_loc(), fold_build2_loc(), fold_convert_const(), fold_convert_loc(), fold_ignored_result(), gcc_assert, gcc_unreachable, ggc_alloc(), integer_zero_node, integer_zerop(), INTEGRAL_TYPE_P, NULL_TREE, POINTER_TYPE_P, protected_set_expr_location_unshare(), save_expr(), TREE_CODE, tree_int_cst_equal(), TREE_OPERAND, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_MAIN_VARIANT, TYPE_SIZE, and VECTOR_TYPE_P.

Referenced by adjust_related_strinfos(), array_ref_element_size(), associate_trees(), tree_switch_conversion::switch_conversion::build_arrays(), build_builtin_expect_predicate(), build_fold_addr_expr_with_type_loc(), build_range_check(), c_strlen(), component_ref_field_offset(), compute_access_range(), convert_to_ptrofftype_loc(), decode_field_reference(), tree_switch_conversion::bit_test_cluster::emit(), expand_arith_overflow(), expand_builtin_bzero(), expand_builtin_memcmp(), expand_builtin_strncmp(), expand_builtin_strnlen(), expand_expr_real_1(), expand_expr_real_2(), expand_omp_atomic_fetch_op(), expand_omp_ordered_sink(), expand_omp_target(), expand_parallel_call(), expand_single_bit_test(), expand_task_call(), finish_taskreg_scan(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_binary_op_with_conditional_arg(), fold_builtin_abs(), fold_builtin_arith_overflow(), fold_builtin_expect(), fold_builtin_fabs(), fold_builtin_isdigit(), fold_builtin_iseqsig(), fold_builtin_memcmp(), fold_builtin_strlen(), fold_builtin_strpbrk(), fold_builtin_unordered_cmp(), fold_comparison(), fold_cond_expr_with_comparison(), fold_convert_loc(), fold_negate_expr(), fold_negate_expr_1(), fold_plusminus_mult_expr(), fold_read_from_constant_string(), fold_ternary_loc(), fold_to_nonsharp_ineq_using_bound(), fold_truth_andor_1(), fold_unary_loc(), tree_switch_conversion::switch_conversion::gen_inbound_check(), get_ws_args_for(), gimple_boolify(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strcpy(), gimple_fold_builtin_strncpy(), gimplify_addr_expr(), gimplify_expr(), gimplify_modify_expr(), gimplify_omp_depend(), strlen_pass::handle_builtin_memcmp(), strlen_pass::handle_builtin_memcpy(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_strlen(), layout_decl(), lower_builtin_setjmp(), lower_copyprivate_clauses(), lower_omp_for_scan(), lower_omp_single_copy(), lower_omp_single_simple(), lower_omp_target(), lower_omp_taskreg(), lower_rec_input_clauses(), lower_reduction_clauses(), make_bit_field_ref(), make_range_step(), maybe_optimize_arith_overflow(), maybe_optimize_mod_cmp(), ipa_param_adjustments::modify_call(), negate_expr(), omit_one_operand_loc(), omit_two_operands_loc(), omp_accumulate_sibling_list(), omp_extract_for_data(), omp_reduction_init_op(), optimize_bit_field_compare(), optimize_range_tests_to_bit_test(), optimize_stdarg_builtin(), record_edge_info(), set_endptr_and_length(), simplify_builtin_call(), size_diffop_loc(), store_expr(), update_range_test(), and worker_single_simple().

◆ fold_convertible_p()

◆ fold_defer_overflow_warnings()

◆ fold_deferring_overflow_warnings_p()

bool fold_deferring_overflow_warnings_p ( void )
extern
Whether we are deferring overflow warnings.   

References fold_deferring_overflow_warnings.

Referenced by verify_interpass_invariants().

◆ fold_div_compare()

enum tree_code fold_div_compare ( enum tree_code code,
tree c1,
tree c2,
tree * lo,
tree * hi,
bool * neg_overflow )
extern
Subroutine of match.pd that optimizes comparisons of a division by
a nonzero integer constant against an integer constant, i.e.
X/C1 op C2.

CODE is the comparison operator: EQ_EXPR, NE_EXPR, GT_EXPR, LT_EXPR,
GE_EXPR or LE_EXPR.  ARG01 and ARG1 must be a INTEGER_CST.   

References wi::add(), build_int_cst(), fold_negate_const(), force_fit_type(), gcc_unreachable, ggc_alloc(), int_const_binop(), wi::mul(), NULL_TREE, operand_equal_p(), swap_tree_comparison(), wi::to_wide(), tree_int_cst_sgn(), TREE_OVERFLOW, TREE_TYPE, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_SIGN, and UNSIGNED.

◆ fold_ignored_result()

tree fold_ignored_result ( tree t)
extern
Strip non-trapping, non-side-effecting tree nodes from an expression
whose result is ignored.  The type of the returned tree need not be
the same as the original expression.   

References ggc_alloc(), integer_zero_node, tcc_binary, tcc_comparison, tcc_expression, tcc_unary, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and TREE_SIDE_EFFECTS.

Referenced by fold_convert_loc(), and omit_one_operand_loc().

◆ fold_indirect_ref_1()

◆ fold_indirect_ref_loc()

tree fold_indirect_ref_loc ( location_t loc,
tree t )
extern
Given an INDIRECT_REF T, return either T or a simplified version.   

References fold_indirect_ref_1(), TREE_OPERAND, and TREE_TYPE.

Referenced by gimplify_compound_lval(), and gimplify_expr().

◆ fold_init()

tree fold_init ( tree expr)
extern

◆ fold_overflow_warning()

◆ fold_read_from_constant_string()

tree fold_read_from_constant_string ( tree exp)
extern
If EXP represents referencing an element in a constant string
(either via pointer arithmetic or array indexing), return the
tree representing the value accessed, otherwise return NULL.   

References array_ref_low_bound(), build_int_cst_type(), compare_tree_int(), exp(), EXPR_LOCATION, fold_convert_loc(), GET_MODE_SIZE(), ggc_alloc(), INDIRECT_REF_P, integer_zerop(), is_int_mode(), NULL, size_diffop_loc(), sizetype, string_constant(), TREE_CODE, tree_fits_uhwi_p(), TREE_INT_CST_LOW, TREE_OPERAND, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TYPE, and TYPE_MODE.

Referenced by expand_expr_real_1(), fold_const_aggregate_ref_1(), and fold_indirect_ref_1().

◆ fold_read_from_vector()

tree fold_read_from_vector ( tree arg,
poly_uint64 idx )
extern

◆ fold_real_zero_addition_p()

bool fold_real_zero_addition_p ( const_tree type,
const_tree arg,
const_tree zero_arg,
int negate )
extern
Subroutine of fold() that checks for the addition of ARG +/- 0.0.

If !NEGATE, return true if ZERO_ARG is +/-0.0 and, for all ARG of
type TYPE, ARG + ZERO_ARG is the same as ARG.  If NEGATE, return true
if ARG - ZERO_ARG is the same as X.

If ARG is NULL, check for any value of type TYPE.

X + 0 and X - 0 both give X when X is NaN, infinite, or nonzero
and finite.  The problematic cases are when X is zero, and its mode
has signed zeros.  In the case of rounding towards -infinity,
X - 0 is not the same as X because 0 - 0 is -0.  In other rounding
modes, X + 0 is not the same as X because -0 + 0 is 0.   

References ggc_alloc(), HONOR_SIGN_DEPENDENT_ROUNDING(), HONOR_SIGNED_ZEROS(), HONOR_SNANS(), REAL_VALUE_MINUS_ZERO, real_zerop(), TREE_CODE, tree_expr_maybe_real_minus_zero_p(), tree_expr_maybe_signaling_nan_p(), TREE_REAL_CST, and uniform_vector_p().

Referenced by eliminate_using_constants().

◆ fold_ternary_loc()

tree fold_ternary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0,
tree op1,
tree op2 )
extern
Fold a ternary expression of code CODE and type TYPE with operands
OP0, OP1, and OP2.  Return the folded expression if folding is
successful.  Otherwise, return NULL_TREE.   

References b, wi::bit_or(), tree_vector_builder::build(), can_native_interpret_type_p(), commutative_ternary_tree_code(), COMPARISON_CLASS_P, CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, contains_label_p(), expr_location_or(), fold_build1, fold_build2_loc(), fold_build3_loc(), fold_cond_expr_with_comparison(), fold_convert_loc(), fold_invert_truthvalue(), fold_vec_perm(), FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, gcc_unreachable, generic_simplify(), ggc_alloc(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), i, integer_all_onesp(), integer_onep(), integer_pow2p(), integer_zerop(), invert_tree_comparison(), invert_truthvalue_loc(), IS_EXPR_CODE_CLASS, known_le, wi::lshift(), native_encode_expr(), native_interpret_expr(), NULL, NULL_TREE, OEP_ONLY_CONST, operand_equal_for_comparison_p(), operand_equal_p(), protected_set_expr_location_unshare(), wi::shifted_mask(), sign_bit_p(), signed_type_for(), STRIP_NOPS, wi::to_wide(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, tree_fits_uhwi_p(), tree_log2(), TREE_OPERAND, TREE_SIDE_EFFECTS, tree_swap_operands_p(), tree_to_uhwi(), tree_to_vec_perm_builder(), TREE_TYPE, truth_value_p(), type(), type_contains_placeholder_p(), TYPE_PRECISION, TYPE_SIZE, TYPE_UNSIGNED, TYPE_VECTOR_SUBPARTS(), types_compatible_p(), unsigned_type_for(), VECTOR_CST_ELT, VECTOR_CST_NELTS, VECTOR_TYPE_P, VOID_TYPE_P, wide_int_to_tree(), and wi::zext().

Referenced by fold(), fold_build3_loc(), fold_gimple_assign(), gimple_fold_stmt_to_constant_1(), and maybe_fold_reference().

◆ fold_unary_ignore_overflow_loc()

tree fold_unary_ignore_overflow_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0 )
extern
If the operation was a conversion do _not_ mark a resulting constant
with TREE_OVERFLOW if the original constant was not.  These conversions
have implementation defined behavior and retaining the TREE_OVERFLOW
flag here would confuse later passes such as VRP.   

References CONVERT_EXPR_CODE_P, fold_unary_loc(), ggc_alloc(), TREE_CODE, and TREE_OVERFLOW.

◆ fold_unary_loc()

tree fold_unary_loc ( location_t loc,
enum tree_code code,
tree type,
tree op0 )
extern
Fold a unary expression of code CODE and type TYPE with operand
OP0.  Return the folded expression if folding is successful.
Otherwise, return NULL_TREE.   

References BITS_PER_WORD, build1_loc(), build2(), build2_loc(), build3(), build3_loc(), build_aligned_type(), build_fold_addr_expr_loc(), CASE_CONVERT, COMPARISON_CLASS_P, const_unop(), constant_boolean_node(), CONSTANT_CLASS_P, CONVERT_EXPR_CODE_P, CONVERT_EXPR_P, DECL_BIT_FIELD, fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), fold_build_pointer_plus_loc(), fold_convert_loc(), fold_negate_expr(), fold_truth_not_expr(), fold_unary_loc(), force_fit_type(), wide_int_storage::from(), gcc_assert, generic_simplify(), get_inner_reference(), ggc_alloc(), handled_component_p(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_M1U, in_gimple_form, INTEGRAL_TYPE_P, IS_EXPR_CODE_CLASS, known_eq, load_extend_op(), MAX, maybe_lvalue_p(), min_align_of_type(), NULL_TREE, offset, POINTER_TYPE_P, REF_REVERSE_STORAGE_ORDER, SANITIZE_ALIGNMENT, sanitize_flags_p(), SANITIZE_NULL, SANITIZE_SI_OVERFLOW, strip_float_extensions(), STRIP_NOPS, STRIP_SIGN_NOPS, suppress_warning(), tcc_unary, wi::to_wide(), TREE_CODE, TREE_CODE_CLASS, TREE_CODE_LENGTH, TREE_CONSTANT, tree_fits_uhwi_p(), TREE_OPERAND, TREE_OVERFLOW, TREE_READONLY, tree_to_uhwi(), TREE_TYPE, TREE_USED, type(), TYPE_ALIGN, TYPE_MAIN_VARIANT, TYPE_MODE, TYPE_OVERFLOW_WRAPS, TYPE_PRECISION, TYPE_QUALS, TYPE_SIGN, TYPE_UNQUALIFIED, TYPE_UNSIGNED, unsigned_type_for(), VAR_P, and VOID_TYPE_P.

Referenced by expand_expr_real_1(), fold(), fold_binary_loc(), fold_build1_loc(), fold_invert_truthvalue(), fold_unary_ignore_overflow_loc(), fold_unary_loc(), gimple_fold_stmt_to_constant_1(), and maybe_fold_reference().

◆ fold_unary_to_constant()

tree fold_unary_to_constant ( enum tree_code code,
tree type,
tree op0 )
extern
Given the components of a unary expression CODE, TYPE and OP0,
attempt to fold the expression to a constant without modifying
TYPE or OP0.

If the expression could be simplified to a constant, then return
the constant.  If the expression would not be simplified to a
constant, then return NULL_TREE.   

References fold_unary, ggc_alloc(), NULL_TREE, and TREE_CONSTANT.

◆ fold_undefer_and_ignore_overflow_warnings()

◆ fold_undefer_overflow_warnings()

void fold_undefer_overflow_warnings ( bool issue,
const gimple * stmt,
int code )
extern
Stop deferring overflow warnings.  If there is a pending warning,
and ISSUE is true, then issue the warning if appropriate.  STMT is
the statement with which the warning should be associated (used for
location information); STMT may be NULL.  CODE is the level of the
warning--a warn_strict_overflow_code value.  This function will use
the smaller of CODE and the deferred code when deciding whether to
issue the warning.  CODE may be zero to mean to always use the
deferred code.   

References fold_deferred_overflow_code, fold_deferred_overflow_warning, fold_deferring_overflow_warnings, gcc_assert, ggc_alloc(), gimple_location(), input_location, issue_strict_overflow_warning, NULL, warning_at(), and warning_suppressed_p().

Referenced by cleanup_control_expr_graph(), combine_cond_expr_cond(), evaluate_stmt(), fold_stmt_1(), fold_undefer_and_ignore_overflow_warnings(), and jump_threader::simplify_control_stmt_condition_1().

◆ get_array_ctor_element_at_index()

tree get_array_ctor_element_at_index ( tree ctor,
offset_int access_index,
unsigned * ctor_idx )
extern
Gets the element ACCESS_INDEX from CTOR, which must be a CONSTRUCTOR
of an array (or vector).  *CTOR_IDX if non-NULL is updated with the
constructor element index of the value returned.  If the element is
not found NULL_TREE is returned and *CTOR_IDX is updated to
the index of the element after the ACCESS_INDEX position (which
may be outside of the CTOR array).   

References wi::cmp(), CONSTRUCTOR_ELTS, wi::ext(), FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, gcc_checking_assert, ggc_alloc(), wi::gt_p(), in_gimple_form, wi::le_p(), NULL_TREE, SIGNED, wi::to_offset(), wi::to_wide(), TREE_CODE, tree_int_cst_lt(), TREE_OPERAND, TREE_TYPE, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_PRECISION, TYPE_SIGN, TYPE_UNSIGNED, and UNSIGNED.

Referenced by fold(), and fold_array_ctor_reference().

◆ getbyterep()

const char * getbyterep ( tree src,
unsigned HOST_WIDE_INT * strsize )
extern
Return a pointer to a NUL-terminated string containing the sequence
of bytes corresponding to the representation of the object referred to
by SRC (or a subsequence of such bytes within it if SRC is a reference
to an initialized constant array plus some constant offset).
Set *STRSIZE the number of bytes in the constant sequence including
the terminating NUL byte.  *STRSIZE is equal to sizeof(A) - OFFSET
where A is the array that stores the constant sequence that SRC points
to and OFFSET is the byte offset of SRC from the beginning of A.  SRC
need not point to a string or even an array of characters but may point
to an object of any type.   

References array_size, byte_representation(), ggc_alloc(), NULL, NULL_TREE, offset, string_constant(), tree_fits_uhwi_p(), TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_uhwi(), TREE_TYPE, and TYPE_SIZE_UNIT.

Referenced by c_getstr(), expand_builtin_memcmp(), expand_builtin_memory_copy_args(), fold_const_call(), gimple_fold_builtin_memchr(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_string_compare(), and inline_expand_builtin_bytecmp().

◆ int_const_binop()

tree int_const_binop ( enum tree_code code,
const_tree arg1,
const_tree arg2,
int overflowable )
extern
Combine two integer constants ARG1 and ARG2 under operation CODE to
produce a new constant.  Return NULL_TREE if we don't know how to
evaluate CODE at compile-time.   

References force_fit_type(), ggc_alloc(), NULL_TREE, wi::OVF_NONE, poly_int_binop(), poly_int_tree_p(), SIGNED, wi::to_wide(), TREE_CODE, TREE_OVERFLOW, TREE_TYPE, TYPE_PRECISION, TYPE_SIGN, and wide_int_binop().

Referenced by tree_switch_conversion::switch_conversion::build_constructors(), build_debug_ref_for_model(), build_ref_for_offset(), build_user_friendly_ref_for_offset(), tree_switch_conversion::switch_conversion::collect(), const_binop(), create_component_ref_by_pieces_1(), do_vec_narrow_conversion(), tree_switch_conversion::bit_test_cluster::emit(), expand_vector_comparison(), expand_vector_condition(), expand_vector_conversion(), expand_vector_piecewise(), extract_bit_test_mask(), find_case_label_range(), fold_binary_loc(), fold_comparison(), fold_const_call(), fold_const_call(), fold_div_compare(), get_up_bounds_for_array_ref(), inbounds_memaccess_p(), initialize_ao_ref_for_dse(), instrument_bool_enum_load(), inverse(), layout_type(), maybe_canonicalize_comparison_1(), maybe_canonicalize_mem_ref_addr(), maybe_fold_tmr(), maybe_rewrite_mem_ref_base(), ipa_param_adjustments::modify_call(), rt_bb_visited::push_rtcfg_pair(), simplify_using_ranges::simplify(), simplify_using_ranges::simplify_div_or_mod_using_ranges(), simplify_using_ranges::simplify_switch_using_ranges(), simplify_using_ranges::simplify_truth_ops_using_ranges(), size_binop_loc(), tree_fold_divides_p(), value_replacement(), vectorizable_live_operation(), vectorizable_live_operation_1(), vectorizable_load(), vectorizable_reduction(), vectorizable_scan_store(), vectorizable_store(), vn_reference_lookup_3(), and rt_bb_visited::vword().

◆ integer_valued_real_binary_p()

bool integer_valued_real_binary_p ( tree_code code,
tree op0,
tree op1,
int depth )
extern
Return true if the floating point result of (CODE OP0 OP1) has an
integer value.  We also allow +Inf, -Inf and NaN to be considered
integer values. Return false for signaling NaN.

DEPTH is the current nesting depth of the query.   

References ggc_alloc(), and RECURSE.

Referenced by gimple_assign_integer_valued_real_p(), and integer_valued_real_p().

◆ integer_valued_real_call_p()

bool integer_valued_real_call_p ( combined_fn fn,
tree arg0,
tree arg1,
int depth )
extern
Return true if the floating point result of calling FNDECL with arguments
ARG0 and ARG1 has an integer value.  We also allow +Inf, -Inf and NaN to be
considered integer values. Return false for signaling NaN.  If FNDECL
takes fewer than 2 arguments, the remaining ARGn are null.

DEPTH is the current nesting depth of the query.   

References ggc_alloc(), and RECURSE.

Referenced by gimple_call_integer_valued_real_p(), and integer_valued_real_p().

◆ integer_valued_real_p()

bool integer_valued_real_p ( tree t,
int depth )
extern
Return true if the floating point expression T has an integer value.
We also allow +Inf, -Inf and NaN to be considered integer values.
Return false for signaling NaN.

DEPTH is the current nesting depth of the query.   

References CALL_EXPR_ARG, call_expr_nargs, error_mark_node, get_call_combined_fn(), ggc_alloc(), integer_valued_real_binary_p(), integer_valued_real_call_p(), integer_valued_real_invalid_p(), integer_valued_real_single_p(), integer_valued_real_unary_p(), NULL_TREE, STRIP_ANY_LOCATION_WRAPPER, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_reference, tcc_unary, TREE_CODE, TREE_CODE_CLASS, and TREE_OPERAND.

◆ integer_valued_real_single_p()

bool integer_valued_real_single_p ( tree t,
int depth )
extern
Return true if the floating point expression T (a GIMPLE_SINGLE_RHS)
has an integer value.  We also allow +Inf, -Inf and NaN to be
considered integer values. Return false for signaling NaN.

DEPTH is the current nesting depth of the query.   

References ggc_alloc(), gimple_stmt_integer_valued_real_p(), name_registered_for_update_p(), real_isinteger(), RECURSE, SSA_NAME_DEF_STMT, TREE_CODE, TREE_OPERAND, TREE_REAL_CST_PTR, TREE_TYPE, and TYPE_MODE.

Referenced by gimple_assign_integer_valued_real_p(), gimple_phi_integer_valued_real_p(), and integer_valued_real_p().

◆ integer_valued_real_unary_p()

bool integer_valued_real_unary_p ( tree_code code,
tree op0,
int depth )
extern
Return true if the floating point result of (CODE OP0) has an
integer value.  We also allow +Inf, -Inf and NaN to be considered
integer values. Return false for signaling NaN.

DEPTH is the current nesting depth of the query.   

References CASE_CONVERT, ggc_alloc(), RECURSE, SCALAR_FLOAT_TYPE_P, TREE_CODE, and TREE_TYPE.

Referenced by gimple_assign_integer_valued_real_p(), and integer_valued_real_p().

◆ inverse_conditions_p()

bool inverse_conditions_p ( const_tree cond1,
const_tree cond2 )
extern
Return true if COND1 tests the opposite condition of COND2.   

References COMPARISON_CLASS_P, ggc_alloc(), HONOR_NANS(), invert_tree_comparison(), operand_equal_p(), TREE_CODE, and TREE_OPERAND.

Referenced by check_redundant_cond_expr().

◆ invert_tree_comparison()

◆ invert_truthvalue_loc()

tree invert_truthvalue_loc ( location_t loc,
tree arg )
extern
Return a simplified tree node for the truth-negation of ARG.  This
never alters ARG itself.  We assume that ARG is an operation that
returns a truth value (0 or 1 for scalars, 0 or -1 for vectors).   

References fold_build1_loc(), ggc_alloc(), TREE_CODE, TREE_TYPE, type(), and VECTOR_TYPE_P.

Referenced by build_range_check(), fold_binary_loc(), fold_range_test(), fold_ternary_loc(), fold_truth_not_expr(), record_edge_info(), and update_range_test().

◆ make_range()

tree make_range ( tree exp,
int * pin_p,
tree * plow,
tree * phigh,
bool * strict_overflow_p )
extern
Given EXP, a logical expression, set the range it is testing into
variables denoted by PIN_P, PLOW, and PHIGH.  Return the expression
actually being tested.  *PLOW and *PHIGH will be made of the same
type as the returned expression.  If EXP is not a comparison, we
will most likely not be returning a useful value and range.  Set
*STRICT_OVERFLOW_P to true if the return value is only valid
because signed overflow is undefined; otherwise, do not change
*STRICT_OVERFLOW_P.   

References build_int_cst(), exp(), EXPR_LOCATION, ggc_alloc(), integer_onep(), integer_type_node, IS_EXPR_CODE_CLASS, make_range_step(), NULL_TREE, range_binop(), tcc_binary, tcc_comparison, tcc_expression, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OPERAND_LENGTH, and TREE_TYPE.

Referenced by fold_range_test().

◆ make_range_step()

◆ may_negate_without_overflow_p()

bool may_negate_without_overflow_p ( const_tree t)
extern
Check whether we may negate an integer constant T without causing
overflow.   

References gcc_assert, ggc_alloc(), wi::only_sign_bit_p(), wi::to_wide(), TREE_CODE, TREE_TYPE, type(), and TYPE_UNSIGNED.

Referenced by create_iv(), and negate_expr_p().

◆ mem_ref_offset()

poly_offset_int mem_ref_offset ( const_tree t)
extern

◆ merge_ranges()

bool merge_ranges ( int * pin_p,
tree * plow,
tree * phigh,
int in0_p,
tree low0,
tree high0,
int in1_p,
tree low1,
tree high1 )
extern

◆ minmax_from_comparison()

tree_code minmax_from_comparison ( tree_code cmp,
tree exp0,
tree exp1,
tree exp2,
tree exp3 )
extern
This is a helper function to detect min/max for some operands of COND_EXPR.
The form is "(EXP0 CMP EXP1) ? EXP2 : EXP3".  

References cfun, get_range_query(), ggc_alloc(), HONOR_NANS(), HONOR_SIGNED_ZEROS(), operand_equal_p(), r, path_range_query::range_of_expr(), wi::to_widest(), TREE_CODE, TREE_TYPE, and TYPE_SIGN.

◆ multiple_of_p()

bool multiple_of_p ( tree type,
const_tree top,
const_tree bottom,
bool nowrap )
extern
Determine if first argument is a multiple of second argument.  Return
false if it is not, or we cannot easily determined it to be.

An example of the sort of thing we care about (at this point; this routine
could surely be made more general, and expanded to do what the *_DIV_EXPR's
fold cases do now) is discovering that

  SAVE_EXPR (I) * SAVE_EXPR (J * 8)

is a multiple of

  SAVE_EXPR (J * 8)

when we know that the two SAVE_EXPR (J * 8) nodes are the same node.

This code also handles discovering that

  SAVE_EXPR (I) * SAVE_EXPR (J * 8)

is a multiple of 8 so we don't have to worry about dealing with a
possible remainder.

Note that we *look* inside a SAVE_EXPR only to determine how it was
calculated; it is not safe for fold to do much of anything else with the
internals of a SAVE_EXPR, since it cannot know when it will be evaluated
at run time.  For example, the latter example above *cannot* be implemented
as SAVE_EXPR (I) * J or any variant thereof, since the value of J at
evaluation time of the original SAVE_EXPR is not necessarily the same at
the time the new expression is evaluated.  The only optimization of this
sort that would be valid is changing

  SAVE_EXPR (I) * SAVE_EXPR (SAVE_EXPR (J) * 8)

divided by 8 to

  SAVE_EXPR (I) * SAVE_EXPR (J)

(where the same SAVE_EXPR (J) is used in the original and the
transformed version).

NOWRAP specifies whether all outer operations in TYPE should
be considered not wrapping.  Any type conversion within TOP acts
as a barrier and we will fall back to NOWRAP being false.
NOWRAP is mostly used to treat expressions in TYPE_SIZE and friends
as not wrapping even though they are generally using unsigned arithmetic.   

References CASE_CONVERT, wi::fits_to_tree_p(), fold_build1, ggc_alloc(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), integer_pow2p(), integer_zerop(), wi::multiple_of_p(), multiple_of_p(), NULL, NULL_TREE, wi::one(), operand_equal_p(), POLY_INT_CST_P, poly_int_tree_p(), wi::sdiv_trunc(), SIGNED, SSA_NAME_DEF_STMT, wi::to_poly_widest(), wi::to_wide(), wi::to_widest(), TREE_CODE, tree_int_cst_sign_bit(), TREE_OPERAND, TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, TYPE_UNSIGNED, and wide_int_to_tree().

Referenced by determine_exit_conditions(), extract_muldiv_1(), fold_binary_loc(), handle_warn_if_not_align(), multiple_of_p(), number_of_iterations_ne(), number_of_iterations_ne_max(), place_field(), round_down_loc(), round_up_loc(), and should_interchange_loops().

◆ native_encode_expr()

int native_encode_expr ( const_tree expr,
unsigned char * ptr,
int len,
int off )
extern
Convert between trees and native memory representation.   
Subroutine of fold_view_convert_expr.  Encode the INTEGER_CST, REAL_CST,
FIXED_CST, COMPLEX_CST, STRING_CST, or VECTOR_CST specified by EXPR into
the buffer PTR of size LEN bytes.  If PTR is NULL, don't actually store
anything, just do a dry run.  Fail either if OFF is -1 and LEN isn't
sufficient to encode the entire EXPR, or if OFF is out of bounds.
Otherwise, start at byte offset OFF and encode at most LEN bytes.
Return the number of bytes placed in the buffer, or zero upon failure.   

References ggc_alloc(), native_encode_complex(), native_encode_fixed(), native_encode_int(), native_encode_real(), native_encode_string(), native_encode_vector(), and TREE_CODE.

Referenced by clear_padding_type(), const_with_all_bytes_same(), constant_byte_string(), strlen_pass::count_nonzero_bytes(), fold_array_ctor_reference(), fold_ctor_reference(), fold_ternary_loc(), fold_view_convert_expr(), fully_constant_vn_reference_p(), native_encode_complex(), native_encode_initializer(), native_encode_vector_part(), native_interpret_expr(), vn_walk_cb_data::push_partial_def(), vect_check_store_rhs(), and vn_reference_lookup_3().

◆ native_encode_initializer()

int native_encode_initializer ( tree init,
unsigned char * ptr,
int len,
int off,
unsigned char * mask )
extern
Similar to native_encode_expr, but also handle CONSTRUCTORs, VCEs,
NON_LVALUE_EXPRs and nops.  If MASK is non-NULL (then PTR has
to be non-NULL and OFF zero), then in addition to filling the
bytes pointed by PTR with the value also clear any bits pointed
by MASK that are known to be initialized, keep them as is for
e.g. uninitialized padding bits or uninitialized fields.   

References build_zero_cst(), CONSTRUCTOR_ELTS, CONSTRUCTOR_NO_CLEARING, count, DECL_BIT_FIELD, DECL_BIT_FIELD_REPRESENTATIVE, DECL_CHAIN, DECL_FIELD_BIT_OFFSET, DECL_PADDING_P, DECL_SIZE, DECL_SIZE_UNIT, find_bitfield_repr_type(), wi::fits_shwi_p(), gcc_assert, ggc_alloc(), ggc_free(), int_byte_position(), INT_MAX, int_size_in_bytes(), integer_zerop(), INTEGRAL_TYPE_P, wi::lshift(), MIN, native_encode_expr(), native_encode_initializer(), native_encode_int(), NULL, NULL_TREE, r, wi::sext(), sizetype, STRIP_NOPS, wi::to_offset(), wi::to_wide(), TREE_CODE, tree_fits_shwi_p(), tree_fits_uhwi_p(), TREE_OPERAND, tree_to_shwi(), tree_to_uhwi(), TREE_TYPE, TYPE_DOMAIN, TYPE_FIELDS, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_PRECISION, vec_safe_iterate(), and wide_int_to_tree().

Referenced by constant_byte_string(), fold_ctor_reference(), native_encode_initializer(), and tree_add_const_value_attribute().

◆ native_interpret_aggregate()

◆ native_interpret_expr()

tree native_interpret_expr ( tree type,
const unsigned char * ptr,
int len )
extern
Subroutine of fold_view_convert_expr.  Interpret the contents of
the buffer PTR of length LEN as a constant of type TYPE.  For
INTEGRAL_TYPE_P we return an INTEGER_CST, for SCALAR_FLOAT_TYPE_P
we return a REAL_CST, etc...  If the buffer cannot be interpreted,
return NULL_TREE.   

References clear_type_padding_in_mask(), GET_MODE_SIZE(), ggc_alloc(), native_encode_expr(), native_interpret_complex(), native_interpret_fixed(), native_interpret_int(), native_interpret_real(), native_interpret_vector(), NULL_TREE, SCALAR_FLOAT_TYPE_MODE, and TREE_CODE.

Referenced by clear_padding_flush(), fold_array_ctor_reference(), fold_ctor_reference(), fold_ternary_loc(), fold_view_convert_expr(), fully_constant_vn_reference_p(), native_interpret_aggregate(), native_interpret_complex(), native_interpret_vector_part(), vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

◆ native_interpret_real()

tree native_interpret_real ( tree type,
const unsigned char * ptr,
int len )
extern
Subroutine of native_interpret_expr.  Interpret the contents of
the buffer PTR of length LEN as a REAL_CST of type TYPE.
If the buffer cannot be interpreted, return NULL_TREE.   

References build_real(), gcc_assert, GET_MODE_SIZE(), ggc_alloc(), MIN, NULL_TREE, offset, r, real_from_target(), REAL_VALUE_TYPE, and SCALAR_FLOAT_TYPE_MODE.

Referenced by clear_padding_type(), and native_interpret_expr().

◆ negate_mathfn_p()

bool negate_mathfn_p ( combined_fn fn)
extern
Return true if the built-in mathematical function specified by CODE
is odd, i.e. -f(x) == f(-x).   

References ggc_alloc().

Referenced by fold_negate_expr_1(), and negate_expr_p().

◆ non_lvalue_loc()

tree non_lvalue_loc ( location_t loc,
tree x )
extern
Return an expr equal to X but certainly not valid as an lvalue.   

References build1_loc(), ggc_alloc(), in_gimple_form, maybe_lvalue_p(), and TREE_TYPE.

Referenced by fold_binary_loc(), fold_builtin_1(), omit_one_operand_loc(), and omit_two_operands_loc().

◆ omit_one_operand_loc()

tree omit_one_operand_loc ( location_t loc,
tree type,
tree result,
tree omitted )
extern
Return a tree for the case when the result of an expression is RESULT
converted to TYPE and OMITTED was previously an operand of the expression
but is now not needed (e.g., we folded OMITTED * 0).

If OMITTED has side effects, we must evaluate it.  Otherwise, just do
the conversion of RESULT to TYPE.   

References build1_loc(), build2_loc(), fold_convert_loc(), fold_ignored_result(), ggc_alloc(), IS_EMPTY_STMT, non_lvalue_loc(), TREE_SIDE_EFFECTS, and void_type_node.

Referenced by build_range_check(), fold_binary_loc(), fold_builtin_arith_overflow(), fold_builtin_classify(), fold_builtin_frexp(), fold_builtin_memcmp(), fold_builtin_strcspn(), fold_builtin_strpbrk(), and fold_comparison().

◆ omit_two_operands_loc()

tree omit_two_operands_loc ( location_t loc,
tree type,
tree result,
tree omitted1,
tree omitted2 )
extern
Return a tree for the case when the result of an expression is RESULT
converted to TYPE and OMITTED1 and OMITTED2 were previously operands
of the expression but are now not needed.

If OMITTED1 or OMITTED2 has side effects, they must be evaluated.
If both OMITTED1 and OMITTED2 have side effects, OMITTED1 is
evaluated before OMITTED2.  Otherwise, if neither has side effects,
just do the conversion of RESULT to TYPE.   

References build2_loc(), fold_convert_loc(), ggc_alloc(), non_lvalue_loc(), TREE_CODE, and TREE_SIDE_EFFECTS.

Referenced by fold_binary_loc(), fold_builtin_memcmp(), fold_builtin_strspn(), and fold_builtin_unordered_cmp().

◆ operand_equal_p()

bool operand_equal_p ( const_tree arg0,
const_tree arg1,
unsigned int flags )
extern
Conveinece wrapper around operand_compare class because usually we do
not need to play with the valueizer.   

References default_compare_instance, ggc_alloc(), and operand_compare::operand_equal_p().

Referenced by add_candidate_1(), add_type_duplicate(), adjust_offsets_for_equal_base_address(), aff_combination_add_elt(), aff_combination_find_elt(), affine_function_equal_p(), all_phi_incrs_profitable_1(), vect_scalar_ops_slice::all_same_p(), analyze_evolution_in_loop(), loop_cand::analyze_oloop_reduction_var(), analyze_overlapping_iterations(), and_comparisons_1(), arith_overflow_check_p(), bitwise_equal_p(), bitwise_inverted_equal_p(), bound_difference(), build_classic_dist_vector_1(), build_range_check(), bump_vector_ptr(), can_group_stmts_p(), cand_increment(), ccp_lattice_meet(), check_bounds_or_overlap(), check_loadstore(), check_loadstore(), check_redundant_cond_expr(), check_stmt_for_type_change(), chrec_apply(), loop_distribution::classify_builtin_ldst(), loop_cand::classify_simple_reduction(), clear_live_bytes_for_ref(), compare_values_warnv(), compatible_calls_p(), compatible_complex_nodes_p(), compute_access_range(), compute_avail(), cond_if_else_store_replacement(), cond_if_else_store_replacement_1(), constant_multiple_of(), convert_atomic_bit_not(), convert_to_divmod(), create_add_ssa_cand(), create_ifn_alias_checks(), create_intersect_range_checks_index(), create_phi_basis_1(), create_waw_or_war_checks(), degenerate_phi_result(), determine_group_iv_cost_cond(), determine_group_iv_cost_generic(), pcom_worker::determine_offset(), dr_may_alias_p(), dse_classify_store(), dse_optimize_stmt(), dump_alias_pair(), dump_mem_ref(), eliminate_redundant_comparison(), eliminate_dom_walker::eliminate_stmt(), pointer_equiv_analyzer::enter(), eq_evolutions_p(), asan_mem_ref_hasher::equal(), cand_chain_hasher::equal(), gimplify_hasher::equal(), mem_ref_hasher::equal(), iv_common_cand_hasher::equal(), iv_inv_expr_hasher::equal(), refs_hasher::equal(), sanopt_tree_couple_hash::equal(), sanopt_tree_triplet_hash::equal(), log_entry_hasher::equal(), tm_memop_hasher::equal(), tree_operand_hash_no_se::equal(), tree_operand_hash::equal(), innermost_loop_behavior_hash::equal(), vect_scalar_ops_slice_hash::equal(), default_hash_traits< scalar_cond_masked_key >::equal(), equal_mem_array_ref_p(), tree_vector_builder::equal_p(), ipa_call_context::equal_to(), ipa_icf::sem_variable::equals_wpa(), eval_subst(), evaluate_control_stmt_using_entry_checks(), execute_update_addresses_taken(), expand_assignment(), expand_builtin_memory_chk(), expand_expr_real_2(), expand_omp_atomic_cas(), expand_omp_atomic_fetch_op(), expand_omp_for_static_chunk(), expand_operands(), expand_vec_cond_optab_fn(), expr_expected_value_1(), expr_to_aff_combination(), expressions_equal_p(), extr_type_from_vtbl_ptr_store(), find_basis_for_base_expr(), find_matching_predicate_in_rest_chains(), find_or_create_group(), find_range_for_lhs(), vn_walk_cb_data::finish(), finish_bitfield_layout(), fold_addr_of_array_ref_difference(), fold_binary_loc(), fold_builtin_memcmp(), fold_comparison(), fold_cond_expr_with_comparison(), fold_div_compare(), fold_plusminus_mult_expr(), fold_range_test(), fold_ternary_loc(), fold_truth_andor(), fold_truth_andor_1(), fuse_memset_builtins(), gather_mem_refs_stmt(), get_computation_cost(), get_initial_def_for_reduction(), get_shiftadd_cost(), gimple_bitwise_equal_p(), gimple_bitwise_inverted_equal_p(), gimple_canonical_types_compatible_p(), gimple_compare_field_offset(), gimple_equal_p(), gimple_fold_builtin_memory_chk(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_realloc(), gimple_fold_builtin_strcpy(), gimple_fold_builtin_string_compare(), gimple_fold_builtin_stxcpy_chk(), gimple_fold_call(), gimple_fold_stmt_to_constant_1(), gimple_operand_equal_value_p(), strlen_pass::handle_builtin_memset(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_pointer_plus(), hashable_expr_equal_p(), hoist_adjacent_loads(), idx_infer_loop_bounds(), indirect_refs_may_alias_p(), infer_nonnull_range_by_attribute(), predicate::init_from_control_deps(), initialize_data_dependence_relation(), initializer_constant_valid_p_1(), inverse_conditions_p(), is_combined_permutation_identity(), is_divmod_with_given_divisor(), is_feasible_trace(), is_strlen_related_p(), loop_exits_before_overflow(), loop_iter_phi_semi_invariant_p(), lower_vec_perm(), make_forwarders_with_degenerate_phis(), mark_aliased_reaching_defs_necessary_1(), match_arith_overflow(), maybe_diag_stxncpy_trunc(), maybe_optimize_guarding_check(), maybe_optimize_mod_cmp(), maybe_optimize_ubsan_ptr_ifn(), ipa_polymorphic_call_context::meet_with(), mem_attrs_eq_p(), mem_expr_equal_p(), merge_last(), merge_ranges(), merge_truthop_with_opposite_arm(), minmax_from_comparison(), move_hint_to_base(), move_variant_to_index(), multiple_of_p(), narrowing_initializer_constant_valid_p(), ncd_with_phi(), non_rewritable_lvalue_p(), nonoverlapping_array_refs_p(), nonoverlapping_refs_since_match_p(), tree_vector_builder::note_representative(), oacc_entry_exit_ok_1(), odr_types_equivalent_p(), omp_accumulate_sibling_list(), operand_equal_for_comparison_p(), operand_equal_for_phi_arg_p(), operator==(), optimize_atomic_bit_test_and(), optimize_bitfield_assignment_op(), optimize_memcpy(), optimize_pow_to_exp(), optimize_spaceship(), dom_opt_dom_walker::optimize_stmt(), optimize_successive_divisions_p(), or_comparisons_1(), phi_args_equal_on_edges(), phi_convertible_by_degenerating_args(), phi_incr_cost_1(), pred_equal_p(), pred_expr_equal_p(), pred_neg_p(), predicate_rhs_code(), prune_runtime_alias_test_list(), ptr_difference_const(), range_predecessor(), range_successor(), record_biv_for_address_use(), record_group_use(), record_increment(), record_phi_increments_1(), refine_bounds_using_guard(), refine_value_range_using_guard(), remove_unused_ivs(), replace_mult_candidate(), replace_one_candidate(), replace_rhs_if_not_dup(), same_access_path_p(), same_bool_comparison_p(), same_bool_result_p(), same_data_refs(), same_data_refs_base_objects(), same_handler_p(), same_phi_args_p(), scan_operand_equal_p(), set_copy_of_val(), set_lattice_value(), set_ssa_val_to(), loop_distribution::share_memory_accesses(), should_interchange_loops(), simplify_1b(), simplify_builtin_call(), simplify_peeled_chrec(), simplify_replace_tree(), simplify_using_initial_conditions(), simplify_vector_constructor(), sink_common_stores_to_bb(), slsr_process_add(), slsr_process_phi(), sm_seq_valid_bb(), spaceship_replacement(), split_at_bb_p(), statement_sink_location(), stmt_is_power_of_op(), stmt_kills_ref_p(), stmt_may_generate_copy(), subset_of(), substitute_in_expr(), suitable_cond_bb(), test_for_singularity(), transform_add_to_multiply(), loop_distribution::transform_reduction_loop(), tree_binary_nonnegative_warnv_p(), twoval_comparison_p(), uniform_vector_p(), pcom_worker::valid_initializer_p(), valid_lattice_transition(), valid_mask_for_fold_vec_perm_cst_p(), values_equal_for_ipcp_p(), vect_add_slp_permutation(), vect_analyze_group_access_1(), vect_build_slp_tree_1(), vect_build_slp_tree_2(), vect_check_gather_scatter(), vect_check_lower_bound(), vect_create_constant_vectors(), vect_dr_aligned_if_peeled_dr_is(), vect_enhance_data_refs_alignment(), vect_find_reusable_accumulator(), vect_get_and_check_slp_defs(), vect_prune_runtime_alias_test_list(), vect_slp_tree_uniform_p(), vect_transform_cycle_phi(), vectorizable_shift(), vectorizable_with_step_bound_p(), verify_type_variant(), copy_prop::visit_phi(), vn_reference_insert(), vn_reference_lookup(), vn_reference_lookup_3(), vn_reference_lookup_pieces(), vrp_operand_equal_p(), and warn_types_mismatch().

◆ ptr_difference_const()

bool ptr_difference_const ( tree e1,
tree e2,
poly_int64 * diff )
extern
Returns true if addresses of E1 and E2 differ by a constant, false
otherwise.  If they do, E1 - E2 is stored in *DIFF.   

References cst_and_fits_in_hwi(), fold_build2, fold_convert, ggc_alloc(), int_cst_value(), operand_equal_p(), split_address_to_core_and_offset(), TREE_TYPE, and type().

◆ range_check_type()

◆ round_down_loc()

tree round_down_loc ( location_t loc,
tree value,
int divisor )
extern

◆ round_up_loc()

tree round_up_loc ( location_t loc,
tree value,
unsigned int divisor )
extern
Return the value of VALUE, rounded up to a multiple of DIVISOR.  

References build_int_cst(), force_fit_type(), ggc_alloc(), multiple_of_p(), NULL_TREE, pow2_or_zerop(), size_binop_loc(), wi::to_wide(), TREE_CODE, TREE_OVERFLOW, and TREE_TYPE.

◆ shift_bytes_in_array_left()

void shift_bytes_in_array_left ( unsigned char * ptr,
unsigned int sz,
unsigned int amnt )
extern
Routines for manipulation of native_encode_expr encoded data if the encoded
or extracted constant positions and/or sizes aren't byte aligned.   
Shift left the bytes in PTR of SZ elements by AMNT bits, carrying over the
bits between adjacent elements.  AMNT should be within
[0, BITS_PER_UNIT).
Example, AMNT = 2:
00011111|11100000 << 2 = 01111111|10000000
PTR[1]  | PTR[0]         PTR[1]  | PTR[0].   

References ggc_alloc(), and i.

Referenced by vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

◆ shift_bytes_in_array_right()

void shift_bytes_in_array_right ( unsigned char * ptr,
unsigned int sz,
unsigned int amnt )
extern
Like shift_bytes_in_array_left but for big-endian.
Shift right the bytes in PTR of SZ elements by AMNT bits, carrying over the
bits between adjacent elements.  AMNT should be within
[0, BITS_PER_UNIT).
Example, AMNT = 2:
00011111|11100000 >> 2 = 00000111|11111000
PTR[0]  | PTR[1]         PTR[0]  | PTR[1].   

References ggc_alloc(), and i.

Referenced by vn_walk_cb_data::push_partial_def(), and vn_reference_lookup_3().

◆ sign_bit_p()

tree sign_bit_p ( tree exp,
const_tree val )
extern
Subroutine for fold: determine if VAL is the INTEGER_CONST that
represents the sign bit of EXP's type.  If EXP represents a sign
or zero extension, also test VAL against the unextended type.
The return value is the (sub)expression whose sign bit is VAL,
or NULL_TREE otherwise.   

References exp(), ggc_alloc(), INTEGRAL_TYPE_P, NULL_TREE, wi::only_sign_bit_p(), sign_bit_p(), wi::to_wide(), TREE_CODE, TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, and TYPE_PRECISION.

Referenced by fold_ternary_loc(), and sign_bit_p().

◆ simple_condition_p()

bool simple_condition_p ( tree exp)
extern
Determine if an operand is simple enough to be evaluated unconditionally.
In addition to simple_operand_p, we assume that comparisons, conversions,
and logic-not operations are simple, if their operands are simple, too.   

References CONVERT_EXPR_P, exp(), generic_expr_could_trap_p(), ggc_alloc(), simple_condition_p(), simple_operand_p(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, and TREE_SIDE_EFFECTS.

Referenced by fold_truth_andor(), gimplify_call_expr(), and simple_condition_p().

◆ size_binop_loc()

tree size_binop_loc ( location_t loc,
enum tree_code code,
tree arg0,
tree arg1 )
extern

◆ size_diffop_loc()

tree size_diffop_loc ( location_t loc,
tree arg0,
tree arg1 )
extern
Given two values, either both of sizetype or both of bitsizetype,
compute the difference between the two values.  Return the value
in signed type corresponding to the type of the operands.   

References bitsizetype, build_int_cst(), fold_convert_loc(), gcc_assert, ggc_alloc(), int_binop_types_match_p(), sbitsizetype, signed_type_for(), size_binop_loc(), sizetype, ssizetype, TREE_CODE, tree_int_cst_equal(), tree_int_cst_lt(), TREE_TYPE, and TYPE_UNSIGNED.

Referenced by expand_expr_real_1(), and fold_read_from_constant_string().

◆ size_int_kind()

tree size_int_kind ( poly_int64 number,
enum size_type_kind kind )
extern
Create a sizetype INT_CST node with NUMBER sign extended.  KIND
indicates which particular sizetype to create.   

References build_int_cst(), and sizetype_tab.

◆ swap_tree_comparison()

◆ tree_binary_nonnegative_warnv_p()

bool tree_binary_nonnegative_warnv_p ( enum tree_code code,
tree type,
tree op0,
tree op1,
bool * strict_overflow_p,
int depth )
extern
Return true if (CODE OP0 OP1) is known to be non-negative.  If the return
value is based on the assumption that signed overflow is undefined,
set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References ANY_INTEGRAL_TYPE_P, FLOAT_TYPE_P, ggc_alloc(), MAX, operand_equal_p(), RECURSE, TREE_CODE, tree_expr_maybe_nan_p(), tree_int_cst_min_precision(), tree_int_cst_sgn(), TREE_OPERAND, tree_simple_nonnegative_warnv_p(), TREE_TYPE, TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, TYPE_UNSIGNED, and UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

◆ tree_binary_nonzero_warnv_p()

bool tree_binary_nonzero_warnv_p ( enum tree_code code,
tree type,
tree op0,
tree op1,
bool * strict_overflow_p )
extern
Return true when (CODE OP0 OP1) is an address and is known to be nonzero.
For floating point we further ensure that T is not denormal.
Similar logic is present in nonzero_address in rtlanal.h.

If the return value is based on the assumption that signed overflow
is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't
change *STRICT_OVERFLOW_P.   

References ANY_INTEGRAL_TYPE_P, ggc_alloc(), tree_expr_nonnegative_warnv_p, tree_expr_nonzero_warnv_p(), and TYPE_OVERFLOW_UNDEFINED.

Referenced by tree_expr_nonzero_warnv_p().

◆ tree_call_nonnegative_warnv_p()

bool tree_call_nonnegative_warnv_p ( tree type,
combined_fn fn,
tree arg0,
tree arg1,
bool * strict_overflow_p,
int depth )
extern
Return true if T is known to be non-negative.  If the return
value is based on the assumption that signed overflow is undefined,
set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References ggc_alloc(), HONOR_SIGNED_ZEROS(), real_from_integer(), real_identical(), real_to_integer(), REAL_VALUE_TYPE, RECURSE, SIGNED, TREE_CODE, tree_expr_maybe_nan_p(), tree_expr_maybe_signaling_nan_p(), TREE_INT_CST_LOW, TREE_REAL_CST, and tree_simple_nonnegative_warnv_p().

Referenced by gimple_call_nonnegative_warnv_p(), and tree_invalid_nonnegative_warnv_p().

◆ tree_expr_finite_p()

bool tree_expr_finite_p ( const_tree x)
extern
Return true if expression X cannot be (or contain) a NaN or infinity.
This function returns true for integer expressions, and returns
false if uncertain.   

References CALL_EXPR_ARG, element_mode(), get_call_combined_fn(), ggc_alloc(), HONOR_INFINITIES(), HONOR_NANS(), real_isfinite(), TREE_CODE, tree_expr_finite_p(), TREE_IMAGPART, TREE_OPERAND, TREE_REAL_CST_PTR, and TREE_REALPART.

Referenced by fold_builtin_classify(), tree_expr_finite_p(), and tree_expr_maybe_nan_p().

◆ tree_expr_infinite_p()

bool tree_expr_infinite_p ( const_tree x)
extern
Return true if expression X evaluates to an infinity.
This function returns false for integer expressions.   

References ggc_alloc(), HONOR_INFINITIES(), real_isinf(), TREE_CODE, tree_expr_infinite_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), and tree_expr_infinite_p().

◆ tree_expr_maybe_infinite_p()

bool tree_expr_maybe_infinite_p ( const_tree x)
extern
Return true if expression X could evaluate to an infinity.
This function returns false for integer expressions, and returns
true if uncertain.   

References ggc_alloc(), HONOR_INFINITIES(), real_isinf(), TREE_CODE, tree_expr_maybe_infinite_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), fold_builtin_fpclassify(), and tree_expr_maybe_infinite_p().

◆ tree_expr_maybe_nan_p()

bool tree_expr_maybe_nan_p ( const_tree x)
extern

◆ tree_expr_maybe_real_minus_zero_p()

bool tree_expr_maybe_real_minus_zero_p ( const_tree x)
extern
Return true if expression X could evaluate to -0.0.
This function returns true if uncertain.   

References get_call_combined_fn(), ggc_alloc(), HONOR_SIGNED_ZEROS(), REAL_VALUE_MINUS_ZERO, TREE_CODE, tree_expr_maybe_real_minus_zero_p(), TREE_OPERAND, and TREE_REAL_CST.

Referenced by fold_real_zero_addition_p(), and tree_expr_maybe_real_minus_zero_p().

◆ tree_expr_maybe_signaling_nan_p()

bool tree_expr_maybe_signaling_nan_p ( const_tree x)
extern
Return true if expression X could evaluate to a signaling NaN.
This function returns false for integer expressions, and returns
true if uncertain.   

References CALL_EXPR_ARG, get_call_combined_fn(), ggc_alloc(), HONOR_SNANS(), real_issignaling_nan(), TREE_CODE, tree_expr_maybe_signaling_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_real_zero_addition_p(), tree_call_nonnegative_warnv_p(), and tree_expr_maybe_signaling_nan_p().

◆ tree_expr_nan_p()

bool tree_expr_nan_p ( const_tree x)
extern
Return true if expression X evaluates to a NaN.
This function returns false for integer expressions.   

References ggc_alloc(), HONOR_NANS(), real_isnan(), TREE_CODE, tree_expr_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by fold_builtin_classify(), fold_builtin_unordered_cmp(), and tree_expr_nan_p().

◆ tree_expr_nonnegative_p()

bool tree_expr_nonnegative_p ( tree t)
extern
Return true if `t' is known to be non-negative.  Handle warnings
about undefined signed overflow.   

References fold_overflow_warning(), ggc_alloc(), tree_expr_nonnegative_warnv_p, and WARN_STRICT_OVERFLOW_MISC.

Referenced by derive_constant_upper_bound_ops(), and gimple_expand_builtin_pow().

◆ tree_expr_nonnegative_warnv_p()

bool tree_expr_nonnegative_warnv_p ( tree t,
bool * strict_overflow_p,
int depth )
extern
Return true if T is known to be non-negative.  If the return
value is based on the assumption that signed overflow is undefined,
set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References error_mark_node, ggc_alloc(), tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_reference, tcc_unary, tree_binary_nonnegative_warnv_p(), TREE_CODE, TREE_CODE_CLASS, tree_invalid_nonnegative_warnv_p(), TREE_OPERAND, tree_single_nonnegative_warnv_p(), TREE_TYPE, and tree_unary_nonnegative_warnv_p().

◆ tree_expr_nonzero_p()

bool tree_expr_nonzero_p ( tree t)
extern
Return true when T is an address and is known to be nonzero.
Handle warnings about undefined signed overflow.   

References fold_overflow_warning(), ggc_alloc(), tree_expr_nonzero_warnv_p(), and WARN_STRICT_OVERFLOW_MISC.

Referenced by strlen_pass::count_nonzero_bytes(), match_single_bit_test(), and simplify_count_trailing_zeroes().

◆ tree_expr_signaling_nan_p()

bool tree_expr_signaling_nan_p ( const_tree x)
extern
Return true if expression X evaluates to a signaling NaN.
This function returns false for integer expressions.   

References ggc_alloc(), HONOR_SNANS(), real_issignaling_nan(), TREE_CODE, tree_expr_signaling_nan_p(), TREE_OPERAND, and TREE_REAL_CST_PTR.

Referenced by tree_expr_signaling_nan_p().

◆ tree_nonzero_bits()

◆ tree_single_nonnegative_warnv_p()

bool tree_single_nonnegative_warnv_p ( tree t,
bool * strict_overflow_p,
int depth )
extern
Return true if T is known to be non-negative.  If the return
value is based on the assumption that signed overflow is undefined,
set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References FIXED_VALUE_NEGATIVE, ggc_alloc(), gimple_stmt_nonnegative_warnv_p(), name_registered_for_update_p(), REAL_VALUE_NEGATIVE, RECURSE, SSA_NAME_DEF_STMT, TREE_CODE, TREE_FIXED_CST, tree_int_cst_sgn(), TREE_OPERAND, TREE_REAL_CST, tree_simple_nonnegative_warnv_p(), TREE_TYPE, and TYPE_UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), gimple_phi_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

◆ tree_single_nonzero_warnv_p()

bool tree_single_nonzero_warnv_p ( tree t,
bool * strict_overflow_p )
extern
Return true when T is an address and is known to be nonzero.
For floating point we further ensure that T is not denormal.
Similar logic is present in nonzero_address in rtlanal.h.

If the return value is based on the assumption that signed overflow
is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't
change *STRICT_OVERFLOW_P.   

References CONSTANT_CLASS_P, DECL_P, expr_not_equal_to(), get_base_address(), ggc_alloc(), integer_zerop(), INTEGRAL_TYPE_P, maybe_nonzero_address(), TARGET_EXPR_SLOT, TREE_CODE, tree_expr_nonzero_warnv_p(), TREE_OPERAND, TREE_TYPE, TYPE_PRECISION, and wi::zero().

Referenced by absorbing_element_p(), range_query::get_tree_range(), ipa_compute_jump_functions_for_edge(), fold_using_range::range_of_address(), and tree_expr_nonzero_warnv_p().

◆ tree_swap_operands_p()

◆ tree_unary_nonnegative_warnv_p()

bool tree_unary_nonnegative_warnv_p ( enum tree_code code,
tree type,
tree op0,
bool * strict_overflow_p,
int depth )
extern
Return true if (CODE OP0) is known to be non-negative.  If the return
value is based on the assumption that signed overflow is undefined,
set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References ANY_INTEGRAL_TYPE_P, CASE_CONVERT, ggc_alloc(), INTEGRAL_TYPE_P, RECURSE, SCALAR_FLOAT_TYPE_P, tree_simple_nonnegative_warnv_p(), TREE_TYPE, type(), TYPE_OVERFLOW_UNDEFINED, TYPE_PRECISION, and TYPE_UNSIGNED.

Referenced by gimple_assign_nonnegative_warnv_p(), and tree_expr_nonnegative_warnv_p().

◆ tree_unary_nonzero_warnv_p()

bool tree_unary_nonzero_warnv_p ( enum tree_code code,
tree type,
tree op0,
bool * strict_overflow_p )
extern
Return true when (CODE OP0) is an address and is known to be nonzero.
For floating point we further ensure that T is not denormal.
Similar logic is present in nonzero_address in rtlanal.h.

If the return value is based on the assumption that signed overflow
is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't
change *STRICT_OVERFLOW_P.   

References ggc_alloc(), tree_expr_nonzero_warnv_p(), TREE_TYPE, type(), and TYPE_PRECISION.

Referenced by tree_expr_nonzero_warnv_p().

◆ wide_int_binop()

bool wide_int_binop ( wide_int & res,
enum tree_code code,
const wide_int & arg1,
const wide_int & arg2,
signop sign,
wi::overflow_type * overflow )
extern
Combine two wide ints ARG1 and ARG2 under operation CODE to produce
a new constant in RES.  Return FALSE if we don't know how to
evaluate CODE at compile-time.   

References wi::add(), wi::bit_and(), wi::bit_or(), wi::bit_xor(), wi::div_ceil(), wi::div_floor(), wi::div_round(), wi::div_trunc(), ggc_alloc(), wi::lrotate(), wi::lshift(), wi::max(), wi::min(), wi::mod_ceil(), wi::mod_floor(), wi::mod_round(), wi::mod_trunc(), wi::mul(), wi::mul_high(), wi::neg_p(), wi::OVF_NONE, wi::rrotate(), wi::rshift(), and wi::sub().

Referenced by int_const_binop().

Variable Documentation

◆ folding_cxx_constexpr

bool folding_cxx_constexpr
extern
Nonzero if we are folding C++ manifestly-constant-evaluated context; zero
otherwise.
Should be used when certain constructs shouldn't be optimized
during folding in that context.   

Referenced by address_compare().

◆ folding_initializer

int folding_initializer
extern
Fold a constant sub-tree into a single node for C-compiler
   Copyright (C) 1987-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Nonzero if we are folding constants inside an initializer or a C++
manifestly-constant-evaluated context; zero otherwise.
Should be used when folding in initializer enables additional
optimizations.   
Nonzero if we are folding constants inside an initializer or a C++
manifestly-constant-evaluated context; zero otherwise.
Should be used when folding in initializer enables additional
optimizations.   

Referenced by address_compare(), const_binop(), symtab_node::equal_address_to(), fold_builtin_constant_p(), and maybe_nonzero_address().