GCC Middle and Back End API Reference
calls.h File Reference

Go to the source code of this file.

Data Structures

class  function_arg_info
 

Functions

int flags_from_decl_or_type (const_tree)
 
int call_expr_flags (const_tree)
 
bool setjmp_call_p (const_tree)
 
bool gimple_maybe_alloca_call_p (const gimple *)
 
bool gimple_alloca_call_p (const gimple *)
 
bool alloca_call_p (const_tree)
 
bool must_pass_in_stack_var_size (const function_arg_info &)
 
bool must_pass_in_stack_var_size_or_pad (const function_arg_info &)
 
bool must_pass_va_arg_in_stack (tree)
 
rtx prepare_call_address (tree, rtx, rtx, rtx *, int, int)
 
bool shift_return_value (machine_mode, bool, rtx)
 
rtx expand_call (tree, rtx, int)
 
void fixup_tail_calls (void)
 
bool pass_by_reference (CUMULATIVE_ARGS *, function_arg_info)
 
bool pass_va_arg_by_reference (tree)
 
bool apply_pass_by_reference_rules (CUMULATIVE_ARGS *, function_arg_info &)
 
bool reference_callee_copied (CUMULATIVE_ARGS *, const function_arg_info &)
 
void maybe_complain_about_tail_call (tree, const char *)
 
rtx rtx_for_static_chain (const_tree, bool)
 
bool cxx17_empty_base_field_p (const_tree)
 

Function Documentation

◆ alloca_call_p()

bool alloca_call_p ( const_tree exp)
extern
Return true when exp contains a builtin alloca call.   

References BUILT_IN_NORMAL, CASE_BUILT_IN_ALLOCA, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE(), exp(), get_callee_fndecl(), and TREE_CODE.

Referenced by tree_expr_nonzero_warnv_p().

◆ apply_pass_by_reference_rules()

bool apply_pass_by_reference_rules ( CUMULATIVE_ARGS * ca,
function_arg_info & arg )
extern
Decide whether ARG, which occurs in the state described by CA,
should be passed by reference.  Return true if so and update
ARG accordingly.   

References build_pointer_type(), function_arg_info::mode, function_arg_info::pass_by_reference, pass_by_reference(), function_arg_info::type, and TYPE_MODE.

Referenced by assign_parm_find_data_types(), and prepare_call_arguments().

◆ call_expr_flags()

◆ cxx17_empty_base_field_p()

bool cxx17_empty_base_field_p ( const_tree field)
extern
Return true if FIELD is the C++17 empty base field that should
be ignored for ABI calling convention decisions in order to
maintain ABI compatibility between C++14 and earlier, which doesn't
add this FIELD to classes with empty bases, and C++17 and later
which does.   

References DECL_ARTIFICIAL, DECL_ATTRIBUTES, DECL_FIELD_ABI_IGNORED, lookup_attribute(), RECORD_OR_UNION_TYPE_P, and TREE_TYPE.

◆ expand_call()

rtx expand_call ( tree exp,
rtx target,
int ignore )
extern
Generate all the code for a CALL_EXPR exp
and return an rtx for its value.
Store the value in TARGET (specified as an rtx) if convenient.
If the value is stored in TARGET then TARGET is returned.
If IGNORE is nonzero, then we ignore the value of the function call.   

