GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple-expr.h"
#include "cfghooks.h"
#include "df.h"
#include "memmodel.h"
#include "tm_p.h"
#include "stringpool.h"
#include "expmed.h"
#include "optabs.h"
#include "opts.h"
#include "regs.h"
#include "emit-rtl.h"
#include "recog.h"
#include "rtl-error.h"
#include "hard-reg-set.h"
#include "alias.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "varasm.h"
#include "except.h"
#include "dojump.h"
#include "explow.h"
#include "calls.h"
#include "expr.h"
#include "optabs-tree.h"
#include "output.h"
#include "langhooks.h"
#include "common/common-target.h"
#include "gimplify.h"
#include "tree-pass.h"
#include "cfgrtl.h"
#include "cfganal.h"
#include "cfgbuild.h"
#include "cfgcleanup.h"
#include "cfgexpand.h"
#include "shrink-wrap.h"
#include "toplev.h"
#include "rtl-iter.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "attribs.h"
#include "gimple.h"
#include "options.h"
#include "function-abi.h"
#include "value-range.h"
#include "gimple-range.h"
#include "insn-attr.h"
#include "gt-function.h"
Data Structures | |
struct | insn_cache_hasher |
class | temp_slot |
struct | temp_slot_address_entry |
struct | temp_address_hasher |
struct | initial_value_pair |
struct | initial_value_struct |
struct | assign_parm_data_all |
struct | assign_parm_data_one |
Macros | |
#define | STACK_ALIGNMENT_NEEDED 1 |
#define | STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT) |
#define | FLOOR_ROUND(VALUE, ALIGN) |
#define | CEIL_ROUND(VALUE, ALIGN) |
#define | STACK_POINTER_OFFSET 0 |
#define | STACK_DYNAMIC_OFFSET(FNDECL) |
Variables | |
int | virtuals_instantiated |
static int | funcdef_no |
struct machine_function *(* | init_machine_status )(void) |
struct function * | cfun = 0 |
static hash_table< insn_cache_hasher > * | prologue_insn_hash |
static hash_table< insn_cache_hasher > * | epilogue_insn_hash |
hash_table< used_type_hasher > * | types_used_by_vars_hash = NULL |
vec< tree, va_gc > * | types_used_by_cur_var_decl |
static vec< function * > | function_context_stack |
static hash_table< temp_address_hasher > * | temp_slot_address_table |
static size_t | n_temp_slots_in_use |
static poly_int64 | in_arg_offset |
static poly_int64 | var_offset |
static poly_int64 | dynamic_offset |
static poly_int64 | out_arg_offset |
static poly_int64 | cfa_offset |
static int | next_block_index = 2 |
static bool | in_dummy_function |
static vec< function * > | cfun_stack |
bool | currently_expanding_function_start |
#define CEIL_ROUND | ( | VALUE, | |
ALIGN ) |
Similar, but round to the next highest integer that meets the alignment.
Referenced by assign_parm_find_entry_rtl(), and assign_parm_setup_block().
#define FLOOR_ROUND | ( | VALUE, | |
ALIGN ) |
Round a value to the lowest integer less than it that is a multiple of the required alignment. Avoid using division in case the value is negative. Assume the alignment is a power of two.
#define STACK_ALIGNMENT_NEEDED 1 |
Expands front end tree to back end RTL for GCC. 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/>.
This file handles the generation of rtl code from tree structure at the level of the function as a whole. It creates the rtl expressions for parameters and auto variables and has full responsibility for allocating stack slots. `expand_function_start' is called at the beginning of a function, before the function body is parsed, and `expand_function_end' is called after parsing the body. Call `assign_stack_local' to allocate a stack slot for a local variable. This is usually done during the RTL generation for the function body, but it can also be done in the reload pass when a pseudo-register does not get a hard register.
So we can assign to cfun in this file.
Referenced by assign_stack_local_1().
#define STACK_BYTES (STACK_BOUNDARY / BITS_PER_UNIT) |
#define STACK_DYNAMIC_OFFSET | ( | FNDECL | ) |
If not defined, pick an appropriate default for the offset of dynamically allocated memory depending on the value of ACCUMULATE_OUTGOING_ARGS, INCOMING_REG_PARM_STACK_SPACE, and OUTGOING_REG_PARM_STACK_SPACE.
The bottom of the stack points to the actual arguments. If REG_PARM_STACK_SPACE is defined, this includes the space for the register parameters. However, if OUTGOING_REG_PARM_STACK space is not defined, stack space for register parameters is not pushed by the caller, but rather part of the fixed stack areas and hence not included in `crtl->outgoing_args_size'. Nevertheless, we must allow for it when allocating stack dynamic objects.
Referenced by get_stack_dynamic_offset().
#define STACK_POINTER_OFFSET 0 |
In most machines, the stack pointer register is equivalent to the bottom of the stack.
|
static |
Create a new frame_space structure describing free space in the stack frame beginning at START and ending at END, and chain it into the function's frame_space_list.
References crtl, end(), ggc_alloc(), frame_space::length, frame_space::next, and frame_space::start.
Referenced by assign_stack_local_1().
Add the decl D to the local_decls list of FUN.
References gcc_assert, function::local_decls, VAR_P, and vec_safe_push().
Referenced by add_local_variables(), declare_inline_vars(), expand_thunk(), expand_used_vars(), record_vars_into(), remap_decls(), replace_by_duplicate_decl(), and ipa_param_body_adjustments::reset_debug_stmts().
bool aggregate_value_p | ( | const_tree | exp, |
const_tree | fntype ) |
Return true if EXP is an aggregate type (or a value with aggregate type). This means a type for which function calls must pass an address to the function or get an address back from the function. EXP may be a type node or an expression (whose type is tested).
References AGGREGATE_TYPE_P, aggregate_value_p(), CALL_EXPR_FN, predefined_function_abi::clobbers_full_reg_p(), DECL_BY_REFERENCE, default_function_abi, error_operand_p(), exp(), first_field(), fixed_regs, fntype_abi(), gcc_unreachable, get_callee_fndecl(), hard_function_value(), hard_regno_nregs(), i, NULL_TREE, REG_P, REGNO, targetm, TREE_ADDRESSABLE, TREE_CODE, TREE_TYPE, TYPE_EMPTY_P, TYPE_MODE, TYPE_P, TYPE_TRANSPARENT_AGGR, and VOID_TYPE_P.
Referenced by aggregate_value_p(), allocate_struct_function(), assign_parms_augmented_arg_list(), copy_result_decl_to_var(), emit_library_call_value_1(), expand_assignment(), expand_call(), expand_function_start(), expand_thunk(), find_func_aliases_for_call(), gimple_regimplify_operands(), gimplify_modify_expr_rhs(), gimplify_return_expr(), has_stmt_been_instrumented_p(), instrument_derefs(), maybe_add_sra_candidate(), maybe_instrument_call(), needs_to_live_in_memory(), prepare_call_arguments(), simd_clone_compute_base_data_type(), split_function(), stack_protect_return_slot_p(), use_register_for_decl(), and vectorizable_store().
Count the subblocks of the list starting with BLOCK. If VECTOR is non-NULL, list them all into VECTOR, in a depth-first preorder traversal of the block tree. Also clear TREE_ASM_WRITTEN in all blocks.
References all_blocks, BLOCK_CHAIN, BLOCK_SUBBLOCKS, and TREE_ASM_WRITTEN.
|
static |
Allocate and initialize the stack usage info data structure for the current function.
References cfun, gcc_assert, and ggc_cleared_alloc().
Referenced by allocate_struct_function(), and prepare_function_start().
Allocate a function structure for FNDECL and set its contents to the defaults. Set cfun to the newly-allocated object. Some of the helper functions invoked during initialization assume that cfun has already been set. Therefore, assign the new object directly into cfun and invoke the back end hook explicitly at the very end, rather than initializing a temporary and calling set_cfun on it. ABSTRACT_P is true if this is a function that will never be seen by the middle-end. Such functions are front-end concepts (like C++ function templates) that do not correspond directly to functions placed in object files.
References aggregate_value_p(), allocate_stack_usage_info(), cfun, current_function_funcdef_no, DECL_ARGUMENTS, DECL_CHAIN, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_RESULT, DECL_STRUCT_FUNCTION, lang_hooks::emits_begin_stmt, get_next_funcdef_no(), ggc_cleared_alloc(), init_eh_for_function(), init_machine_status, invoke_set_current_function_hook(), MAY_HAVE_DEBUG_MARKER_STMTS, NULL_TREE, relayout_decl(), stdarg_p(), targetm, TREE_TYPE, VA_LIST_MAX_FPR_SIZE, and VA_LIST_MAX_GPR_SIZE.
Referenced by cgraph_build_static_cdtor_1(), function_reader::create_function(), create_loop_fn(), cgraph_node::create_wrapper(), expand_thunk(), finalize_size_functions(), init_lowered_empty_function(), push_function_context(), and push_struct_function().
|
static |
A subroutine of assign_parms. Adjust DATA->ENTRY_RTL such that it's always valid and contiguous.
References copy_rtx(), emit_group_store(), gcc_assert, GET_CODE, GET_MODE, i, int_size_in_bytes(), INTVAL, move_block_from_reg(), NULL, NULL_RTX, REG_P, REGNO, validize_mem(), XEXP, XVECEXP, and XVECLEN.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Adjust DATA->STACK_RTL such that it's always valid and properly aligned.
References crtl, GET_MODE_ALIGNMENT, MEM_ALIGN, NULL, optab_handler(), POINTER_TYPE_P, PREFERRED_STACK_BOUNDARY, SPCT_FLAG_ALL, targetm, and TYPE_ALIGN.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Examine PARM and pull out type and mode data for the parameter. Incorporate ABI specifics such as pass-by- reference and type promotion.
References apply_pass_by_reference_rules(), assign_parm_data_all::args_so_far, assign_parm_data_all::args_so_far_v, cfun, current_function_decl, DECL_ARG_TYPE, DECL_CHAIN, error_mark_node, first_field(), NULL, promote_function_mode(), RECORD_OR_UNION_TYPE_P, targetm, TREE_CODE, TREE_TYPE, TYPE_MODE, TYPE_TRANSPARENT_AGGR, TYPE_UNSIGNED, void_type_node, and VOID_TYPE_P.
Referenced by assign_parms(), and gimplify_parameters().
|
static |
A subroutine of assign_parms. Set DATA->ENTRY_PARM corresponding to the incoming location of the current parameter.
References assign_parm_data_all::args_so_far, CEIL_ROUND, const0_rtx, crtl, current_function_decl, assign_parm_data_all::extra_pretend_bytes, gcc_assert, locate_and_pad_parm(), function_arg_info::named, NULL, assign_parm_data_all::pretend_args_size, assign_parm_data_all::reg_parm_stack_space, assign_parm_data_all::stack_args_size, STACK_BYTES, and targetm.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Given that this parameter is allocated stack space by the ABI, find it.
References ARGS_SIZE_RTX, const0_rtx, crtl, DECL_MODE, gen_rtx_MEM(), GET_MODE_SIZE(), known_eq, least_bit_hwi(), MAX, MEM_EXPR, MEM_OFFSET, MEM_OFFSET_KNOWN_P, MIN, offset, PAD_NONE, PAD_UPWARD, poly_int_rtx_p(), set_mem_align(), set_mem_attributes(), set_mem_offset(), set_mem_size(), set_reg_attrs_for_parm(), STACK_POINTER_OFFSET, and subreg_lowpart_offset().
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. If there is actually space on the stack for this parm, count it in stack_args_size and return true.
References ADD_PARM_SIZE, args_size::constant, GET_CODE, NULL, NULL_RTX, assign_parm_data_all::reg_parm_stack_space, assign_parm_data_all::stack_args_size, XEXP, and XVECEXP.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Reconstitute any values which were passed in multiple registers and would fit in a single register.
References emit_group_store(), gen_reg_rtx(), GET_CODE, GET_MODE, and GET_MODE_SIZE().
Referenced by assign_parm_setup_reg(), and assign_parm_setup_stack().
|
static |
A subroutine of assign_parms. Arrange for the parameter to be present and valid in DATA->STACK_RTL.
References adjust_address, align_dynamic_address(), assign_stack_local(), BITS_PER_WORD, BLOCK_OP_NORMAL, CEIL_ROUND, cfun, change_address(), convert_to_mode(), copy_rtx(), copy_to_reg(), DECL_ALIGN, opt_mode< T >::else_blk(), emit_block_move(), emit_group_move_into_temps(), emit_group_store(), emit_move_insn(), end_sequence(), expand_shift(), assign_parm_data_all::first_conversion_insn, force_reg(), gcc_assert, gcc_checking_assert, GEN_INT, gen_int_mode(), gen_lowpart_SUBREG(), gen_reg_rtx(), gen_rtx_MEM(), gen_rtx_REG(), generating_concat_p, GET_CODE, get_dynamic_stack_size(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_SIZE(), int_mode_for_size(), int_size_in_bytes(), is_gimple_reg(), known_eq, assign_parm_data_all::last_conversion_insn, mark_reg_pointer(), MAX, MAX_SUPPORTED_STACK_ALIGNMENT, MEM_NOTRAP_P, MEM_P, move_block_from_reg(), NULL, NULL_RTX, PAD_DOWNWARD, PAD_UPWARD, promote_ssa_mode(), push_to_sequence2(), PUT_MODE(), REG_P, REGNO, SET_DECL_ALIGN, set_mem_attributes(), set_parm_rtl(), ssa_default_def(), TRULY_NOOP_TRUNCATION_MODES_P, TYPE_EMPTY_P, UINTVAL, use_register_for_decl(), validize_mem(), word_mode, and XEXP.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Return true if the current parameter should be stored as a BLKmode in the current frame.
References GET_MODE, GET_MODE_SIZE(), known_lt, PAD_DOWNWARD, PAD_UPWARD, and REG_P.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Allocate a pseudo to hold the current parameter. Get it there. Perform all ABI specified conversions.
References adjust_address_nv, assign_parm_remove_parallels(), assign_stack_local(), can_extend_p(), CLEAR_HARD_REG_SET, convert_to_mode(), copy_rtx(), current_function_decl, DECL_ARTIFICIAL, emit_insn(), emit_move_insn(), end_sequence(), expand_assignment(), extract_bit_field(), assign_parm_data_all::first_conversion_insn, fixed_reg_set, gen_extend_insn(), gen_reg_rtx(), gen_rtx_MEM(), GET_CODE, get_insns(), get_last_insn(), GET_MODE, GET_MODE_ALIGNMENT, GET_MODE_BITSIZE(), GET_MODE_CLASS, GET_MODE_INNER, GET_MODE_SIZE(), hard_reg_set_empty_p(), HARD_REGISTER_P, insn_operand_matches(), INSN_P, insns, assign_parm_data_all::last_conversion_insn, make_tree(), mark_reg_pointer(), mark_user_reg(), MEM_ALIGN, MEM_P, NEXT_INSN(), note_stores(), NULL, NULL_RTX, optab_handler(), partial_subreg_p(), POINTER_TYPE_P, prev_nonnote_insn(), promote_function_mode(), push_to_sequence2(), record_hard_reg_sets(), reg_mentioned_p(), REG_P, REGNO, regno_reg_rtx, SET_DECL_RTL, SET_DEST, set_dst_reg_note(), set_mem_attributes(), set_parm_rtl(), set_unique_reg_note(), single_set(), STACK_SLOT_ALIGNMENT, start_sequence(), SUBREG_PROMOTED_SET, SUBREG_PROMOTED_VAR_P, SUBREG_REG, targetm, TEST_HARD_REG_BIT, TREE_TYPE, TREE_USED, TYPE_ALIGN, TYPE_MODE, TYPE_UNSIGNED, use_register_for_decl(), validize_mem(), virtual_incoming_args_rtx, and XEXP.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. Allocate stack space to hold the current parameter. Get it there. Perform all ABI specified conversions.
References adjust_address, assign_parm_remove_parallels(), assign_stack_local(), BLOCK_OP_NORMAL, convert_to_mode(), convert_wider_int_to_float(), copy_rtx(), emit_block_move(), emit_move_insn(), end_sequence(), assign_parm_data_all::first_conversion_insn, force_reg(), GEN_INT, gen_reg_rtx(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_ALIGNMENT, GET_MODE_SIZE(), int_size_in_bytes(), known_lt, assign_parm_data_all::last_conversion_insn, MEM_ALIGN, MEM_OFFSET, MEM_OFFSET_KNOWN_P, MEM_P, offset, optab_handler(), push_to_sequence2(), REG_P, SCALAR_FLOAT_MODE_P, SCALAR_INT_MODE_P, set_mem_align(), set_mem_attributes(), set_mem_offset(), set_parm_rtl(), STACK_SLOT_ALIGNMENT, subreg_lowpart_offset(), targetm, TREE_TYPE, TYPE_ALIGN, TYPE_EMPTY_P, TYPE_UNSIGNED, and validize_mem().
Referenced by assign_parms().
|
static |
Assign RTL expressions to the function's parameters. This may involve copying them into registers and using those registers as the DECL_RTL.
References AGGREGATE_TYPE_P, ARGS_GROW_DOWNWARD, ARGS_SIZE_RTX, assign_parm_data_all::args_so_far, assign_parm_data_all::args_so_far_v, assign_parm_adjust_entry_rtl(), assign_parm_adjust_stack_rtl(), assign_parm_find_data_types(), assign_parm_find_entry_rtl(), assign_parm_find_stack_rtl(), assign_parm_is_stack_parm(), assign_parm_setup_block(), assign_parm_setup_block_p(), assign_parm_setup_reg(), assign_parm_setup_stack(), assign_parms_augmented_arg_list(), assign_parms_initialize_all(), assign_parms_setup_varargs(), assign_parms_unsplit_complex(), build1(), cfun, const0_rtx, args_size::constant, convert_memory_address, crtl, current_function_decl, DECL_BY_REFERENCE, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_INCOMING_RTL, DECL_MODE, DECL_REGISTER, DECL_RESULT, DECL_RTL, DECL_RTL_SET_P, emit_insn(), expand_expr(), EXPAND_NORMAL, assign_parm_data_all::extra_pretend_bytes, assign_parm_data_all::first_conversion_insn, FOR_EACH_VEC_ELT, assign_parm_data_all::function_result_decl, gcc_assert, gen_int_mode(), gen_rtx_MEM(), GET_MODE_ALIGNMENT, i, int_size_in_bytes(), MEM_P, MINIMUM_ALIGNMENT, NULL_RTX, assign_parm_data_all::pretend_args_size, REG_FUNCTION_VALUE_P, REG_P, assign_parm_data_all::reg_parm_stack_space, REGNO, set_decl_incoming_rtl(), SET_DECL_RTL, SET_DECL_VALUE_EXPR, set_mem_attributes(), set_parm_rtl(), size_diffop, size_int, assign_parm_data_all::stack_args_size, SUPPORTS_STACK_ALIGNMENT, targetm, TREE_ADDRESSABLE, TREE_TYPE, TYPE_ALIGN, TYPE_EMPTY_P, TYPE_MODE, TYPE_NO_NAMED_ARGS_STDARG_P, use_register_for_decl(), and args_size::var.
Referenced by expand_function_start().
|
static |
A subroutine of assign_parms. Adjust the parameter list to incorporate the hidden struct return argument, and (abi willing) complex args. Return the new parameter list.
References aggregate_value_p(), build_decl(), build_pointer_type(), cfun, current_function_decl, DECL_ARG_TYPE, DECL_ARGUMENTS, DECL_ARTIFICIAL, DECL_CHAIN, DECL_NAMELESS, DECL_RESULT, DECL_SOURCE_LOCATION, assign_parm_data_all::function_result_decl, get_identifier(), assign_parm_data_all::orig_fnargs, split_complex_args(), targetm, TREE_CONSTANT, TREE_TYPE, type(), and vNULL.
Referenced by assign_parms(), and gimplify_parameters().
|
static |
A subroutine of assign_parms. Initialize ALL.
References assign_parm_data_all::args_so_far, assign_parm_data_all::args_so_far_v, current_function_decl, NULL_RTX, assign_parm_data_all::reg_parm_stack_space, and TREE_TYPE.
Referenced by assign_parms(), and gimplify_parameters().
|
static |
A subroutine of assign_parms. Invoke setup_incoming_varargs.
References assign_parm_data_all::args_so_far, function_arg_info::named, assign_parm_data_all::pretend_args_size, and targetm.
Referenced by assign_parms().
|
static |
A subroutine of assign_parms. If the ABI splits complex arguments, then undo the frobbing that we did in assign_parms_augmented_arg_list.
References adjust_address_nv, assign_stack_local(), DECL_INCOMING_RTL, DECL_MODE, DECL_RTL, emit_move_insn(), end_sequence(), assign_parm_data_all::first_conversion_insn, gen_lowpart_SUBREG(), get_insns(), get_last_insn(), GET_MODE, GET_MODE_INNER, GET_MODE_SIZE(), i, int_size_in_bytes(), assign_parm_data_all::last_conversion_insn, assign_parm_data_all::orig_fnargs, push_to_sequence2(), set_decl_incoming_rtl(), set_mem_attributes(), set_parm_rtl(), STACK_SLOT_ALIGNMENT, targetm, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_TYPE, and TYPE_ALIGN.
Referenced by assign_parms().
rtx assign_stack_local | ( | machine_mode | mode, |
poly_int64 | size, | ||
int | align ) |
Wrap up assign_stack_local_1 with last parameter as false.
References ASLK_RECORD_PAD, and assign_stack_local_1().
Referenced by alter_reg(), assign_mem_slot(), assign_parm_setup_block(), assign_parm_setup_reg(), assign_parm_setup_stack(), assign_parms_unsplit_complex(), emit_stack_save(), expand_builtin_apply(), expand_builtin_apply_args_1(), expand_function_start(), get_arg_pointer_save_area(), get_secondary_mem(), lra(), lra_spill(), reload(), and sjlj_build_landing_pads().
rtx assign_stack_local_1 | ( | machine_mode | mode, |
poly_int64 | size, | ||
int | align, | ||
int | kind ) |
Allocate a stack slot of SIZE bytes and return a MEM rtx for it with machine mode MODE. ALIGN controls the amount of alignment for the address of the slot: 0 means according to MODE, -1 means use BIGGEST_ALIGNMENT and round size to multiple of that, -2 means use BITS_PER_UNIT, positive specifies alignment boundary in bits. KIND has ASLK_REDUCE_ALIGN bit set if it is OK to reduce alignment and ASLK_RECORD_PAD bit set if we should remember extra space we allocated for alignment purposes. When we are called from assign_stack_temp_for_type, it is not set so we don't track the same stack slot in two independent lists. We do not round to stack_boundary here.
References add_frame_space(), ASLK_RECORD_PAD, ASLK_REDUCE_ALIGN, crtl, current_function_decl, FRAME_GROWS_DOWNWARD, frame_offset, frame_offset_overflow(), frame_pointer_rtx, gcc_assert, gcc_checking_assert, gen_rtx_MEM(), GET_MODE_ALIGNMENT, GET_MODE_SIZE(), get_stack_local_alignment(), known_eq, known_gt, known_lt, frame_space::length, MAX_SUPPORTED_STACK_ALIGNMENT, MEM_NOTRAP_P, frame_space::next, NULL, plus_constant(), set_mem_align(), STACK_ALIGNMENT_NEEDED, stack_slot_list, frame_space::start, SUPPORTS_STACK_ALIGNMENT, targetm, trunc_int_for_mode(), try_fit_stack_local(), vec_safe_push(), virtual_stack_vars_rtx, and virtuals_instantiated.
Referenced by assign_stack_local(), assign_stack_temp_for_type(), and setup_save_areas().
rtx assign_stack_temp | ( | machine_mode | mode, |
poly_int64 | size ) |
Allocate a temporary stack slot and record it for possible later reuse. First two arguments are same as in preceding function.
References assign_stack_temp_for_type(), NULL_TREE, and temp_slot::size.
Referenced by emit_group_load_1(), emit_group_store(), emit_library_call_value_1(), expand_assignment(), expand_builtin_issignaling(), expand_expr_real_1(), extract_bit_field_1(), and store_bit_field_1().
rtx assign_stack_temp_for_type | ( | machine_mode | mode, |
poly_int64 | size, | ||
tree | type ) |
Allocate a temporary stack slot and record it for possible later reuse. MODE is the machine mode to be given to the returned rtx. SIZE is the size in units of the space required. We do no rounding here since assign_stack_local will do any required rounding. TYPE is the type that will be used for the stack slot.
References adjust_address_nv, temp_slot::align, assign_stack_local_1(), avail_temp_slots, temp_slot::base_offset, cut_slot_from_list(), FRAME_GROWS_DOWNWARD, frame_offset, temp_slot::full_size, gcc_assert, gen_rtx_MEM(), get_alias_set(), GET_MODE, get_stack_local_alignment(), ggc_alloc(), temp_slot::in_use, insert_slot_to_list(), insert_temp_slot_address(), known_eq, known_ge, temp_slot::level, MEM_NOTRAP_P, MEM_VOLATILE_P, n_temp_slots_in_use, temp_slot::next, NULL, objects_must_conflict_p(), set_mem_alias_set(), set_mem_align(), temp_slot::size, temp_slot::slot, stack_slot_list, temp_slot_level, temp_slots_at_level(), temp_slot::type, type(), TYPE_VOLATILE, vec_safe_push(), virtuals_instantiated, and XEXP.
Referenced by assign_stack_temp(), assign_temp(), expand_expr_real_1(), expand_ifn_atomic_compare_exchange_into_call(), and ubsan_encode_value().
Assign a temporary. If TYPE_OR_DECL is a decl, then we are doing it on behalf of the decl and so that should be used in error messages. In either case, we allocate of the given type. MEMORY_REQUIRED is 1 if the result must be addressable stack memory; it is 0 if a register is OK. DONT_PROMOTE is 1 if we should not promote values in register to wider modes.
References assign_stack_temp_for_type(), COMPLETE_TYPE_P, DECL_P, error(), gcc_assert, gen_reg_rtx(), known_eq, max_int_size_in_bytes(), NULL, poly_int_tree_p(), promote_mode(), temp_slot::size, TREE_ADDRESSABLE, TREE_CODE, TREE_TYPE, type(), TYPE_MODE, TYPE_SIZE_UNIT, and TYPE_UNSIGNED.
Referenced by emit_library_call_value_1(), emit_push_insn(), expand_asm_stmt(), expand_builtin_cexpi(), expand_call(), expand_cond_expr_using_cmove(), expand_constructor(), expand_expr_real_1(), expand_expr_real_2(), expand_return(), expand_vector_ubsan_overflow(), get_temp_reg(), initialize_argument_information(), and store_one_arg().
Concatenate two chains of blocks (chained through BLOCK_CHAIN) by modifying the last node in chain 1 to point to chain 2.
References BLOCK_CHAIN, and gcc_assert.
Reverse the order of elements in the fragment chain T of blocks, and return the new head of the chain (old last element). In addition to that clear BLOCK_SAME_RANGE flags when needed and adjust BLOCK_SUPERCONTEXT from the super fragment to its super fragment origin.
References BLOCK_FRAGMENT_CHAIN, BLOCK_FRAGMENT_ORIGIN, BLOCK_SAME_RANGE, and BLOCK_SUPERCONTEXT.
Referenced by blocks_nreverse_all().
Reverse the order of elements in the chain T of blocks, and return the new head of the chain (old last element).
References BLOCK_CHAIN.
Referenced by lower_function_body(), lower_gimple_bind(), and remap_blocks().
Reverse the order of elements in the chain T of blocks, and return the new head of the chain (old last element). Also do the same on subblocks and reverse the order of elements in BLOCK_FRAGMENT_CHAIN as well.
References BLOCK_CHAIN, BLOCK_FRAGMENT_CHAIN, BLOCK_FRAGMENT_ORIGIN, block_fragments_nreverse(), BLOCK_SAME_RANGE, BLOCK_SUBBLOCKS, blocks_nreverse_all(), and NULL_TREE.
Referenced by blocks_nreverse_all(), and reorder_blocks().
void clear_block_marks | ( | tree | block | ) |
Helper function for reorder_blocks. Reset TREE_ASM_WRITTEN.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, clear_block_marks(), and TREE_ASM_WRITTEN.
Referenced by clear_block_marks(), lower_function_body(), and reorder_blocks().
void clobber_return_register | ( | void | ) |
References current_function_decl, DECL_RESULT, DECL_RTL, DECL_RTL_SET_P, diddle_return_value(), do_clobber_return_reg(), NULL, REG_P, and REGNO.
Referenced by expand_eh_return(), expand_function_end(), and expand_null_return().
|
static |
Combine temporary stack slots which are adjacent on the stack. This allows for better use of already allocated stack space. This is only done for BLKmode slots because we can be sure that we won't have alignment problems in this case.
References avail_temp_slots, temp_slot::base_offset, cut_slot_from_list(), temp_slot::full_size, GET_MODE, known_eq, temp_slot::next, temp_slot::size, and temp_slot::slot.
Referenced by free_temp_slots().
|
static |
Determine if any INSNs in HASH are, or are part of, INSN. Because we can be running after reorg, SEQUENCE rtl is possible.
References as_a(), rtx_sequence::element(), hash_table< Descriptor, Lazy, Allocator >::find(), GET_CODE, i, rtx_sequence::len(), NONJUMP_INSN_P, NULL, and PATTERN().
Referenced by epilogue_contains(), prologue_contains(), prologue_epilogue_contains(), and reposition_prologue_and_epilogue_notes().
const char * current_function_name | ( | void | ) |
Returns the name of the current function.
References cfun, and function_name().
Referenced by adjust_cfg_counts(), create_loop_fn(), df_dump_start(), dump_cfg_stats(), dump_enumerated_decls(), dump_fixup_graph(), initialize_uninitialized_regs(), one_code_hoisting_pass(), one_cprop_pass(), one_pre_gcse_pass(), one_store_motion_pass(), print_loops(), and set_nothrow_function_flags().
Removes temporary slot TEMP from LIST.
Referenced by assign_stack_temp_for_type(), combine_temp_slots(), make_slot_available(), and move_slot_to_level().
|
extern |
If VAR is present in a subblock of BLOCK, return the subblock.
References BLOCK_SUBBLOCKS, BLOCK_VARS, debug_find_var_in_block_tree(), NULL_TREE, and TREE_CHAIN.
Referenced by debug_find_var_in_block_tree().
void diddle_return_value | ( | void(* | doit )(rtx, void *), |
void * | arg ) |
Call DOIT for each hard register used as a return value from the current function.
References crtl, and diddle_return_value_1().
Referenced by clobber_return_register(), df_get_exit_block_use_set(), and use_return_register().
|
static |
References emit_clobber().
Referenced by clobber_return_register().
|
static |
References emit_use().
Referenced by use_return_register().
void dump_stack_clash_frame_info | ( | enum stack_clash_probes | probes, |
bool | residuals ) |
If debugging dumps are requested, dump information about how the target handled -fstack-check=clash for the prologue. PROBES describes what if any probes were emitted. RESIDUALS indicates if the prologue had any residual allocation (i.e. total allocation was not a multiple of PROBE_INTERVAL).
References cfun, dump_file, frame_pointer_needed, NO_PROBE_NO_FRAME, NO_PROBE_SMALL_FRAME, PROBE_INLINE, PROBE_LOOP, and TREE_THIS_VOLATILE.
void emit_initial_value_sets | ( | void | ) |
Called from gimple_expand_cfg.
References crtl, emit_insn_at_entry(), emit_move_insn(), end_sequence(), initial_value_struct::entries, get_insns(), initial_value_pair::hard_reg, i, initial_value_struct::num_entries, initial_value_pair::pseudo, and start_sequence().
References contains(), and epilogue_insn_hash.
void expand_dummy_function_end | ( | void | ) |
Undo the effects of init_dummy_function_start.
References cfun, end_sequence(), free_after_compilation(), free_after_parsing(), gcc_assert, in_dummy_function, in_sequence_p(), and pop_dummy_function().
Referenced by backend_init_target().
void expand_function_end | ( | void | ) |
Generate RTL for the end of the current function.
References anti_adjust_stack_and_probe(), arg_pointer_save_area, as_a(), BARRIER_P, BITS_PER_WORD, build_pointer_type(), CALL_P, cfun, clear_pending_stack_adjust(), clobber_return_register(), convert_memory_address, convert_move(), crtl, current_function_decl, DECL_BY_REFERENCE, DECL_REGISTER, DECL_RESULT, DECL_RTL, DECL_RTL_SET_P, do_pending_stack_adjust(), emit_group_load(), emit_group_move(), emit_insn(), emit_insn_after(), emit_insn_before(), emit_label(), emit_move_insn(), emit_stack_restore(), emit_stack_save(), end_sequence(), EXIT_IGNORE_STACK, expand_eh_return(), gcc_assert, gen_blockage(), GEN_INT, gen_reg_rtx(), gen_rtx_REG(), generating_concat_p, GENERIC_STACK_CHECK, get_arg_pointer_save_area(), GET_CODE, get_insns(), get_last_insn(), GET_MODE, GET_MODE_BITSIZE(), global_options, in_sequence_p(), input_location, int_size_in_bytes(), is_complex_int_mode(), naked_return_label, NEXT_INSN(), NULL_RTX, parm_birth_insn, probe_stack_range(), prologue_location, promote_function_mode(), PUT_MODE(), REG_FUNCTION_VALUE_P, REG_P, REGNO, return_label, SAVE_FUNCTION, set_curr_insn_location(), set_insn_locations(), shift_return_value(), sjlj_emit_function_exit_after(), stack_check_probe_note, stack_protect_epilogue(), start_sequence(), targetm, TREE_TYPE, TYPE_EMPTY_P, TYPE_MODE, TYPE_UNSIGNED, UI_SJLJ, use_return_register(), and XEXP.
Referenced by construct_exit_block().
void expand_function_start | ( | tree | subr | ) |
References aggregate_value_p(), arg_pointer_rtx, assemble_static_space(), assign_parms(), assign_stack_local(), build4(), build_decl(), cfun, convert_move(), crtl, current_function_decl, current_function_funcdef_no, currently_expanding_function_start, DECL_BY_REFERENCE, DECL_HAS_VALUE_EXPR_P, DECL_MODE, DECL_NAME, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK, DECL_REGISTER, DECL_RESULT, DECL_RTL_SET_P, DECL_SOURCE_LOCATION, emit_move_insn(), emit_note(), expand_expr(), EXPAND_WRITE, function_beg_insn, gcc_assert, gen_group_rtx(), gen_label_rtx(), gen_reg_rtx(), gen_rtx_MEM(), GENERIC_STACK_CHECK, GET_CODE, get_last_insn(), GET_MODE, GET_MODE_SIZE(), hard_frame_pointer_rtx, hard_function_value(), init_recog_no_volatile(), int_size_in_bytes(), integer_zero_node, is_gimple_reg(), mark_reg_pointer(), MEM_P, NOTE_P, NULL, NULL_RTX, NULL_TREE, parm_birth_insn, promote_decl_mode(), promote_ssa_mode(), reg_mentioned_p(), REG_P, return_label, set_decl_incoming_rtl(), SET_DECL_RTL, SET_DECL_VALUE_EXPR, set_dst_reg_note(), set_mem_attributes(), set_parm_rtl(), ssa_default_def(), stack_check_probe_note, stack_limit_rtx, targetm, TREE_OPERAND, TREE_TYPE, TYPE_ALIGN, TYPE_MODE, update_nonlocal_goto_save_area(), and XEXP.
Forward declarations.
Find the temp slot corresponding to the object at address X.
References temp_slot_address_entry::address, temp_slot::base_offset, find_temp_slot_from_address(), temp_slot::full_size, GET_CODE, temp_slot_address_entry::hash, i, max_slot_level(), temp_slot::next, NULL, offset, REG_P, strip_offset(), temp_slot_address_entry::temp_slot, temp_slot_address_compute_hash(), temp_slot_address_table, temp_slots_at_level(), virtual_stack_vars_rtx, and XEXP.
Referenced by find_temp_slot_from_address(), preserve_temp_slots(), and update_temp_slot_address().
const char * fndecl_name | ( | tree | fndecl | ) |
Returns the name of function declared by FNDECL.
References lang_hooks::decl_printable_name, and NULL.
Referenced by cgraph_node::add_new_function(), function_name(), get_static_name(), and ipa_reference_read_optimization_summary().
bool frame_offset_overflow | ( | poly_int64 | offset, |
tree | func ) |
Issue an error message and return TRUE if frame OFFSET overflows in the signed target pointer arithmetics for function FUNC. Otherwise return FALSE.
References coeffs_in_range_p(), DECL_SOURCE_LOCATION, error_at(), FRAME_GROWS_DOWNWARD, GET_MODE_BITSIZE(), HOST_WIDE_INT_1U, poly_int< N, C >::is_constant(), and offset.
Referenced by alloc_stack_frame_space(), and assign_stack_local_1().
void free_after_compilation | ( | struct function * | f | ) |
Clear out all parts of the state in F that can safely be discarded after the function has been compiled, to let garbage collection reclaim the memory.
References function::cfg, function::cond_uids, crtl, function::curr_properties, function::eh, epilogue_insn_hash, free(), function::machine, NULL, prologue_insn_hash, and regno_reg_rtx.
Referenced by expand_dummy_function_end(), expand_thunk(), and rest_of_clean_state().
void free_after_parsing | ( | struct function * | f | ) |
Clear out all parts of the state in F that can safely be discarded after the function has been parsed, but not compiled, to let garbage collection reclaim the memory.
References function::language.
Referenced by expand_dummy_function_end(), and rest_of_clean_state().
void free_temp_slots | ( | void | ) |
Free all temporaries used so far. This is normally called at the end of generating code for a statement.
References combine_temp_slots(), make_slot_available(), temp_slot::next, remove_unused_temp_slot_addresses(), temp_slot_level, and temp_slots_at_level().
Referenced by expand_asm_stmt(), expand_case(), expand_gimple_stmt(), expand_sjlj_dispatch_table(), pop_temp_slots(), and stack_protect_epilogue().
const char * function_name | ( | const function * | fn | ) |
Returns the name of function FN.
References function::decl, fndecl_name(), and NULL.
Referenced by current_function_name(), dump_function_to_file(), gen_ctf_function_type(), get_function_name(), output_intermediate_json_line(), print_graph_cfg(), and read_graph_file().
|
static |
Emit a sequence of insns to zero the call-used registers before RET according to ZERO_REGS_TYPE.
References bitmap_copy(), BLOCK_FOR_INSN(), CLEAR_HARD_REG_SET, crtl, current_function_decl, DECL_NAME, df_get_live_out(), df_regs_ever_live_p(), df_simulate_initialize_backwards(), df_simulate_one_insn_backwards(), df_update_exit_block_uses(), emit_insn_before(), end_sequence(), expand_asm_reg_clobber_mem_blockage(), fixed_regs, gcc_assert, get_insns(), hard_reg_set_empty_p(), hard_reg_set_subset_p(), leaf_function_p(), MAIN_NAME_P, reg_class_contents, REGNO_REG_SET_P, SET_HARD_REG_BIT, start_sequence(), targetm, and TEST_HARD_REG_BIT.
void generate_setjmp_warnings | ( | void | ) |
Generate warning messages for variables live across setjmp.
References bitmap_empty_p(), cfun, current_function_decl, DECL_INITIAL, n_basic_blocks_for_fn, NUM_FIXED_BLOCKS, regstat_get_setjmp_crosses(), setjmp_args_warning(), setjmp_crosses, and setjmp_vars_warning().
Referenced by ira().
rtx get_arg_pointer_save_area | ( | void | ) |
References arg_pointer_save_area, assign_stack_local(), copy_rtx(), crtl, emit_insn_after(), emit_move_insn(), end_sequence(), entry_of_function(), get_insns(), GET_MODE_SIZE(), pop_topmost_sequence(), push_topmost_sequence(), start_sequence(), and validize_mem().
Referenced by expand_builtin_setjmp_receiver(), and expand_function_end().
Return a vector containing all the blocks rooted at BLOCK. The number of elements in the vector is stored in N_BLOCKS_P. The vector is dynamically allocated; it is the caller's responsibility to call `free' on the pointer returned.
References all_blocks, and NULL.
Referenced by number_blocks().
poly_int64 get_frame_size | ( | void | ) |
Return size needed for stack frame based on slots so far allocated. This size counts from zero. It is not rounded to PREFERRED_STACK_BOUNDARY; the caller may have to do that.
References FRAME_GROWS_DOWNWARD, and frame_offset.
Referenced by do_reload(), final_start_function_1(), get_initial_register_offset(), lra(), reload(), and rtx_addr_can_trap_p_1().
If a pseudo represents an initial hard reg (or expression), return it, else return NULL_RTX.
References crtl, initial_value_struct::entries, initial_value_pair::hard_reg, i, NULL_RTX, initial_value_struct::num_entries, initial_value_pair::pseudo, and rtx_equal_p().
rtx get_hard_reg_initial_val | ( | machine_mode | mode, |
unsigned int | regno ) |
Make sure that there's a pseudo register of mode MODE that stores the initial value of hard register REGNO. Return an rtx for such a pseudo.
References crtl, initial_value_struct::entries, gen_reg_rtx(), gen_rtx_REG(), ggc_alloc(), GGC_RESIZEVEC, ggc_vec_alloc(), initial_value_pair::hard_reg, has_hard_reg_initial_val(), initial_value_struct::max_entries, initial_value_struct::num_entries, and initial_value_pair::pseudo.
int get_last_funcdef_no | ( | void | ) |
Return value of funcdef.
References funcdef_no.
int get_next_funcdef_no | ( | void | ) |
Return value of funcdef and increase it.
References funcdef_no.
Referenced by allocate_struct_function().
poly_int64 get_stack_dynamic_offset | ( | ) |
Return the value of STACK_DYNAMIC_OFFSET for the current function. This is done through a function wrapper so that the macro sees a predictable set of included files.
References current_function_decl, and STACK_DYNAMIC_OFFSET.
Referenced by allocate_dynamic_stack_space(), and instantiate_virtual_regs().
|
static |
Return stack slot alignment in bits for TYPE and MODE.
References GET_MODE_ALIGNMENT, STACK_SLOT_ALIGNMENT, lang_hooks_for_types::type_for_mode, and lang_hooks::types.
Referenced by assign_stack_local_1(), and assign_stack_temp_for_type().
gimple_seq gimplify_parameters | ( | gimple_seq * | cleanup | ) |
Gimplify the parameter list for current_function_decl. This involves evaluating SAVE_EXPRs of variable sized parameters and generating code to implement callee-copies reference parameters. Returns a sequence of statements to add to the beginning of the function.
References assign_parm_data_all::args_so_far, assign_parm_data_all::args_so_far_v, assign_parm_find_data_types(), assign_parms_augmented_arg_list(), assign_parms_initialize_all(), build2(), build_alloca_call_expr(), build_clobber(), build_fold_indirect_ref, build_pointer_type(), CALL_ALLOCA_FOR_VAR_P, compare_tree_int(), create_tmp_reg(), create_tmp_var, DECL_ALIGN, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_NOT_GIMPLE_REG_P, DECL_SIZE, DECL_SIZE_UNIT, fold_convert, FOR_EACH_VEC_ELT, GENERIC_STACK_CHECK, get_name(), gimple_build_assign(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_assign(), gimplify_one_sizepos(), gimplify_type_sizes(), i, is_gimple_reg(), max_int_size_in_bytes(), NULL, reference_callee_copied(), SET_DECL_VALUE_EXPR, SR_NONE, targetm, TREE_ADDRESSABLE, TREE_CODE, and TREE_TYPE.
Referenced by gimplify_body().
rtx has_hard_reg_initial_val | ( | machine_mode | mode, |
unsigned int | regno ) |
See if get_hard_reg_initial_val has been used to create a pseudo for the initial value of hard register REGNO in mode MODE. Return the associated pseudo if so, otherwise return NULL.
References crtl, initial_value_struct::entries, GET_MODE, initial_value_pair::hard_reg, i, NULL_RTX, initial_value_struct::num_entries, initial_value_pair::pseudo, and REGNO.
Referenced by get_hard_reg_initial_val().
|
static |
Helper to Hash a struct types_used_by_vars_entry.
References gcc_assert, types_used_by_vars_entry::type, and types_used_by_vars_entry::var_decl.
Referenced by used_type_hasher::hash().
void init_dummy_function_start | ( | void | ) |
Initialize the rtl expansion mechanism so that we can do simple things like generate sequences. This is used to provide a context during global initialization of some passes. You must call expand_dummy_function_end to exit this context.
References prepare_function_start(), and push_dummy_function().
Referenced by backend_init_target().
void init_function_start | ( | tree | subr | ) |
Generate RTL for the start of the function SUBR (a FUNCTION_DECL tree node) and initialize static variables for generating RTL for the statements of the function.
References AGGREGATE_TYPE_P, decide_function_section(), DECL_RESULT, DECL_SOURCE_LOCATION, initialize_rtl(), prepare_function_start(), TREE_TYPE, and warning_at().
Referenced by cgraph_node::expand(), and expand_thunk().
void init_temp_slots | ( | void | ) |
Initialize temporary slots.
References avail_temp_slots, hash_table< Descriptor, Lazy, Allocator >::create_ggc(), n_temp_slots_in_use, temp_slot_address_table, temp_slot_level, used_temp_slots, and vec_alloc().
Referenced by prepare_function_start(), and rest_of_clean_state().
Return the hardreg-pseudoreg initial values pair entry I and TRUE if I is a valid entry, or FALSE if I is not a valid entry.
References crtl, initial_value_struct::entries, initial_value_pair::hard_reg, i, initial_value_struct::num_entries, and initial_value_pair::pseudo.
Referenced by allocate_initial_values().
Inserts temporary slot TEMP to LIST.
References temp_slot::next, NULL, and temp_slot::prev.
Referenced by assign_stack_temp_for_type(), make_slot_available(), and move_slot_to_level().
Add ADDRESS as an alias of TEMP_SLOT to the addess -> temp slot mapping.
References temp_slot_address_entry::address, copy_rtx(), ggc_alloc(), temp_slot_address_entry::hash, temp_slot_address_entry::temp_slot, temp_slot_address_compute_hash(), and temp_slot_address_table.
Referenced by assign_stack_temp_for_type(), and update_temp_slot_address().
void instantiate_decl_rtl | ( | rtx | x | ) |
Subroutine of instantiate_decls. Given RTL representing a decl, do any instantiation required.
References CONSTANT_P, GET_CODE, instantiate_decl_rtl(), instantiate_virtual_regs_in_rtx(), MEM_P, REG_P, VIRTUAL_REGISTER_P, and XEXP.
Referenced by instantiate_decl_rtl(), instantiate_decls(), instantiate_decls_1(), and instantiate_expr().
|
static |
Scan all decls in FNDECL (both variables and parameters) and instantiate all virtual registers in their DECL_RTL's.
References cfun, DECL_ARGUMENTS, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_INCOMING_RTL, DECL_INITIAL, DECL_RESULT, DECL_RTL, DECL_RTL_SET_P, DECL_STRUCT_FUNCTION, DECL_VALUE_EXPR, FOR_EACH_LOCAL_DECL, instantiate_decl_rtl(), instantiate_decls_1(), instantiate_expr(), NULL, TREE_CODE, vec_free(), and walk_tree.
Referenced by instantiate_virtual_regs().
|
static |
Subroutine of instantiate_decls: Process all decls in the given BLOCK node and all its subblocks.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_RTL, DECL_RTL_SET_P, DECL_VALUE_EXPR, instantiate_decl_rtl(), instantiate_decls_1(), instantiate_expr(), NULL, VAR_P, and walk_tree.
Referenced by instantiate_decls(), and instantiate_decls_1().
Helper for instantiate_decls called via walk_tree: Process all decls in the given DECL_VALUE_EXPR.
References DECL_HAS_VALUE_EXPR_P, DECL_INCOMING_RTL, DECL_NAMELESS, DECL_P, DECL_RTL, DECL_RTL_SET_P, DECL_VALUE_EXPR, EXPR_P, instantiate_decl_rtl(), instantiate_expr(), NULL, TREE_CODE, VAR_P, and walk_tree.
Referenced by instantiate_decls(), instantiate_decls_1(), and instantiate_expr().
|
static |
Given a piece of RTX and a pointer to a HOST_WIDE_INT, if the RTX is a virtual register, return the equivalent hard register and set the offset indirectly through the pointer. Otherwise, return 0.
References arg_pointer_rtx, cfa_offset, crtl, dynamic_offset, frame_pointer_rtx, GEN_INT, in_arg_offset, NULL_RTX, offset, out_arg_offset, stack_pointer_rtx, stack_realign_drap, var_offset, virtual_cfa_rtx, virtual_incoming_args_rtx, virtual_outgoing_args_rtx, virtual_preferred_stack_boundary_rtx, virtual_stack_dynamic_rtx, and virtual_stack_vars_rtx.
Referenced by instantiate_virtual_regs_in_insn(), and instantiate_virtual_regs_in_rtx().
|
static |
Pass through the INSNS of function FNDECL and convert virtual register references to hard register references.
References ARG_POINTER_CFA_OFFSET, CALL_INSN_FUNCTION_USAGE, CALL_P, cfa_offset, current_function_decl, DEBUG_BIND_INSN_P, DEBUG_MARKER_INSN_P, rtx_insn::deleted(), dynamic_offset, GET_CODE, get_insns(), get_stack_dynamic_offset(), in_arg_offset, init_recog(), INSN_P, INSN_VAR_LOCATION_PTR, instantiate_decls(), instantiate_virtual_regs_in_insn(), instantiate_virtual_regs_in_rtx(), NEXT_INSN(), out_arg_offset, PATTERN(), REG_NOTES, STACK_POINTER_OFFSET, targetm, var_offset, and virtuals_instantiated.
|
static |
A subroutine of instantiate_virtual_regs. Instantiate any virtual registers present inside of insn. The result will be a valid insn.
References asm_noperands(), ASM_OPERANDS_INPUT_CONSTRAINT_VEC, ASM_OPERANDS_INPUT_VEC, ASM_OPERANDS_OUTPUT_CONSTRAINT, ASM_OPERANDS_OUTPUT_IDX, ASM_OPERANDS_TEMPLATE, check_asm_operands(), copy_rtx(), copy_to_reg(), delete_insn(), recog_data_d::dup_loc, recog_data_d::dup_num, emit_insn_before(), emit_move_insn(), end_sequence(), error_for_asm(), expand_simple_binop(), extract_asm_operands(), extract_insn(), fatal_insn_not_found, force_operand(), force_reg(), gcc_assert, gen_int_mode(), GET_CODE, get_insns(), GET_MODE, ggc_strdup, i, INSN_CODE, insn_data, instantiate_new_reg(), instantiate_virtual_regs_in_rtx(), JUMP_P, known_eq, LAST_VIRTUAL_REGISTER, recog_data_d::n_dups, recog_data_d::n_operands, NULL, NULL_RTX, offset, recog_data_d::operand, recog_data_d::operand_loc, recog_data_d::operand_mode, OPTAB_LIB_WIDEN, PATTERN(), poly_int_rtx_p(), PUT_MODE(), recog_data, recog_memoized(), REG_P, REGNO, replace_equiv_address(), rtvec_alloc(), safe_insn_predicate(), SET_DEST, SET_SRC, simplify_gen_binary(), simplify_gen_subreg(), single_set(), start_sequence(), SUBREG_BYTE, SUBREG_REG, and XEXP.
Referenced by instantiate_virtual_regs().
A subroutine of instantiate_virtual_regs. Instantiate any virtual registers present inside of *LOC. The expression is simplified, as much as possible, but is not to be considered "valid" in any sense implied by the target. Return true if any change is made.
References changed, FOR_EACH_SUBRTX_PTR, GET_CODE, GET_MODE, instantiate_new_reg(), offset, plus_constant(), and XEXP.
Referenced by instantiate_decl_rtl(), instantiate_virtual_regs(), and instantiate_virtual_regs_in_insn().
|
static |
Invoke the target hook when setting cfun. Update the optimization options if the function uses different options than the default.
References DECL_FUNCTION_SPECIFIC_OPTIMIZATION, global_options, global_options_set, in_dummy_function, init_tree_optimization_optabs(), optimization_current_node, optimization_default_node, parse_alignment_opts(), targetm, this_fn_optabs, TREE_OPTIMIZATION, and TREE_OPTIMIZATION_OPTABS.
Referenced by allocate_struct_function(), and set_cfun().
void locate_and_pad_parm | ( | machine_mode | passed_mode, |
tree | type, | ||
int | in_regs, | ||
int | reg_parm_stack_space, | ||
int | partial, | ||
tree | fndecl, | ||
struct args_size * | initial_offset_ptr, | ||
struct locate_and_pad_arg_data * | locate ) |
Compute the size and offset from the start of the stacked arguments for a parm passed in mode PASSED_MODE and with type TYPE. INITIAL_OFFSET_PTR points to the current offset into the stacked arguments. The starting offset and size for this parm are returned in LOCATE->OFFSET and LOCATE->SIZE, respectively. When IN_REGS is nonzero, the offset is that of stack slot, which is returned in LOCATE->SLOT_OFFSET. LOCATE->ALIGNMENT_PAD is the amount of padding required from the initial offset ptr to the stack slot. IN_REGS is nonzero if the argument will be passed in registers. It will never be set if REG_PARM_STACK_SPACE is not defined. REG_PARM_STACK_SPACE is the number of bytes of stack space reserved for arguments which are passed in registers. FNDECL is the function in which the argument was defined. There are two types of rounding that are done. The first, controlled by TARGET_FUNCTION_ARG_BOUNDARY, forces the offset from the start of the argument list to be aligned to the specific boundary (in bits). This rounding affects the initial and starting offsets, but not the argument size. The second, controlled by TARGET_FUNCTION_ARG_PADDING and PARM_BOUNDARY, optionally rounds the size of the parm to PARM_BOUNDARY. The initial offset is not affected by this rounding, while the size always is and the starting offset may be.
LOCATE->OFFSET will be negative for ARGS_GROW_DOWNWARD case; INITIAL_OFFSET_PTR is positive because locate_and_pad_parm's callers pass in the total size of args so far as INITIAL_OFFSET_PTR. LOCATE->SIZE is always positive.
References ADD_PARM_SIZE, locate_and_pad_arg_data::alignment_pad, arg_size_in_bytes(), ARGS_GROW_DOWNWARD, ARGS_SIZE_TREE, locate_and_pad_arg_data::boundary, args_size::constant, crtl, gcc_assert, GET_MODE_SIZE(), MAX_SUPPORTED_STACK_ALIGNMENT, locate_and_pad_arg_data::offset, pad_below(), PAD_DOWNWARD, PAD_NONE, pad_to_arg_alignment(), round_up, locate_and_pad_arg_data::size, size_binop, size_int, locate_and_pad_arg_data::slot_offset, ssize_int, SUB_PARM_SIZE, SUPPORTS_STACK_ALIGNMENT, targetm, tree_fits_uhwi_p(), TREE_INT_CST_LOW, tree_to_uhwi(), args_size::var, and locate_and_pad_arg_data::where_pad.
Referenced by assign_parm_find_entry_rtl(), emit_library_call_value_1(), and initialize_argument_information().
|
static |
Return a sequence to be used as the epilogue for the current function, or NULL.
References emit_jump_insn(), emit_note(), end_sequence(), epilogue_insn_hash, epilogue_location, get_insns(), get_last_insn(), JUMP_P, NULL, record_insns(), set_insn_locations(), set_return_jump_label(), start_sequence(), and targetm.
Referenced by thread_prologue_and_epilogue_insns().
rtl_opt_pass * make_pass_instantiate_virtual_regs | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_late_thread_prologue_and_epilogue | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_leaf_regs | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_match_asm_constraints | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_thread_prologue_and_epilogue | ( | gcc::context * | ctxt | ) |
rtl_opt_pass * make_pass_zero_call_used_regs | ( | gcc::context * | ctxt | ) |
|
static |
Return a sequence to be used as the prologue for the current function, or NULL.
References crtl, emit_insn(), emit_note(), emit_use(), end_sequence(), frame_pointer_needed, gen_blockage(), get_insns(), hard_frame_pointer_rtx, NULL, prologue_insn_hash, prologue_location, record_insns(), set_insn_locations(), start_sequence(), and targetm.
Referenced by thread_prologue_and_epilogue_insns().
|
static |
Make temporary slot TEMP available.
References avail_temp_slots, cut_slot_from_list(), temp_slot::in_use, insert_slot_to_list(), temp_slot::level, n_temp_slots_in_use, and temp_slots_at_level().
Referenced by free_temp_slots().
|
static |
Return a sequence to be used as the split prologue for the current function, or NULL.
References cfun, DECL_ATTRIBUTES, emit_insn(), end_sequence(), get_insns(), lookup_attribute(), NULL, prologue_insn_hash, prologue_location, record_insns(), set_insn_locations(), start_sequence(), and targetm.
Referenced by thread_prologue_and_epilogue_insns().
This mini-pass fixes fall-out from SSA in asm statements that have in-out constraints. Say you start with orig = inout; asm ("": "+mr" (inout)); use (orig); which is transformed very early to use explicit output and match operands: orig = inout; asm ("": "=mr" (inout) : "0" (inout)); use (orig); Or, after SSA and copyprop, asm ("": "=mr" (inout_2) : "0" (inout_1)); use (inout_1); Clearly inout_2 and inout_1 can't be coalesced easily anymore, as they represent two separate values, so they will get different pseudo registers during expansion. Then, since the two operands need to match per the constraints, but use different pseudo registers, reload can only register a reload for these operands. But reloads can only be satisfied by hardregs, not by memory, so we need a register for this reload, just because we are presented with non-matching operands. So, even though we allow memory for this operand, no memory can be used for it, just because the two operands don't match. This can cause reload failures on register-starved targets. So it's a symptom of reload not being able to use memory for reloads or, alternatively it's also a symptom of both operands not coming into reload as matching (in which case the pseudo could go to memory just fine, as the alternative allows it, and no reload would be necessary). We fix the latter problem here, by transforming asm ("": "=mr" (inout_2) : "0" (inout_1)); back to inout_2 = inout_1; asm ("": "=mr" (inout_2) : "0" (inout_2));
References ASM_OPERANDS_INPUT_CONSTRAINT, ASM_OPERANDS_INPUT_LENGTH, ASM_OPERANDS_INPUT_VEC, ASM_OPERANDS_OUTPUT_CONSTRAINT, changed, CONSTANT_P, copy_rtx(), df_insn_rescan(), emit_insn_before(), emit_move_insn(), end_sequence(), gcc_assert, general_operand(), get_insns(), GET_MODE, i, insns, matching_constraint_num(), MEM_P, NULL, reg_overlap_mentioned_p(), REG_P, replace_rtx(), RTVEC_ELT, rtx_equal_p(), SET_DEST, SET_SRC, start_sequence(), and SUBREG_P.
|
static |
If CONSTRAINT is a matching constraint, then return its number. Otherwise, return -1.
References IN_RANGE, and NULL.
Referenced by match_asm_constraints_1().
|
static |
Returns the maximal temporary slot level.
References used_temp_slots.
Referenced by find_temp_slot_from_address().
INSN has been duplicated or replaced by as COPY, perhaps by duplicating a basic block, splitting or peepholes. If INSN is a prologue or epilogue insn, then record COPY as well.
References epilogue_insn_hash, hash_table< Descriptor, Lazy, Allocator >::find(), hash_table< Descriptor, Lazy, Allocator >::find_slot(), gcc_assert, NULL, and prologue_insn_hash.
Referenced by copy_frame_info_to_split_insn(), and duplicate_insn_chain().
|
static |
Moves temporary slot TEMP to LEVEL.
References cut_slot_from_list(), insert_slot_to_list(), temp_slot::level, and temp_slots_at_level().
Referenced by preserve_temp_slots().
void number_blocks | ( | tree | fn | ) |
Set BLOCK_NUMBER for all the blocks in FN.
References BLOCK_NUMBER, DECL_INITIAL, free(), get_block_vector(), i, and next_block_index.
Referenced by final_start_function_1(), optimize_inline_calls(), and tree_function_versioning().
|
static |
References ADD_PARM_SIZE, args_size::constant, GET_MODE_SIZE(), round_up, SUB_PARM_SIZE, TREE_CODE, and TREE_INT_CST_LOW.
Referenced by locate_and_pad_parm().
|
static |
Round the stack offset in *OFFSET_PTR up to a multiple of BOUNDARY. BOUNDARY is measured in bits, but must be a multiple of a storage unit.
References ARGS_GROW_DOWNWARD, ARGS_SIZE_TREE, args_size::constant, NULL_TREE, offset, round_down, round_up, size_binop, ssize_int, STACK_POINTER_OFFSET, and args_size::var.
Referenced by locate_and_pad_parm().
void pop_cfun | ( | void | ) |
Pop cfun from the stack. Also set current_function_decl accordingly.
References cfun, cfun_stack, current_function_decl, function::decl, gcc_checking_assert, in_dummy_function, NULL_TREE, and set_cfun().
Referenced by account_profile_1(), cgraph_node::add_new_function(), cgraph_node::analyze(), analyze_function(), autofdo::auto_profile(), compute_fn_summary(), create_omp_child_function(), create_task_copyfn(), do_per_function_toporder(), estimated_stack_frame_size(), execute_all_ipa_transforms(), execute_function_dump(), execute_function_todo(), execute_one_pass(), cgraph_node::expand(), expand_omp_target(), expand_omp_taskreg(), finalize_task_copyfn(), function_and_variable_visibility(), cgraph_node::get_body(), gimplify_function_tree(), inline_analyze_function(), input_function(), modref_summaries::insert(), modref_summaries_lto::insert(), ipa_analyze_node(), ipa_merge_profiles(), ipa_sra_summarize_function(), ipa_tm_execute(), ipa_tm_scan_irr_function(), ipa_tm_transform_clone(), ipa_tm_transform_transaction(), lower_assumption(), lower_emutls_function_body(), lto_prepare_function_for_streaming(), move_block_to_fn(), move_sese_region_to_fn(), pop_dummy_function(), symbol_table::process_new_functions(), cgraph_edge::redirect_call_stmt_to_callee(), ipa_icf_gimple::func_checker::safe_for_total_scalarization_p(), simd_clone_adjust(), tree_function_versioning(), tree_profiling(), and auto_cfun::~auto_cfun().
void pop_dummy_function | ( | void | ) |
References in_dummy_function, and pop_cfun().
Referenced by gcc::pass_manager::dump_passes(), and expand_dummy_function_end().
void pop_function_context | ( | void | ) |
Restore the last saved context, at the end of a nested function. This function is called from language-specific code.
References current_function_decl, function::decl, function_context_stack, generating_concat_p, set_cfun(), and virtuals_instantiated.
void pop_temp_slots | ( | void | ) |
Pop a temporary nesting level. All slots in use in the current level are freed.
References free_temp_slots(), and temp_slot_level.
Referenced by emit_library_call_value_1(), expand_addsub_overflow(), expand_assignment(), expand_mul_overflow(), expand_neg_overflow(), precompute_register_parameters(), rtx_for_function_call(), and store_one_arg().
|
static |
Reset crtl and other non-struct-function variables to defaults as appropriate for emitting rtl at the start of a function.
References allocate_stack_usage_info(), function_abi::base_abi(), caller_save_needed, cfun, crtl, cse_not_expected, default_function_abi, default_rtl_profile(), fndecl_abi(), frame_pointer_needed, gcc_assert, generating_concat_p, get_last_insn(), in_dummy_function, init_emit(), init_expr(), init_temp_slots(), init_varasm_status(), reg_renumber, and virtuals_instantiated.
Referenced by init_dummy_function_start(), and init_function_start().
void preserve_temp_slots | ( | rtx | x | ) |
If X could be a reference to a temporary slot, mark that slot as belonging to the to one level higher than the current level. If X matched one of our slots, just mark that one. Otherwise, we can't easily predict which it is, so upgrade all of them. This is called when an ({...}) construct occurs and a statement returns a value in memory.
References CONSTANT_P, find_temp_slot_from_address(), temp_slot::level, MEM_P, move_slot_to_level(), temp_slot::next, REG_P, REG_POINTER, temp_slot_level, temp_slots_at_level(), and XEXP.
Referenced by expand_assignment(), precompute_register_parameters(), and store_one_arg().
References contains(), and prologue_insn_hash.
References contains(), epilogue_insn_hash, and prologue_insn_hash.
void push_cfun | ( | struct function * | new_cfun | ) |
Push the current cfun onto the stack, and set cfun to new_cfun. Also set current_function_decl accordingly.
References cfun, cfun_stack, current_function_decl, function::decl, gcc_assert, NULL_TREE, and set_cfun().
Referenced by account_profile_1(), cgraph_node::add_new_function(), cgraph_node::analyze(), analyze_function(), auto_cfun::auto_cfun(), autofdo::auto_profile(), compute_fn_summary(), create_task_copyfn(), do_per_function_toporder(), estimated_stack_frame_size(), execute_all_ipa_transforms(), execute_function_dump(), execute_function_todo(), cgraph_node::expand(), expand_omp_target(), expand_omp_taskreg(), finalize_task_copyfn(), function_and_variable_visibility(), cgraph_node::get_body(), gimplify_function_tree(), inline_analyze_function(), modref_summaries::insert(), modref_summaries_lto::insert(), ipa_analyze_node(), ipa_merge_profiles(), ipa_sra_summarize_function(), ipa_tm_execute(), ipa_tm_scan_irr_function(), ipa_tm_transform_clone(), ipa_tm_transform_transaction(), lower_emutls_function_body(), lto_prepare_function_for_streaming(), move_block_to_fn(), move_sese_region_to_fn(), symbol_table::process_new_functions(), cgraph_edge::redirect_call_stmt_to_callee(), ipa_icf_gimple::func_checker::safe_for_total_scalarization_p(), simd_clone_adjust(), and tree_profiling().
void push_dummy_function | ( | bool | with_decl | ) |
References build_decl(), build_function_type_list(), DECL_ARTIFICIAL, DECL_RESULT, gcc_assert, get_identifier(), in_dummy_function, NULL_TREE, push_struct_function(), SET_DECL_ASSEMBLER_NAME, UNKNOWN_LOCATION, and void_type_node.
Referenced by gcc::pass_manager::dump_passes(), and init_dummy_function_start().
void push_function_context | ( | void | ) |
Save the current context for compilation of a nested function. This is called from language-specific code.
References allocate_struct_function(), cfun, function_context_stack, NULL, and set_cfun().
This is like allocate_struct_function, but pushes a new cfun for FNDECL instead of just setting it.
References allocate_struct_function(), cfun, cfun_stack, current_function_decl, gcc_assert, and in_dummy_function.
Referenced by create_assumption_fn(), create_omp_child_function(), gimplify_function_tree(), initialize_cfun(), input_function(), and push_dummy_function().
void push_temp_slots | ( | void | ) |
Push deeper into the nesting level for stack temporaries.
References temp_slot_level.
Referenced by emit_library_call_value_1(), expand_addsub_overflow(), expand_assignment(), expand_mul_overflow(), expand_neg_overflow(), precompute_register_parameters(), rtx_for_function_call(), and store_one_arg().
void record_dynamic_alloc | ( | tree | decl_or_exp | ) |
Record a dynamic allocation made for DECL_OR_EXP.
References cfun, DECL_P, lang_hooks::decl_printable_name, DECL_SOURCE_LOCATION, EXPR_LOCATION, ggc_strdup, callinfo_dalloc::location, callinfo_dalloc::name, NULL, and vec_safe_push().
Referenced by expand_builtin_alloca(), and gimplify_vla_decl().
void record_epilogue_seq | ( | rtx_insn * | seq | ) |
References epilogue_insn_hash, NULL, and record_insns().
Referenced by emit_common_heads_for_components(), emit_common_tails_for_components(), and insert_prologue_epilogue_for_components().
void record_final_call | ( | tree | callee, |
location_t | location ) |
Record a final call to CALLEE at LOCATION.
References cfun, and vec_safe_push().
Referenced by emit_library_call_value_1(), and expand_call().
|
static |
We always define `record_insns' even if it's not used so that we can always export `prologue_epilogue_contains'.
Add a list of INSNS to the hash HASHP, possibly allocating HASHP for the first time.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), end(), hash_table< Descriptor, Lazy, Allocator >::find_slot(), gcc_assert, insns, NEXT_INSN(), and NULL.
Referenced by make_epilogue_seq(), make_prologue_seq(), make_split_prologue_seq(), record_epilogue_seq(), record_prologue_seq(), and thread_prologue_and_epilogue_insns().
void record_prologue_seq | ( | rtx_insn * | seq | ) |
References NULL, prologue_insn_hash, and record_insns().
Referenced by emit_common_heads_for_components(), emit_common_tails_for_components(), and insert_prologue_epilogue_for_components().
True if register REGNO was alive at a place where `setjmp' was called and was set more than once or is an argument. Such regs may be clobbered by `longjmp'.
References cfun, df_get_live_out(), ENTRY_BLOCK_PTR_FOR_FN, max_reg_num(), REG_N_SETS(), REGNO_REG_SET_P, and setjmp_crosses.
Referenced by setjmp_args_warning(), and setjmp_vars_warning().
|
static |
Remove all mappings of addresses to unused temp slots.
References n_temp_slots_in_use, NULL, remove_unused_temp_slot_addresses_1(), and temp_slot_address_table.
Referenced by free_temp_slots().
int remove_unused_temp_slot_addresses_1 | ( | temp_slot_address_entry ** | slot, |
void * | ) |
Remove an address -> temp slot mapping entry if the temp slot is not in use anymore. Callback for remove_unused_temp_slot_addresses.
References temp_slot::in_use, temp_slot_address_entry::temp_slot, and temp_slot_address_table.
Referenced by remove_unused_temp_slot_addresses().
void reorder_blocks | ( | void | ) |
Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END}, and create duplicate blocks.
??? Need an option to either create block fragments or to create abstract origin duplicates of a source block. It really depends on what optimization has been performed.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, blocks_nreverse_all(), clear_block_marks(), current_function_decl, DECL_INITIAL, get_insns(), NULL_TREE, and reorder_blocks_1().
Referenced by reemit_insn_block_notes().
|
static |
References BLOCK_CHAIN, BLOCK_FRAGMENT_CHAIN, BLOCK_FRAGMENT_ORIGIN, BLOCK_SAME_RANGE, BLOCK_SUBBLOCKS, BLOCK_SUPERCONTEXT, copy_node(), gcc_assert, insns, NEXT_INSN(), NOTE_BLOCK, NOTE_KIND, NOTE_P, NULL_TREE, and TREE_ASM_WRITTEN.
Referenced by reorder_blocks().
void reposition_prologue_and_epilogue_notes | ( | void | ) |
Reposition the prologue-end and epilogue-begin notes after instruction scheduling.
References BB_END, cfun, contains(), epilogue_insn_hash, EXIT_BLOCK_PTR_FOR_FN, FOR_BB_INSNS, FOR_EACH_EDGE, get_insns(), LABEL_P, last, NEXT_INSN(), NOTE_KIND, NOTE_P, NULL, PREV_INSN(), prologue_insn_hash, reorder_insns(), and targetm.
|
static |
References crtl, leaf_function_p(), and only_leaf_regs_used().
|
static |
A subroutine of instantiate_virtual_regs_in_insn. Return true if X matches the predicate for insn CODE operand OPERAND.
References insn_operand_matches().
Referenced by instantiate_virtual_regs_in_insn().
cfun should never be set directly; use this function.
References cfun, function::decl, invoke_set_current_function_hook(), NULL_TREE, and redirect_edge_var_map_empty().
Referenced by cgraph_build_static_cdtor_1(), cgraph_debug_gimple_stmt(), create_loop_fn(), cgraph_node::create_wrapper(), expand_thunk(), symbol_table::finalize_compilation_unit(), finalize_size_functions(), inline_call(), ipa_passes(), pop_cfun(), pop_function_context(), push_cfun(), and push_function_context().
void set_return_jump_label | ( | rtx_insn * | returnjump | ) |
Set JUMP_LABEL for a return insn.
References ANY_RETURN_P, GET_CODE, JUMP_LABEL, PATTERN(), ret_rtx, and XVECEXP.
Referenced by find_end_label(), force_nonfallthru_and_redirect(), and make_epilogue_seq().
|
static |
Do the appropriate part of setjmp_vars_warning but for arguments instead of local variables.
References current_function_decl, DECL_ARGUMENTS, DECL_CHAIN, DECL_RTL, REG_P, REGNO, regno_clobbered_at_setjmp(), setjmp_crosses, and warning().
Referenced by generate_setjmp_warnings().
Walk the tree of blocks describing the binding levels within a function and warn about variables the might be killed by setjmp or vfork. This is done after calling flow_analysis before register allocation since that will clobber the pseudo-regs to hard regs.
References BLOCK_CHAIN, BLOCK_SUBBLOCKS, BLOCK_VARS, DECL_CHAIN, DECL_RTL, DECL_RTL_SET_P, REG_P, REGNO, regno_clobbered_at_setjmp(), setjmp_crosses, setjmp_vars_warning(), VAR_P, and warning().
Referenced by generate_setjmp_warnings(), and setjmp_vars_warning().
unsigned int spill_slot_alignment | ( | machine_mode | mode | ) |
Return the minimum spill slot alignment for a register of mode MODE.
References GET_MODE_ALIGNMENT, NULL_TREE, and STACK_SLOT_ALIGNMENT.
Referenced by add_pseudo_to_slot().
If ARGS contains entries with complex types, split the entry into two entries of the component type. Return a new list of substitutions are needed, else the old list.
References build_decl(), copy_node(), DECL_ARG_TYPE, DECL_ARTIFICIAL, DECL_IGNORED_P, DECL_SIZE, DECL_SIZE_UNIT, EXPR_LOCATION, FOR_EACH_VEC_ELT, i, layout_decl(), NULL, NULL_TREE, SET_DECL_MODE, targetm, TREE_ADDRESSABLE, TREE_CODE, and TREE_TYPE.
Referenced by assign_parms_augmented_arg_list().
void stack_protect_epilogue | ( | void | ) |
Expand code to verify the stack_protect_guard. This is invoked at the end of a function to be protected.
References const0_rtx, crtl, DECL_P, DECL_RTL, emit_cmp_and_jump_insns(), emit_insn(), emit_label(), expand_call(), expand_normal(), free_temp_slots(), gcc_assert, gen_label_rtx(), get_last_insn(), JUMP_P, NULL, NULL_RTX, predict_insn_def(), ptr_mode, TAKEN, targetm, and y.
Referenced by expand_call(), and expand_function_end().
|
static |
Compute the hash value for an address -> temp slot mapping. The value is cached on the mapping entry.
References temp_slot_address_entry::address, do_not_record, GET_MODE, hash_rtx(), and NULL.
Referenced by find_temp_slot_from_address(), and insert_temp_slot_address().
|
static |
Returns the list of used temp slots at LEVEL.
References temp_slot::level, used_temp_slots, vec_safe_grow_cleared(), and vec_safe_length().
Referenced by assign_stack_temp_for_type(), find_temp_slot_from_address(), free_temp_slots(), make_slot_available(), move_slot_to_level(), and preserve_temp_slots().
void thread_prologue_and_epilogue_insns | ( | void | ) |
Generate the prologue and epilogue RTL if the machine supports it. Thread this into place with notes indicating where the prologue ends and where the epilogue begins. Update the basic block information when possible. Notes on epilogue placement: There are several kinds of edges to the exit block: * a single fallthru edge from LAST_BB * possibly, edges from blocks containing sibcalls * possibly, fake edges from infinite loops The epilogue is always emitted on the fallthru edge from the last basic block in the function, LAST_BB, into the exit block. If LAST_BB is empty except for a label, it is the target of every other basic block in the function that ends in a return. If a target has a return or simple_return pattern (possibly with conditional variants), these basic blocks can be changed so that a return insn is emitted into them, and their target is adjusted to the real exit block. Notes on shrink wrapping: We implement a fairly conservative version of shrink-wrapping rather than the textbook one. We only generate a single prologue and a single epilogue. This is sufficient to catch a number of interesting cases involving early exits. First, we identify the blocks that require the prologue to occur before them. These are the ones that modify a call-saved register, or reference any of the stack or frame pointer registers. To simplify things, we then mark everything reachable from these blocks as also requiring a prologue. This takes care of loops automatically, and avoids the need to examine whether MEMs reference the frame, since it is sufficient to check for occurrences of the stack or frame pointer. We then compute the set of blocks for which the need for a prologue is anticipatable (borrowing terminology from the shrink-wrapping description in Muchnick's book). These are the blocks which either require a prologue themselves, or those that have only successors where the prologue is anticipatable. The prologue needs to be inserted on all edges from BB1->BB2 where BB2 is in ANTIC and BB1 is not. For the moment, we ensure that only one such edge exists. The epilogue is placed as described above, but we make a distinction between inserting return and simple_return patterns when modifying other blocks that end in a return. Blocks that end in a sibcall omit the sibcall_epilogue if the block is not in ANTIC.
References as_a(), basic_block_def::aux, BB_END, bitmap_clear(), bitmap_set_bit, BLOCK_FOR_INSN(), CALL_P, cfg_layout_finalize(), cfg_layout_initialize(), cfun, commit_edge_insertions(), crtl, default_rtl_profile(), df_analyze(), df_update_entry_block_defs(), df_update_entry_exit_and_calls(), df_update_exit_block_uses(), eh_returnjump_p(), ei_next(), ei_safe_edge(), ei_start, emit_insn(), emit_insn_before(), emit_note(), emit_note_after(), end_sequence(), ENTRY_BLOCK_PTR_FOR_FN, epilogue_completed, epilogue_insn_hash, epilogue_location, EXIT_BLOCK_PTR_FOR_FN, find_fallthru_edge(), find_many_sub_basic_blocks(), find_sub_basic_blocks(), FOR_EACH_BB_FN, FOR_EACH_EDGE, gcc_assert, get_insns(), basic_block_def::index, insert_insn_on_edge(), last, last_basic_block_for_fn, make_epilogue_seq(), make_prologue_seq(), make_split_prologue_seq(), next_active_insn(), basic_block_def::next_bb, NEXT_INSN(), NONDEBUG_INSN_P, NOTE_KIND, NOTE_P, NULL, NUM_FIXED_BLOCKS, PATTERN(), PREV_INSN(), record_insns(), reorder_insns(), returnjump_p(), rtl_profile_for_bb(), set_insn_locations(), SIBLING_CALL_P, single_succ_edge(), single_succ_p(), start_sequence(), targetm, try_shrink_wrapping(), try_shrink_wrapping_separate(), and try_split().
Referenced by rest_of_handle_thread_prologue_and_epilogue().
|
static |
Determine whether it is possible to fit a stack slot of size SIZE and alignment ALIGNMENT into an area in the stack frame that starts at frame offset START and has a length of LENGTH. If so, store the frame offset to be used for the stack slot in *POFFSET and return true; return false otherwise. This function will extend the frame size when given a start/length pair that lies at the end of the frame.
References FRAME_GROWS_DOWNWARD, frame_offset, frame_phase, known_eq, maybe_gt, PREFERRED_STACK_BOUNDARY, and targetm.
Referenced by assign_stack_local_1().
Inserts an entry into the types_used_by_vars_hash hash table.
References hash_table< Descriptor, Lazy, Allocator >::create_ggc(), ggc_alloc(), NULL, type(), types_used_by_vars_entry::type, types_used_by_vars_hash, and types_used_by_vars_entry::var_decl.
Indicate that NEW_RTX is an alternate way of referring to the temp slot that previously was known by OLD_RTX.
References find_temp_slot_from_address(), GET_CODE, insert_temp_slot_address(), REG_P, rtx_equal_p(), update_temp_slot_address(), and XEXP.
Referenced by memory_address_addr_space(), offset_address(), replace_equiv_address(), and update_temp_slot_address().
bool use_register_for_decl | ( | const_tree | decl | ) |
Return true if we should assign DECL a pseudo register; false if it should live on the local stack.
References aggregate_value_p(), cfun, current_function_decl, DECL_BY_REFERENCE, DECL_IGNORED_P, DECL_MODE, DECL_REGISTER, FLOAT_TYPE_P, RECORD_OR_UNION_TYPE_P, SSA_NAME_VAR, targetm, TREE_ADDRESSABLE, TREE_CODE, TREE_SIDE_EFFECTS, TREE_TYPE, and TYPE_MODE.
Referenced by assign_parm_setup_block(), assign_parm_setup_reg(), assign_parms(), avoid_type_punning_on_regs(), discover_nonconstant_array_refs(), expand_one_ssa_partition(), expand_one_var(), gimple_can_coalesce_p(), and set_rtl().
|
static |
References diddle_return_value(), do_use_return_reg(), and NULL.
Referenced by expand_function_end().
void used_types_insert | ( | tree | t | ) |
Given a type, insert it into the used hash table in cfun.
References cfun, DINFO_LEVEL_NONE, NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_TYPE, TYPE_MAIN_VARIANT, TYPE_NAME, types_used_by_cur_var_decl, used_types_insert_helper(), and vec_safe_push().
Insert a TYPE into the used types hash table of CFUN.
References hash_set< KeyId, Lazy, Traits >::add(), hash_set< KeyId, Lazy, Traits >::create_ggc(), NULL, and function::used_types_hash.
Referenced by used_types_insert().
|
static |
Referenced by instantiate_new_reg(), and instantiate_virtual_regs().
struct function* cfun = 0 |
The currently compiled function.
Referenced by push_function_context().
Initialized with NOGC, making this poisonous to the garbage collector.
Referenced by pop_cfun(), push_cfun(), and push_struct_function().
bool currently_expanding_function_start |
Start the RTL for a new function, and set variables used for emitting RTL. SUBR is the FUNCTION_DECL node. PARMS_HAVE_CLEANUPS is nonzero if there are cleanups associated with the function's parameters, which must be run at any return statement.
Referenced by expand_function_start().
|
static |
Referenced by instantiate_new_reg(), and instantiate_virtual_regs().
|
static |
|
static |
Assign unique numbers to labels generated for profiling, debugging, etc.
Referenced by draw_cfg_node(), draw_cfg_node_succ_edges(), draw_cfg_nodes_for_loop(), get_last_funcdef_no(), and get_next_funcdef_no().
Stack of nested functions.
Keep track of the cfun stack.
Referenced by pop_function_context(), and push_function_context().
|
static |
These routines are responsible for converting virtual register references to the actual hard register references once RTL generation is complete. The following four variables are used for communication between the routines. They contain the offsets of the virtual registers from their respective hard registers.
Referenced by instantiate_new_reg(), and instantiate_virtual_regs().
|
static |
Keep track of whether we're in a dummy function context. If we are, we don't want to invoke the set_current_function hook, because we'll get into trouble if the hook calls target_reinit () recursively or when the initial initialization is not yet complete.
Referenced by expand_dummy_function_end(), invoke_set_current_function_hook(), pop_cfun(), pop_dummy_function(), prepare_function_start(), push_dummy_function(), and push_struct_function().
struct machine_function *(* init_machine_status) (void) | ( | void | ) |
These variables hold pointers to functions to create and destroy target specific, per-function data structures.
Referenced by allocate_struct_function().
|
static |
|
static |
Referenced by number_blocks().
|
static |
Referenced by instantiate_new_reg(), and instantiate_virtual_regs().
|
static |
|
static |
A table of addresses that represent a stack slot. The table is a mapping from address RTXen to a temp slot.
Referenced by find_temp_slot_from_address(), init_temp_slots(), insert_temp_slot_address(), remove_unused_temp_slot_addresses(), and remove_unused_temp_slot_addresses_1().
During parsing of a global variable, this vector contains the types referenced by the global variable.
Referenced by used_types_insert().
hash_table<used_type_hasher>* types_used_by_vars_hash = NULL |
Hash table making the relationship between a global variable and the types it references in its initializer. The key of the entry is a referenced type, and the value is the DECL of the global variable. types_use_by_vars_do_hash and types_used_by_vars_eq below are the hash and equality functions to use for this hash table.
Referenced by types_used_by_var_decl_insert().
|
static |
Referenced by instantiate_new_reg(), and instantiate_virtual_regs().
int virtuals_instantiated |
Nonzero once virtual register instantiation has been done. assign_stack_local uses frame_pointer_rtx when this is nonzero. calls.cc:emit_library_call_value_1 uses it to set up post-instantiation libcalls.
Referenced by allocate_dynamic_stack_space(), assign_stack_local_1(), assign_stack_temp_for_type(), emit_library_call_value_1(), instantiate_virtual_regs(), pop_function_context(), and prepare_function_start().