GCC Middle and Back End API Reference
|
Data Structures | |
struct | stack_var |
struct | stack_vars_data |
Enumerations | |
enum | { SPCT_FLAG_DEFAULT = 1, SPCT_FLAG_ALL = 2, SPCT_FLAG_STRONG = 3 } |
Variables | |
struct ssaexpand | SA |
gimple | currently_expanding_gimple_stmt |
static struct stack_var * | stack_vars |
static size_t | stack_vars_alloc |
static size_t | stack_vars_num |
static struct pointer_map_t * | decl_to_stack_part |
static bitmap_obstack | stack_var_bitmap_obstack |
static size_t * | stack_vars_sorted |
static int | frame_phase |
static bool | has_protected_decls |
static bool | has_short_buffer |
static struct pointer_map_t * | lab_rtx_for_bb |
|
static |
Take into account all sizes of partitions and reset DECL_RTLs.
References HOST_WIDE_INT, stack_var::next, set_rtl(), si, stack_var::size, stack_vars_num, and stack_vars_sorted.
Referenced by estimated_stack_frame_size().
|
static |
If the points-to solution *PI points to variables that are in a partition together with other variables add all partition members to the pointed-to variables bitmap.
References pt_solution::anything, bitmap_bit_p(), bitmap_clear(), bitmap_empty_p(), bitmap_ior_into(), pointer_map_contains(), pointer_set_insert(), and pt_solution::vars.
Referenced by update_alias_info_with_stack_vars().
|
static |
Generate stack partition conflicts between all partitions that are simultaneously live.
References add_scope_conflicts_1(), basic_block_def::aux, bitmap_ior_into(), changed, free(), and pre_and_rev_post_order_compute().
Referenced by expand_used_vars().
|
static |
Helper routine for add_scope_conflicts, calculating the active partitions at the end of BB, leaving the result in WORK. We're called to generate conflicts when FOR_CONFLICT is true, otherwise we're just tracking liveness.
References basic_block_def::aux, bitmap_clear(), bitmap_clear_bit(), bitmap_ior_into(), stack_var::conflicts, gimple_assign_lhs(), gimple_clobber_p(), gsi_after_labels(), gsi_end_p(), gsi_next(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), pc_rtx, pointer_map_contains(), basic_block_def::preds, edge_def::src, visit_conflict(), visit_op(), and walk_stmt_load_store_addr_ops().
Referenced by add_scope_conflicts().
|
static |
Ensure that variables in different stack protection phases conflict so that they are not merged and share the same stack slot.
References add_stack_var_conflict(), stack_protect_decl_phase(), and stack_vars_num.
Referenced by expand_used_vars().
|
static |
Accumulate DECL into STACK_VARS.
References align_local_variable(), stack_var::alignb, stack_var::conflicts, stack_var::decl, stack_var::next, pc_rtx, pointer_map_create(), pointer_map_insert(), stack_var::representative, set_rtl(), stack_var::size, stack_vars_alloc, stack_vars_num, and tree_low_cst().
Referenced by expand_one_var().
|
static |
Make the decls associated with luid's X and Y conflict.
References bitmap_set_bit(), and stack_var::conflicts.
Referenced by add_stack_protection_conflicts(), union_stack_vars(), and visit_conflict().
|
static |
Compute the byte alignment to use for DECL. Ignore alignment we can't do with expected alignment of the stack boundary.
Referenced by add_stack_var(), and expand_one_stack_var().
|
static |
Allocate SIZE bytes at byte alignment ALIGN from the stack frame. Return the frame offset.
References cfun, function::decl, frame_offset_overflow(), frame_phase, HOST_WIDE_INT, and offset.
Referenced by expand_one_stack_var(), expand_stack_vars(), and expand_used_vars().
|
static |
And helper function that checks for asan phase (with stack protector it is phase 3). This is used as callback for expand_stack_vars. Returns true if any of the vars in the partition need to be protected.
References asan_protect_stack_decl(), and stack_var::next.
Referenced by expand_used_vars().
|
static |
Ensure INSN_VAR_LOCATION_LOC (insn) doesn't have unbound complexity. Allow 4 levels of rtl nesting for most rtl codes, and if we see anything deeper than that, create DEBUG_EXPRs and emit DEBUG_INSNs before INSN.
References emit_debug_insn_before(), exp(), make_debug_expr_from_rtl(), and VAR_INIT_STATUS_INITIALIZED.
Referenced by expand_debug_locations().
|
static |
Return the difference between the ceil and the truncated result of a signed division by OP1 with remainder MOD.
Referenced by expand_debug_expr().
|
static |
Return the difference between the ceil and the truncated result of an unsigned division by OP1 with remainder MOD.
Referenced by expand_debug_expr().
|
static |
A subroutine of expand_used_vars. Walk down through the BLOCK tree and clear TREE_USED on all local variables.
Referenced by expand_used_vars().
|
static |
Create a block containing landing pads and similar stuff.
References add_bb_to_loop(), cfun, edge_def::count, basic_block_def::count, create_basic_block(), expand_function_end(), edge_def::flags, basic_block_def::frequency, function::function_end_locus, get_last_insn(), input_location, basic_block_def::loop_father, make_edge(), edge_def::probability, redirect_edge_succ(), rtl_profile_for_bb(), and update_bb_for_insn().
Referenced by gimple_expand_cfg().
|
static |
Create a basic block for initialization code.
References add_bb_to_loop(), edge_def::count, basic_block_def::count, create_basic_block(), edge_def::dest, emit_jump(), basic_block_def::frequency, get_insns(), get_last_insn(), gimple_block_label(), init_rtl_bb_info(), label_rtx(), basic_block_def::loop_father, make_edge(), basic_block_def::next_bb, edge_def::probability, redirect_edge_succ(), and update_bb_for_insn().
Referenced by gimple_expand_cfg().
|
static |
Convert X to MODE, that must be Pmode or ptr_mode, without emitting any rtl.
References simplify_gen_subreg(), subreg_lowpart_offset(), and targetm.
Referenced by expand_debug_expr().
|
static |
Create a decl for the guard at the top of the stack frame.
References current_function_decl, and expand_one_stack_var().
Referenced by expand_used_vars().
|
static |
A subroutine of expand_one_var. VAR is a variable that will be allocated to the local stack frame. Return true if we wish to add VAR to STACK_VARS so that it will be coalesced with other variables. Return false to allocate VAR immediately. This function is used to reduce the number of variables considered for coalescing, which reduces the size of the quadratic problem.
References tree_low_cst().
Referenced by expand_one_var().
|
static |
RTL expansion is not able to compile array references with variable offsets for arrays stored in single register. Discover such expressions and mark variables as addressable to avoid this scenario.
References discover_nonconstant_array_refs_r(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_debug(), and walk_gimple_op().
Referenced by gimple_expand_cfg().
|
static |
Helper function for discover_nonconstant_array_refs. Look for ARRAY_REF nodes with non-constant indexes and mark them addressable.
References get_base_address(), and is_gimple_min_invariant().
Referenced by discover_nonconstant_array_refs().
|
static |
A debugging aid for expand_used_vars. Dump the generated partitions.
References stack_var::alignb, dump_file, dump_flags, HOST_WIDE_INT_PRINT_DEC, stack_var::next, print_generic_expr(), stack_var::representative, si, stack_var::size, stack_vars_num, and stack_vars_sorted.
Referenced by expand_used_vars().
HOST_WIDE_INT estimated_stack_frame_size | ( | ) |
Make a fair guess for the size of the stack frame of the function in NODE. This doesn't have to be exact, the result is only used in the inline heuristics. So we don't want to run the full stack var packing algorithm (which is quadratic in the number of stack vars). Instead, we calculate the total size of all stack vars. This turns out to be a pretty fair estimate -- packing of stack vars doesn't happen very often.
References account_stack_vars(), auto_var_in_fn_p(), symtab_node_base::decl, function::decl, expand_one_var(), fini_vars_expansion(), HOST_WIDE_INT, init_vars_expansion(), pop_cfun(), push_cfun(), stack_vars_num, stack_vars_sorted, and cgraph_node::symbol.
Referenced by compute_inline_parameters().
|
static |
A subroutine of expand_gimple_stmt_1, expanding one GIMPLE_CALL statement STMT.
References build_pointer_type(), BUILT_IN_NORMAL, decl_debug_args_lookup(), exp(), expand_assignment(), expand_debug_expr(), expand_expr_real_1(), expand_internal_call(), EXPAND_NORMAL, get_gimple_for_ssa_name(), gimple_assign_rhs1(), gimple_assign_rhs_code(), gimple_call_alloca_for_var_p(), gimple_call_arg(), gimple_call_chain(), gimple_call_fn(), gimple_call_fndecl(), gimple_call_fntype(), gimple_call_from_thunk_p(), gimple_call_internal_p(), gimple_call_lhs(), gimple_call_nothrow_p(), gimple_call_num_args(), gimple_call_return_slot_opt_p(), gimple_call_return_type(), gimple_call_tail_p(), gimple_call_va_arg_pack_p(), gimple_has_side_effects(), gimple_location(), and mark_transaction_restart_calls().
Referenced by expand_gimple_stmt_1().
Referenced by expand_call_stmt(), expand_debug_expr(), and expand_debug_locations().
|
static |
Return an RTX equivalent to the value of the tree expression EXP.
References build_pointer_type(), build_zero_cst(), ceil_sdiv_adjust(), ceil_udiv_adjust(), const_true_rtx, convert_debug_memory_address(), copy_rtx(), debug_tree(), exp(), expand_debug_expr(), expand_debug_parm_decl(), expand_expr(), EXPAND_INITIALIZER, floor_sdiv_adjust(), g, gen_rtx_MEM(), gen_rtx_SUBREG(), get_gimple_for_ssa_name(), get_inner_reference(), get_ref_base_and_extent(), gimple_assign_rhs_to_tree(), handled_component_p(), HOST_WIDE_INT, int_mode_for_mode(), is_gimple_mem_ref_addr(), lookup_constant_def(), make_decl_rtl_for_debug(), ssaexpand::map, offset, separate_ops::op0, separate_ops::op1, separate_ops::op2, ssaexpand::partition_to_pseudo, plus_constant(), round_sdiv_adjust(), round_udiv_adjust(), rtvec_alloc(), SA, set_mem_addr_space(), set_mem_attributes(), set_mem_expr(), simplify_gen_binary(), simplify_gen_relational(), simplify_gen_subreg(), simplify_gen_ternary(), simplify_gen_unary(), smallest_mode_for_size(), strlen(), subreg_lowpart_offset(), target_for_debug_bind(), targetm, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_exceptional, tcc_expression, tcc_reference, tcc_statement, tcc_type, tcc_unary, tcc_vl_exp, tree_mem_ref_addr(), and var_to_partition().
|
static |
Expand the _LOCs in debug insns. We run this after expanding all regular insns, so that any variables referenced in the function will have their DECL_RTLs set.
References avoid_complex_debug_insns(), expand_debug_expr(), expand_debug_source_expr(), get_insns(), get_last_insn(), last, and VAR_INIT_STATUS_UNINITIALIZED.
Referenced by gimple_expand_cfg().
|
static |
Return an RTX equivalent to the value of the parameter DECL.
References copy_rtx(), gen_raw_REG(), gen_rtx_REG_offset(), and replace_equiv_address_nv().
Referenced by expand_debug_expr(), and expand_debug_source_expr().
|
static |
Return an RTX equivalent to the source bind value of the tree expression EXP.
References current_function_decl, decl_debug_args_lookup(), expand_debug_parm_decl(), separate_ops::op0, simplify_gen_subreg(), simplify_gen_unary(), subreg_lowpart_offset(), and vec_safe_iterate().
Referenced by expand_debug_locations().
|
static |
Expand basic block BB from GIMPLE trees to RTL.
References bb_seq(), bitmap_bit_p(), can_fallthru(), curr_insn_location(), delink_stmt_imm_use(), edge_def::dest, do_pending_stack_adjust(), dump_file, dump_flags, emit_debug_insn(), emit_insn_after_noloc(), emit_jump(), emit_label(), emit_note(), emit_note_after(), expand_gimple_cond(), expand_gimple_stmt(), expand_gimple_tailcall(), edge_def::flags, basic_block_def::flags, gen_move_insn(), gen_reg_rtx(), get_gimple_for_ssa_name(), get_last_insn(), basic_block_def::basic_block_il_dependent::gimple, gimple_assign_rhs_to_tree(), gimple_call_set_tail(), gimple_call_tail_p(), gimple_debug_bind_get_value(), gimple_debug_bind_get_var(), gimple_debug_bind_has_value_p(), gimple_debug_bind_p(), gimple_debug_source_bind_get_value(), gimple_debug_source_bind_get_var(), gimple_debug_source_bind_p(), gimple_location(), gimple_return_retval(), edge_def::goto_locus, gsi_end_p(), gsi_next(), gsi_remove(), gsi_stmt(), basic_block_def::il, basic_block_def::index, init_rtl_bb_info(), is_gimple_call(), is_gimple_debug(), label_rtx_for_bb(), last, maybe_dump_rtl_for_gimple_stmt(), basic_block_def::next_bb, gimple_bb_info::phi_nodes, pointer_map_contains(), rtl_profile_for_bb(), SA, gimple_bb_info::seq, set_curr_insn_location(), single_succ(), single_succ_edge(), single_succ_p(), basic_block_def::succs, target_for_debug_bind(), update_bb_for_insn(), update_stmt(), ssaexpand::values, VAR_INIT_STATUS_INITIALIZED, and VAR_INIT_STATUS_UNINITIALIZED.
Referenced by gimple_expand_cfg().
|
static |
A subroutine of expand_gimple_basic_block. Expand one GIMPLE_COND. Returns a new basic block if we've terminated the current basic block and created a new one.
References add_bb_to_loop(), bitmap_bit_p(), edge_def::count, basic_block_def::count, create_basic_block(), curr_insn_location(), edge_def::dest, emit_jump(), extract_true_false_edges_from_block(), edge_def::flags, basic_block_def::frequency, get_last_insn(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs_code(), gimple_cond_code(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_location(), edge_def::goto_locus, integer_onep(), integer_zerop(), jumpif_1(), jumpifnot_1(), label_rtx_for_bb(), last, basic_block_def::loop_father, make_edge(), maybe_cleanup_end_of_block(), maybe_dump_rtl_for_gimple_stmt(), basic_block_def::next_bb, optimize_insn_for_speed_p(), edge_def::probability, redirect_edge_succ(), SA, set_curr_insn_location(), tcc_comparison, update_bb_for_insn(), and ssaexpand::values.
Referenced by expand_gimple_basic_block().
|
static |
Expand one gimple statement STMT and return the last RTL instruction before any of the newly generated ones. In addition to generating the necessary RTL instructions this also sets REG_EH_REGION notes if necessary and sets the current source location for diagnostics.
References cfun, expand_gimple_stmt_1(), find_reg_note(), free_temp_slots(), get_last_insn(), gimple_has_location(), gimple_location(), input_location, insn_could_throw_p(), last, lookup_stmt_eh_lp(), make_reg_eh_region_note(), and next_real_insn().
Referenced by expand_gimple_basic_block(), and expand_gimple_tailcall().
|
static |
A subroutine of expand_gimple_stmt, expanding one gimple statement STMT that doesn't require special handling for outgoing edges. That is no tailcalls and no GIMPLE_COND.
References separate_ops::code, convert_modes(), convert_move(), current_function_decl, emit_move_insn(), emit_storent_insn(), expand_asm_stmt(), expand_assignment(), expand_call_stmt(), expand_case(), expand_computed_goto(), expand_expr(), expand_expr_real_2(), expand_goto(), expand_label(), EXPAND_NORMAL, expand_null_return(), expand_return(), EXPAND_WRITE, force_operand(), get_gimple_rhs_class(), gimple_assign_lhs(), gimple_assign_nontemporal_move_p(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_expr_code(), gimple_goto_dest(), gimple_has_location(), gimple_label_label(), gimple_location(), gimple_return_retval(), GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, separate_ops::location, separate_ops::op0, separate_ops::op1, separate_ops::op2, set_curr_insn_location(), and separate_ops::type.
Referenced by expand_gimple_stmt().
|
static |
A subroutine of expand_gimple_basic_block. Expand one GIMPLE_CALL that has CALL_EXPR_TAILCALL set. Returns non-null if we actually generated a tail call (something that might be denied by the ABI rules governing the call; see calls.c). Sets CAN_FALLTHRU if we generated a *conditional* tail call, and can still reach the rest of BB. The case here is __builtin_sqrt, where the NaN result goes through the external function (with a tailcall) and the normal result happens via a sqrt instruction.
References count, edge_def::count, basic_block_def::count, create_basic_block(), delete_insn(), edge_def::dest, do_pending_stack_adjust(), ei_next(), ei_safe_edge(), expand_gimple_stmt(), edge_def::flags, basic_block_def::frequency, get_last_insn(), last, make_edge(), maybe_dump_rtl_for_gimple_stmt(), edge_def::probability, remove_edge(), basic_block_def::succs, and update_bb_for_insn().
Referenced by expand_gimple_basic_block().
|
static |
A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that has some associated error, e.g. its type is error-mark. We just need to pick something that won't crash the rest of the compiler.
References gen_reg_rtx(), and gen_rtx_MEM().
Referenced by expand_one_var().
|
static |
A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that will reside in a hard register.
References rest_of_decl_compilation().
Referenced by expand_one_var().
|
static |
A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that will reside in a pseudo register.
References gen_reg_rtx(), get_pointer_alignment(), mark_reg_pointer(), mark_user_reg(), promote_decl_mode(), reg_mode, and set_rtl().
Referenced by expand_one_var().
|
static |
A subroutine of expand_one_var. Called to immediately assign rtl to a variable to be allocated in the stack frame.
References align_local_variable(), alloc_stack_frame_space(), expand_one_stack_var_at(), HOST_WIDE_INT, offset, and tree_low_cst().
Referenced by create_stack_guard(), and expand_one_var().
|
static |
Assign rtl to DECL at BASE + OFFSET.
References frame_phase, gen_rtx_MEM(), offset, plus_constant(), set_mem_attributes(), set_rtl(), and trunc_int_for_mode().
Referenced by expand_one_stack_var(), and expand_stack_vars().
|
static |
A subroutine of expand_used_vars. Expand one variable according to its flavor. Variables to be placed on the stack are not actually expanded yet, merely recorded. When REALLY_EXPAND is false, only add stack values to be allocated. Return stack usage this variable is supposed to take.
References add_stack_var(), defer_stack_allocation(), error(), expand_one_error_var(), expand_one_hard_reg_var(), expand_one_register_var(), expand_one_stack_var(), tree_low_cst(), use_register_for_decl(), and valid_constant_size_p().
Referenced by estimated_stack_frame_size(), expand_used_vars(), and expand_used_vars_for_block().
|
static |
This function sets crtl->args.internal_arg_pointer to a virtual register if DRAP is needed. Local register allocator will replace virtual_incoming_args_rtx with the virtual register.
References function::calls_alloca, function::can_throw_non_call_exceptions, cfun, fixup_tail_calls(), function::has_nonlocal_label, and targetm.
Referenced by gimple_expand_cfg().
|
static |
A subroutine of expand_used_vars. Give each partition representative a unique location within the stack frame. Update each partition member with that location.
References stack_var::alignb, alloc_stack_frame_space(), allocate_dynamic_stack_space(), stack_vars_data::asan_decl_vec, asan_protect_stack_decl(), stack_vars_data::asan_vec, stack_var::decl, expand_one_stack_var_at(), HOST_WIDE_INT, ssaexpand::map, stack_var::next, offset, ssaexpand::partition_to_pseudo, pc_rtx, SA, si, stack_var::size, stack_vars_num, stack_vars_sorted, and var_to_partition().
Referenced by expand_used_vars().
|
static |
Expand all variables used in the function.
References add_local_decl(), add_scope_conflicts(), add_stack_protection_conflicts(), alloc_stack_frame_space(), asan_decl_phase_3(), stack_vars_data::asan_decl_vec, asan_emit_stack_protection(), stack_vars_data::asan_vec, bitmap_bit_p(), function::calls_alloca, cfun, clear_tree_used(), create_stack_guard(), create_tmp_reg(), current_function_decl, dump_file, dump_stack_var_partition(), expand_one_var(), expand_stack_vars(), expand_used_vars_for_block(), fini_vars_expansion(), frame_phase, has_protected_decls, HOST_WIDE_INT, init_vars_expansion(), is_gimple_reg(), is_global_var(), len, function::local_decls, ssaexpand::map, _var_map::num_partitions, offset, ssaexpand::partition_has_default_def, partition_stack_vars(), ssaexpand::partition_to_pseudo, partition_to_var(), pointer_map_create(), pointer_map_destroy(), pointer_map_insert(), record_or_union_type_has_array_p(), replace_ssa_name_symbol(), SA, SPCT_FLAG_ALL, SPCT_FLAG_DEFAULT, SPCT_FLAG_STRONG, stack_protect_decl_phase_1(), stack_protect_decl_phase_2(), stack_vars_num, vec_safe_is_empty(), vec_safe_length(), virtual_operand_p(), and vNULL.
Referenced by gimple_expand_cfg().
|
static |
A subroutine of expand_used_vars. Walk down through the BLOCK tree expanding variables. Those variables that can be put into registers are allocated pseudos; those that can't are put on the stack. TOPLEVEL is true if this is the outermost BLOCK.
References expand_one_var().
Referenced by expand_used_vars().
|
static |
Free up stack variable graph data.
References bitmap_obstack_release(), pointer_map_destroy(), stack_vars_alloc, stack_vars_num, and stack_vars_sorted.
Referenced by estimated_stack_frame_size(), and expand_used_vars().
|
static |
Return the difference between the floor and the truncated result of a signed division by OP1 with remainder MOD.
Referenced by expand_debug_expr().
tree gimple_assign_rhs_to_tree | ( | ) |
Return an expression tree corresponding to the RHS of GIMPLE statement STMT.
References copy_node(), currently_expanding_to_rtl, get_gimple_rhs_class(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_block(), gimple_expr_code(), gimple_has_location(), gimple_location(), GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, and GIMPLE_UNARY_RHS.
Referenced by aff_combination_expand(), expand_debug_expr(), expand_expr_real_1(), expand_gimple_basic_block(), and insert_debug_temp_for_var_def().
|
static |
Translate the intermediate representation contained in the CFG from GIMPLE trees to RTL. We do conversion per basic block and preserve/update the tree CFG. This implies we have to do some magic as the CFG can simultaneously consist of basic blocks containing RTL and GIMPLE trees. This can confuse the CFG hooks, so be careful to not manipulate CFG during the expansion.
References bitmap_ones(), function::calls_alloca, CDI_DOMINATORS, CDI_POST_DOMINATORS, function::cfg, cfun, cgraph_function_possibly_inlined_p(), cleanup_cfg(), commit_one_edge_insertion(), construct_exit_block(), construct_init_block(), curr_insn_location(), current_function_decl, currently_expanding_to_rtl, debug_hooks, function::decl, default_rtl_profile(), delete_tree_cfg_annotations(), edge_def::dest, discover_nonconstant_array_refs(), dump_file, function::eh, ei_next(), ei_safe_edge(), emit_initial_value_sets(), emit_insn_after(), emit_insn_after_noloc(), emit_insn_before(), emit_note(), end_sequence(), expand_debug_locations(), expand_function_start(), expand_gimple_basic_block(), expand_main_function(), expand_phi_nodes(), expand_stack_alignment(), expand_used_vars(), find_many_sub_basic_blocks(), finish_eh_generation(), finish_out_of_ssa(), fixup_tail_calls(), edge_def::flags, free_dominance_info(), free_histograms(), function::function_start_locus, generating_concat_p, get_containing_scope(), get_insns(), get_pointer_alignment(), function::gimple_df, has_short_buffer, gimple_df::in_ssa_p, insn_locations_finalize(), insn_locations_init(), edge_def::insns, LOOP_CLOSED_SSA, loops_state_clear(), ssaexpand::map, mark_reg_pointer(), control_flow_graph::max_jumptable_ents, basic_block_def::next_bb, _var_map::num_partitions, gcc_debug_hooks::outlining_inline_function, ssaexpand::partition_to_pseudo, partition_to_var(), pc_rtx, pointer_map_create(), pointer_map_destroy(), prologue_location, purge_all_dead_edges(), edge_def::edge_def_insns::r, rebuild_jump_labels(), rebuild_jump_labels_chain(), reg_renumber, eh_status::region_tree, remove_edge(), replace_ssa_name_symbol(), resolve_unique_section(), rewrite_out_of_ssa(), rtl_profile_for_bb(), rtl_register_cfg_hooks(), SA, sbitmap_alloc(), sbitmap_free(), set_block_levels(), set_curr_insn_location(), set_eh_throw_stmt_table(), set_mem_expr(), single_succ_p(), edge_def::src, stack_protect_prologue(), start_sequence(), basic_block_def::succs, targetm, timevar_pop(), timevar_push(), gimple_df::tm_restart, unshare_all_rtl(), var_to_partition(), verify_flow_info(), and warning().
|
static |
Prepare for expanding variables.
References bitmap_obstack_initialize(), has_protected_decls, has_short_buffer, and pointer_map_create().
Referenced by estimated_stack_frame_size(), and expand_used_vars().
|
static |
Returns the label_rtx expression for a label starting basic block BB.
References block_label(), gen_label_rtx(), gimple_label_label(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), label_rtx(), pointer_map_contains(), and pointer_map_insert().
Referenced by expand_gimple_basic_block(), and expand_gimple_cond().
rtl_opt_pass* make_pass_expand | ( | ) |
|
static |
Mark all calls that can have a transaction restart.
References add_reg_note(), cfun, get_last_insn(), function::gimple_df, tm_restart_node::label_or_list, label_rtx(), next_real_insn(), tm_restart_node::stmt, and gimple_df::tm_restart.
Referenced by expand_call_stmt().
|
static |
A subroutine of expand_gimple_cond. Given E, a fallthrough edge of a basic block where we just expanded the conditional at the end, possibly clean up the CFG and instruction sequence. LAST is the last instruction before the just emitted jump sequence.
References any_condjump_p(), delete_insn(), get_last_insn(), last, and remove_edge().
Referenced by expand_gimple_cond().
|
static |
If we need to produce a detailed dump, print the tree representation for STMT to the dump file. SINCE is the last RTX after which the RTL generated for STMT should have been appended.
References dump_file, dump_flags, print_gimple_stmt(), and print_rtl().
Referenced by expand_gimple_basic_block(), expand_gimple_cond(), and expand_gimple_tailcall().
|
static |
A subroutine of expand_used_vars. Binpack the variables into partitions constrained by the interference graph. The overall algorithm used is as follows: Sort the objects by size in descending order. For each object A { S = size(A) O = 0 loop { Look for the largest non-conflicting object B with size <= S. UNION (A, B) } }
References stack_var::alignb, HOST_WIDE_INT, stack_var::representative, si, stack_var::size, stack_var_cmp(), stack_var_conflict_p(), stack_vars_num, stack_vars_sorted, union_stack_vars(), and update_alias_info_with_stack_vars().
Referenced by expand_used_vars().
|
static |
Helper routine to check if a record or union contains an array field.
References field_type().
Referenced by expand_used_vars().
|
static |
Return the difference between the rounded and the truncated result of a signed division by OP1 with remainder MOD. Halfway cases are rounded away from zero, rather than to the nearest even number.
Referenced by expand_debug_expr().
|
static |
Return the difference between the rounded and the truncated result of a unsigned division by OP1 with remainder MOD. Halfway cases are rounded away from zero, rather than to the nearest even number.
Referenced by expand_debug_expr().
|
static |
For each lexical block, set BLOCK_NUMBER to the depth at which it is found in the block tree.
Referenced by gimple_expand_cfg().
|
inlinestatic |
Associate declaration T with storage space X. If T is no SSA name this is exactly SET_DECL_RTL, otherwise make the partition of T associated with X.
References ssaexpand::map, ssaexpand::partition_to_pseudo, pc_rtx, SA, set_reg_attrs_for_decl_rtl(), and var_to_partition().
Referenced by account_stack_vars(), add_stack_var(), expand_one_register_var(), and expand_one_stack_var_at().
|
static |
References host_integerp(), HOST_WIDE_INT, len, and tree_low_cst().
Referenced by stack_protect_decl_phase().
|
static |
Return nonzero if DECL should be segregated into the "vulnerable" upper part of the local stack frame. Remember if we ever return nonzero for any variable in this function. The return value is the phase number in which the variable should be allocated.
References has_protected_decls, has_short_buffer, SPCT_FLAG_ALL, SPCT_FLAG_STRONG, and stack_protect_classify_type().
Referenced by add_stack_protection_conflicts(), stack_protect_decl_phase_1(), and stack_protect_decl_phase_2().
|
static |
Two helper routines that check for phase 1 and phase 2. These are used as callbacks for expand_stack_vars.
References stack_protect_decl_phase().
Referenced by expand_used_vars().
|
static |
References stack_protect_decl_phase().
Referenced by expand_used_vars().
|
static |
A subroutine of partition_stack_vars. A comparison function for qsort, sorting an array of indices by the properties of the object.
References stack_var::alignb, stack_var::decl, HOST_WIDE_INT, and stack_var::size.
Referenced by partition_stack_vars().
|
static |
Check whether the decls associated with luid's X and Y conflict.
References bitmap_bit_p(), stack_var::conflicts, and stack_var::decl.
Referenced by partition_stack_vars().
|
static |
A subroutine of partition_stack_vars. The UNION portion of a UNION/FIND partitioning algorithm. Partitions A and B are known to be non-conflicting. Merge them into a single partition A.
References add_stack_var_conflict(), stack_var::alignb, stack_var::conflicts, stack_var::next, and stack_var::representative.
Referenced by partition_stack_vars().
|
static |
Update points-to sets based on partition info, so we can use them on RTL. The bitmaps representing stack partitions will be saved until expand, where partitioned decls used as bases in memory expressions will be rewritten.
References add_partitioned_vars_to_ptset(), bitmap_set_bit(), cfun, create_tmp_var(), stack_var::decl, gimple_df::decls_to_pointers, gimple_df::escaped, get_ptr_info(), function::gimple_df, make_ssa_name(), stack_var::next, pointer_map_create(), pointer_map_destroy(), pointer_map_insert(), pointer_set_create(), pointer_set_destroy(), ptr_info_def::pt, pt_solution_set(), stack_vars_num, and visited.
Referenced by partition_stack_vars().
|
static |
Callback for walk_stmt_ops. If OP is a decl touched by add_stack_var record conflicts between it and all currently active other partitions from bitmap DATA.
References add_stack_var_conflict(), bitmap_set_bit(), get_base_address(), pc_rtx, pointer_map_contains(), and stack_vars_num.
Referenced by add_scope_conflicts_1().
|
static |
Callback for walk_stmt_ops. If OP is a decl touched by add_stack_var enter its partition number into bitmap DATA.
References bitmap_set_bit(), get_base_address(), pc_rtx, and pointer_map_contains().
Referenced by add_scope_conflicts_1().
gimple currently_expanding_gimple_stmt |
This variable holds the currently expanded gimple statement for purposes of comminucating the profile info to the builtin expanders.
Referenced by expand_builtin_memcpy(), and expand_builtin_memset_args().
|
static |
|
static |
The phase of the stack frame. This is the known misalignment of virtual_stack_vars_rtx from PREFERRED_STACK_BOUNDARY. That is, (frame_offset+frame_phase) % PREFERRED_STACK_BOUNDARY == 0.
Referenced by alloc_stack_frame_space(), expand_one_stack_var_at(), expand_used_vars(), and try_fit_stack_local().
|
static |
Used during expand_used_vars to remember if we saw any decls for which we'd like to enable stack smashing protection.
Referenced by expand_used_vars(), init_vars_expansion(), and stack_protect_decl_phase().
|
static |
Used during expand_used_vars. Remember if we say a character buffer smaller than our cutoff threshold. Used for -Wstack-protector.
Referenced by gimple_expand_cfg(), init_vars_expansion(), and stack_protect_decl_phase().
|
static |
Maps the blocks that do not contain tree labels to rtx labels.
struct ssaexpand SA |
@verbatim A pass for lowering trees to RTL.
Copyright (C) 2004-2013 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 variable holds information helping the rewriting of SSA trees into RTL.
Referenced by build_common_tree_nodes(), expand_debug_expr(), expand_gimple_basic_block(), expand_gimple_cond(), expand_stack_vars(), expand_used_vars(), get_gimple_for_ssa_name(), get_rtx_for_ssa_name(), gimple_expand_cfg(), insert_part_to_rtx_on_edge(), insert_partition_copy_on_edge(), insert_rtx_to_part_on_edge(), insert_value_copy_on_edge(), and set_rtl().
|
static |
Conflict bitmaps go on this obstack. This allows us to destroy all of them in one big sweep.
|
static |
We have an array of such objects while deciding allocation.
|
static |
Referenced by add_stack_var(), and fini_vars_expansion().
|
static |
|
static |
An array of indices such that stack_vars[stack_vars_sorted[i]].size is non-decreasing.
Referenced by account_stack_vars(), dump_stack_var_partition(), estimated_stack_frame_size(), expand_stack_vars(), fini_vars_expansion(), and partition_stack_vars().