References _, ACCUMULATE_OUTGOING_ARGS, add_reg_note(), AGGREGATE_TYPE_P, aggregate_value_p(), allocate_dynamic_stack_space(), anti_adjust_stack(), ARGS_GROW_DOWNWARD, ARGS_SIZE_RTX, assign_temp(), avoid_likely_spilled_reg(), bitmap_clear(), BLOCK_OP_CALL_PARM, build_pointer_type(), CALL_EXPR_BY_DESCRIPTOR, CALL_EXPR_FN, CALL_EXPR_MUST_TAIL_CALL, call_expr_nargs, CALL_EXPR_RETURN_SLOT_OPT, CALL_EXPR_STATIC_CHAIN, CALL_EXPR_TAILCALL, CALL_FROM_THUNK_P, CALL_P, can_implement_as_sibling_call_p(), cfun, check_sibcall_argument_overlap(), combine_pending_stack_adjustment_and_call(), compute_argument_addresses(), compute_argument_block_size(), const0_rtx, args_size::constant, convert_memory_address, convert_wider_int_to_float(), copy_addr_to_reg(), copy_to_reg(), crtl, current_function_decl, current_function_has_unbounded_dynamic_stack_size, current_function_pushed_stack_size, dbg_cnt(), DECL_ARGUMENTS, DECL_CHAIN, DECL_HIDDEN_STRING_LENGTH, DECL_INCOMING_RTL, DECL_MODE, DECL_RESULT, decl_return_flags(), DECL_RTL, do_pending_stack_adjust(), ECF_BY_DESCRIPTOR, ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_MALLOC, ECF_MAY_BE_ALLOCA, ECF_NORETURN, ECF_NOTHROW, ECF_PURE, ECF_SIBCALL, emit_barrier_after(), emit_block_move(), emit_call_1(), emit_group_move(), emit_group_move_into_temps(), emit_group_store(), emit_insn(), emit_move_insn(), emit_stack_restore(), emit_stack_save(), function_arg_info::end_marker(), end_sequence(), ERF_RETURN_ARG_MASK, ERF_RETURNS_ARG, exp(), expand_expr(), EXPAND_NORMAL, expand_normal(), EXPR_LOCATION, finalize_must_preallocate(), fixup_args_size_notes(), flags_from_decl_or_type(), FOR_EACH_CALL_EXPR_ARG, FOR_EACH_SUBRTX, force_operand(), force_reg(), free(), gcc_assert, gcc_checking_assert, GEN_INT, gen_int_mode(), gen_lowpart_SUBREG(), gen_reg_rtx(), gen_rtx_EXPR_LIST(), gen_rtx_MEM(), gen_rtx_REG(), get_callee_fndecl(), GET_CODE, get_insns(), get_last_insn(), GET_MODE, GET_MODE_SIZE(), hard_function_value(), HARD_REGISTER_P, highest_outgoing_arg_in_use, HOST_BITS_PER_INT, HOST_WIDE_INT_M1U, i, inhibit_defer_pop, initialize_argument_information(), insns, int_size_in_bytes(), internal_arg_pointer_exp_state, known_eq, known_gt, last, last_call_insn(), list_length(), load_register_parameters(), make_tree(), MALLOC_ABI_ALIGNMENT, mark_reg_pointer(), MAX, maybe_complain_about_tail_call(), maybe_ge, maybe_gt, MEM_ALIGN, MEM_P, memory_address, NO_DEFER_POP, NULL, NULL_RTX, NULL_TREE, offset, OK_DEFER_POP, OUTGOING_REG_PARM_STACK_SPACE, partial_subreg_p(), pc_rtx, pending_stack_adjust, plus_constant(), POINTER_TYPE_P, poly_int_tree_p(), precompute_arguments(), precompute_register_parameters(), PREFERRED_STACK_BOUNDARY, prepare_call_address(), PREV_INSN(), promote_function_mode(), push_block(), record_final_call(), record_new_stack_level(), reg_mentioned_p(), REG_P, REGNO, restore_pending_stack_adjust(), cgraph_node::rtl_info(), rtx_equal_p(), rtx_for_function_call(), SAVE_BLOCK, save_pending_stack_adjust(), sbitmap_alloc(), sbitmap_free(), SCALAR_FLOAT_MODE_P, SCALAR_INT_MODE_P, set_mem_attributes(), shift_return_value(), sorry(), split_complex_types(), stack_arg_under_construction, STACK_GROWS_DOWNWARD, stack_pointer_delta, stack_protect_epilogue(), stack_usage_map, stack_usage_watermark, start_sequence(), store_one_arg(), store_unaligned_arguments_into_pseudos(), stored_args_map, stored_args_watermark, SUBREG_PROMOTED_SET, SUBREG_PROMOTED_VAR_P, targetm, TREE_ADDRESSABLE, TREE_CODE, tree_could_throw_p(), TREE_NOTHROW, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN, TYPE_ARG_TYPES, TYPE_MODE, TYPE_NO_NAMED_ARGS_STDARG_P, TYPE_SIZE_UNIT, TYPE_UNSIGNED, update_stack_alignment_for_call(), use_reg(), args_size::var, virtual_outgoing_args_rtx, virtual_stack_dynamic_rtx, warning(), XEXP, and XVECEXP.

