GCC Middle and Back End API Reference
|
#include <mpc.h>
Go to the source code of this file.
Data Structures | |
struct | target_builtins |
struct | c_strlen_data |
Macros | |
#define | this_target_builtins (&default_target_builtins) |
Variables | |
struct target_builtins | default_target_builtins |
bool | force_folding_builtin_constant_p |
unsigned HOST_WIDE_INT | target_newline |
unsigned HOST_WIDE_INT | target_percent |
char | target_percent_s [3] |
char | target_percent_c [3] |
char | target_percent_s_newline [4] |
#define this_target_builtins (&default_target_builtins) |
|
extern |
Check whether there is an internal function associated with function CFN and return type RETURN_TYPE. Return the function if so, otherwise return IFN_LAST. Note that this function only tests whether the function is defined in internals.def, not whether it is actually available on the target.
References as_builtin_fn(), as_internal_fn(), associated_internal_fn(), and internal_fn_p().
|
extern |
If BUILT_IN_NORMAL function FNDECL has an associated internal function, return its code, otherwise return IFN_LAST. Note that this function only tests whether the function is defined in internals.def, not whether it is actually available on the target.
References associated_internal_fn(), BUILT_IN_NORMAL, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), gcc_checking_assert, and TREE_TYPE.
Return true if FNDECL shouldn't be folded right now. If a built-in function has an inline attribute always_inline wrapper, defer folding it after always_inline functions have been inlined, otherwise e.g. -D_FORTIFY_SOURCE checking might not be performed.
References cfun, DECL_ATTRIBUTES, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, and lookup_attribute().
Referenced by fold_builtin_call_array(), fold_call_expr(), fold_call_stmt(), and gimple_fold_builtin().
|
extern |
Determine whether a tree node represents a call to a built-in function. If the tree T is a call to a built-in function with the right number of arguments of the appropriate types, return the DECL_FUNCTION_CODE of the call, e.g. BUILT_IN_SQRT. Otherwise the return value is END_BUILTINS.
References BUILT_IN_NORMAL, COMPLEX_FLOAT_TYPE_P, DECL_FUNCTION_CODE(), END_BUILTINS, fndecl_built_in_p(), get_callee_fndecl(), INTEGRAL_TYPE_P, more_const_call_expr_args_p(), NULL_TREE, POINTER_TYPE_P, SCALAR_FLOAT_TYPE_P, TREE_CHAIN, TREE_CODE, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and VOID_TYPE_P.
Referenced by convert_to_integer_1(), and convert_to_real_1().
|
extern |
Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) bytes from constant string DATA + OFFSET and return it as target constant. If PREV isn't nullptr, it has the RTL info from the previous iteration.
References c_readstr(), emit_move_insn(), gcc_assert, gen_const_vec_duplicate(), gen_int_mode(), gen_memset_value_from_prev(), gen_reg_rtx(), GET_MODE_INNER, GET_MODE_SIZE(), expand_operand::mode, NULL, expand_operand::target, and VECTOR_MODE_P.
Referenced by asan_emit_stack_protection(), clear_by_pieces(), expand_builtin_memset_args(), gimple_stringops_transform(), and try_store_by_multiple_pieces().
|
extern |
Callback routine for store_by_pieces. Read GET_MODE_BITSIZE (MODE) bytes from constant string DATA + OFFSET and return it as target constant.
References c_readstr(), const0_rtx, expand_operand::mode, and offset.
Referenced by expand_builtin_strncpy(), and simplify_builtin_call().
Return true if the builtin DECL is implemented in a standard library. Otherwise return false which doesn't guarantee it is not (thus the list of handled builtins below may be incomplete).
References BUILT_IN_NORMAL, CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, DECL_BUILT_IN_CLASS, and DECL_FUNCTION_CODE().
Referenced by symtab_node::output_to_lto_symbol_table_p().
|
extern |
Return a constant integer corresponding to target reading GET_MODE_BITSIZE (MODE) bits from string constant STR. If NULL_TERMINATED_P, reading stops after '\0' character, all further ones are assumed to be zero, otherwise it reads as many characters as needed.
References GET_MODE_SIZE(), i, and native_decode_rtx().
Referenced by builtin_memcpy_read_str(), builtin_memset_gen_str(), builtin_memset_read_str(), builtin_strncpy_read_str(), inline_string_cmp(), and string_cst_read_str().
|
extern |
Compute the length of a null-terminated character string or wide character string handling character sizes of 1, 2, and 4 bytes. TREE_STRING_LENGTH is not the right way because it evaluates to the size of the character array in bytes (as opposed to characters) and because it can contain a zero byte in the middle. ONLY_VALUE should be nonzero if the result is not going to be emitted into the instruction stream and zero if it is going to be expanded. E.g. with i++ ? "foo" : "bar", if ONLY_VALUE is nonzero, constant 3 is returned, otherwise NULL, since len = c_strlen (ARG, 1); if (len) expand_expr (len, ...); would not evaluate the side-effects. If ONLY_VALUE is two then we do not emit warnings about out-of-bound accesses. Note that this implies the result is not going to be emitted into the instruction stream. Additional information about the string accessed may be recorded in DATA. For example, if ARG references an unterminated string, then the declaration will be stored in the DECL field. If the length of the unterminated string can be determined, it'll be stored in the LEN field. Note this length could well be different than what a C strlen call would return. ELTSIZE is 1 for normal single byte character strings, and 2 or 4 for wide characer strings. ELTSIZE is by default 1. The value returned is of type `ssizetype'.
References boolean_type_node, build_zero_cst(), c_strlen(), DECL_SOURCE_LOCATION, EXPR_LOC_OR_LOC, fold_build2_loc(), fold_build3_loc(), fold_convert_loc(), gcc_checking_assert, inform(), input_location, NULL_TREE, save_expr(), size_int, sizetype, ssize_int, ssizetype, string_constant(), string_length(), STRIP_NOPS, suppress_warning(), TREE_CODE, tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_STRING_LENGTH, TREE_STRING_POINTER, tree_to_uhwi(), TREE_TYPE, TYPE_SIZE_UNIT, warning_at(), and warning_suppressed_p().
Referenced by c_strlen(), expand_builtin_stpcpy_1(), expand_builtin_strcmp(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_builtin_strnlen(), fold_builtin_strlen(), get_range_strlen_tree(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_sprintf_chk(), gimple_fold_builtin_stpcpy(), gimple_fold_builtin_strncat(), gimple_fold_builtin_strncat_chk(), gimple_fold_builtin_stxcpy_chk(), maybe_emit_sprintf_chk_warning(), strdup_object_size(), and unterminated_array().
Return true if NODE should be considered for inline expansion regardless of the optimization level. This means whenever a function is invoked with its "internal" name, which normally contains the prefix "__builtin".
References DECL_NAME, IDENTIFIER_POINTER, and is_builtin_name().
Referenced by expand_builtin(), and expand_call_stmt().
|
extern |
Default target-specific builtin expander that does nothing.
References NULL_RTX.
|
extern |
If arguments ARG0 and ARG1 are a COMPLEX_CST, call the two-argument mpc function FUNC on it and return the resulting value as a tree with type TYPE. The mpfr precision is set to the precision of TYPE. We assume that function FUNC returns zero if the result could be calculated exactly within the requested precision. If DO_NONFINITE is true, then fold expressions containing Inf or NaN in the arguments and/or results.
References b, do_mpc_ckconv(), mpfr_from_real(), NULL_TREE, real_format::p, real_isfinite(), REAL_MODE_FORMAT, REAL_VALUE_TYPE, real_format::round_towards_zero, SCALAR_FLOAT_TYPE_P, STRIP_NOPS, TREE_CODE, TREE_IMAGPART, TREE_OVERFLOW, TREE_REAL_CST_PTR, TREE_REALPART, TREE_TYPE, and TYPE_MODE.
Referenced by const_binop().
Expand an expression EXP that calls a built-in function, with result going to TARGET if that's convenient (and in mode MODE if that's convenient). SUBTARGET may be used as the target for computing one of EXP's operands. IGNORE is nonzero if the value is to be ignored.
References AGGREGATE_TYPE_P, ALLOCA_FUNCTION_CODE_P, asan_intercepted_p(), asan_memfn_rtl(), boolean_type_node, build_call_vec(), build_fold_addr_expr, BUILT_IN_MD, builtin_decl_explicit(), CALL_EXPR_ARG, CALL_EXPR_FN, call_expr_nargs, called_as_built_in(), CASE_BUILT_IN_ALLOCA, CASE_FLT_FN, CASE_FLT_FN_FLOATN_NX, CASE_INT_FN, const0_rtx, const1_rtx, current_function_decl, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), DECL_RESULT, DECL_RTL, ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_PURE, error(), exp(), expand_asan_emit_allocas_unpoison(), expand_builtin___clear_cache(), expand_builtin_adjust_descriptor(), expand_builtin_adjust_trampoline(), expand_builtin_alloca(), expand_builtin_apply(), expand_builtin_apply_args(), expand_builtin_assume_aligned(), expand_builtin_atomic_always_lock_free(), expand_builtin_atomic_clear(), expand_builtin_atomic_compare_exchange(), expand_builtin_atomic_exchange(), expand_builtin_atomic_fetch_op(), expand_builtin_atomic_is_lock_free(), expand_builtin_atomic_load(), expand_builtin_atomic_signal_fence(), expand_builtin_atomic_store(), expand_builtin_atomic_test_and_set(), expand_builtin_atomic_thread_fence(), expand_builtin_bswap(), expand_builtin_bzero(), expand_builtin_cexpi(), expand_builtin_classify_type(), expand_builtin_compare_and_swap(), expand_builtin_copysign(), expand_builtin_crc_table_based(), expand_builtin_dwarf_sp_column(), expand_builtin_eh_copy_values(), expand_builtin_eh_filter(), expand_builtin_eh_pointer(), expand_builtin_eh_return(), expand_builtin_eh_return_data_regno(), expand_builtin_expect(), expand_builtin_expect_with_probability(), expand_builtin_extend_pointer(), expand_builtin_extract_return_addr(), expand_builtin_fabs(), expand_builtin_feclear_feraise_except(), expand_builtin_fegetround(), expand_builtin_fork_or_exec(), expand_builtin_frame_address(), expand_builtin_frob_return_addr(), expand_builtin_goacc_parlevel_id_size(), expand_builtin_init_descriptor(), expand_builtin_init_dwarf_reg_sizes(), expand_builtin_init_trampoline(), expand_builtin_int_roundingfn(), expand_builtin_int_roundingfn_2(), expand_builtin_interclass_mathfn(), expand_builtin_issignaling(), expand_builtin_longjmp(), expand_builtin_mathfn_3(), expand_builtin_mathfn_ternary(), expand_builtin_memcmp(), expand_builtin_memcpy(), expand_builtin_memmove(), expand_builtin_memory_chk(), expand_builtin_mempcpy(), expand_builtin_memset(), expand_builtin_next_arg(), expand_builtin_nonlocal_goto(), expand_builtin_object_size(), expand_builtin_powi(), expand_builtin_prefetch(), expand_builtin_return(), expand_builtin_saveregs(), expand_builtin_set_thread_pointer(), expand_builtin_setjmp_receiver(), expand_builtin_setjmp_setup(), expand_builtin_signbit(), expand_builtin_sincos(), expand_builtin_stack_address(), expand_builtin_stpcpy(), expand_builtin_strcmp(), expand_builtin_strcpy(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_builtin_strnlen(), expand_builtin_strub_enter(), expand_builtin_strub_leave(), expand_builtin_strub_update(), expand_builtin_sync_lock_release(), expand_builtin_sync_lock_test_and_set(), expand_builtin_sync_operation(), expand_builtin_sync_synchronize(), expand_builtin_thread_pointer(), expand_builtin_trap(), expand_builtin_unop(), expand_builtin_unreachable(), expand_builtin_unwind_init(), expand_builtin_update_setjmp_buf(), expand_builtin_va_copy(), expand_builtin_va_end(), expand_builtin_va_start(), expand_call(), expand_expr(), EXPAND_NORMAL, expand_normal(), expand_speculation_safe_value(), expand_stack_restore(), expand_stack_save(), flags_from_decl_or_type(), fold_builtin_next_arg(), FOR_EACH_CALL_EXPR_ARG, FORCED_LABEL, gcc_assert, gcc_fallthrough, gcc_unreachable, gen_reg_rtx(), gen_rtx_INSN_LIST(), get_builtin_sync_mode(), get_callee_fndecl(), i, ILSOP_MEMCMP, ILSOP_MEMCPY, ILSOP_MEMMOVE, ILSOP_MEMSET, label_rtx(), maybe_emit_chk_warning(), maybe_emit_sprintf_chk_warning(), MEM_P, expand_operand::mode, nonlocal_goto_handler_labels, register_operand(), SANITIZE_ADDRESS, sanitize_flags_p(), SANITIZE_HWADDRESS, SANITIZE_KERNEL_ADDRESS, SANITIZE_KERNEL_HWADDRESS, expand_operand::target, targetm, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_MODE, validate_arglist(), expand_operand::value, vec_alloc(), virtual_cfa_rtx, and XEXP.
Referenced by expand_expr_real_1(), expand_ifn_atomic_bit_test_and(), and expand_ifn_atomic_op_fetch_cmp_0().
|
extern |
Expand CRC* or REV_CRC* built-ins.
References CALL_EXPR_ARG, exp(), expand_crc_table_based(), expand_normal(), expand_reversed_crc_table_based(), gcc_assert, gen_int_mode(), gen_reg_rtx(), generate_reflecting_code_standard(), expand_operand::mode, expand_operand::target, TREE_CODE, and TREE_INT_CST_LOW.
Referenced by expand_builtin().
Expand expression EXP, which is a call to the memset builtin. Return NULL_RTX if we failed the caller should emit a normal call, otherwise try to get the result in TARGET, if convenient (and in mode MODE if that's convenient).
References CALL_EXPR_ARG, exp(), expand_builtin_memset_args(), expand_operand::mode, NULL_RTX, expand_operand::target, and validate_arglist().
Referenced by expand_builtin(), and expand_DEFERRED_INIT().
|
extern |
Expand a call to __builtin_saveregs, generating the result in TARGET, if that's convenient.
References emit_insn_after(), end_sequence(), entry_of_function(), get_insns(), pop_topmost_sequence(), push_topmost_sequence(), saveregs_value, start_sequence(), and targetm.
Referenced by expand_builtin().
|
extern |
Construct the trailing part of a __builtin_setjmp call. This is also called directly by the SJLJ exception handling code. If RECEIVER_LABEL is NULL, instead contruct a nonlocal goto handler.
References copy_to_reg(), crtl, current_function_decl, emit_clobber(), emit_insn(), emit_move_insn(), emit_use(), fixed_regs, gen_blockage(), get_arg_pointer_save_area(), HARD_FRAME_POINTER_IS_ARG_POINTER, HARD_FRAME_POINTER_REGNUM, hard_frame_pointer_rtx, i, NULL, REG_P, rtx_for_static_chain(), and targetm.
Referenced by expand_builtin(), expand_label(), and sjlj_emit_dispatch_table().
Construct the leading half of a __builtin_setjmp call. Control will return to RECEIVER_LABEL. This is also called directly by the SJLJ exception handling code.
References cfun, convert_memory_address, emit_insn(), emit_move_insn(), emit_stack_save(), force_operand(), force_reg(), gen_rtx_MEM(), GET_MODE_SIZE(), hard_frame_pointer_rtx, new_alias_set(), NULL_RTX, plus_constant(), SAVE_NONLOCAL, set_mem_alias_set(), setjmp_alias_set, targetm, and validize_mem().
Referenced by expand_builtin(), and sjlj_emit_function_enter().
|
extern |
References ACCUMULATE_OUTGOING_ARGS, add_args_size_note(), build_call_expr(), builtin_decl_implicit(), emit_barrier(), emit_insn(), expand_call(), NULL_RTX, stack_pointer_delta, and targetm.
Referenced by expand_assignment(), expand_builtin(), expand_builtin_object_size(), and expand_sjlj_dispatch_table().
|
extern |
__builtin_update_setjmp_buf is passed a pointer to an array of five words (not all will be used on all machines) that was passed to __builtin_setjmp. It updates the stack pointer in that block to the current value. This is also called directly by the SJLJ exception handling code.
References convert_memory_address, emit_stack_save(), gen_rtx_MEM(), GET_MODE_SIZE(), memory_address, plus_constant(), and SAVE_NONLOCAL.
Referenced by expand_builtin(), and sjlj_mark_call_sites().
|
extern |
Expand IFN_ATOMIC_BIT_TEST_AND_* internal function.
References build_call_nary(), const0_rtx, const1_rtx, create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_move_insn(), exp(), expand_atomic_fetch_op(), expand_builtin(), expand_expr(), expand_expr_force_mode(), expand_simple_binop(), expand_simple_unop(), EXPAND_WRITE, gcc_assert, gcc_unreachable, gen_reg_rtx(), get_builtin_sync_mem(), get_memmodel(), gimple_call_addr_fndecl(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_lhs(), gimple_call_num_args(), integer_onep(), integer_zero_node, make_tree(), maybe_expand_insn(), MEMMODEL_SYNC_SEQ_CST, expand_operand::mode, NULL_RTX, NULL_TREE, OPTAB_DIRECT, expand_operand::target, TREE_TYPE, and TYPE_MODE.
Referenced by expand_ATOMIC_BIT_TEST_AND_COMPLEMENT(), expand_ATOMIC_BIT_TEST_AND_RESET(), and expand_ATOMIC_BIT_TEST_AND_SET().
|
extern |
Expand IFN_ATOMIC_COMPARE_EXCHANGE internal function.
References convert_modes(), expand_atomic_compare_and_swap(), expand_expr(), expand_expr_force_mode(), expand_ifn_atomic_compare_exchange_into_call(), EXPAND_WRITE, failure, gcc_assert, get_builtin_sync_mem(), get_memmodel(), GET_MODE, gimple_call_arg(), gimple_call_lhs(), int_mode_for_size(), is_mm_acq_rel(), is_mm_release(), MEMMODEL_SEQ_CST, NULL, NULL_RTX, opt_mode< T >::require(), tree_to_shwi(), and write_complex_part().
Referenced by expand_ATOMIC_COMPARE_EXCHANGE().
|
extern |
Expand IFN_ATOMIC_*_FETCH_CMP_0 internal function.
References ATOMIC_OP_FETCH_CMP_0_EQ, ATOMIC_OP_FETCH_CMP_0_GE, ATOMIC_OP_FETCH_CMP_0_GT, ATOMIC_OP_FETCH_CMP_0_LE, ATOMIC_OP_FETCH_CMP_0_LT, ATOMIC_OP_FETCH_CMP_0_NE, boolean_type_node, build_call_nary(), comp, const0_rtx, create_convert_operand_to(), create_fixed_operand(), create_integer_operand(), create_output_operand(), direct_optab_handler(), emit_move_insn(), emit_store_flag_force(), exp(), expand_atomic_fetch_op(), expand_builtin(), expand_expr(), expand_expr_force_mode(), EXPAND_WRITE, gcc_assert, gcc_unreachable, gen_reg_rtx(), get_builtin_sync_mem(), get_memmodel(), gimple_call_addr_fndecl(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_lhs(), gimple_call_num_args(), integer_zero_node, maybe_expand_insn(), MEMMODEL_SYNC_SEQ_CST, expand_operand::mode, NULL_RTX, NULL_TREE, expand_operand::target, tree_to_uhwi(), TREE_TYPE, and TYPE_MODE.
Referenced by expand_ATOMIC_ADD_FETCH_CMP_0(), expand_ATOMIC_AND_FETCH_CMP_0(), expand_ATOMIC_OR_FETCH_CMP_0(), expand_ATOMIC_SUB_FETCH_CMP_0(), and expand_ATOMIC_XOR_FETCH_CMP_0().
Fold a CALL_EXPR with type TYPE with FN as the function expression. N arguments are passed in the array ARGARRAY. Return a folded expression or NULL_TREE if no simplification was possible.
References avoid_folding_inline_builtin(), BUILT_IN_MD, DECL_BUILT_IN_CLASS, fndecl_built_in_p(), fold_builtin_n(), get_callee_fndecl(), NULL_TREE, targetm, TREE_CODE, and TREE_OPERAND.
Referenced by dynamic_object_sizes_execute_one(), fold_build_call_array_loc(), and gimple_fold_stmt_to_constant_1().
Fold a call to builtin_expect with arguments ARG0, ARG1, ARG2, ARG3. Return NULL_TREE if no simplification is possible.
References build2(), build_builtin_expect_predicate(), COMPARISON_CLASS_P, CONVERT_EXPR_P, DECL_WEAK, fndecl_built_in_p(), fold_convert_loc(), get_callee_fndecl(), INTEGRAL_TYPE_P, NULL_TREE, save_expr(), STRIP_NOPS, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, TREE_TYPE, and VAR_OR_FUNCTION_DECL_P.
Referenced by fold_builtin_2(), fold_builtin_3(), and gimple_fold_call().
Fold the next_arg or va_start call EXP. Returns true if there was an error produced. False otherwise. This is done so that we don't output the error or warning twice or three times.
References CALL_EXPR_ARG, call_expr_nargs, CONVERT_EXPR_P, current_function_decl, DECL_ARGUMENTS, DECL_REGISTER, error(), exp(), INDIRECT_REF_P, input_location, integer_zero_node, integer_zerop(), line_table, NULL, SSA_NAME_VAR, stdarg_p(), TREE_CODE, tree_last(), TREE_OPERAND, TREE_TYPE, and warning_at().
Referenced by expand_builtin(), expand_builtin_va_start(), and gimplify_call_expr().
A wrapper function for builtin folding that prevents warnings for "statement without effect" and the like, caused by removing the call node earlier than the warning is generated.
References avoid_folding_inline_builtin(), BUILT_IN_MD, CALL_EXPR_ARG, CALL_EXPR_ARGP, call_expr_nargs, CALL_EXPR_VA_ARG_PACK, DECL_BUILT_IN_CLASS, exp(), fndecl_built_in_p(), fold_builtin_n(), get_callee_fndecl(), NULL_TREE, targetm, and TREE_CODE.
Referenced by fold(), and gimplify_call_expr().
A wrapper function for builtin folding that prevents warnings for "statement without effect" and the like, caused by removing the call node earlier than the warning is generated.
References avoid_folding_inline_builtin(), BUILT_IN_MD, CAN_HAVE_LOCATION_P, DECL_BUILT_IN_CLASS, error_mark_node, EXPR_HAS_LOCATION, fndecl_built_in_p(), fold_builtin_n(), gimple_call_arg_ptr(), gimple_call_fndecl(), gimple_call_num_args(), gimple_call_va_arg_pack_p(), gimple_has_location(), gimple_location(), NULL_TREE, SET_EXPR_LOCATION, targetm, TREE_CODE, and TREE_OPERAND.
Referenced by gimple_fold_builtin().
Get a MEM rtx for expression EXP which is the address of an operand to be used in a string instruction (cmpstrsi, cpymemsi, ..). LEN is the maximum length of the block of memory that might be accessed or NULL if unknown.
References ADDR_SPACE_GENERIC_P, build_array_type(), build_fold_addr_expr, build_int_cst(), build_range_type(), char_type_node, clear_mem_offset(), CONVERT_EXPR_P, exp(), expand_expr(), EXPAND_NORMAL, fold_build2, gcc_checking_assert, gen_rtx_MEM(), get_base_address(), get_pointer_alignment(), is_gimple_mem_ref_addr(), memory_address, NULL, NULL_RTX, POINTER_TYPE_P, ptr_mode, ptr_type_node, SAVE_EXPR_RESOLVED_P, set_mem_alias_set(), set_mem_align(), set_mem_attributes(), size_one_node, size_zero_node, sizetype, TREE_CODE, TREE_OPERAND, TREE_TYPE, and TYPE_ADDR_SPACE.
Referenced by expand_builtin_memcmp(), expand_builtin_memory_copy_args(), expand_builtin_memset_args(), expand_builtin_strcmp(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_movstr(), expand_RAWMEMCHR(), and inline_string_cmp().
|
extern |
Return the alignment in bits of EXP, an object.
References exp(), get_object_alignment_1(), and least_bit_hwi().
Referenced by copy_ref_info(), expand_assignment(), expand_expr_real_1(), gather_mem_refs_stmt(), gimplify_expr(), instrument_derefs(), instrument_expr(), not_size_aligned(), predicate_load_or_store(), ref_at_iteration(), rewrite_use_address(), vect_recog_cond_store_pattern(), vectorizable_load(), vectorizable_store(), and vn_reference_lookup_3().
|
extern |
For a memory reference expression EXP compute values M and N such that M divides (&EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Otherwise return false and store BITS_PER_UNIT to *alignp and any bit-offset to *bitposp.
References exp(), get_object_alignment_2(), TREE_CODE, and TREE_OPERAND.
Referenced by ao_ref_alignment(), build_ref_for_offset(), ao_compare::compare_ao_refs(), dr_analyze_innermost(), get_object_alignment(), may_be_unaligned_p(), replace_ref(), and set_mem_attributes_minus_bitpos().
|
extern |
Compute values M and N such that M divides (address of EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Otherwise return false and store BITS_PER_UNIT to *alignp and any bit-offset to *bitposp. Note that the address (and thus the alignment) computed here is based on the address to which a symbol resolves, whereas DECL_ALIGN is based on the address at which an object is actually located. These two addresses are not always the same. For example, on ARM targets, the address &foo of a Thumb function foo() has the lowest bit set, whereas foo() itself starts on an even address. If ADDR_P is true we are taking the address of the memory reference EXP and thus cannot rely on the access taking place.
References poly_int< N, C >::coeffs, CONSTANT_CLASS_P, DECL_ALIGN, DECL_INITIAL, DECL_P, exp(), poly_int< N, C >::force_shwi(), get_inner_reference(), get_pointer_alignment_1(), HOST_BITS_PER_INT, least_bit_hwi(), MAX, mem_ref_offset(), MIN, min_align_of_type(), offset, ptrmemfunc_vbit_in_pfn, TARGET_PTRMEMFUNC_VBIT_LOCATION, targetm, TMR_INDEX, TMR_INDEX2, TMR_STEP, TREE_CODE, tree_ctz(), TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, and TYPE_ALIGN.
Referenced by ao_ref_alignment(), get_object_alignment_1(), and get_pointer_alignment_1().
|
extern |
Return the alignment in bits of EXP, a pointer valued expression. The alignment returned is, by default, the alignment of the thing that EXP points to. If it is not a POINTER_TYPE, 0 is returned. Otherwise, look at the expression to see if we can do better, i.e., if the expression is actually pointing at an object whose alignment is tighter.
References ptr_info_def::align, exp(), get_pointer_alignment_1(), and least_bit_hwi().
Referenced by adjust_one_expanded_partition_var(), asan_expand_mark_ifn(), expand_builtin_memcmp(), expand_builtin_memory_chk(), expand_builtin_memory_copy_args(), expand_builtin_memset_args(), expand_builtin_strcmp(), expand_builtin_strlen(), expand_builtin_strncmp(), expand_builtin_strncpy(), expand_one_register_var(), get_builtin_sync_mem(), get_memory_rtx(), gimple_fold_builtin_clear_padding(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_memset(), gimple_stringops_transform(), strlen_pass::handle_builtin_memcmp(), simplify_builtin_call(), tree_ctz(), ubsan_expand_null_ifn(), and vectorizable_simd_clone_call().
|
extern |
For a pointer valued expression EXP compute values M and N such that M divides (EXP - N) and such that N < M. If these numbers can be determined, store M in alignp and N in *BITPOSP and return true. Return false if the results are just a conservative approximation. If EXP is not a pointer, false is returned too.
References exp(), get_object_alignment_2(), get_pointer_alignment_1(), get_ptr_info_alignment(), HOST_BITS_PER_INT, MIN, POINTER_TYPE_P, SSA_NAME_PTR_INFO, STRIP_NOPS, TREE_CODE, tree_ctz(), TREE_INT_CST_LOW, TREE_OPERAND, and TREE_TYPE.
Referenced by dr_analyze_innermost(), get_object_alignment_2(), get_pointer_alignment(), get_pointer_alignment_1(), get_value_from_alignment(), ipa_compute_jump_functions_for_edge(), and ipa_param_adjustments::modify_call().
|
extern |
Initialize format string characters in the target charset.
References target_c, target_newline, target_percent, target_percent_c, target_percent_s, target_percent_s_newline, target_s, and lang_hooks::to_target_charset.
Referenced by gimple_fold_builtin_fprintf(), gimple_fold_builtin_printf(), gimple_fold_builtin_snprintf(), gimple_fold_builtin_snprintf_chk(), gimple_fold_builtin_sprintf(), gimple_fold_builtin_sprintf_chk(), and maybe_emit_sprintf_chk_warning().
Return true if DECL is a builtin that is not expensive, i.e., they are most probably expanded inline into reasonably simple code. This is a superset of is_simple_builtin.
References BUILT_IN_MD, BUILT_IN_NORMAL, CASE_BUILT_IN_ALLOCA, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), and is_simple_builtin().
Referenced by estimate_num_insns(), expression_expensive_p(), gimple_inexpensive_call_p(), loop_body_includes_call(), and num_calls().
Return true if DECL is a builtin that expands to a constant or similarly simple code.
References BUILT_IN_NORMAL, DECL_FUNCTION_CODE(), and fndecl_built_in_p().
Referenced by estimate_num_insns(), and is_inexpensive_builtin().
|
extern |
Like mathfn_built_in_1, but always use the implicit array.
References mathfn_built_in_1().
Referenced by attempt_builtin_powi(), convert_to_integer_1(), convert_to_real_1(), execute_cse_sincos_1(), expand_builtin_int_roundingfn(), expand_pow_as_sqrts(), fold_builtin_carg(), gimple_expand_builtin_cabs(), and gimple_expand_builtin_pow().
|
extern |
Like mathfn_built_in_1, but take a built_in_function and always use the implicit array.
References as_combined_fn(), and mathfn_built_in_1().
|
extern |
Return the type associated with a built in function, i.e., the one to be passed to mathfn_built_in to get the type-specific function.
Similar to above, but appends _R after any F/L suffix.
References NULL_TREE, and SEQ_OF_CASE_MATHFN.
Referenced by execute_cse_sincos_1().
Emit a call to __builtin___clear_cache, unless the target specifies it as do-nothing. This function can be used by trampoline finalizers to duplicate the effects of expanding a call to the clear_cache builtin.
References begin(), CONST_INT_P, create_address_operand(), end(), gcc_assert, GET_MODE, maybe_expand_insn(), ptr_mode, and targetm.
Referenced by expand_builtin___clear_cache().
Returns true is EXP represents data that would potentially reside in a readonly section.
References decl_readonly_section(), exp(), get_base_address(), STRIP_NOPS, TREE_CODE, TREE_OPERAND, TREE_STATIC, and VAR_P.
Referenced by expand_builtin_memory_chk(), and gimple_fold_builtin_memory_op().
|
extern |
If CALL is a call to a BUILT_IN_NORMAL function that could be replaced on the current target by a call to an internal function, return the code of that internal function, otherwise return IFN_LAST. The caller is responsible for ensuring that any side-effects of the built-in call are dealt with correctly. E.g. if CALL sets errno, the caller must decide that the errno result isn't needed or make it available in some other way.
References associated_internal_fn(), bb_optimization_type(), BUILT_IN_NORMAL, direct_internal_fn_supported_p(), direct_internal_fn_types(), gimple_bb(), gimple_call_builtin_p(), and gimple_call_fndecl().
Referenced by can_use_internal_fn(), expand_call_stmt(), and use_internal_fn().
|
extern |
Look up the function in builtin_decl that corresponds to DECL and set ASMSPEC as its user assembler name. DECL must be a function decl that declares a builtin.
References BITS_PER_WORD, BUILT_IN_NORMAL, builtin_decl_explicit(), DECL_FUNCTION_CODE(), fndecl_built_in_p(), gcc_assert, int_mode_for_size(), INT_TYPE_SIZE, opt_mode< T >::require(), set_optab_libfunc(), set_user_assembler_libfunc(), and set_user_assembler_name().
|
extern |
The "standard" definition of va_list is void*.
References ptr_type_node.
The "standard" type of va_list is va_list_type_node.
References NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, type(), TYPE_MAIN_VARIANT, and va_list_type_node.
The "standard" implementation of va_start: just assign `nextarg' to the variable.
References convert_move(), expand_expr(), EXPAND_WRITE, and NULL_RTX.
Referenced by expand_builtin_va_start().
The "standard" abi va_list is va_list_type_node.
References va_list_type_node.
|
extern |
Return the number of leading non-zero elements in the sequence [ PTR, PTR + MAXELTS ) where each element's size is ELTSIZE bytes. ELTSIZE must be a power of 2 less than 8. Used by c_strlen.
References gcc_checking_assert.
Referenced by c_strlen(), and gimple_fold_builtin_memchr().
Return true if T is a constant and the value cast to a target char can be represented by a host char. Store the casted char constant in *P if so.
References CHAR_TYPE_SIZE, HOST_BITS_PER_CHAR, real_format::p, tree_fits_uhwi_p(), and tree_to_uhwi().
Referenced by fold_const_call(), fold_const_call(), gimple_fold_builtin_memchr(), and gimple_fold_builtin_strchr().
|
extern |
Used by expand_builtin_classify_type and fold_builtin_classify_type.
References array_type_class, bitint_type_class, boolean_type_class, complex_type_class, enumeral_type_class, function_type_class, integer_type_class, lang_type_class, method_type_class, no_type_class, offset_type_class, opaque_type_class, pointer_type_class, real_type_class, record_type_class, reference_type_class, string_type_class, TREE_CODE, TYPE_STRING_FLAG, union_type_class, vector_type_class, and void_type_class.
Referenced by expand_builtin_classify_type(), and fold_builtin_classify_type().
This function validates the types of a function call argument list against a specified list of tree_codes. If the last specifier is a 0, that represents an ellipses, otherwise the last specifier must be a VOID_TYPE. This is the GIMPLE version of validate_arglist. Eventually we want to completely convert builtins.cc to work from GIMPLEs and the tree based validate_arglist will then be removed.
References ap, end(), gimple_call_arg(), gimple_call_num_args(), i, and validate_arg().
Referenced by interesting_stringop_to_profile_p().
|
extern |
Expand builtin functions. Copyright (C) 1988-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/>.
Legacy warning! Please add no further builtin simplifications here (apart from pure constant folding) - builtin simplifications should go to match.pd or gimple-fold.cc instead.
|
extern |
Non-zero if __builtin_constant_p should be folded right away.
Referenced by fold_builtin_constant_p().
|
extern |
Referenced by gimple_fold_builtin_printf(), and init_target_chars().
|
extern |
|
extern |
Referenced by gimple_fold_builtin_fprintf(), gimple_fold_builtin_printf(), and init_target_chars().
|
extern |
|
extern |
Referenced by gimple_fold_builtin_printf(), and init_target_chars().