Referenced by emit_block_op_via_libcall(), expand_builtin(), expand_builtin_atomic_fetch_op(), expand_builtin_fork_or_exec(), expand_builtin_int_roundingfn_2(), expand_builtin_mathfn_3(), expand_builtin_mathfn_ternary(), expand_builtin_memset_args(), expand_builtin_strcmp(), expand_builtin_strncmp(), expand_builtin_strub_leave(), expand_builtin_trap(), expand_expr_real_1(), expand_ifn_atomic_compare_exchange_into_call(), set_storage_via_libcall(), sjlj_emit_function_enter(), and stack_protect_epilogue().

◆ fixup_tail_calls()

void fixup_tail_calls ( void )
extern
A sibling call sequence invalidates any REG_EQUIV notes made for
this function's incoming arguments.

At the start of RTL generation we know the only REG_EQUIV notes
in the rtl chain are those for incoming arguments, so we can look
for REG_EQUIV notes between the start of the function and the
NOTE_INSN_FUNCTION_BEG.

This is (slight) overkill.  We could keep track of the highest
argument we clobber and be more selective in removing notes, but it
does not seem to be worth the effort.   

References find_reg_note(), gcc_assert, get_insns(), NEXT_INSN(), NOTE_KIND, NOTE_P, and remove_note().

Referenced by expand_stack_alignment().

◆ flags_from_decl_or_type()

int flags_from_decl_or_type ( const_tree exp)
extern
Detect flags (function attributes) from the function decl or type node.   

References DECL_ATTRIBUTES, DECL_IS_MALLOC, DECL_IS_NOVOPS, DECL_IS_RETURNS_TWICE, DECL_LOOPING_CONST_OR_PURE_P, DECL_P, DECL_PURE_P, ECF_COLD, ECF_CONST, ECF_LEAF, ECF_LOOPING_CONST_OR_PURE, ECF_MALLOC, ECF_NORETURN, ECF_NOTHROW, ECF_NOVOPS, ECF_PURE, ECF_RETURNS_TWICE, ECF_TM_BUILTIN, ECF_TM_PURE, ECF_XTHROW, exp(), gcc_unreachable, is_tm_builtin(), lookup_attribute(), special_function_p(), TREE_NOTHROW, TREE_READONLY, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ATTRIBUTES, TYPE_P, and TYPE_READONLY.

Referenced by analyze_function(), call_expr_flags(), cgraph_node::cannot_return_p(), compute_function_frequency(), decl_maybe_in_construction_p(), diagnose_tm_1(), ipa_icf::sem_function::equals_wpa(), execute_split_functions(), expand_builtin(), expand_call(), find_always_executed_bbs(), find_obviously_necessary_stmts(), finite_loop_p(), function_and_variable_visibility(), get_references_in_stmt(), gimple_build_call_from_tree(), gimple_build_eh_must_not_throw(), gimple_call_flags(), gimple_ic(), ignore_edge_p(), ipa_merge_modref_summary_after_inlining(), ipa_reference_get_read_global(), ipa_reference_get_written_global(), ipa_tm_mayenterirr_function(), ipa_tm_transform_calls_redirect(), is_removable_cxa_atexit_call(), is_tm_pure(), likely_target_p(), lower_stmt(), maybe_push_res_to_seq(), symtab_node::noninterposable_alias(), param_type_may_change_p(), polymorphic_ctor_dtor_p(), propagate(), propagate_bits(), propagate_pure_const(), pure_const_read_summary(), read_write_all_from_decl(), speculation_useful_p(), visit_reference_op_call(), and visit_stmt().

◆ gimple_alloca_call_p()

◆ gimple_maybe_alloca_call_p()

bool gimple_maybe_alloca_call_p ( const gimple * stmt)
extern
Return true if STMT may be an alloca call.   

References ECF_MAY_BE_ALLOCA, gimple_call_fndecl(), is_gimple_call(), and special_function_p().

Referenced by expand_call_inline(), and inline_forbidden_p_stmt().

◆ maybe_complain_about_tail_call()

void maybe_complain_about_tail_call ( tree call_expr,
const char * reason )
extern
Issue an error if CALL_EXPR was flagged as requiring
tall-call optimization.   

References CALL_EXPR_MUST_TAIL_CALL, error_at(), EXPR_LOCATION, gcc_assert, and TREE_CODE.

Referenced by can_implement_as_sibling_call_p(), expand_call(), and initialize_argument_information().

◆ must_pass_in_stack_var_size()

bool must_pass_in_stack_var_size ( const function_arg_info & arg)
extern
Nonzero if we do not know how to pass ARG solely in registers.   

References poly_int_tree_p(), TREE_ADDRESSABLE, function_arg_info::type, and TYPE_SIZE.

◆ must_pass_in_stack_var_size_or_pad()

bool must_pass_in_stack_var_size_or_pad ( const function_arg_info & arg)
extern
Another version of the TARGET_MUST_PASS_IN_STACK hook.  This one
takes trailing padding of a structure into account.   
??? Should be able to merge these two by examining BLOCK_REG_PADDING.   

References int_size_in_bytes(), function_arg_info::mode, PAD_DOWNWARD, PAD_UPWARD, targetm, TREE_ADDRESSABLE, TREE_CODE, function_arg_info::type, TYPE_EMPTY_P, and TYPE_SIZE.

◆ must_pass_va_arg_in_stack()

bool must_pass_va_arg_in_stack ( tree type)
extern
Return true if TYPE must be passed on the stack when passed to
the "..." arguments of a function.   

References targetm.

◆ pass_by_reference()

◆ pass_va_arg_by_reference()

bool pass_va_arg_by_reference ( tree type)
extern
Return true if TYPE should be passed by reference when passed to
the "..." arguments of a function.   

References NULL, and pass_by_reference().

Referenced by std_gimplify_va_arg_expr().

◆ prepare_call_address()

rtx prepare_call_address ( tree fndecl_or_type,
rtx funexp,
rtx static_chain_value,
rtx * call_fusage,
int reg_parm_seen,
int flags )
extern
Force FUNEXP into a form suitable for the address of a CALL,
and return that as an rtx.  Also load the static chain register
if FNDECL is a nested function.

CALL_FUSAGE points to a variable holding the prospective
CALL_INSN_FUNCTION_USAGE information.   

References build_decl(), const0_rtx, convert_memory_address, copy_to_mode_reg(), DECL_STATIC_CHAIN, ECF_BY_DESCRIPTOR, ECF_SIBCALL, emit_cmp_and_jump_insns(), emit_insn(), emit_label(), emit_move_insn(), force_not_mem(), force_reg(), gcc_assert, GEN_INT, gen_label_rtx(), gen_rtx_MEM(), GET_CODE, get_last_insn(), GET_MODE, JUMP_P, MEM_NOTRAP_P, memory_address, NO_FUNCTION_CSE, NULL_RTX, NULL_TREE, plus_constant(), POINTER_SIZE, predict_insn_def(), ptr_mode, REG_P, STATIC_CHAIN_REG_P, TAKEN, targetm, TREE_CODE, TYPE_P, UNKNOWN_LOCATION, and use_reg().

Referenced by emit_library_call_value_1(), expand_builtin_apply(), and expand_call().

◆ reference_callee_copied()

bool reference_callee_copied ( CUMULATIVE_ARGS * ca,
const function_arg_info & arg )
extern
Return true if ARG, which is passed by reference, should be callee
copied instead of caller copied.   

References targetm, TREE_ADDRESSABLE, and function_arg_info::type.

Referenced by emit_library_call_value_1(), gimplify_parameters(), and initialize_argument_information().

◆ rtx_for_static_chain()

rtx rtx_for_static_chain ( const_tree fndecl_or_type,
bool incoming_p )
extern
Return the static chain for this function, if any.   

References DECL_P, DECL_STATIC_CHAIN, NULL, and targetm.

Referenced by df_get_entry_block_def_set(), and expand_builtin_setjmp_receiver().

◆ setjmp_call_p()

bool setjmp_call_p ( const_tree fndecl)
extern
Return true when FNDECL represents a call to setjmp.   

References DECL_IS_RETURNS_TWICE, ECF_RETURNS_TWICE, and special_function_p().

Referenced by check_call(), and inline_forbidden_p_stmt().

◆ shift_return_value()

bool shift_return_value ( machine_mode mode,
bool left_p,
rtx value )
extern
Given that a function returns a value of mode MODE at the most
significant end of hard register VALUE, shift VALUE left or right
as specified by LEFT_P.  Return true if some action was needed.   

References force_expand_binop(), gcc_assert, gcc_unreachable, gen_int_shift_amount(), GET_MODE, GET_MODE_BITSIZE(), HARD_REGISTER_P, known_eq, OPTAB_WIDEN, REG_P, and shift.

Referenced by emit_library_call_value_1(), expand_call(), and expand_function_end().